[v3,3/4] kvm: vmx: Don't set hardware IA32_CSTAR MSR on VM-entry
diff mbox series

Message ID 20181112204728.674-1-jmattson@google.com
State New
Headers show
Series
  • [v3,1/4] kvm: vmx: Set IA32_TSC_AUX for legacy mode guests
Related show

Commit Message

Jim Mattson Nov. 12, 2018, 8:47 p.m. UTC
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 <jmattson@google.com>
Reviewed-by: Peter Shier <pshier@google.com>
---
 arch/x86/kvm/vmx.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Jim Mattson Nov. 30, 2018, 5:37 p.m. UTC | #1
Ping.
On Mon, Nov 12, 2018 at 12:47 PM Jim Mattson <jmattson@google.com> wrote:
>
> 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 <jmattson@google.com>
> Reviewed-by: Peter Shier <pshier@google.com>
> ---
>  arch/x86/kvm/vmx.c | 3 ---
>  1 file changed, 3 deletions(-)
>
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index ee460a21d369..df468980a8c1 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -3413,9 +3413,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++);
>                 /*
> --
> 2.19.1.930.g4563a0d9d0-goog
>

Patch
diff mbox series

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index ee460a21d369..df468980a8c1 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -3413,9 +3413,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++);
 		/*