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

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

 



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

Signed-off-by: Avi Kivity <avi@xxxxxxxxxx>
---
 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 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);
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux