From: Mohammed Gamal <mgamal@redhat.com>
To: Jim Mattson <jmattson@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
kvm list <kvm@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Vitaly Kuznetsov <vkuznets@redhat.com>,
Wanpeng Li <wanpengli@tencent.com>,
Joerg Roedel <joro@8bytes.org>,
Aaron Lewis <aaronlewis@google.com>,
Sean Christopherson <seanjc@google.com>
Subject: Re: [PATCH] KVM: x86: VMX: Make smaller physical guest address space support user-configurable
Date: Tue, 22 Jun 2021 14:59:23 +0200 [thread overview]
Message-ID: <01f3b0a48ac46d148f0cb489cb58f4b551832815.camel@redhat.com> (raw)
In-Reply-To: <CALMp9eTU8C4gXWfsLF-_=ymRC7Vqb0St=0BKvuvcNjBkqQBayA@mail.gmail.com>
On Mon, 2021-06-21 at 11:01 -0700, Jim Mattson wrote:
> On Mon, Jan 18, 2021 at 2:22 AM Mohammed Gamal <mgamal@redhat.com>
> wrote:
> >
> > On Fri, 2021-01-15 at 16:08 -0800, Jim Mattson wrote:
> > > On Thu, Sep 3, 2020 at 7:12 AM Mohammed Gamal <mgamal@redhat.com>
> > > wrote:
> > > >
> > > > This patch exposes allow_smaller_maxphyaddr to the user as a
> > > > module
> > > > parameter.
> > > >
> > > > Since smaller physical address spaces are only supported on
> > > > VMX,
> > > > the parameter
> > > > is only exposed in the kvm_intel module.
> > > > Modifications to VMX page fault and EPT violation handling will
> > > > depend on whether
> > > > that parameter is enabled.
> > > >
> > > > Also disable support by default, and let the user decide if
> > > > they
> > > > want to enable
> > > > it.
> > > >
> > > > Signed-off-by: Mohammed Gamal <mgamal@redhat.com>
> > > > ---
> > > > arch/x86/kvm/vmx/vmx.c | 15 ++++++---------
> > > > arch/x86/kvm/vmx/vmx.h | 3 +++
> > > > arch/x86/kvm/x86.c | 2 +-
> > > > 3 files changed, 10 insertions(+), 10 deletions(-)
> > > >
> > > > diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
> > > > index 819c185adf09..dc778c7b5a06 100644
> > > > --- a/arch/x86/kvm/vmx/vmx.c
> > > > +++ b/arch/x86/kvm/vmx/vmx.c
> > > > @@ -129,6 +129,9 @@ static bool __read_mostly
> > > > enable_preemption_timer = 1;
> > > > module_param_named(preemption_timer, enable_preemption_timer,
> > > > bool, S_IRUGO);
> > > > #endif
> > > >
> > > > +extern bool __read_mostly allow_smaller_maxphyaddr;
> > >
> > > Since this variable is in the kvm module rather than the
> > > kvm_intel
> > > module, its current setting is preserved across "rmmod kvm_intel;
> > > modprobe kvm_intel." That is, if set to true, it doesn't revert
> > > to
> > > false after "rmmod kvm_intel." Is that the intended behavior?
> > >
> >
> > IIRC, this is because this setting was indeed not intended to be
> > just
> > VMX-specific, but since AMD has an issue with PTE accessed-bits
> > being
> > set by hardware and thus we can't yet enable this feature on it, it
> > might make sense to move the variable to the kvm_intel module for
> > now.
>
> Um...
>
> We do allow it for SVM, if NPT is not enabled. In fact, we set it
> unconditionally in that case. See commit 3edd68399dc15 ("KVM: x86:
> Add
> a capability for GUEST_MAXPHYADDR < HOST_MAXPHYADDR support").
>
> Perhaps it should be a module parameter for SVM as well?
Hmmm, I think given how AMD CPUs' behavior with NPT enabled, maybe it'd
actually be a better idea to move this entirely to VMX for the time
being. And then maybe make it available again on AMD only if the
behavior with NPT is changed.
>
> And, in any case, it would be nice if the parameter reverted to false
> when the kvm_intel module is unloaded.
>
> > Paolo, what do you think?
> >
> >
>
prev parent reply other threads:[~2021-06-22 12:59 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-03 14:11 Mohammed Gamal
2020-09-03 17:57 ` Jim Mattson
2020-09-03 18:03 ` Paolo Bonzini
2020-09-03 18:32 ` Jim Mattson
2020-09-03 20:02 ` Paolo Bonzini
2020-09-03 21:26 ` Jim Mattson
2020-09-23 13:45 ` Paolo Bonzini
[not found] ` <CALMp9eTHbhwfdq4Be=XcUG9z82KK8AapQeVmsdH=mGdQ_Yt2ug@mail.gmail.com>
2020-09-23 15:19 ` Paolo Bonzini
2020-09-28 15:34 ` Qian Cai
2020-09-29 11:59 ` Qian Cai
2020-09-29 12:26 ` Paolo Bonzini
2020-09-29 13:39 ` Qian Cai
2020-09-29 14:47 ` Paolo Bonzini
2020-10-02 17:28 ` Naresh Kamboju
2020-10-02 17:30 ` Paolo Bonzini
2021-01-16 0:08 ` Jim Mattson
2021-01-18 10:18 ` Mohammed Gamal
2021-06-21 18:01 ` Jim Mattson
2021-06-22 12:59 ` Mohammed Gamal [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=01f3b0a48ac46d148f0cb489cb58f4b551832815.camel@redhat.com \
--to=mgamal@redhat.com \
--cc=aaronlewis@google.com \
--cc=jmattson@google.com \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
--cc=vkuznets@redhat.com \
--cc=wanpengli@tencent.com \
/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®