* [PATCH] hvm: clear vmxe if vmxoff
@ 2006-09-29 6:44 Magnus Damm
2006-09-29 6:44 ` [PATCH] hvm: disable on smp Magnus Damm
0 siblings, 1 reply; 2+ messages in thread
From: Magnus Damm @ 2006-09-29 6:44 UTC (permalink / raw)
To: xen-devel; +Cc: Magnus Damm, magnus.damm
hvm: clear vmxe if vmxoff
The current Xen code keeps X86_CR4_VMXE set even if VMXON has not been
executed. The stop_vmx() code assumes that it is possible to call VMXOFF
if X86_CR4_VMXE is set which is not always true. Calling VMXOFF without
VMXON results in an illegal opcode trap, and to avoid this condition this
patch makes sure that X86_CR4_VMXE is only set when VMXON has been called.
Tested using x86_32 on a Pentium D 930.
Signed-Off-By: Magnus Damm <magnus@valinux.co.jp>
--- 0001/xen/arch/x86/hvm/vmx/vmx.c
+++ work/xen/arch/x86/hvm/vmx/vmx.c 2006-09-29 14:49:55.000000000 +0900
@@ -485,8 +485,10 @@ static void vmx_ctxt_switch_to(struct vc
static void stop_vmx(void)
{
- if (read_cr4() & X86_CR4_VMXE)
+ if (read_cr4() & X86_CR4_VMXE) {
__vmxoff();
+ clear_in_cr4(X86_CR4_VMXE);
+ }
}
void vmx_migrate_timers(struct vcpu *v)
@@ -806,12 +808,14 @@ int start_vmx(void)
if ( (vmcs = vmx_alloc_host_vmcs()) == NULL )
{
+ clear_in_cr4(X86_CR4_VMXE);
printk("Failed to allocate host VMCS\n");
return 0;
}
if ( __vmxon(virt_to_maddr(vmcs)) )
{
+ clear_in_cr4(X86_CR4_VMXE);
printk("VMXON failed\n");
vmx_free_host_vmcs(vmcs);
return 0;
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH] hvm: disable on smp
2006-09-29 6:44 [PATCH] hvm: clear vmxe if vmxoff Magnus Damm
@ 2006-09-29 6:44 ` Magnus Damm
0 siblings, 0 replies; 2+ messages in thread
From: Magnus Damm @ 2006-09-29 6:44 UTC (permalink / raw)
To: xen-devel; +Cc: Magnus Damm, magnus.damm
hvm: disable hvm on smp
With Intel VT, VMXOFF needs to be executed before halting the CPU. Without
this fix Xen or Linux is unable to start up the CPU after a kexec reboot.
Tested using x86_32 on a Pentium D 930.
Signed-Off-By: Magnus Damm <magnus@valinux.co.jp>
--- 0001/xen/arch/x86/smp.c
+++ work/xen/arch/x86/smp.c 2006-09-29 14:47:34.000000000 +0900
@@ -21,6 +21,7 @@
#include <asm/smpboot.h>
#include <asm/hardirq.h>
#include <asm/ipi.h>
+#include <asm/hvm/hvm.h>
#include <mach_apic.h>
/*
@@ -306,6 +307,7 @@ static void stop_this_cpu (void *dummy)
local_irq_disable();
disable_local_APIC();
+ hvm_disable();
for ( ; ; )
__asm__ __volatile__ ( "hlt" );
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-09-29 6:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-29 6:44 [PATCH] hvm: clear vmxe if vmxoff Magnus Damm
2006-09-29 6:44 ` [PATCH] hvm: disable on smp Magnus Damm
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.