From: Avi Kivity <[email protected]>

Fixes an oops due to the per-cpu area being referenced with the guest's %fs.

Signed-off-by: Avi Kivity <[email protected]>

diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index c9d711f..af4b911 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -1148,8 +1148,8 @@ static void svm_vcpu_put(struct kvm_vcpu *vcpu)
 
        ++vcpu->stat.host_state_reload;
        kvm_load_ldt(svm->host.ldt);
-       loadsegment(fs, svm->host.fs);
 #ifdef CONFIG_X86_64
+       loadsegment(fs, svm->host.fs);
        load_gs_index(svm->host.gs);
        wrmsrl(MSR_KERNEL_GS_BASE, current->thread.gs);
 #else
@@ -3633,6 +3633,8 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu)
 
 #ifdef CONFIG_X86_64
        wrmsrl(MSR_GS_BASE, svm->host.gs_base);
+#else
+       loadsegment(fs, svm->host.fs);
 #endif
 
        reload_tss(vcpu);
--
To unsubscribe from this list: send the line "unsubscribe kvm-commits" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to