Re: [PATCH 2/2] selftests/mm: add a uffd test for re-registering during UFFDIO_COPY
From: Jose A. Perez de Azpillaga
Date: Sat Oct 31 2026 - 08:44:26 EST
On 10/31/26 10:35 AM, Mike Rapoport wrote:
> On Thu, Oct 29, 2026 at 11:11:02PM +0100, Jose A. Perez de Azpillaga wrote:
>> Re-register the destination without WP while a UFFDIO_COPY_MODE_WP copy
>> waits for its source page, then check that the copy fails with -EINVAL
>> and leaves no uffd-wp bit behind. This covers both the hugetlb and the
>> non-hugetlb UFFDIO_COPY retry.
>
> maybe "all memory types"?
yep, that reads better.
>
>> Signed-off-by: Jose A. Perez de Azpillaga <azpijr@xxxxxxxxx>
>> ---
>> tools/testing/selftests/mm/uffd-unit-tests.c | 105 +++++++++++++++++++
>> 1 file changed, 105 insertions(+)
>>
>> diff --git a/tools/testing/selftests/mm/uffd-unit-tests.c b/tools/testing/selftests/mm/uffd-unit-tests.c
>> index 2a97ba1d6feb..8a7efaa7b3ac 100644
>> --- a/tools/testing/selftests/mm/uffd-unit-tests.c
>> +++ b/tools/testing/selftests/mm/uffd-unit-tests.c
>> @@ -375,6 +375,104 @@ static void uffd_wp_unpopulated_test(uffd_global_test_opts_t *gopts, uffd_test_a
>> uffd_test_pass();
>> }
>>
>> +struct wp_copy_args {
>> + uffd_global_test_opts_t *gopts;
>> + char *src;
>> + __s64 copy;
>
> maybe result?
sure, will rename it in v2.
--
cheers,
jose a. p-a