Re: [RFC PATCH v1 26/37] KVM: selftests: guest_memfd: Test that shared/private status is consistent across processes
From: Ackerley Tng
Date: Fri Oct 17 2025 - 19:34:01 EST
Ackerley Tng <ackerleytng@xxxxxxxxxx> writes:
> From: Sean Christopherson <seanjc@xxxxxxxxxx>
>
> Add a test to verify that a guest_memfd's shared/private status is
> consistent across processes.
>
Missed copying Sean's note from [1]. Rephrased:
Test that on shared to private conversion, any shared pages previously
mapped in any process are unmapped from all processes.
[1] https://lore.kernel.org/all/aN7U1ewx8dNOKl1n@xxxxxxxxxx/
> The test forks a child process after creating the shared guest_memfd
> region so that the second process exists alongside the main process for the
> entire test.
>
> The processes then take turns to access memory to check that the
> shared/private status is consistent across processes.
>
> Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>
> Co-developed-by: Ackerley Tng <ackerleytng@xxxxxxxxxx>
> Signed-off-by: Ackerley Tng <ackerleytng@xxxxxxxxxx>
> ---
> .../kvm/guest_memfd_conversions_test.c | 74 +++++++++++++++++++
> 1 file changed, 74 insertions(+)
>
>
> [...snip...]
>