[v3,2/4] kvm: vmx: Document the need for MSR_STAR in i386 builds
diff mbox series

Message ID 20181112204508.261895-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:45 p.m. UTC
Add a comment explaining why MSR_STAR must be included in
vmx_msr_index[] even for i386 builds.

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@google.com>
Reviewed-by: Peter Shier <pshier@google.com>
---
 arch/x86/kvm/vmx.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Jim Mattson Nov. 30, 2018, 5:36 p.m. UTC | #1
Ping.
On Mon, Nov 12, 2018 at 12:45 PM Jim Mattson <jmattson@google.com> wrote:
>
> Add a comment explaining why MSR_STAR must be included in
> vmx_msr_index[] even for i386 builds.
>
> 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@google.com>
> Reviewed-by: Peter Shier <pshier@google.com>
> ---
>  arch/x86/kvm/vmx.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index 120fc97a63fc..ee460a21d369 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -1388,8 +1388,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.
> + * Though SYSCALL is only supported in 64-bit mode on Intel CPUs, kvm
> + * will emulate SYSCALL in legacy mode if the vendor string in guest
> + * CPUID.0:{EBX,ECX,EDX} is "AuthenticAMD" or "AMDisbetter!" To
> + * support this emulation, IA32_STAR must always be included in
> + * vmx_msr_index[], even in i386 builds.
>   */
>  static const u32 vmx_msr_index[] = {
>  #ifdef CONFIG_X86_64
> --
> 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 120fc97a63fc..ee460a21d369 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -1388,8 +1388,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.
+ * Though SYSCALL is only supported in 64-bit mode on Intel CPUs, kvm
+ * will emulate SYSCALL in legacy mode if the vendor string in guest
+ * CPUID.0:{EBX,ECX,EDX} is "AuthenticAMD" or "AMDisbetter!" To
+ * support this emulation, IA32_STAR must always be included in
+ * vmx_msr_index[], even in i386 builds.
  */
 static const u32 vmx_msr_index[] = {
 #ifdef CONFIG_X86_64