Re: [kvm-unit-tests PATCH v3 3/4] x86/access: Forced emulation support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Apr 04, 2023, Mathias Krause wrote:
> On 04.04.23 02:04, Sean Christopherson wrote:
> > On Mon, Apr 03, 2023, Mathias Krause wrote:
> >> Add support to enforce access tests to be handled by the emulator, if
> >> supported by KVM. Exclude it from the ac_test_exec() test, though, to
> >> not slow it down too much.
> > 
> > IMO, the slowdown is nowhere near bad enought to warrant exclusion.  On bare metal
> > without KASAN and other debug gunk, the total runtime with EPT enabled is <6s.
> > With EPT disabled, it's <8s.  In a VM, they times are <16s and <26s respectively.
> > Those are perfectly reasonable, and forcing emulation actually makes the EPT case,
> > interesting.  And the KASAN/debug builds are so horrendously slow that I think we
> > should figure out a way to special case those kernels anyways.
> 
> You must have a more beefy machine than I do.

I doubt it, my numbers are from a Haswell with a whopping 6 cores (and the core
count should be irrelevant).

> Testing bare metal on a NUC12 (i7-1260P) with kvm.ko loaded with
> force_emulation_prefix=1 and not excluding AC_FEP_BIT from ac_test_bump()
> gives me a runtime of little over 41s with EPT enabled and, funnily, only 9s
> with EPT disabled, as that implicitly excludes the CR4.PKE tests, reducing
> the number of tests to run by a factor of 10 (~38 million tests down do 3.8
> million).

Ah, right, fancy new features.  Running on an Icelake, i.e. with 5-level paging
and PKRU support, is indeed quite painful.

After much fiddling, I think the best option is to add a separate config entry
to enable FEP, and have that entry be nodefault, i.e. a "manual" testcase.  Ditto
for the nVMX #PF variant.  That will allow CI and other runners to enable the
test for compatible configs, e.g. when running on bare metal, without causing
problems for existing setups.  Well, unless there are setups that do a generic
"-g nodefault", but x86 doesn't currently have any nodefault tests so that's
quite unlikely.

The only downside is that the CR0.WP testcase will also become manual only.  We
could obviously have it ignore the opt-in flag, but there's value is containing
it to the opt-in testcase, e.g. it becomes very obvious that emulation is relevant
to the failure when the FEP version fails but the non-FEP version does not.  And
I also think we should mark the VPID-based variants nodefault, as they have 4+
minute runtimes in VMs, i.e. we should encourage use of "-g nodefault" in CI when
appropriate.

I'll post a v4, there are other cleanups needed in the access test, e.g. the darn
thing doesn't use report_summary() and so actually getting it to report a SKIP is
impossible.



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux