* [PATCH] SVM: set NM intercept when enabling CR0.TS in the guest
@ 2008-01-29 12:01 Joerg Roedel
[not found] ` <1201608087-29131-1-git-send-email-joerg.roedel-5C7GfCeVMHo@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Joerg Roedel @ 2008-01-29 12:01 UTC (permalink / raw)
To: Avi Kivity
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Joerg Roedel,
Markus Rechberger
Explicitly enable the NM intercept in svm_set_cr0 if we enable TS in the guest
copy of CR0 for lazy FPU switching. This fixes guest SMP with Linux under SVM.
Without that patch Linux deadlocks or panics right after trying to boot the
other CPUs.
Signed-off-by: Joerg Roedel <joerg.roedel-5C7GfCeVMHo@public.gmane.org>
Signed-off-by: Markus Rechberger <markus.rechberger-5C7GfCeVMHo@public.gmane.org>
---
arch/x86/kvm/svm.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 7bdbe16..d1c7fcb 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -792,8 +792,10 @@ static void svm_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0)
vcpu->arch.cr0 = cr0;
cr0 |= X86_CR0_PG | X86_CR0_WP;
cr0 &= ~(X86_CR0_CD | X86_CR0_NW);
- if (!vcpu->fpu_active)
+ if (!vcpu->fpu_active) {
+ svm->vmcb->control.intercept_exceptions |= (1 << NM_VECTOR);
cr0 |= X86_CR0_TS;
+ }
svm->vmcb->save.cr0 = cr0;
}
--
1.5.3.7
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] SVM: set NM intercept when enabling CR0.TS in the guest
[not found] ` <1201608087-29131-1-git-send-email-joerg.roedel-5C7GfCeVMHo@public.gmane.org>
@ 2008-01-29 12:23 ` Avi Kivity
0 siblings, 0 replies; 2+ messages in thread
From: Avi Kivity @ 2008-01-29 12:23 UTC (permalink / raw)
To: Joerg Roedel
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Markus Rechberger
Joerg Roedel wrote:
> Explicitly enable the NM intercept in svm_set_cr0 if we enable TS in the guest
> copy of CR0 for lazy FPU switching. This fixes guest SMP with Linux under SVM.
> Without that patch Linux deadlocks or panics right after trying to boot the
> other CPUs.
>
Applied, thanks.
--
error compiling committee.c: too many arguments to function
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-01-29 12:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-29 12:01 [PATCH] SVM: set NM intercept when enabling CR0.TS in the guest Joerg Roedel
[not found] ` <1201608087-29131-1-git-send-email-joerg.roedel-5C7GfCeVMHo@public.gmane.org>
2008-01-29 12:23 ` Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox