[PATCH kvm-unit-tests] riscv: Fix virt_to_phys()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




---
Signed-off-by: Cade Richard <cade.richard@xxxxxxxxxxxx>
---
 lib/riscv/mmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/riscv/mmu.c b/lib/riscv/mmu.c
index bd006881..c4770552 100644
--- a/lib/riscv/mmu.c
+++ b/lib/riscv/mmu.c
@@ -194,7 +194,7 @@ unsigned long virt_to_phys(volatile void *address)
 	paddr = virt_to_pte_phys(pgtable, (void *)address);
 	assert(sizeof(long) == 8 || !(paddr >> 32));
 
-	return (unsigned long)paddr;
+	return (unsigned long)paddr | ((unsigned long) address & 0x00000FFF);
 }
 
 void *phys_to_virt(unsigned long address)

---
base-commit: a68956b3fb6f5f308822b20ce0ff8e02db1f7375
change-id: 20240706-virt-to-phys-2a27a924ef2a

Best regards,
-- 
Cade Richard <cade.richard@xxxxxxxxxxxx>





[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux