[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zh_4tsd5rAo4G1Lv@google.com>
Date: Wed, 17 Apr 2024 09:28:38 -0700
From: Sean Christopherson <seanjc@...gle.com>
To: Thomas Prescher <thomas.prescher@...erus-technology.de>
Cc: "pbonzini@...hat.com" <pbonzini@...hat.com>, "x86@...nel.org" <x86@...nel.org>,
"dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>, "hpa@...or.com" <hpa@...or.com>,
Julian Stecklina <julian.stecklina@...erus-technology.de>,
"tglx@...utronix.de" <tglx@...utronix.de>, "bp@...en8.de" <bp@...en8.de>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"mingo@...hat.com" <mingo@...hat.com>
Subject: Re: [PATCH 1/2] KVM: nVMX: fix CR4_READ_SHADOW when L0 updates CR4
during a signal
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
Powered by blists - more mailing lists