libhyp: Make DeviceAssigningHypervisor pub
Bug: 277993056
Test: atest libpvmfw.device_assignment.test, launch protected VM
Change-Id: I7d25f88d252a55fff3b381160a5655d2c2fe944c
diff --git a/libs/hyp/src/hypervisor.rs b/libs/hyp/src/hypervisor.rs
index 3d42ccb..c53b886 100644
--- a/libs/hyp/src/hypervisor.rs
+++ b/libs/hyp/src/hypervisor.rs
@@ -24,7 +24,9 @@
use crate::error::{Error, Result};
use alloc::boxed::Box;
use common::Hypervisor;
-pub use common::{MemSharingHypervisor, MmioGuardedHypervisor, MMIO_GUARD_GRANULE_SIZE};
+pub use common::{
+ DeviceAssigningHypervisor, MemSharingHypervisor, MmioGuardedHypervisor, MMIO_GUARD_GRANULE_SIZE,
+};
pub use geniezone::GeniezoneError;
use geniezone::GeniezoneHypervisor;
use gunyah::GunyahHypervisor;
@@ -34,8 +36,6 @@
use smccc::hvc64;
use uuid::Uuid;
-use self::common::DeviceAssigningHypervisor;
-
enum HypervisorBackend {
RegularKvm,
Gunyah,
diff --git a/libs/hyp/src/hypervisor/common.rs b/libs/hyp/src/hypervisor/common.rs
index 2ea18f3..eaac652 100644
--- a/libs/hyp/src/hypervisor/common.rs
+++ b/libs/hyp/src/hypervisor/common.rs
@@ -79,6 +79,7 @@
fn granule(&self) -> Result<usize>;
}
+/// Device assigning hypervisor
pub trait DeviceAssigningHypervisor {
/// Returns MMIO token.
fn get_phys_mmio_token(&self, base_ipa: u64, size: u64) -> Result<u64>;
diff --git a/libs/hyp/src/lib.rs b/libs/hyp/src/lib.rs
index 505aade..6a23585 100644
--- a/libs/hyp/src/lib.rs
+++ b/libs/hyp/src/lib.rs
@@ -20,6 +20,7 @@
mod hypervisor;
mod util;
+pub use crate::hypervisor::DeviceAssigningHypervisor;
pub use error::{Error, Result};
pub use hypervisor::{
get_device_assigner, get_mem_sharer, get_mmio_guard, KvmError, MMIO_GUARD_GRANULE_SIZE,