From: Jim Mattson Date: Wed, 5 Dec 2018 23:29:00 +0000 (-0800) Subject: kvm: vmx: Don't set hardware IA32_CSTAR MSR on VM-entry X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=db31c8f5af7de0e78f63fd4c255cf3868d667bf4;p=linux.git kvm: vmx: Don't set hardware IA32_CSTAR MSR on VM-entry SYSCALL raises #UD in compatibility mode on Intel CPUs, so it's pointless to load the guest's IA32_CSTAR value into the hardware MSR. IA32_CSTAR still provides 48 bits of storage on Intel CPUs that have CPUID.80000001:EDX.LM[bit 29] set, so we cannot remove it from the vmx_msr_index[] array. Signed-off-by: Jim Mattson Reviewed-by: Peter Shier Signed-off-by: Paolo Bonzini --- diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index d754fd0c86743..2084db0976221 100644 --- a/arch/x86/kvm/vmx/vmx.c +++ b/arch/x86/kvm/vmx/vmx.c @@ -1380,9 +1380,6 @@ static void setup_msrs(struct vcpu_vmx *vmx) if (index >= 0) move_msr_up(vmx, index, save_nmsrs++); index = __find_msr_index(vmx, MSR_LSTAR); - if (index >= 0) - move_msr_up(vmx, index, save_nmsrs++); - index = __find_msr_index(vmx, MSR_CSTAR); if (index >= 0) move_msr_up(vmx, index, save_nmsrs++); /*