From 3bc06e8a8ce051fe79d63bcc1c30e727c9b4166c Mon Sep 17 00:00:00 2001 From: Jonathan Klimt Date: Mon, 25 Nov 2024 22:44:36 +0100 Subject: [PATCH] Fixed GuestVirtAddr in aarch64 --- src/arch/aarch64/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/arch/aarch64/mod.rs b/src/arch/aarch64/mod.rs index 636c1265..b3542b3b 100644 --- a/src/arch/aarch64/mod.rs +++ b/src/arch/aarch64/mod.rs @@ -89,7 +89,7 @@ impl PageTableEntry { /// Return the stored physical address. pub fn address(&self) -> GuestPhysAddr { // For other granules than 4KiB or hugepages we should check the DESCRIPTOR_TYPE bit and modify the address translation accordingly. - GuestPhysAddr( + GuestPhysAddr::new( self.physical_address_and_flags.as_u64() & !(PAGE_SIZE as u64 - 1) & !(u64::MAX << 48), ) } @@ -108,7 +108,7 @@ impl From for PageTableEntry { /// The upper bits must always be 0 or 1 and indicate whether TBBR0 or TBBR1 contains the /// base address. So always enforce 0 here. fn is_valid_address(virtual_address: GuestVirtAddr) -> bool { - virtual_address < GuestVirtAddr(0x1_0000_0000_0000) + virtual_address < GuestVirtAddr::new(0x1_0000_0000_0000) } /// Converts a virtual address in the guest to a physical address in the guest