ia64/xen-unstable

changeset 10725:16b4abe0f925

[HVM][VMX] Clean up some writes to 64-bit VMCS fields in 32-bit Xen.
Signed-off-by: Eddie Dong <eddie.dong@intel.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Mon Jul 10 17:47:28 2006 +0100 (2006-07-10)
parents bc2f68334e96
children 984225e947f1
files xen/arch/x86/hvm/vmx/vmcs.c
line diff
     1.1 --- a/xen/arch/x86/hvm/vmx/vmcs.c	Mon Jul 10 17:40:27 2006 +0100
     1.2 +++ b/xen/arch/x86/hvm/vmx/vmcs.c	Mon Jul 10 17:47:28 2006 +0100
     1.3 @@ -167,8 +167,16 @@ static inline int construct_vmcs_control
     1.4  
     1.5      error |= __vmwrite(VM_ENTRY_CONTROLS, MONITOR_VM_ENTRY_CONTROLS);
     1.6  
     1.7 -    error |= __vmwrite(IO_BITMAP_A, (u64)virt_to_maddr(arch_vmx->io_bitmap_a));
     1.8 -    error |= __vmwrite(IO_BITMAP_B, (u64)virt_to_maddr(arch_vmx->io_bitmap_b));
     1.9 +    error |= __vmwrite(IO_BITMAP_A, virt_to_maddr(arch_vmx->io_bitmap_a));
    1.10 +    error |= __vmwrite(IO_BITMAP_B, virt_to_maddr(arch_vmx->io_bitmap_b));
    1.11 +
    1.12 +#ifdef CONFIG_X86_PAE
    1.13 +    /* On PAE bitmaps may in future be above 4GB. Write high words. */
    1.14 +    error |= __vmwrite(IO_BITMAP_A_HIGH,
    1.15 +                       (paddr_t)virt_to_maddr(arch_vmx->io_bitmap_a) >> 32);
    1.16 +    error |= __vmwrite(IO_BITMAP_B_HIGH,
    1.17 +                       (paddr_t)virt_to_maddr(arch_vmx->io_bitmap_b) >> 32);
    1.18 +#endif
    1.19  
    1.20      return error;
    1.21  }
    1.22 @@ -391,8 +399,10 @@ static inline int construct_init_vmcs_gu
    1.23      error |= __vmwrite(GUEST_INTERRUPTIBILITY_INFO, 0);
    1.24      __asm__ __volatile__ ("mov %%dr7, %0\n" : "=r" (dr7));
    1.25      error |= __vmwrite(GUEST_DR7, dr7);
    1.26 -    error |= __vmwrite(VMCS_LINK_POINTER, 0xffffffff);
    1.27 -    error |= __vmwrite(VMCS_LINK_POINTER_HIGH, 0xffffffff);
    1.28 +    error |= __vmwrite(VMCS_LINK_POINTER, ~0UL);
    1.29 +#if defined(__i386__)
    1.30 +    error |= __vmwrite(VMCS_LINK_POINTER_HIGH, ~0UL);
    1.31 +#endif
    1.32  
    1.33      return error;
    1.34  }
    1.35 @@ -410,7 +420,7 @@ static inline int construct_vmcs_host(vo
    1.36      error |= __vmwrite(HOST_ES_SELECTOR, __HYPERVISOR_DS);
    1.37      error |= __vmwrite(HOST_SS_SELECTOR, __HYPERVISOR_DS);
    1.38      error |= __vmwrite(HOST_DS_SELECTOR, __HYPERVISOR_DS);
    1.39 -#if defined (__i386__)
    1.40 +#if defined(__i386__)
    1.41      error |= __vmwrite(HOST_FS_SELECTOR, __HYPERVISOR_DS);
    1.42      error |= __vmwrite(HOST_GS_SELECTOR, __HYPERVISOR_DS);
    1.43      error |= __vmwrite(HOST_FS_BASE, 0);