From: Sean Christopherson <seanjc@google.com>
To: Thomas Prescher <thomas.prescher@cyberus-technology.de>
Cc: "mingo@redhat.com" <mingo@redhat.com>,
"x86@kernel.org" <x86@kernel.org>,
"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
"hpa@zytor.com" <hpa@zytor.com>,
Julian Stecklina <julian.stecklina@cyberus-technology.de>,
"tglx@linutronix.de" <tglx@linutronix.de>,
"bp@alien8.de" <bp@alien8.de>,
"pbonzini@redhat.com" <pbonzini@redhat.com>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] KVM: nVMX: fix CR4_READ_SHADOW when L0 updates CR4 during a signal
Date: Thu, 18 Apr 2024 11:28:06 -0700 [thread overview]
Message-ID: <ZiFmNmlUxfQnXIua@google.com> (raw)
In-Reply-To: <61f14bc6415d5d8407fc3ae6f6c3348caa2a97e9.camel@cyberus-technology.de>
On Thu, Apr 18, 2024, Thomas Prescher wrote:
> On Wed, 2024-04-17 at 09:28 -0700, Sean Christopherson wrote:
> > On Wed, Apr 17, 2024, Sean Christopherson wrote:
> > > On Wed, Apr 17, 2024, Thomas Prescher wrote:
> > > > On Tue, 2024-04-16 at 11:07 -0700, Sean Christopherson wrote:
> > > > > Hur dur, I forgot that KVM provides a "guest_mode" stat.
> > > > > Userspace can do
> > > > > KVM_GET_STATS_FD on the vCPU FD to get a file handle to the
> > > > > binary stats,
> > > > > and then you wouldn't need to call back into KVM just to query
> > > > > guest_mode.
> > > > >
> > > > > Ah, and I also forgot that we have kvm_run.flags, so adding
> > > > > KVM_RUN_X86_GUEST_MODE would also be trivial (I almost
> > > > > suggested it
> > > > > earlier, but didn't want to add a new field to kvm_run without
> > > > > a very good
> > > > > reason).
> > > >
> > > > Thanks for the pointers. This is really helpful.
> > > >
> > > > I tried the "guest_mode" stat as you suggested and it solves the
> > > > immediate issue we have with VirtualBox/KVM.
> > >
> > > Note,
> >
> > Gah, got distracted. I was going to say that we should add
> > KVM_RUN_X86_GUEST_MODE,
> > because stats aren't guaranteed ABI[*], i.e. relying on guest_mode
> > could prove
> > problematic in the long run (though that's unlikely).
> >
> > [*]
> > https://lore.kernel.org/all/CABgObfZ4kqaXLaOAOj4aGB5GAe9GxOmJmOP+7kdke6OqA35HzA@mail.gmail.com
>
> Allright. I will propose a patch that sets the KVM_RUN_X86_GUEST_MODE
> flag in the next couple of days. Do we also need a new capability for
> this flag so userland can query whether this field is actually updated
> by KVM?
Hmm, yeah, I don't see any way around that.
next prev parent reply other threads:[~2024-04-18 18:28 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-16 12:35 [PATCH 1/2] KVM: nVMX: fix CR4_READ_SHADOW when L0 updates CR4 during a signal Julian Stecklina
2024-04-16 12:35 ` [PATCH 2/2] KVM: nVMX: remove unnecessary CR4_READ_SHADOW write Julian Stecklina
2024-04-16 14:35 ` [PATCH 1/2] KVM: nVMX: fix CR4_READ_SHADOW when L0 updates CR4 during a signal Sean Christopherson
2024-04-16 15:08 ` Thomas Prescher
2024-04-16 15:17 ` Sean Christopherson
2024-04-16 17:31 ` Thomas Prescher
2024-04-16 18:07 ` Sean Christopherson
2024-04-17 13:05 ` Thomas Prescher
2024-04-17 16:11 ` Sean Christopherson
2024-04-17 16:28 ` Sean Christopherson
2024-04-18 13:48 ` Thomas Prescher
2024-04-18 18:28 ` Sean Christopherson [this message]
2024-05-08 13:27 ` Thomas Prescher
2024-04-18 13:46 ` Thomas Prescher
2024-04-18 18:36 ` Sean Christopherson
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=ZiFmNmlUxfQnXIua@google.com \
--to=seanjc@google.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=julian.stecklina@cyberus-technology.de \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=tglx@linutronix.de \
--cc=thomas.prescher@cyberus-technology.de \
--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