From: Paolo Bonzini <pbonzini@redhat.com>
To: Maxim Levitsky <mlevitsk@redhat.com>, kvm@vger.kernel.org
Cc: Borislav Petkov <bp@alien8.de>,
"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)"
<x86@kernel.org>, Wanpeng Li <wanpengli@tencent.com>,
Jim Mattson <jmattson@google.com>,
Sean Christopherson <sean.j.christopherson@intel.com>,
Thomas Gleixner <tglx@linutronix.de>,
"H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@redhat.com>,
linux-kernel@vger.kernel.org,
Vitaly Kuznetsov <vkuznets@redhat.com>,
Joerg Roedel <joro@8bytes.org>
Subject: Re: [PATCH v7 0/4] KVM: nSVM: ondemand nested state allocation
Date: Mon, 19 Oct 2020 17:52:27 +0200 [thread overview]
Message-ID: <2c7ad393-9a7e-359e-a076-0d9ed702fe23@redhat.com> (raw)
In-Reply-To: <20201001112954.6258-1-mlevitsk@redhat.com>
On 01/10/20 13:29, Maxim Levitsky wrote:
> This is the next version of this patch series.
>
> In V5 I adopted Sean Christopherson's suggestion to make .set_efer return
> a negative error (-ENOMEM in this case) which in most cases in kvm
> propagates to the userspace.
>
> I noticed though that wrmsr emulation code doesn't do this and instead
> it injects #GP to the guest on _any_ error.
>
> So I fixed the wrmsr code to behave in a similar way to the rest
> of the kvm code.
> (#GP only on a positive error value, and forward the negative error to
> the userspace)
>
> I had to adjust one wrmsr handler (xen_hvm_config) to stop it from returning
> negative values so that new WRMSR emulation behavior doesn't break it.
> This patch was only compile tested.
>
> The memory allocation failure was tested by always returning -ENOMEM
> from svm_allocate_nested.
>
> The nested allocation itself was tested by countless attempts to run
> nested guests, do nested migration on both my AMD and Intel machines.
> I wasn't able to break it.
>
> Changes from V5: addressed Sean Christopherson's review feedback.
> Changes from V6: rebased the code on latest kvm/queue
>
> Best regards,
> Maxim Levitsky
>
> Maxim Levitsky (4):
> KVM: x86: xen_hvm_config: cleanup return values
> KVM: x86: report negative values from wrmsr emulation to userspace
> KVM: x86: allow kvm_x86_ops.set_efer to return an error value
> KVM: nSVM: implement on demand allocation of the nested state
>
> arch/x86/include/asm/kvm_host.h | 2 +-
> arch/x86/kvm/emulate.c | 4 +--
> arch/x86/kvm/svm/nested.c | 42 ++++++++++++++++++++++
> arch/x86/kvm/svm/svm.c | 64 ++++++++++++++++++---------------
> arch/x86/kvm/svm/svm.h | 10 +++++-
> arch/x86/kvm/vmx/vmx.c | 6 ++--
> arch/x86/kvm/x86.c | 39 ++++++++++----------
> 7 files changed, 114 insertions(+), 53 deletions(-)
>
Queued, thanks.
Paolo
prev parent reply other threads:[~2020-10-19 15:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-01 11:29 Maxim Levitsky
2020-10-01 11:29 ` [PATCH v7 1/4] KVM: x86: xen_hvm_config: cleanup return values Maxim Levitsky
2020-10-01 11:29 ` [PATCH v7 2/4] KVM: x86: report negative values from wrmsr emulation to userspace Maxim Levitsky
2020-10-01 11:29 ` [PATCH v7 3/4] KVM: x86: allow kvm_x86_ops.set_efer to return an error value Maxim Levitsky
2020-10-01 11:29 ` [PATCH v7 4/4] KVM: nSVM: implement on demand allocation of the nested state Maxim Levitsky
2020-10-19 15:52 ` 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=2c7ad393-9a7e-359e-a076-0d9ed702fe23@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=sean.j.christopherson@intel.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®