[PATCH v2 2/4] kvm: vmx: Omit MSR_STAR from vmx_msr_index[] for i386 builds

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

 



The SYSCALL instruction is only supported in 64-bit mode on Intel
CPUs. With VT-x, A legacy-mode hypervisor can't launch a long-mode
guest. Therefore, we can omit MSR_STAR support for i386 builds.

Note that the elided comment has not been relevant since move_msr_up()
was introduced in commit a75beee6e4f5d ("KVM: VMX: Avoid saving and
restoring msrs on lightweight vmexit").

Signed-off-by: Jim Mattson <jmattson@xxxxxxxxxx>
Reviewed-by: Peter Shier <pshier@xxxxxxxxxx>
Reviewed-by: Marc Orr <marcorr@xxxxxxxxxx>
---
 arch/x86/kvm/vmx.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 120fc97a63fc..da7f43457d49 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -1387,15 +1387,11 @@ static u64 host_efer;
 
 static void ept_save_pdptrs(struct kvm_vcpu *vcpu);
 
-/*
- * Keep MSR_STAR at the end, as setup_msrs() will try to optimize it
- * away by decrementing the array size.
- */
 static const u32 vmx_msr_index[] = {
 #ifdef CONFIG_X86_64
-	MSR_SYSCALL_MASK, MSR_LSTAR, MSR_CSTAR,
+	MSR_SYSCALL_MASK, MSR_STAR, MSR_LSTAR, MSR_CSTAR,
 #endif
-	MSR_EFER, MSR_TSC_AUX, MSR_STAR,
+	MSR_EFER, MSR_TSC_AUX
 };
 
 DEFINE_STATIC_KEY_FALSE(enable_evmcs);
-- 
2.19.1.930.g4563a0d9d0-goog




[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