Re: [PATCH v2 07/13] KVM: selftests: Create a new guest_memfd for each testcase

From: Sean Christopherson
Date: Fri Oct 10 2025 - 16:12:39 EST


On Fri, Oct 10, 2025, David Hildenbrand wrote:
> On 04.10.25 01:26, Sean Christopherson wrote:
> > Refactor the guest_memfd selftest to improve test isolation by creating a
> > a new guest_memfd for each testcase. Currently, the test reuses a single
> > guest_memfd instance for all testcases, and thus creates dependencies
> > between tests, e.g. not truncating folios from the guest_memfd instance
> > at the end of a test could lead to unexpected results (see the PUNCH_HOLE
> > purging that needs to done by in-flight the NUMA testcases[1]).
> >
> > Invoke each test via a macro wrapper to create and close a guest_memfd
> > to cut down on the boilerplate copy+paste needed to create a test.
> >
> > Link: https://lore.kernel.org/all/20250827175247.83322-10-shivankg@xxxxxxx
> > Reported-by: Ackerley Tng <ackerleytng@xxxxxxxxxx>
>
> Do we have a Closes: link where this was reported?

No, it was "reported" internally by way of an internal patch that Ackerley
submitted for review. I suppose maybe Suggested-by would be more approriate?
Ackerley's patch essentially did the same thing, but through copy+paste instead
of a centralized macro.

I used Reported-by though because this really is a bug (I've been burned by such
issues in KVM-Unit-Tests many times), and I wanted to treat it as such.