* [PATCH] selftests/mm: Fix soft-dirty kselftest supported check
@ 2026-02-18 18:42 Audra Mitchell
2026-02-24 16:15 ` David Hildenbrand (Arm)
0 siblings, 1 reply; 2+ messages in thread
From: Audra Mitchell @ 2026-02-18 18:42 UTC (permalink / raw)
To: linux-kselftest
Cc: akpm, david, lorenzo.stoakes, Liam.Howlett, vbabka, rppt, surenb,
mhocko, shuah, linux-mm, linux-kernel
On architectures with separate user address space, such as s390 or
those without an MMU, the call to __access_ok will return true.
The soft-dirty test attempts to check if the PAGEMAP_SCAN feature
is supported by providing an invalid address and expecting
__access_ok to return false, thus throwing an EFAULT error on return.
Because of this assumption, this check will always fail for the
architectures aforementioned. Update the supported check to handle
the return being zero for these types of cases.
Signed-off-by: Audra Mitchell <audra@redhat.com>
---
tools/testing/selftests/mm/vm_util.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/tools/testing/selftests/mm/vm_util.c b/tools/testing/selftests/mm/vm_util.c
index d954bf91afd5..3bb7d322101c 100644
--- a/tools/testing/selftests/mm/vm_util.c
+++ b/tools/testing/selftests/mm/vm_util.c
@@ -77,10 +77,8 @@ static bool pagemap_scan_supported(int fd, char *start)
/* Provide an invalid address in order to trigger EFAULT. */
ret = __pagemap_scan_get_categories(fd, start, (struct page_region *) ~0UL);
- if (ret == 0)
- ksft_exit_fail_msg("PAGEMAP_SCAN succeeded unexpectedly\n");
- supported = errno == EFAULT;
+ supported = (ret == 0) || (errno == EFAULT);
return supported;
}
--
2.52.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] selftests/mm: Fix soft-dirty kselftest supported check
2026-02-18 18:42 [PATCH] selftests/mm: Fix soft-dirty kselftest supported check Audra Mitchell
@ 2026-02-24 16:15 ` David Hildenbrand (Arm)
0 siblings, 0 replies; 2+ messages in thread
From: David Hildenbrand (Arm) @ 2026-02-24 16:15 UTC (permalink / raw)
To: Audra Mitchell, linux-kselftest
Cc: akpm, lorenzo.stoakes, Liam.Howlett, vbabka, rppt, surenb,
mhocko, shuah, linux-mm, linux-kernel
On 2/18/26 19:42, Audra Mitchell wrote:
> On architectures with separate user address space, such as s390 or
> those without an MMU, the call to __access_ok will return true.
Where is this __access_ok() you mention here? Somewhere in
fs/proc/task_mmu.c?
> The soft-dirty test attempts to check if the PAGEMAP_SCAN feature
> is supported by providing an invalid address and expecting
> __access_ok to return false, thus throwing an EFAULT error on return.
Where in the soft-dirty test is that triggered?
I'm wondering whether the soft-dirty test should be adjusted, but I did
not yet understand from where this behavior is triggered.
> Because of this assumption, this check will always fail for the
> architectures aforementioned. Update the supported check to handle
> the return being zero for these types of cases.
It would be great to include the output of an actual test case
(soft-dirty?) that is affected by this before/after your change (likely
on s390x where it seems to trigger).
Do we have a Fixes: tag?
>
> Signed-off-by: Audra Mitchell <audra@redhat.com>
> ---
> tools/testing/selftests/mm/vm_util.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/tools/testing/selftests/mm/vm_util.c b/tools/testing/selftests/mm/vm_util.c
> index d954bf91afd5..3bb7d322101c 100644
> --- a/tools/testing/selftests/mm/vm_util.c
> +++ b/tools/testing/selftests/mm/vm_util.c
> @@ -77,10 +77,8 @@ static bool pagemap_scan_supported(int fd, char *start)
>
> /* Provide an invalid address in order to trigger EFAULT. */
> ret = __pagemap_scan_get_categories(fd, start, (struct page_region *) ~0UL);
> - if (ret == 0)
> - ksft_exit_fail_msg("PAGEMAP_SCAN succeeded unexpectedly\n");
>
> - supported = errno == EFAULT;
> + supported = (ret == 0) || (errno == EFAULT);
>
> return supported;
> }
--
Cheers,
David
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-02-24 16:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-18 18:42 [PATCH] selftests/mm: Fix soft-dirty kselftest supported check Audra Mitchell
2026-02-24 16:15 ` David Hildenbrand (Arm)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox