Skip to contentSkip to conversation

KVM: SVM: Load %fs early on vmexit path, on i386

PATCH New Avi Kivity 1 participant 1 message Dec 26, 2010

Subsystems (3)
lore
Share & tools
lore

Avi Kivity

author
#0 lore raw

PATCH 1/1 KVM: SVM: Load %fs early on vmexit path, on i386

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

---
 arch/x86/kvm/svm.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
arch/x86/kvm/svm.c +3 -1
index c9d711f..af4b911 100644
@@ -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);
Signature · 1 line
1.7.1