From: Paolo Bonzini <pbonzini@redhat.com>
To: Maxim Levitsky <mlevitsk@redhat.com>, kvm@vger.kernel.org
Cc: Wanpeng Li <wanpengli@tencent.com>,
Jim Mattson <jmattson@google.com>, Ingo Molnar <mingo@redhat.com>,
"open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)"
<linux-kernel@vger.kernel.org>, "H. Peter Anvin" <hpa@zytor.com>,
"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)"
<x86@kernel.org>, Thomas Gleixner <tglx@linutronix.de>,
Borislav Petkov <bp@alien8.de>,
Vitaly Kuznetsov <vkuznets@redhat.com>,
Sean Christopherson <seanjc@google.com>,
Joerg Roedel <joro@8bytes.org>
Subject: Re: [PATCH v2 0/2] KVM: x86: nSVM: fixes for SYSENTER emulation
Date: Thu, 1 Apr 2021 14:51:46 +0200 [thread overview]
Message-ID: <6acb7872-37ed-0b24-65a1-ddaa17bae6ef@redhat.com> (raw)
In-Reply-To: <20210401111928.996871-1-mlevitsk@redhat.com>
On 01/04/21 13:19, Maxim Levitsky wrote:
> This is a result of a deep rabbit hole dive in regard to why
> currently the nested migration of 32 bit guests
> is totally broken on AMD.
>
> It turns out that due to slight differences between the original AMD64
> implementation and the Intel's remake, SYSENTER instruction behaves a
> bit differently on Intel, and to support migration from Intel to AMD we
> try to emulate those differences away.
>
> Sadly that collides with virtual vmload/vmsave feature that is used in nesting.
> The problem was that when it is enabled,
> on migration (and otherwise when userspace reads MSR_IA32_SYSENTER_{EIP|ESP},
> wrong value were returned, which leads to #DF in the
> nested guest when the wrong value is loaded back.
>
> The patch I prepared carefully fixes this, by mostly disabling that
> SYSCALL emulation when we don't spoof the Intel's vendor ID, and if we do,
> and yet somehow SVM is enabled (this is a very rare edge case), then
> virtual vmload/save is force disabled.
>
> V2: incorporated review feedback from Paulo.
>
> Best regards,
> Maxim Levitsky
>
> Maxim Levitsky (2):
> KVM: x86: add guest_cpuid_is_intel
> KVM: nSVM: improve SYSENTER emulation on AMD
>
> arch/x86/kvm/cpuid.h | 8 ++++
> arch/x86/kvm/svm/svm.c | 99 +++++++++++++++++++++++++++---------------
> arch/x86/kvm/svm/svm.h | 6 +--
> 3 files changed, 76 insertions(+), 37 deletions(-)
>
Queued, thanks.
Paolo
prev parent reply other threads:[~2021-04-01 18:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-01 11:19 Maxim Levitsky
2021-04-01 11:19 ` [PATCH v2 1/2] KVM: x86: add guest_cpuid_is_intel Maxim Levitsky
2021-04-01 11:19 ` [PATCH v2 2/2] KVM: nSVM: improve SYSENTER emulation on AMD Maxim Levitsky
2021-04-01 13:03 ` Vitaly Kuznetsov
2021-04-01 13:43 ` Paolo Bonzini
2021-04-01 15:31 ` Vitaly Kuznetsov
2021-04-01 15:57 ` Paolo Bonzini
2021-04-01 17:05 ` Maxim Levitsky
2021-04-01 12:51 ` Paolo Bonzini [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6acb7872-37ed-0b24-65a1-ddaa17bae6ef@redhat.com \
--to=pbonzini@redhat.com \
--cc=bp@alien8.de \
--cc=hpa@zytor.com \
--cc=jmattson@google.com \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=mlevitsk@redhat.com \
--cc=seanjc@google.com \
--cc=tglx@linutronix.de \
--cc=vkuznets@redhat.com \
--cc=wanpengli@tencent.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®