[Bug 216177] kvm-unit-tests vmx has about 60% of failure chance

bugzilla-daemon
2022-06-28T01:31:09Z

--- Comment #4 from Sean Christopherson (seanjc@google.com) ---
On Tue, Jun 28, 2022, bugzilla-daemon@kernel.org wrote:
> https://bugzilla.kernel.org/show_bug.cgi?id=216177
>
> --- Comment #3 from Yang Lixiao (lixiao.yang@intel.com) ---
> (In reply to Nadav Amit from comment #2)
> > > On Jun 27, 2022, at 5:28 PM, bugzilla-daemon@kernel.org wrote:
> > >
> > > https://bugzilla.kernel.org/show_bug.cgi?id=216177
> > >
> > > Sean Christopherson (seanjc@google.com) changed:
> > >
> > > What |Removed |Added
> > >
> >
> ----------------------------------------------------------------------------
> > > CC| |seanjc@google.com
> > >
> > > --- Comment #1 from Sean Christopherson (seanjc@google.com) ---
> > > It's vmx_preemption_timer_expiry_test, which is known to be flaky (though
> > > IIRC
> > > it's KVM that's at fault).
> > >
> > > Test suite: vmx_preemption_timer_expiry_test
> > > FAIL: Last stored guest TSC (28067103426) < TSC deadline (28067086048)
> >
> > For the record:
> >
> > https://lore.kernel.org/kvm/D121A03E-6861-4736-8070-5D1E4FEE1D32@gmail.com/
>
> Thanks for your reply. So this is a KVM bug, and you have sent a patch to kvm
> to fix this bug, right?

No, AFAIK no one has posted a fix. If it's the KVM issue I'm thinking of, the
fix is non-trivial. It'd require scheduling a timer in L0 with a deadline
shorter
than what L1 requests when emulating the VMX timer, and then busy waiting in L0
if
the host timer fires early. KVM already does this for e.g. L1's TSC deadline
timer.
That code would need to be adapated for the nested VMX preemption timer.