From b8e1cf2d4eaa4bd28c77e2c9941ceb2616e51b59 Mon Sep 17 00:00:00 2001 From: Sebastien Boeuf Date: Wed, 11 Mar 2020 09:30:57 +0100 Subject: [PATCH] vm-allocator: Add new function to free 32 bits MMIO address space The allocator already had functions to allocate and free both IO and 64 bits MMIO address spaces, but it only had an allocating function for 32 bits MMIO address space. With this new function, it will be now possible to remove cleanly some ranges from the 32 bits MMIO address space. Signed-off-by: Sebastien Boeuf --- vm-allocator/src/system.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vm-allocator/src/system.rs b/vm-allocator/src/system.rs index 92fdc5a5e..8cb4eccd8 100755 --- a/vm-allocator/src/system.rs +++ b/vm-allocator/src/system.rs @@ -131,4 +131,10 @@ impl SystemAllocator { pub fn free_mmio_addresses(&mut self, address: GuestAddress, size: GuestUsize) { self.mmio_address_space.free(address, size) } + + /// Free an MMIO address range from the 32 bits hole. + /// We can only free a range if it matches exactly an already allocated range. + pub fn free_mmio_hole_addresses(&mut self, address: GuestAddress, size: GuestUsize) { + self.mmio_hole_address_space.free(address, size) + } }