Re: [PATCH v2 5/6] kvm: x86: Emulate MSR IA32_CORE_CAPABILITIES

From: Peter Zijlstra
Date: Tue Feb 11 2020 - 07:38:35 EST


On Mon, Feb 10, 2020 at 07:52:13PM -0800, Andy Lutomirski wrote:
> On Tue, Feb 4, 2020 at 1:37 AM Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> >
> > On Tue, Feb 04, 2020 at 05:19:26PM +0800, Xiaoyao Li wrote:
> >
> > > > > + case MSR_IA32_CORE_CAPS:
> > > > > + if (!msr_info->host_initiated)
> > > >
> > > > Shouldn't @data be checked against kvm_get_core_capabilities()?
> > >
> > > Maybe it's for the case that userspace might have the ability to emulate SLD
> > > feature? And we usually let userspace set whatever it wants, e.g.,
> > > ARCH_CAPABILITIES.
> >
> > If the 'sq_misc.split_lock' event is sufficiently accurate, I suppose
> > the host could use that to emulate the feature at the cost of one
> > counter used.
>
> I would be impressed if the event were to fire before executing the
> offending split lock. Wouldn't the best possible result be for it to
> fire with RIP pointing to the *next* instruction? This seems like it
> could be quite confusing to a guest.

True; and I see no indication the event is PEBS capable, so even that is
pushing it.

However, it's virt; isn't that confused per definition? ;-))