OrangePi_CM5/tools/testing/selftests
Alistair Popple 6292503700 mm/hmm.c: allow VM_MIXEDMAP to work with hmm_range_fault
commit 87c01d57fa23de82fff593a7d070933d08755801 upstream.

hmm_range_fault() can be used instead of get_user_pages() for devices
which allow faulting however unlike get_user_pages() it will return an
error when used on a VM_MIXEDMAP range.

To make hmm_range_fault() more closely match get_user_pages() remove
this restriction.  This requires dealing with the !ARCH_HAS_PTE_SPECIAL
case in hmm_vma_handle_pte().  Rather than replicating the logic of
vm_normal_page() call it directly and do a check for the zero pfn
similar to what get_user_pages() currently does.

Also add a test to hmm selftest to verify functionality.

Link: https://lkml.kernel.org/r/20211104012001.2555676-1-apopple@nvidia.com
Fixes: da4c3c735e ("mm/hmm/mirror: helper to snapshot CPU page table")
Signed-off-by: Alistair Popple <apopple@nvidia.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Cc: Jerome Glisse <jglisse@redhat.com>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Zi Yan <ziy@nvidia.com>
Cc: Ralph Campbell <rcampbell@nvidia.com>
Cc: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-27 10:54:36 +01:00
..
android
…
arm64 kselftest/arm64: signal: Skip tests if required features are missing 2021-09-30 10:11:03 +02:00
bpf selftests/bpf: Fix bpf_object leak in skb_ctx selftest 2022-01-27 10:54:10 +01:00
breakpoints
…
capabilities
…
cgroup
…
clone3 selftests: clone3: clone3: add case CLONE3_ARGS_NO_TEST 2022-01-27 10:53:55 +01:00
core selftests/core: fix conflicting types compile error for close_range() 2021-11-18 14:04:01 +01:00
cpu-hotplug
…
cpufreq
…
dmabuf-heaps kselftests: dmabuf-heaps: Fix Makefile's inclusion of the kernel's usr/include dir 2021-03-04 11:38:05 +01:00
drivers selftests: Clean forgotten resources as part of cleanup() 2021-07-19 09:44:49 +02:00
efivarfs
…
exec tools/testing/selftests/exec: fix link error 2021-05-26 12:06:49 +02:00
filesystems linux-kselftest-fixes-5.10-rc3 2020-11-06 15:42:42 -08:00
firmware selftests: firmware: Fix ignored return val of asprintf() warn 2021-09-18 13:40:20 +02:00
fpu
…
ftrace selftests/ftrace: make kprobe profile testcase description unique 2022-01-27 10:54:15 +01:00
futex
…
gpio selftests/gpio: Fix build when source tree is read only 2021-06-03 09:00:31 +02:00
ia64
…
intel_pstate
…
ipc
…
ir
…
kcmp
…
kexec
…
kmod
…
kselftest tweewide: Fix most Shebang lines 2021-05-22 11:40:55 +02:00
kvm KVM: selftests: Make sure kvm_create_max_vcpus test won't hit RLIMIT_NOFILE 2021-12-22 09:30:50 +01:00
lib
…
livepatch
…
lkdtm selftests/lkdtm: Fix expected text for CR4 pinning 2021-07-19 09:45:00 +02:00
locking
…
media_tests
…
membarrier
…
memfd
…
memory-hotplug
…
mincore
…
mount
…
mqueue
…
net selftests/net: udpgso_bench_tx: fix dst ip argument 2022-01-05 12:40:31 +01:00
netfilter netfilter: selftest: conntrack_vrf.sh: fix file permission 2021-12-16 16:38:33 +01:00
nsfs
…
ntb
…
openat2
…
pid_namespace
…
pidfd selftests: pidfd: drop needless linux/kcmp.h inclusion in pidfd_setns_test.c 2020-10-27 17:04:01 -06:00
powerpc selftests/powerpc/spectre_v2: Return skip code when miss_percent is high 2022-01-27 10:54:23 +01:00
prctl
…
proc selftests: proc: fix warning: _GNU_SOURCE redefined 2020-11-05 10:08:14 -07:00
pstore
…
ptp
…
ptrace
…
rcutorture
…
resctrl Revert "selftests/resctrl: Use resctrl/info for feature detection" 2021-08-15 14:00:25 +02:00
rseq
…
rtc
…
safesetid
…
seccomp powerpc/64s/syscall: Use pt_regs.trap to distinguish syscall ABI difference between sc and scv syscalls 2021-05-26 12:06:53 +02:00
sigaltstack
…
size
…
sparc64
…
splice selftests: splice: Adjust for handler fallback removal 2021-07-14 16:56:42 +02:00
static_keys
…
sync
…
sysctl
…
tc-testing tc-testing: fix list handling 2021-07-14 16:56:26 +02:00
timens
…
timers selftests: timers: rtcpie: skip test if default RTC device does not exist 2021-07-20 16:05:42 +02:00
tmpfs
…
tpm2
…
uevent
…
user
…
vDSO
…
vm mm/hmm.c: allow VM_MIXEDMAP to work with hmm_range_fault 2022-01-27 10:54:36 +01:00
watchdog
…
wireguard wireguard: device: reset peer src endpoint when netns exits 2021-12-08 09:03:22 +01:00
x86 selftests: x86: fix [-Wstringop-overread] warn in test_process_vm_readv() 2022-01-11 15:24:58 +01:00
zram
…
.gitignore
…
Makefile
…
gen_kselftest_tar.sh
…
kselftest.h
…
kselftest_deps.sh
…
kselftest_harness.h selftests: harness: avoid false negatives if test has no ASSERTs 2022-01-27 10:53:55 +01:00
kselftest_install.sh
…
kselftest_module.h
…
lib.mk selftests: be sure to make khdr before other targets 2021-10-09 14:40:57 +02:00
run_kselftest.sh selftests/run_kselftest.sh: fix dry-run typo 2020-12-30 11:53:07 +01:00