|
@@ -5651,6 +5651,18 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu)
|
|
|
#endif
|
|
|
);
|
|
|
|
|
|
+ /* Eliminate branch target predictions from guest mode */
|
|
|
+ vmexit_fill_RSB();
|
|
|
+
|
|
|
+#ifdef CONFIG_X86_64
|
|
|
+ wrmsrl(MSR_GS_BASE, svm->host.gs_base);
|
|
|
+#else
|
|
|
+ loadsegment(fs, svm->host.fs);
|
|
|
+#ifndef CONFIG_X86_32_LAZY_GS
|
|
|
+ loadsegment(gs, svm->host.gs);
|
|
|
+#endif
|
|
|
+#endif
|
|
|
+
|
|
|
/*
|
|
|
* We do not use IBRS in the kernel. If this vCPU has used the
|
|
|
* SPEC_CTRL MSR it may have left it on; save the value and
|
|
@@ -5671,18 +5683,6 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu)
|
|
|
|
|
|
x86_spec_ctrl_restore_host(svm->spec_ctrl);
|
|
|
|
|
|
- /* Eliminate branch target predictions from guest mode */
|
|
|
- vmexit_fill_RSB();
|
|
|
-
|
|
|
-#ifdef CONFIG_X86_64
|
|
|
- wrmsrl(MSR_GS_BASE, svm->host.gs_base);
|
|
|
-#else
|
|
|
- loadsegment(fs, svm->host.fs);
|
|
|
-#ifndef CONFIG_X86_32_LAZY_GS
|
|
|
- loadsegment(gs, svm->host.gs);
|
|
|
-#endif
|
|
|
-#endif
|
|
|
-
|
|
|
reload_tss(vcpu);
|
|
|
|
|
|
local_irq_disable();
|