x86-64-enable-vmx.patch
PATCH 4/5 x86-64-enable-vmx.patch
Enable CONFIG_VMX for x86_64.
- Provides vmexit/entry handling code based on the x86_32 code
- Fix find_highest_vector for 64 bit (Benjamin Liu)
Signed-off-by Arun Sharma <[email protected]>
xen/arch/x86/Makefile +0 -4
@@ -7,10 +7,6 @@ OBJS := $(subst $(TARGET_SUBARCH)/asm-offsets.o,,$(OBJS)) -ifneq ($(TARGET_SUBARCH),x86_32) -OBJS := $(patsubst vmx%.o,,$(OBJS)) -endif - ifneq ($(crash_debug),y) OBJS := $(patsubst cdb%.o,,$(OBJS)) endif
xen/arch/x86/vmx.c +5 -0
@@ -959,7 +959,12 @@struct exec_domain *d = current;local_irq_disable (); +#ifdef __i386__ asmvolatile ("movl %0,%%cr2" : :"r" (d->arch.arch_vmx.cpu_cr2)); +#else + asmvolatile ("movq %0,%%cr2" : :"r" (d->arch.arch_vmx.cpu_cr2)); +#endif + }#endif /* CONFIG_VMX */
xen/arch/x86/vmx_intercept.c +1 -1
@@ -37,7 +37,7 @@struct exec_domain *d = current;struct vmx_handler_t *handler = &(d->arch.arch_vmx.vmx_platform.vmx_handler);int i; -unsigned addr, offset; +unsigned long addr, offset;for (i =0 ; i < handler->num_slot; i++) { addr = handler->hdl_list[i].addr; offset = handler->hdl_list[i].offset;
xen/arch/x86/vmx_io.c +54 -11
100 lines not on this page · raw message
xen/arch/x86/vmx_vmcs.c +13 -0
@@ -327,7 +327,11 @@ error |=__vmwrite (GUEST_EFLAGS , eflags); error |=__vmwrite (GUEST_INTERRUPTIBILITY_INFO ,0 ); +#ifdef __i386__ __asm__ __volatile__ ("mov %%dr7, %0\n" :"=r" (dr7)); +#else + __asm__ __volatile__ ("movq %%dr7, %0\n" :"=r" (dr7)); +#endif error |=__vmwrite (GUEST_DR7 , dr7); error |=__vmwrite (GUEST_VMCS0 ,0xffffffff ); error |=__vmwrite (GUEST_VMCS1 ,0xffffffff );
@@ -363,12 +367,21 @@ host_env->idtr_base = desc.address; error |=__vmwrite (HOST_IDTR_BASE , host_env->idtr_base); +#ifdef __i386__ __asm__ __volatile__ ("movl %%cr0,%0" :"=r" (crn) : ); +#else + __asm__ __volatile__ ("movq %%cr0,%0" :"=r" (crn) : ); +#endif + host_env->cr0 = crn; error |=__vmwrite (HOST_CR0 , crn);/* same CR0 */ /* CR3 is set in vmx_final_setup_hostos */ +#ifdef __i386__ __asm__ __volatile__ ("movl %%cr4,%0" :"=r" (crn) : ); +#else + __asm__ __volatile__ ("movq %%cr4,%0" :"=r" (crn) : ); +#endif host_env->cr4 = crn; error |=__vmwrite (HOST_CR4 , crn); error |=__vmwrite (HOST_EIP , (unsigned long ) vmx_asm_vmexit_handler);
xen/arch/x86/x86_64/entry.S +133 -0
139 lines not on this page · raw message
xen/include/asm-x86/config.h +0 -2
@@ -7,9 +7,7 @@#ifndef __X86_CONFIG_H__#define __X86_CONFIG_H__ -#ifdef __i386__#define CONFIG_VMX 1 -#endif #define CONFIG_X86 1#define CONFIG_SHADOW 1