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

[Xen-changelog] [xen-unstable] [HVM][VMX] Clean up some writes to 64-bit VMCS fields in 32-bit Xen.



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Node ID 16b4abe0f925e385495175d2cc288642cdcb1374
# Parent  bc2f68334e9649bd9f628bd5762e529d85dd5012
[HVM][VMX] Clean up some writes to 64-bit VMCS fields in 32-bit Xen.
Signed-off-by: Eddie Dong <eddie.dong@xxxxxxxxx>
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 xen/arch/x86/hvm/vmx/vmcs.c |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diff -r bc2f68334e96 -r 16b4abe0f925 xen/arch/x86/hvm/vmx/vmcs.c
--- a/xen/arch/x86/hvm/vmx/vmcs.c       Mon Jul 10 17:40:27 2006 +0100
+++ b/xen/arch/x86/hvm/vmx/vmcs.c       Mon Jul 10 17:47:28 2006 +0100
@@ -167,8 +167,16 @@ static inline int construct_vmcs_control
 
     error |= __vmwrite(VM_ENTRY_CONTROLS, MONITOR_VM_ENTRY_CONTROLS);
 
-    error |= __vmwrite(IO_BITMAP_A, (u64)virt_to_maddr(arch_vmx->io_bitmap_a));
-    error |= __vmwrite(IO_BITMAP_B, (u64)virt_to_maddr(arch_vmx->io_bitmap_b));
+    error |= __vmwrite(IO_BITMAP_A, virt_to_maddr(arch_vmx->io_bitmap_a));
+    error |= __vmwrite(IO_BITMAP_B, virt_to_maddr(arch_vmx->io_bitmap_b));
+
+#ifdef CONFIG_X86_PAE
+    /* On PAE bitmaps may in future be above 4GB. Write high words. */
+    error |= __vmwrite(IO_BITMAP_A_HIGH,
+                       (paddr_t)virt_to_maddr(arch_vmx->io_bitmap_a) >> 32);
+    error |= __vmwrite(IO_BITMAP_B_HIGH,
+                       (paddr_t)virt_to_maddr(arch_vmx->io_bitmap_b) >> 32);
+#endif
 
     return error;
 }
@@ -391,8 +399,10 @@ static inline int construct_init_vmcs_gu
     error |= __vmwrite(GUEST_INTERRUPTIBILITY_INFO, 0);
     __asm__ __volatile__ ("mov %%dr7, %0\n" : "=r" (dr7));
     error |= __vmwrite(GUEST_DR7, dr7);
-    error |= __vmwrite(VMCS_LINK_POINTER, 0xffffffff);
-    error |= __vmwrite(VMCS_LINK_POINTER_HIGH, 0xffffffff);
+    error |= __vmwrite(VMCS_LINK_POINTER, ~0UL);
+#if defined(__i386__)
+    error |= __vmwrite(VMCS_LINK_POINTER_HIGH, ~0UL);
+#endif
 
     return error;
 }
@@ -410,7 +420,7 @@ static inline int construct_vmcs_host(vo
     error |= __vmwrite(HOST_ES_SELECTOR, __HYPERVISOR_DS);
     error |= __vmwrite(HOST_SS_SELECTOR, __HYPERVISOR_DS);
     error |= __vmwrite(HOST_DS_SELECTOR, __HYPERVISOR_DS);
-#if defined (__i386__)
+#if defined(__i386__)
     error |= __vmwrite(HOST_FS_SELECTOR, __HYPERVISOR_DS);
     error |= __vmwrite(HOST_GS_SELECTOR, __HYPERVISOR_DS);
     error |= __vmwrite(HOST_FS_BASE, 0);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.