[kvm-unit-tests RFC PATCH 01/10] x86: vm: Remove virt_to_phys() on CR3 initialization

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

 



CR3 register is initialized when no paging is yet enabled.
Therefore, translation with virt_to_phys() is erroneous.

Cc: Radim Krčmář <rkrcmar@xxxxxxxxxx>
Signed-off-by: Alexander Gordeev <agordeev@xxxxxxxxxx>
---
 lib/x86/vm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/x86/vm.c b/lib/x86/vm.c
index cda4c5f46da3..362497cfa341 100644
--- a/lib/x86/vm.c
+++ b/lib/x86/vm.c
@@ -137,7 +137,7 @@ static void setup_mmu(unsigned long len)
     vfree_top = (void*)(3ul << 30);
 #endif
 
-    write_cr3(virt_to_phys(cr3));
+    write_cr3((unsigned long)cr3);
 #ifndef __x86_64__
     write_cr4(X86_CR4_PSE);
 #endif
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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