From 4356b11ec0fffaa24331ad762e57547537ff3482 Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Fri, 30 Jun 2023 21:34:33 +0300 Subject: proc: support proc-empty-vm test on i386 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Unmap everything starting from 4GB length until it unmaps, otherwise test has to detect which virtual memory split kernel is using. Link: https://lkml.kernel.org/r/20230630183434.17434-1-adobriyan@gmail.com Signed-off-by: Alexey Dobriyan Cc: Björn Töpel Signed-off-by: Andrew Morton --- tools/testing/selftests/proc/proc-empty-vm.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tools') diff --git a/tools/testing/selftests/proc/proc-empty-vm.c b/tools/testing/selftests/proc/proc-empty-vm.c index 7588428b8fcd..3aea36c57800 100644 --- a/tools/testing/selftests/proc/proc-empty-vm.c +++ b/tools/testing/selftests/proc/proc-empty-vm.c @@ -37,6 +37,10 @@ #include #include +#ifdef __amd64__ +#define TEST_VSYSCALL +#endif + /* * 0: vsyscall VMA doesn't exist vsyscall=none * 1: vsyscall VMA is --xp vsyscall=xonly @@ -119,6 +123,7 @@ static void sigaction_SIGSEGV(int _, siginfo_t *__, void *___) _exit(EXIT_FAILURE); } +#ifdef TEST_VSYSCALL static void sigaction_SIGSEGV_vsyscall(int _, siginfo_t *__, void *___) { _exit(g_vsyscall); @@ -170,6 +175,7 @@ static void vsyscall(void) exit(1); } } +#endif static int test_proc_pid_maps(pid_t pid) { @@ -299,7 +305,9 @@ int main(void) { int rv = EXIT_SUCCESS; +#ifdef TEST_VSYSCALL vsyscall(); +#endif switch (g_vsyscall) { case 0: @@ -346,6 +354,14 @@ int main(void) #ifdef __amd64__ munmap(NULL, ((size_t)1 << 47) - 4096); +#elif defined __i386__ + { + size_t len; + + for (len = -4096;; len -= 4096) { + munmap(NULL, len); + } + } #else #error "implement 'unmap everything'" #endif -- cgit v1.2.3 From f58a2dd8d5d01b3ece13af7915745b8e7de20afe Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Fri, 30 Jun 2023 21:34:34 +0300 Subject: proc: skip proc-empty-vm on anything but amd64 and i386 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This test is arch specific, requires "munmap everything" primitive. Link: https://lkml.kernel.org/r/20230630183434.17434-2-adobriyan@gmail.com Signed-off-by: Alexey Dobriyan Cc: Björn Töpel Signed-off-by: Andrew Morton --- tools/testing/selftests/proc/proc-empty-vm.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tools') diff --git a/tools/testing/selftests/proc/proc-empty-vm.c b/tools/testing/selftests/proc/proc-empty-vm.c index 3aea36c57800..dfbcb3ce2194 100644 --- a/tools/testing/selftests/proc/proc-empty-vm.c +++ b/tools/testing/selftests/proc/proc-empty-vm.c @@ -1,3 +1,4 @@ +#if defined __amd64__ || defined __i386__ /* * Copyright (c) 2022 Alexey Dobriyan * @@ -402,3 +403,9 @@ int main(void) return rv; } +#else +int main(void) +{ + return 4; +} +#endif -- cgit v1.2.3 From ef815d2cba782e96b9aad9483523d474ed41c62a Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Tue, 15 Aug 2023 22:50:10 -0700 Subject: treewide: drop CONFIG_EMBEDDED There is only one Kconfig user of CONFIG_EMBEDDED and it can be switched to EXPERT or "if !ARCH_MULTIPLATFORM" (suggested by Arnd). Link: https://lkml.kernel.org/r/20230816055010.31534-1-rdunlap@infradead.org Signed-off-by: Randy Dunlap Acked-by: Geert Uytterhoeven Acked-by: Arnd Bergmann Acked-by: Palmer Dabbelt [RISC-V] Acked-by: Greg Ungerer Acked-by: Jason A. Donenfeld Acked-by: Michael Ellerman [powerpc] Cc: Russell King Cc: Vineet Gupta Cc: Brian Cain Cc: Michal Simek Cc: Thomas Bogendoerfer Cc: Dinh Nguyen Cc: Jonas Bonn Cc: Stefan Kristiansson Cc: Stafford Horne Cc: Nicholas Piggin Cc: Christophe Leroy Cc: Paul Walmsley Cc: Albert Ou Cc: Yoshinori Sato Cc: Rich Felker Cc: John Paul Adrian Glaubitz Cc: Max Filippov Cc: Josh Triplett Cc: Masahiro Yamada Signed-off-by: Andrew Morton --- tools/testing/selftests/wireguard/qemu/kernel.config | 1 - 1 file changed, 1 deletion(-) (limited to 'tools') diff --git a/tools/testing/selftests/wireguard/qemu/kernel.config b/tools/testing/selftests/wireguard/qemu/kernel.config index 6327c9c400e0..507555714b1d 100644 --- a/tools/testing/selftests/wireguard/qemu/kernel.config +++ b/tools/testing/selftests/wireguard/qemu/kernel.config @@ -41,7 +41,6 @@ CONFIG_KALLSYMS=y CONFIG_BUG=y CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y CONFIG_JUMP_LABEL=y -CONFIG_EMBEDDED=n CONFIG_BASE_FULL=y CONFIG_FUTEX=y CONFIG_SHMEM=y -- cgit v1.2.3