From 3259bdc4105faa25c62906eee63f5be6b7ae064f Mon Sep 17 00:00:00 2001 From: Chris Oo Date: Thu, 7 Nov 2024 18:02:49 +0000 Subject: [PATCH] rename crate --- Cargo.lock | 40 +++++++++---------- Cargo.toml | 2 +- .../Cargo.toml | 2 +- .../src/device_dma.rs | 0 .../src/lib.rs | 0 openhcl/underhill_core/Cargo.toml | 2 +- openhcl/underhill_core/src/dispatch/mod.rs | 2 +- openhcl/underhill_core/src/worker.rs | 2 +- openhcl/virt_mshv_vtl/Cargo.toml | 2 +- openhcl/virt_mshv_vtl/src/lib.rs | 6 +-- .../virt_mshv_vtl/src/processor/snp/mod.rs | 2 +- .../virt_mshv_vtl/src/processor/tdx/mod.rs | 4 +- .../src/processor/tdx/tlb_flush.rs | 4 +- .../get/guest_emulation_transport/Cargo.toml | 2 +- .../guest_emulation_transport/src/client.rs | 2 +- .../src/process_loop.rs | 8 ++-- 16 files changed, 40 insertions(+), 40 deletions(-) rename openhcl/{shared_pool_alloc => page_pool_alloc}/Cargo.toml (95%) rename openhcl/{shared_pool_alloc => page_pool_alloc}/src/device_dma.rs (100%) rename openhcl/{shared_pool_alloc => page_pool_alloc}/src/lib.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index 930d6fde2..fe74bcaeb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2307,11 +2307,11 @@ dependencies = [ "inspect", "inspect_counters", "mesh", + "page_pool_alloc", "pal_async", "parking_lot", "power_resources", "serde_json", - "shared_pool_alloc", "test_with_tracing", "thiserror 2.0.0", "tracing", @@ -4504,6 +4504,23 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" name = "oversized_box" version = "0.0.0" +[[package]] +name = "page_pool_alloc" +version = "0.0.0" +dependencies = [ + "anyhow", + "hcl", + "hvdef", + "inspect", + "memory_range", + "parking_lot", + "sparse_mmap", + "thiserror 2.0.0", + "tracing", + "user_driver", + "vm_topology", +] + [[package]] name = "page_table" version = "0.0.0" @@ -5680,23 +5697,6 @@ dependencies = [ "lazy_static", ] -[[package]] -name = "shared_pool_alloc" -version = "0.0.0" -dependencies = [ - "anyhow", - "hcl", - "hvdef", - "inspect", - "memory_range", - "parking_lot", - "sparse_mmap", - "thiserror 2.0.0", - "tracing", - "user_driver", - "vm_topology", -] - [[package]] name = "shell-words" version = "1.1.0" @@ -6696,6 +6696,7 @@ dependencies = [ "netvsp", "nvme_driver", "nvme_resources", + "page_pool_alloc", "pal", "pal_async", "pal_uring", @@ -6710,7 +6711,6 @@ dependencies = [ "serde_helpers", "serde_json", "serial_16550_resources", - "shared_pool_alloc", "socket2", "sparse_mmap", "state_unit", @@ -7198,13 +7198,13 @@ dependencies = [ "libc", "memory_range", "mesh", + "page_pool_alloc", "pal", "pal_async", "pal_uring", "parking_lot", "pci_core", "safe_intrinsics", - "shared_pool_alloc", "sidecar_client", "thiserror 2.0.0", "tracelimit", diff --git a/Cargo.toml b/Cargo.toml index 8b1826111..e473c11b6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -151,9 +151,9 @@ host_fdt_parser = { path = "openhcl/host_fdt_parser" } kmsg_defs = { path = "openhcl/kmsg_defs" } minimal_rt = { path = "openhcl/minimal_rt" } minimal_rt_build = { path = "openhcl/minimal_rt_build" } +page_pool_alloc = { path = "openhcl/page_pool_alloc" } sidecar_client = { path = "openhcl/sidecar_client" } sidecar_defs = { path = "openhcl/sidecar_defs" } -shared_pool_alloc = { path = "openhcl/shared_pool_alloc" } underhill_attestation = { path = "openhcl/underhill_attestation" } underhill_confidentiality = { path = "openhcl/underhill_confidentiality" } underhill_core = { path = "openhcl/underhill_core" } diff --git a/openhcl/shared_pool_alloc/Cargo.toml b/openhcl/page_pool_alloc/Cargo.toml similarity index 95% rename from openhcl/shared_pool_alloc/Cargo.toml rename to openhcl/page_pool_alloc/Cargo.toml index 2d1a836e1..7b071c66b 100644 --- a/openhcl/shared_pool_alloc/Cargo.toml +++ b/openhcl/page_pool_alloc/Cargo.toml @@ -2,7 +2,7 @@ # Licensed under the MIT License. [package] -name = "shared_pool_alloc" +name = "page_pool_alloc" edition = "2021" rust-version.workspace = true diff --git a/openhcl/shared_pool_alloc/src/device_dma.rs b/openhcl/page_pool_alloc/src/device_dma.rs similarity index 100% rename from openhcl/shared_pool_alloc/src/device_dma.rs rename to openhcl/page_pool_alloc/src/device_dma.rs diff --git a/openhcl/shared_pool_alloc/src/lib.rs b/openhcl/page_pool_alloc/src/lib.rs similarity index 100% rename from openhcl/shared_pool_alloc/src/lib.rs rename to openhcl/page_pool_alloc/src/lib.rs diff --git a/openhcl/underhill_core/Cargo.toml b/openhcl/underhill_core/Cargo.toml index caf6646fe..d826c543a 100644 --- a/openhcl/underhill_core/Cargo.toml +++ b/openhcl/underhill_core/Cargo.toml @@ -32,7 +32,7 @@ cvm_tracing.workspace = true diag_proto.workspace = true diag_server.workspace = true debug_worker_defs = { workspace = true, optional = true } -shared_pool_alloc = { workspace = true, features = ["vfio"] } +page_pool_alloc = { workspace = true, features = ["vfio"] } virt.workspace = true vmm_core.workspace = true vmm_core_defs.workspace = true diff --git a/openhcl/underhill_core/src/dispatch/mod.rs b/openhcl/underhill_core/src/dispatch/mod.rs index cd18a8c93..8d472ca0f 100644 --- a/openhcl/underhill_core/src/dispatch/mod.rs +++ b/openhcl/underhill_core/src/dispatch/mod.rs @@ -40,10 +40,10 @@ use mesh::CancelContext; use mesh::MeshPayload; use mesh_worker::WorkerRpc; use net_packet_capture::PacketCaptureParams; +use page_pool_alloc::PagePool; use pal_async::task::Spawn; use pal_async::task::Task; use parking_lot::Mutex; -use shared_pool_alloc::PagePool; use socket2::Socket; use state_unit::SavedStateUnit; use state_unit::SpawnedUnit; diff --git a/openhcl/underhill_core/src/worker.rs b/openhcl/underhill_core/src/worker.rs index 8549fb784..f5f199279 100644 --- a/openhcl/underhill_core/src/worker.rs +++ b/openhcl/underhill_core/src/worker.rs @@ -89,6 +89,7 @@ use mesh_worker::Worker; use mesh_worker::WorkerId; use mesh_worker::WorkerRpc; use net_packet_capture::PacketCaptureParams; +use page_pool_alloc::PagePool; use pal_async::local::LocalDriver; use pal_async::task::Spawn; use pal_async::DefaultDriver; @@ -96,7 +97,6 @@ use pal_async::DefaultPool; use parking_lot::Mutex; use scsi_core::ResolveScsiDeviceHandleParams; use scsidisk::atapi_scsi::AtapiScsiDisk; -use shared_pool_alloc::PagePool; use socket2::Socket; use state_unit::SpawnedUnit; use state_unit::StateUnits; diff --git a/openhcl/virt_mshv_vtl/Cargo.toml b/openhcl/virt_mshv_vtl/Cargo.toml index b91b09004..bfbd3374c 100644 --- a/openhcl/virt_mshv_vtl/Cargo.toml +++ b/openhcl/virt_mshv_vtl/Cargo.toml @@ -13,7 +13,7 @@ gdb = [] aarch64emu.workspace = true aarch64defs.workspace = true hcl.workspace = true -shared_pool_alloc.workspace = true +page_pool_alloc.workspace = true virt.workspace = true virt_support_aarch64emu.workspace = true virt_support_apic.workspace = true diff --git a/openhcl/virt_mshv_vtl/src/lib.rs b/openhcl/virt_mshv_vtl/src/lib.rs index 86b3ae2ce..c8c061c2a 100644 --- a/openhcl/virt_mshv_vtl/src/lib.rs +++ b/openhcl/virt_mshv_vtl/src/lib.rs @@ -135,7 +135,7 @@ pub enum Error { #[error("failed to map overlay page")] MapOverlay(#[source] std::io::Error), #[error("failed to allocate shared visibility pages for overlay")] - AllocateSharedVisOverlay(#[source] shared_pool_alloc::PagePoolOutOfMemory), + AllocateSharedVisOverlay(#[source] page_pool_alloc::PagePoolOutOfMemory), #[error("failed to open msr device")] OpenMsr(#[source] std::io::Error), #[error("cpuid did not contain valid TSC frequency information")] @@ -215,7 +215,7 @@ struct UhPartitionInner { isolated_memory_protector: Option>, #[cfg_attr(guest_arch = "aarch64", allow(dead_code))] #[inspect(skip)] - shared_vis_pages_pool: Option, + shared_vis_pages_pool: Option, #[inspect(with = "inspect::AtomicMut")] no_sidecar_hotplug: AtomicBool, use_mmio_hypercalls: bool, @@ -1155,7 +1155,7 @@ pub struct UhLateParams<'a> { /// An object to call to change host visibility on guest memory. pub isolated_memory_protector: Option>, /// Allocator for shared visibility pages. - pub shared_vis_pages_pool: Option, + pub shared_vis_pages_pool: Option, } /// Trait for CVM-related protections on guest memory. diff --git a/openhcl/virt_mshv_vtl/src/processor/snp/mod.rs b/openhcl/virt_mshv_vtl/src/processor/snp/mod.rs index e48e5a0ab..364644086 100644 --- a/openhcl/virt_mshv_vtl/src/processor/snp/mod.rs +++ b/openhcl/virt_mshv_vtl/src/processor/snp/mod.rs @@ -85,7 +85,7 @@ pub struct SnpBacked { direct_overlays_pfns: [u64; UhDirectOverlay::Count as usize], #[inspect(skip)] #[allow(dead_code)] // Allocation handle for direct overlays held until drop - direct_overlay_pfns_handle: shared_pool_alloc::PagePoolHandle, + direct_overlay_pfns_handle: page_pool_alloc::PagePoolHandle, #[inspect(hex)] hv_sint_notifications: u16, general_stats: GeneralStats, diff --git a/openhcl/virt_mshv_vtl/src/processor/tdx/mod.rs b/openhcl/virt_mshv_vtl/src/processor/tdx/mod.rs index 45cfb6876..8eb663454 100644 --- a/openhcl/virt_mshv_vtl/src/processor/tdx/mod.rs +++ b/openhcl/virt_mshv_vtl/src/processor/tdx/mod.rs @@ -393,7 +393,7 @@ pub struct TdxBacked { direct_overlays_pfns: [u64; UhDirectOverlay::Count as usize], #[inspect(skip)] #[allow(dead_code)] // Allocation handle for direct overlays held until drop - direct_overlay_pfns_handle: shared_pool_alloc::PagePoolHandle, + direct_overlay_pfns_handle: page_pool_alloc::PagePoolHandle, lapic: LapicState, untrusted_synic: Option, @@ -413,7 +413,7 @@ pub struct TdxBacked { flush_state: VtlArray, /// A mapped page used for issuing INVGLA hypercalls. #[inspect(skip)] - flush_page: shared_pool_alloc::PagePoolHandle, + flush_page: page_pool_alloc::PagePoolHandle, enter_stats: EnterStats, exit_stats: ExitStats, diff --git a/openhcl/virt_mshv_vtl/src/processor/tdx/tlb_flush.rs b/openhcl/virt_mshv_vtl/src/processor/tdx/tlb_flush.rs index c4868a359..4c3e2b6b2 100644 --- a/openhcl/virt_mshv_vtl/src/processor/tdx/tlb_flush.rs +++ b/openhcl/virt_mshv_vtl/src/processor/tdx/tlb_flush.rs @@ -119,7 +119,7 @@ impl UhProcessor<'_, TdxBacked> { partition_flush_state: &TdxPartitionFlushState, gva_list_count: &mut Wrapping, runner: &mut ProcessorRunner<'_, Tdx>, - flush_page: &shared_pool_alloc::PagePoolHandle, + flush_page: &page_pool_alloc::PagePoolHandle, ) -> bool { // Check quickly to see whether any new addresses are in the list. if partition_flush_state.s.gva_list_count == *gva_list_count { @@ -155,7 +155,7 @@ impl UhProcessor<'_, TdxBacked> { target_vtl: GuestVtl, flush_addrs: &[HvGvaRange], runner: &mut ProcessorRunner<'_, Tdx>, - flush_page: &shared_pool_alloc::PagePoolHandle, + flush_page: &page_pool_alloc::PagePoolHandle, ) { // Now we can build the TDX structs and actually call INVGLA. tracing::trace!( diff --git a/vm/devices/get/guest_emulation_transport/Cargo.toml b/vm/devices/get/guest_emulation_transport/Cargo.toml index 1a660447b..f0ca655cb 100644 --- a/vm/devices/get/guest_emulation_transport/Cargo.toml +++ b/vm/devices/get/guest_emulation_transport/Cargo.toml @@ -14,7 +14,7 @@ get_protocol.workspace = true guest_emulation_device = { workspace = true, optional = true } guestmem.workspace = true hvdef.workspace = true -shared_pool_alloc.workspace = true +page_pool_alloc.workspace = true underhill_config.workspace = true vmbus_async.workspace = true vmbus_ring.workspace = true diff --git a/vm/devices/get/guest_emulation_transport/src/client.rs b/vm/devices/get/guest_emulation_transport/src/client.rs index 74c811cbb..b073f6717 100644 --- a/vm/devices/get/guest_emulation_transport/src/client.rs +++ b/vm/devices/get/guest_emulation_transport/src/client.rs @@ -388,7 +388,7 @@ impl GuestEmulationTransportClient { /// Set the shared memory allocator, which is required by ['igvm_attest']. pub fn set_shared_memory_allocator( &mut self, - shared_pool_allocator: shared_pool_alloc::PagePoolAllocator, + shared_pool_allocator: page_pool_alloc::PagePoolAllocator, shared_guest_memory: guestmem::GuestMemory, ) { self.control.notify(msg::Msg::SetupSharedMemoryAllocator( diff --git a/vm/devices/get/guest_emulation_transport/src/process_loop.rs b/vm/devices/get/guest_emulation_transport/src/process_loop.rs index 956579ef8..4a918a80b 100644 --- a/vm/devices/get/guest_emulation_transport/src/process_loop.rs +++ b/vm/devices/get/guest_emulation_transport/src/process_loop.rs @@ -85,7 +85,7 @@ pub(crate) enum FatalError { #[error("failed to make the IgvmAttest request because shared memory is unavailable")] SharedMemoryUnavailable, #[error("failed to allocated shared memory")] - SharedMemoryAllocationError(#[source] shared_pool_alloc::PagePoolOutOfMemory), + SharedMemoryAllocationError(#[source] page_pool_alloc::PagePoolOutOfMemory), #[error("failed to read the `IGVM_ATTEST` response from shared memory")] ReadSharedMemory(#[source] guestmem::GuestMemoryError), #[error("failed to deserialize the asynchronous `IGVM_ATTEST` response")] @@ -174,7 +174,7 @@ pub(crate) mod msg { Inspect(inspect::Deferred), /// Store the shared memory allocator and guest memory for later use by /// IGVM attestation. - SetupSharedMemoryAllocator(shared_pool_alloc::PagePoolAllocator, guestmem::GuestMemory), + SetupSharedMemoryAllocator(page_pool_alloc::PagePoolAllocator, guestmem::GuestMemory), // Late bound receivers for Guest Notifications /// Take the late-bound GuestRequest receiver for Generation Id updates. @@ -468,7 +468,7 @@ pub(crate) struct ProcessLoop { #[inspect(skip)] igvm_attest_read_send: mesh::Sender>, #[inspect(skip)] - shared_pool_allocator: Option>, + shared_pool_allocator: Option>, shared_guest_memory: Option>, stats: Stats, @@ -1806,7 +1806,7 @@ async fn request_saved_state( async fn request_igvm_attest( mut access: HostRequestPipeAccess, request: msg::IgvmAttestRequestData, - shared_pool_allocator: Option>, + shared_pool_allocator: Option>, shared_guest_memory: Option>, ) -> Result, IgvmAttestError>, FatalError> { const ALLOCATED_SHARED_MEMORY_SIZE: usize =