linux/tools
Kevin Brodsky fde8353121 selftests/mm: report SKIP in pfnmap if a check fails
pfnmap currently checks the target file in FIXTURE_SETUP(pfnmap), meaning
once for every test, and skips the test if any check fails.

The target file is the same for every test so this is a little overkill. 
More importantly, this approach means that the whole suite will report
PASS even if all the tests are skipped because kernel configuration (e.g. 
CONFIG_STRICT_DEVMEM=y) prevented /dev/mem from being mapped, for
instance.

Let's ensure that KSFT_SKIP is returned as exit code if any check fails by
performing the checks in pfnmap_init(), run once.  That function also
takes care of finding the offset of the pages to be mapped and saves it in
a global.  The file is now opened only once and the fd saved in a global,
but it is still mapped/unmapped for every test, as some of them modify the
mapping.

Link: https://lkml.kernel.org/r/20260122170224.4056513-10-kevin.brodsky@arm.com
Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com>
Acked-by: David Hildenbrand (Red Hat) <david@kernel.org>
Cc: Dev Jain <dev.jain@arm.com>
Cc: Jason Gunthorpe <jgg@nvidia.com>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: SeongJae Park <sj@kernel.org>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Usama Anjum <Usama.Anjum@arm.com>
Cc: wang lian <lianux.mm@gmail.com>
Cc: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2026-01-31 14:22:42 -08:00
..
accounting tools/delaytop: improve error handling for missing PSI support 2025-09-13 17:32:56 -07:00
arch tools headers: Sync arm64 headers with kernel sources 2025-12-24 11:43:12 -08:00
bootconfig
bpf bpftool: Fix build warnings due to MS extensions 2025-12-09 23:21:33 -08:00
build tools build: Fix the common set of features test wrt libopenssl 2025-12-27 20:26:44 -08:00
certs
cgroup
counter
crypto
debugging
dma dma-mapping updates for Linux 6.19: 2025-12-06 09:25:05 -08:00
docs docs: makefile: move rustdoc check to the build wrapper 2025-11-29 08:42:53 -07:00
firewire
firmware
gpio
hv
iio iio: add power and energy measurement modifiers 2025-09-13 13:47:19 +01:00
include treewide: Update email address 2026-01-11 06:09:11 -10:00
kvm/kvm_stat
laptop
leds
lib bpf-fixes 2025-12-17 15:54:58 +12:00
memory-model
mm tools/mm/slabinfo: fix --partial long option mapping 2026-01-20 19:24:43 -08:00
net tools: ynl: render event op docs correctly 2026-01-13 11:56:36 -08:00
objtool objtool: fix build failure due to missing libopcodes check 2026-01-13 11:37:51 +01:00
pcmcia
perf treewide: Update email address 2026-01-11 06:09:11 -10:00
power platform-drivers-x86 for v6.19-1 2025-12-10 06:38:17 +09:00
rcu
sched
sched_ext tools/sched_ext: update scx_show_state.py for scx_aborting change 2025-12-28 06:11:26 -10:00
scripts tools headers: Sync syscall table with kernel sources 2025-12-24 11:43:36 -08:00
sound
spi
testing selftests/mm: report SKIP in pfnmap if a check fails 2026-01-31 14:22:42 -08:00
thermal tools/thermal/thermal-engine: Fix format string bug in thermal-engine 2025-11-25 11:00:28 +01:00
time
tracing rtla updaets for v6.19: 2025-12-05 09:34:01 -08:00
usb
verification
virtio tools/virtio: add device, device_driver stubs 2025-12-24 08:02:56 -05:00
wmi
workqueue
writeback
Makefile tools/dma: move dma_map_benchmark from selftests to tools/dma 2025-10-29 09:41:40 +01:00