[COMMIT master] KVM: SVM: Load %fs early on vmexit path, on i386

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Avi Kivity <avi@xxxxxxxxxx>

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

Signed-off-by: Avi Kivity <avi@xxxxxxxxxx>

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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM Development]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Walks]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux