Re: [PATCH 2/3] bitmap: Rename module

2024-07-30 Thread John Hubbard
anything about their testing flow. 2. Leave kselftests alone so we don't weaken kernel testing Or augment them as above, so that we don't weaken kernel testing, yes. thanks, -- John Hubbard NVIDIA

Re: [PATCH 2/3] bitmap: Rename module

2024-07-26 Thread John Hubbard
to do this [1], right? So: lib/tests/bitmap_kunit.c [1] https://lore.kernel.org/20240724201354.make.730-k...@kernel.org thanks, -- John Hubbard NVIDIA F:tools/include/linux/bitfield.h F:tools/include/linux/bitmap.h F:tools/include/linux/bits.h diff --git a/lib/Kconfig.debug

Re: [PATCH v2] Documentation: KUnit: Update filename best practices

2024-07-22 Thread John Hubbard
"_kunit" part of the name is especially helpful, because (as I mentioned earlier) these tests really are different enough that it's worth calling out. You can run them simply by loading the kernel module. So if I want to quickly run kunit tests, searching for "*_kunit.c" does help with that. thanks, -- John Hubbard NVIDIA

Re: [PATCH v2] Documentation: KUnit: Update filename best practices

2024-07-20 Thread John Hubbard
Gow Cc: Brendan Higgins Cc: Rae Moar Cc: John Hubbard Cc: Jonathan Corbet Cc: Linus Torvalds Cc: linux-kselftest@vger.kernel.org Cc: kunit-...@googlegroups.com Cc: linux-...@vger.kernel.org Cc: linux-ker...@vger.kernel.org Cc: linux-harden...@vger.kernel.org --- Documentation/dev-tools/kunit

Re: Converting kselftest test modules to kunit

2024-07-17 Thread John Hubbard
example of up-to-date documentation there. And it's very clear. Cheers, -- David thanks, -- John Hubbard NVIDIA

Re: [PATCH] Documentation: KUnit: Update filename best practices

2024-07-17 Thread John Hubbard
, -- John Hubbard NVIDIA

Re: Converting kselftest test modules to kunit

2024-07-17 Thread John Hubbard
On 7/16/24 11:26 AM, Kees Cook wrote: On Tue, Jul 16, 2024 at 11:04:06AM -0700, John Hubbard wrote: This is a classic case of testing a kernel API via ioctl into the kernel, so I think it meets your criteria for moving to KUnit. Having said that, I must now go try out KUnit in a bit more depth

Re: Converting kselftest test modules to kunit

2024-07-16 Thread John Hubbard
ing on them. Also maybe: mm gup_test This is a classic case of testing a kernel API via ioctl into the kernel, so I think it meets your criteria for moving to KUnit. Having said that, I must now go try out KUnit in a bit more depth before I'm sure that this will work out. But it shou

Re: [PATCH v2] selftests/rtc:Fix a resource leak

2024-07-16 Thread John Hubbard
neering at Google (Apr 7, 2020), by Titus Winters thanks, -- John Hubbard NVIDIA

Re: [PATCH] selftests/net: fix gro.c compilation failure due to non-existent opt_ipproto_off

2024-07-12 Thread John Hubbard
On 7/12/24 4:51 PM, John Hubbard wrote: Linux 6.6 does not have an opt_ipproto_off variable in gro.c at all (it was added in later kernel versions), so attempting to initialize one breaks the build. This is the first time I've tried to fix something in linux-stable, and I'm not sure that I've

[PATCH] selftests/net: fix gro.c compilation failure due to non-existent opt_ipproto_off

2024-07-12 Thread John Hubbard
es: https://lore.kernel.org/all/8b1717db-8c4a-47ee-b28c-170b630c4...@cloudflare.com/#t Signed-off-by: John Hubbard --- tools/testing/selftests/net/gro.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/testing/selftests/net/gro.c b/tools/testing/selftests/net/gro.c index b204df4f3332..30024d0ed

Re: [PATCH net-next v16 12/13] selftests: add ncdevmem, netcat for devmem TCP

2024-07-11 Thread John Hubbard
On 7/11/24 8:28 AM, Mina Almasry wrote: On Wed, Jul 10, 2024 at 5:44 PM John Hubbard wrote: On 7/9/24 5:17 PM, Mina Almasry wrote: ... diff --git a/tools/testing/selftests/net/Makefile b/tools/testing/selftests/net/Makefile index bc3925200637c..39420a6e86b7f 100644 --- a/tools/testing

Re: [PATCH net-next v16 12/13] selftests: add ncdevmem, netcat for devmem TCP

2024-07-10 Thread John Hubbard
.sh lib.sh net_helper.sh setup_loopback.sh setup_veth.sh @@ -104,6 +109,10 @@ TEST_INCLUDES := forwarding/lib.sh include ../lib.mk +# YNL build +YNL_GENS := netdev +include ynl.mk This seems to be missing a rule to generate ynl.mk, right? thanks, -- John Hubbard NVIDIA

Re: [PATCH v4 0/7] selftests/x86: fix build errors and warnings found via clang

2024-07-09 Thread John Hubbard
On 7/9/24 1:34 PM, Shuah Khan wrote: On 7/4/24 01:24, John Hubbard wrote: ...>> Muhammad Usama Anjum (1):    selftests: x86: test_FISTTP: use fisttps instead of ambiguous fisttp Usama and John, I am seeing checkpatch warnings in this series. v4-3-7 WARNING: externs should be avoided

[PATCH v5 3/3] selftests/vDSO: remove duplicate compiler invocations from Makefile

2024-07-05 Thread John Hubbard
ource file dependencies, for visual clarity. Signed-off-by: John Hubbard --- tools/testing/selftests/vDSO/Makefile | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/tools/testing/selftests/vDSO/Makefile b/tools/testing/selftests/vDSO/Makefile index 20

[PATCH v5 2/3] selftests/vDSO: remove partially duplicated "all:" target in Makefile

2024-07-05 Thread John Hubbard
of this by including ../lib.mk at the right place, and removing the $(OUTPUT) prefix to the programs to be built, and removing the duplicate "all:" target. Reviewed-by: Muhammad Usama Anjum Signed-off-by: John Hubbard --- tools/testing/selftests/vDSO/Makefile | 15 +++ 1 fi

[PATCH v5 1/3] selftests/vDSO: fix clang build errors and warnings

2024-07-05 Thread John Hubbard
pass tests here, so remove it. Reviewed-by: Carlos Llamas Reviewed-by: Edward Liaw Reviewed-by: Muhammad Usama Anjum Tested-by: Muhammad Usama Anjum Signed-off-by: John Hubbard --- tools/testing/selftests/vDSO/parse_vdso.c | 16 +++- .../selftests/vDSO/vdso_standalone_test

[PATCH v5 0/3] selftests/vDSO: fix clang build errors, and Makefile cleanup

2024-07-05 Thread John Hubbard
kefile. 2. Added Reviewed-by and Tested-by tags for the original patch, which fixes all of the clang errors and warnings for this selftest. 3. Removed an obsolete blurb from the commit description of the original patch, now that Valentin Obst LLVM build fix has been merged. thanks, John Hubbard NV

Re: [PATCH v4 2/3] selftests/mm: remove partially duplicated "all:" target in Makefile

2024-07-05 Thread John Hubbard
On 7/5/24 10:53, Shuah Khan wrote: On 7/3/24 20:33, John Hubbard wrote: There were a couple of errors here: 1. TEST_GEN_PROGS was incorrectly prepending $(OUTPUT) to each program to be built. However, lib.mk already does that because it assumes "bare" program names are passed in, so

[PATCH v4 7/7] selftests/x86: fix printk warnings reported by clang

2024-07-04 Thread John Hubbard
These warnings are all of the form, "the format specified a short (signed or unsigned) int, but the value is a full length int". Acked-by: Muhammad Usama Anjum Signed-off-by: John Hubbard --- tools/testing/selftests/x86/sigreturn.c | 2 +- tools/testing/selftests/x86/test_vsysc

[PATCH v4 6/7] selftests/x86: remove (or use) unused variables and functions

2024-07-04 Thread John Hubbard
d but probably wants to be returned from main(), as a non-zero result. That result is also unused right now, so another option would be to delete it entirely, but this way, main() also gets fixed. It was missing a return value. Acked-by: Muhammad Usama Anjum Signed-off-by: John Hubbard --- tools/testing

[PATCH v4 5/7] selftests/x86: avoid -no-pie warnings from clang during compilation

2024-07-04 Thread John Hubbard
le without (wastefully) restructuring the Makefile. Avoid the warning by simply disabling that warning, for clang builds. Acked-by: Muhammad Usama Anjum Signed-off-by: John Hubbard --- tools/testing/selftests/x86/Makefile | 7 +++ 1 file changed, 7 insertions(+) diff --git a/tools/testing/sel

[PATCH v4 1/7] selftests/x86: fix Makefile dependencies to work with clang

2024-07-04 Thread John Hubbard
and the Makefile dependencies with a single call to the new Makefile function extra-files. That fixes the build failure, while still providing the correct dependencies in all cases. Acked-by: Muhammad Usama Anjum Signed-off-by: John Hubbard --- tools/testing/selftests/x86/Makefile | 21

[PATCH v4 4/7] selftests/x86: build sysret_rip.c with clang

2024-07-04 Thread John Hubbard
with the assembler's full set of features. Acked-by: Muhammad Usama Anjum Signed-off-by: John Hubbard --- tools/testing/selftests/x86/Makefile | 1 + .../testing/selftests/x86/clang_helpers_64.S | 16 +++ tools/testing/selftests/x86/sysret_rip.c | 20

[PATCH v4 3/7] selftests/x86: build fsgsbase_restore.c with clang

2024-07-04 Thread John Hubbard
es. Acked-by: Muhammad Usama Anjum Signed-off-by: John Hubbard --- tools/testing/selftests/x86/Makefile | 2 ++ tools/testing/selftests/x86/clang_helpers_32.S | 11 +++ tools/testing/selftests/x86/clang_helpers_64.S | 12 tools/testing/selftests/x86/fsgsbase_rest

[PATCH v4 2/7] selftests: x86: test_FISTTP: use fisttps instead of ambiguous fisttp

2024-07-04 Thread John Hubbard
f-by: Muhammad Usama Anjum Signed-off-by: John Hubbard --- tools/testing/selftests/x86/test_FISTTP.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/x86/test_FISTTP.c b/tools/testing/selftests/x86/test_FISTTP.c index 09789c0ce3e9..b9ae9d8cebc

[PATCH v4 0/7] selftests/x86: fix build errors and warnings found via clang

2024-07-04 Thread John Hubbard
the first version: 1) Rebased onto Linux 6.10-rc1 Enjoy! [1] https://lore.kernel.org/44428518-4d21-4de7-8587-04eceefb3...@nvidia.com thanks, John Hubbard John Hubbard (6): selftests/x86: fix Makefile dependencies to work with clang selftests/x86: build fsgsbase_restore.c with clang selftests/

Re: [RFC PATCH] selftests: introduce and use SELFTESTS_CC_IS_CLANG instead of LLVM

2024-07-03 Thread John Hubbard
On 7/3/24 8:04 PM, John Hubbard wrote: Current practice in the selftests Makefiles is to use $(LLVM) as a way to decide if clang is being used as the compiler (and/or the linker front end). Unfortunately, this does not cover all of the use cases: 1) CC could have been set within selftests

Re: [PATCH v3 0/7] selftests/x86: fix build errors and warnings found via clang

2024-07-03 Thread John Hubbard
On 7/2/24 3:28 AM, Muhammad Usama Anjum wrote: On 6/29/24 1:06 AM, John Hubbard wrote: On 5/31/24 12:38 PM, John Hubbard wrote: Hi, Dave Hansen, Muhammad Usama Anjum, here is the combined series that we discussed yesterday [1]. Hi Dave, Shuah, Are either of you planning to take this series

[RFC PATCH] selftests: introduce and use SELFTESTS_CC_IS_CLANG instead of LLVM

2024-07-03 Thread John Hubbard
, then SELFTESTS_CC_IS_CLANG will be non-empty. SELFTESTS_CC_IS_CLANG does not specify which linker is being used. However, it can still help with linker options, because $(CC) is often used to do both the compile and link steps (often in the same step). Signed-off-by: John Hubbard --- Hi

[PATCH v3] selftest/timerns: fix clang build failures for abs() calls

2024-07-03 Thread John Hubbard
Reviewed-by: Muhammad Usama Anjum Signed-off-by: John Hubbard --- Hi, Changes since v2: 1) Commit description: removed the reference to Valentin Obst's patch being a prerequisite, now that that has been merged. 2) Rebased on Linux 6.10-rc6+. Changes since the first version: 1) Rebased

[PATCH v3] selftests/timers: remove unused irqcount variable

2024-07-03 Thread John Hubbard
When building with clang, via: make LLVM=1 -C tools/testing/selftest ...clang warns about an unused irqcount variable. clang is correct: the variable is incremented and then ignored. Fix this by deleting the irqcount variable. Signed-off-by: John Hubbard --- Changes since v2: 1) Rebased

[PATCH v4 3/3] selftests/vDSO: remove duplicate compiler invocations from Makefile

2024-07-03 Thread John Hubbard
ource file dependencies, for visual clarity. Signed-off-by: John Hubbard --- tools/testing/selftests/vDSO/Makefile | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/tools/testing/selftests/vDSO/Makefile b/tools/testing/selftests/vDSO/Makefile index 20

[PATCH v4 2/3] selftests/mm: remove partially duplicated "all:" target in Makefile

2024-07-03 Thread John Hubbard
of this by including ../lib.mk at the right place, and removing the $(OUTPUT) prefix to the programs to be built, and removing the duplicate "all:" target. Signed-off-by: John Hubbard --- tools/testing/selftests/vDSO/Makefile | 15 +++ 1 file changed, 7 insertions(+), 8

[PATCH v4 0/3] selftests/vDSO: fix clang build errors, and Makefile cleanup

2024-07-03 Thread John Hubbard
2. Added Reviewed-by and Tested-by tags for the original patch, which fixes all of the clang errors and warnings for this selftest. 3. Removed an obsolete blurb from the commit description of the original patch, now that Valentin Obst LLVM build fix has been merged. John Hubbard (3): selftests

[PATCH v4 1/3] selftests/vDSO: fix clang build errors and warnings

2024-07-03 Thread John Hubbard
pass tests here, so remove it. Reviewed-by: Carlos Llamas Reviewed-by: Edward Liaw Reviewed-by: Muhammad Usama Anjum Tested-by: Muhammad Usama Anjum Signed-off-by: John Hubbard --- tools/testing/selftests/vDSO/parse_vdso.c | 16 +++- .../selftests/vDSO/vdso_standalone_test

Re: [PATCH v3 1/3] selftests/vDSO: fix clang build errors and warnings

2024-07-02 Thread John Hubbard
On 7/2/24 11:49 AM, Edward Liaw wrote: On Tue, Jul 2, 2024 at 11:26 AM John Hubbard wrote: On 7/2/24 11:12 AM, Edward Liaw wrote: On Fri, Jun 14, 2024 at 4:31 PM John Hubbard wrote: ... Hi John, Could you try re-submitting this series with the RESEND prefix? Thanks, Edward Sure

Re: [PATCH v3 1/3] selftests/vDSO: fix clang build errors and warnings

2024-07-02 Thread John Hubbard
On 7/2/24 11:12 AM, Edward Liaw wrote: On Fri, Jun 14, 2024 at 4:31 PM John Hubbard wrote: ... Hi John, Could you try re-submitting this series with the RESEND prefix? Thanks, Edward Sure. Is that the key, for kselftests? Because I've got 5+ small patchsets that are languishing

Re: [PATCH v3 0/7] selftests/x86: fix build errors and warnings found via clang

2024-06-28 Thread John Hubbard
On 5/31/24 12:38 PM, John Hubbard wrote: Hi, Dave Hansen, Muhammad Usama Anjum, here is the combined series that we discussed yesterday [1]. Hi Dave, Shuah, Are either of you planning to take this series? I ask because I have a very slightly overlapping series that enhances the LLVM/clang

Re: [PATCH RFC 0/5] mm/gup: Introduce exclusive GUP pinning

2024-06-18 Thread John Hubbard
parate folio->pincount, I suppose that might take too long? Or not? This feels like force-fitting a very specific feature (KVM/CoCo handling of shmem pages) into a more general mechanism that is running low on bits (gup/pup). Maybe a good topic for LPC! thanks, -- John Hubbard NVIDIA Tree with pa

Re: [PATCH v3 1/6] selftests/mm: mseal, self_elf: fix missing __NR_mseal

2024-06-18 Thread John Hubbard
On 6/18/24 2:53 PM, Andrew Morton wrote: On Tue, 18 Jun 2024 14:29:32 -0700 John Hubbard wrote: OK, I've drafted an updated commit description (below) Awesome! :) thanks, -- John Hubbard NVIDIA

Re: [PATCH v3 1/6] selftests/mm: mseal, self_elf: fix missing __NR_mseal

2024-06-18 Thread John Hubbard
On 6/18/24 1:54 PM, David Hildenbrand wrote: On 18.06.24 22:14, John Hubbard wrote: On 6/17/24 11:56 PM, David Hildenbrand wrote: On 18.06.24 04:24, John Hubbard wrote: ... ... I can update the commit description with some of the above, if it helps. I think it will. The main concern I had

Re: [PATCH v3 2/6] selftests/mm: mseal, self_elf: factor out test macros and other duplicated items

2024-06-18 Thread John Hubbard
On 6/17/24 7:24 PM, John Hubbard wrote: Clean up and move some copy-pasted items into a new mseal_helpers.h. 1. The test macros can be made safer and simpler, by observing that they are invariably called when about to return. This means that the macros do not need an intrusive label to goto

Re: [PATCH v3 1/6] selftests/mm: mseal, self_elf: fix missing __NR_mseal

2024-06-18 Thread John Hubbard
On 6/17/24 11:56 PM, David Hildenbrand wrote: On 18.06.24 04:24, John Hubbard wrote: ... diff --git a/tools/testing/selftests/mm/seal_elf.c b/tools/testing/selftests/mm/seal_elf.c index f2babec79bb6..27bf2f84231d 100644 --- a/tools/testing/selftests/mm/seal_elf.c +++ b/tools/testing/selftests

[PATCH v3 6/6] selftests/mm: remove local __NR_* definitions

2024-06-17 Thread John Hubbard
) Acked-by: David Hildenbrand Cc: Jeff Xu Signed-off-by: John Hubbard --- tools/testing/selftests/mm/hugepage-mremap.c | 2 +- .../testing/selftests/mm/ksm_functional_tests.c | 8 +--- tools/testing/selftests/mm/memfd_secret.c| 14 +- tools/testing/selftests

[PATCH v3 4/6] selftests/mm: fix vm_util.c build failures: add snapshot of fs.h

2024-06-17 Thread John Hubbard
t;) Acked-by: David Hildenbrand Signed-off-by: John Hubbard --- tools/include/uapi/linux/fs.h | 392 ++ 1 file changed, 392 insertions(+) create mode 100644 tools/include/uapi/linux/fs.h diff --git a/tools/include/uapi/linux/fs.h b/tools/include/uapi/linux/fs.h

[PATCH v3 5/6] selftests/mm: kvm, mdwe fixes to avoid requiring "make headers"

2024-06-17 Thread John Hubbard
we settled on in [1]. [1] commit e076eaca5906 ("selftests: break the dependency upon local header files") Cc: David Hildenbrand Signed-off-by: John Hubbard --- tools/include/uapi/linux/prctl.h | 331 +++ 1 file changed, 331 insertions(+) create mode 100644 tool

[PATCH v3 3/6] selftests/mm: mseal, self_elf: rename TEST_END_CHECK to REPORT_TEST_PASS

2024-06-17 Thread John Hubbard
Now that the test macros are factored out into their final location, and simplified, it's time to rename TEST_END_CHECK to something that represents its new functionality: REPORT_TEST_PASS. Acked-by: David Hildenbrand Reviewed-by: Jeff Xu Tested-by: Jeff Xu Signed-off-by: John Hubbard

[PATCH v3 2/6] selftests/mm: mseal, self_elf: factor out test macros and other duplicated items

2024-06-17 Thread John Hubbard
cannot, unfortunately use pkey-helpers.h. The best we can do is to factor out these few items into mseal_helpers.h. 3. These tests still need their own definition of u64, so also move that to the header file. Cc: Jeff Xu Acked-by: David Hildenbrand Signed-off-by: John Hubbard --- tools/testing

[PATCH v3 1/6] selftests/mm: mseal, self_elf: fix missing __NR_mseal

2024-06-17 Thread John Hubbard
ak the dependency upon local header files") Fixes: 4926c7a52de7 ("selftest mm/mseal memory sealing") Cc: Jeff Xu Cc: David Hildenbrand Signed-off-by: John Hubbard --- tools/testing/selftests/mm/mseal_test.c | 2 +- tools/testing/selftests/mm/seal_elf.c | 2 +- 2 files ch

[PATCH v3 0/6] cleanups, fixes, and progress towards avoiding "make headers"

2024-06-17 Thread John Hubbard
m and mdwe tests require. 4. Factor out some common code from mseal_test.c and seal_elf.c, into a new mseal_helpers.h file. 5. Remove local __NR_* definitions and checks. [1] commit e076eaca5906 ("selftests: break the dependency upon local header files") John Hubbard (6): selftests/mm: m

Re: [PATCH v2 1/6] selftests/mm: mseal, self_elf: fix missing __NR_mseal

2024-06-17 Thread John Hubbard
On 6/17/24 11:11 AM, David Hildenbrand wrote: On 14.06.24 20:02, John Hubbard wrote: On 6/14/24 5:41 AM, David Hildenbrand wrote: On 14.06.24 14:28, David Hildenbrand wrote: On 14.06.24 04:30, John Hubbard wrote: ... ... thinking again, are some of these headers arch-specific (IOW

Shuah, Andy L: [PATCH v3 0/3] selftests/vDSO: fix clang build errors, and Makefile cleanup

2024-06-17 Thread John Hubbard
On 6/14/24 4:34 PM, John Hubbard wrote: On 6/14/24 4:31 PM, John Hubbard wrote: Hi, Jason A. Donenfeld, I've added you because I ended up looking through your latest "implement getrandom() in vDSO" series [1], which also touches this Makefile, so just a heads up about upcoming (mi

Re: [PATCH v17 5/5] x86: vdso: Wire up getrandom() vDSO implementation

2024-06-14 Thread John Hubbard
y/vdso/vgetrandom-chacha.S +$(OUTPUT)/vdso_test_chacha: include/asm/rwonce.h +include/asm/rwonce.h: + mkdir -p include/asm + touch $@ thanks, -- John Hubbard NVIDIA

Re: [PATCH v2 5/6] selftests/mm: kvm, mdwe fixes to avoid requiring "make headers"

2024-06-14 Thread John Hubbard
On 6/14/24 5:31 AM, David Hildenbrand wrote: On 14.06.24 04:30, John Hubbard wrote: ... +#ifndef PR_SET_MEMORY_MERGE +#define PR_SET_MEMORY_MERGE    67 +#endif + +#ifndef PR_GET_MEMORY_MERGE +#define PR_GET_MEMORY_MERGE    68 +#endif + +#ifndef PR_SET_MDWE +#define PR_SET_MDWE

Re: [PATCH v3 1/3] selftests/vDSO: fix clang build errors and warnings

2024-06-14 Thread John Hubbard
Also Cc'ing Thomas Gleixner on this one, sorry for the omission. On 6/14/24 4:31 PM, John Hubbard wrote: When building with clang, via: make LLVM=1 -C tools/testing/selftests ...there are several warnings, and an error. This fixes all of those and allows these tests to run and pass. 1

Re: [PATCH v3 0/3] selftests/vDSO: fix clang build errors, and Makefile cleanup

2024-06-14 Thread John Hubbard
On 6/14/24 4:31 PM, John Hubbard wrote: Hi, Jason A. Donenfeld, I've added you because I ended up looking through your latest "implement getrandom() in vDSO" series [1], which also touches this Makefile, so just a heads up about upcoming (minor) merge conflicts. Belatedly adding Car

[PATCH v3 1/3] selftests/vDSO: fix clang build errors and warnings

2024-06-14 Thread John Hubbard
pass tests here, so remove it. Reviewed-by: Carlos Llamas Reviewed-by: Edward Liaw Reviewed-by: Muhammad Usama Anjum Tested-by: Muhammad Usama Anjum Signed-off-by: John Hubbard --- tools/testing/selftests/vDSO/parse_vdso.c | 16 +++- .../selftests/vDSO/vdso_standalone_test

[PATCH v3 0/3] selftests/vDSO: fix clang build errors, and Makefile cleanup

2024-06-14 Thread John Hubbard
patch, now that Valentin Obst LLVM build fix has been merged. [1] https://lore.kernel.org/20240614190646.2081057-1-ja...@zx2c4.com John Hubbard (3): selftests/vDSO: fix clang build errors and warnings selftests/mm: remove partially duplicated "all:" target in Makefile selftests/vD

[PATCH v3 2/3] selftests/mm: remove partially duplicated "all:" target in Makefile

2024-06-14 Thread John Hubbard
of this by including ../lib.mk at the right place, and removing the $(OUTPUT) prefix to the programs to be built, and removing the duplicate "all:" target. Signed-off-by: John Hubbard --- tools/testing/selftests/vDSO/Makefile | 15 +++ 1 file changed, 7 insertions(+), 8

[PATCH v3 3/3] selftests/vDSO: remove duplicate compiler invocations from Makefile

2024-06-14 Thread John Hubbard
ource file dependencies, for visual clarity. Signed-off-by: John Hubbard --- tools/testing/selftests/vDSO/Makefile | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/tools/testing/selftests/vDSO/Makefile b/tools/testing/selftests/vDSO/Makefile index 20

Re: [PATCH v2] selftests/vDSO: fix clang build errors and warnings

2024-06-14 Thread John Hubbard
On 6/14/24 3:51 PM, John Hubbard wrote: On 6/11/24 11:30 AM, Carlos Llamas wrote: On Mon, May 27, 2024 at 02:16:22PM -0700, John Hubbard wrote: ... Reviewed-by: Carlos Llamas Thanks for the review! I have no earthly idea what will happen next. I'd like to hear at least something from

Re: [PATCH v2] selftests/vDSO: fix clang build errors and warnings

2024-06-14 Thread John Hubbard
On 6/11/24 11:30 AM, Carlos Llamas wrote: On Mon, May 27, 2024 at 02:16:22PM -0700, John Hubbard wrote: When building with clang, via: make LLVM=1 -C tools/testing/selftests ...there are several warnings, and an error. This fixes all of those and allows these tests to run and pass

Re: [PATCH v2 1/6] selftests/mm: mseal, self_elf: fix missing __NR_mseal

2024-06-14 Thread John Hubbard
On 6/14/24 5:41 AM, David Hildenbrand wrote: On 14.06.24 14:28, David Hildenbrand wrote: On 14.06.24 04:30, John Hubbard wrote: The selftests/mm build isn't exactly "broken", according to the current documentation, which still claims that one must run "make headers&qu

[PATCH v2 6/6] selftests/mm: remove local __NR_* definitions

2024-06-13 Thread John Hubbard
t;) Cc: David Hildenbrand Cc: Jeff Xu Signed-off-by: John Hubbard --- tools/testing/selftests/mm/hugepage-mremap.c | 2 +- .../testing/selftests/mm/ksm_functional_tests.c | 8 +--- tools/testing/selftests/mm/memfd_secret.c| 14 +- tools/testing/selftests

[PATCH v2 1/6] selftests/mm: mseal, self_elf: fix missing __NR_mseal

2024-06-13 Thread John Hubbard
m the correct location. The way to do so is to include instead of just . [1] commit e076eaca5906 ("selftests: break the dependency upon local header files") Fixes: 4926c7a52de7 ("selftest mm/mseal memory sealing") Cc: Jeff Xu Cc: David Hildenbrand Signed-off-by: John

[PATCH v2 5/6] selftests/mm: kvm, mdwe fixes to avoid requiring "make headers"

2024-06-13 Thread John Hubbard
'PR_SET_MDWE' mdwe_test.c:38:18: error: use of undeclared identifier 'PR_GET_MDWE' Fix these errors by adding the missing items to vm_util.h, and include vm_util.h from mdwe_test.c. Cc: David Hildenbrand Signed-off-by: John Hubbard --- tools/testing/selftests/mm/mdwe_test.c | 1 + tools/testing

[PATCH v2 3/6] selftests/mm: mseal, self_elf: rename TEST_END_CHECK to REPORT_TEST_PASS

2024-06-13 Thread John Hubbard
Now that the test macros are factored out into their final location, and simplified, it's time to rename TEST_END_CHECK to something that represents its new functionality: REPORT_TEST_PASS. Cc: David Hildenbrand Reviewed-by: Jeff Xu Tested-by: Jeff Xu Signed-off-by: John Hubbard --- tools

[PATCH v2 4/6] selftests/mm: fix vm_util.c build failures: add snapshot of fs.h

2024-06-13 Thread John Hubbard
uot;) Cc: David Hildenbrand Signed-off-by: John Hubbard --- tools/include/uapi/linux/fs.h | 392 ++ 1 file changed, 392 insertions(+) create mode 100644 tools/include/uapi/linux/fs.h diff --git a/tools/include/uapi/linux/fs.h b/tools/include/uapi/linux/fs.h

[PATCH v2 2/6] selftests/mm: mseal, self_elf: factor out test macros and other duplicated items

2024-06-13 Thread John Hubbard
cannot, unfortunately use pkey-helpers.h. The best we can do is to factor out these few items into mseal_helpers.h. 3. These tests still need their own definition of u64, so also move that to the header file. Cc: Jeff Xu Cc: David Hildenbrand Signed-off-by: John Hubbard --- tools/testing

[PATCH v2 0/6] cleanups, fixes, and progress towards avoiding "make headers"

2024-06-13 Thread John Hubbard
elftests: break the dependency upon local header files") John Hubbard (6): selftests/mm: mseal, self_elf: fix missing __NR_mseal selftests/mm: mseal, self_elf: factor out test macros and other duplicated items selftests/mm: mseal, self_elf: rename TEST_END_CHECK to REPORT_TEST_PASS

Re: [PATCH 0/5] cleanups, fixes, and progress towards avoiding "make headers"

2024-06-13 Thread John Hubbard
On 6/12/24 7:11 PM, John Hubbard wrote: On 6/12/24 1:24 AM, David Hildenbrand wrote: On 11.06.24 22:54, John Hubbard wrote: On 6/11/24 2:36 AM, David Hildenbrand wrote: On 08.06.24 04:10, John Hubbard wrote: ... You remembered correctly, but the situation is slighly muddier than one would

Re: [PATCH 0/5] cleanups, fixes, and progress towards avoiding "make headers"

2024-06-12 Thread John Hubbard
On 6/12/24 1:24 AM, David Hildenbrand wrote: On 11.06.24 22:54, John Hubbard wrote: On 6/11/24 2:36 AM, David Hildenbrand wrote: On 08.06.24 04:10, John Hubbard wrote: Eventually, once the build succeeds on a sufficiently old distro, the idea is to delete $(KHDR_INCLUDES) from the selftests

Re: [PATCH 0/5] cleanups, fixes, and progress towards avoiding "make headers"

2024-06-11 Thread John Hubbard
On 6/11/24 2:36 AM, David Hildenbrand wrote: On 08.06.24 04:10, John Hubbard wrote: Eventually, once the build succeeds on a sufficiently old distro, the idea is to delete $(KHDR_INCLUDES) from the selftests/mm build, and then after that, from selftests/lib.mk and all of the other selftest

Re: [PATCH 0/5] cleanups, fixes, and progress towards avoiding "make headers"

2024-06-11 Thread John Hubbard
On 6/10/24 9:45 PM, Jeff Xu wrote: On Mon, Jun 10, 2024 at 9:34 PM John Hubbard wrote: On 6/10/24 9:21 PM, Jeff Xu wrote: Hi On Fri, Jun 7, 2024 at 7:10 PM John Hubbard wrote: Eventually, once the build succeeds on a sufficiently old distro, the idea is to delete $(KHDR_INCLUDES) from

Re: [PATCH 5/5] selftests/mm: mseal, self_elf: rename TEST_END_CHECK to REPORT_TEST_PASS

2024-06-10 Thread John Hubbard
On 6/10/24 9:27 PM, Jeff Xu wrote: Hi On Fri, Jun 7, 2024 at 7:10 PM John Hubbard wrote: Now that the test macros are factored out into their final location, and simplified, it's time to rename TEST_END_CHECK to something that represents its new functionality: REPORT_TEST_PASS. Cc: Jeff Xu

Re: [PATCH 0/5] cleanups, fixes, and progress towards avoiding "make headers"

2024-06-10 Thread John Hubbard
On 6/10/24 9:21 PM, Jeff Xu wrote: Hi On Fri, Jun 7, 2024 at 7:10 PM John Hubbard wrote: Eventually, once the build succeeds on a sufficiently old distro, the idea is to delete $(KHDR_INCLUDES) from the selftests/mm build, and then after that, from selftests/lib.mk and all of the other

Re: [PATCH 3/5] mm/selftests: kvm, mdwe fixes to avoid requiring "make headers"

2024-06-07 Thread John Hubbard
On 6/7/24 7:10 PM, John Hubbard wrote: On Ubuntu 23.04, the kvm and mdwe selftests/mm build fails due to missing a few items that are found in prctl.h. Here is an excerpt of the build failures: The subject line is confused: it really should start with "selftests/mm", not &qu

[PATCH 5/5] selftests/mm: mseal, self_elf: rename TEST_END_CHECK to REPORT_TEST_PASS

2024-06-07 Thread John Hubbard
Now that the test macros are factored out into their final location, and simplified, it's time to rename TEST_END_CHECK to something that represents its new functionality: REPORT_TEST_PASS. Cc: Jeff Xu Signed-off-by: John Hubbard --- tools/testing/selftests/mm/mseal_helpers.h | 2 +- tools

[PATCH 4/5] selftests/mm: mseal, self_elf: factor out test macros and other duplicated items

2024-06-07 Thread John Hubbard
, unfortunately use pkey-helpers.h. The best we can do is to factor out these few items into mseal_helpers.h. 3. These tests still need their own definition of u64, so also move that to the header file. Cc: Jeff Xu Signed-off-by: John Hubbard --- tools/testing/selftests/mm/mseal_helpers.h | 40

[PATCH 3/5] mm/selftests: kvm, mdwe fixes to avoid requiring "make headers"

2024-06-07 Thread John Hubbard
'PR_SET_MDWE' mdwe_test.c:38:18: error: use of undeclared identifier 'PR_GET_MDWE' Fix these errors by adding the missing items to vm_util.h, and include vm_util.h from mdwe_test.c. Signed-off-by: John Hubbard --- tools/testing/selftests/mm/mdwe_test.c | 1 + tools/testing/selftests/mm/vm_util.h

[PATCH 1/5] selftests/mm: mseal, self_elf: fix missing __NR_mseal

2024-06-07 Thread John Hubbard
ts: break the dependency upon local header files") Fixes: 4926c7a52de7 ("selftest mm/mseal memory sealing") Cc: Jeff Xu Signed-off-by: John Hubbard --- tools/testing/selftests/mm/mseal_helpers.h | 5 + tools/testing/selftests/mm/mseal_test.c| 1 + tools/testing/self

[PATCH 2/5] selftests/mm: fix vm_util.c build failures: add snapshot of fs.h

2024-06-07 Thread John Hubbard
'struct page_region' ... vm_util.c:105:20: error: use of undeclared identifier 'PAGE_IS_SOFT_DIRTY' To fix this, add fs.h, taken from a snapshot of ./usr/include/linux/fs.h after running "make headers". [1] commit e076eaca5906 ("selftests: break the dependency upon local header f

[PATCH 0/5] cleanups, fixes, and progress towards avoiding "make headers"

2024-06-07 Thread John Hubbard
[1] commit e076eaca5906 ("selftests: break the dependency upon local header files") John Hubbard (5): selftests/mm: mseal, self_elf: fix missing __NR_mseal selftests/mm: fix vm_util.c build failures: add snapshot of fs.h mm/selftests: kvm, mdwe fixes to avoid requiring "make heade

Re: [PATCH v3 5/7] selftests/x86: avoid -no-pie warnings from clang during compilation

2024-06-07 Thread John Hubbard
On 5/31/24 12:38 PM, John Hubbard wrote: ... diff --git a/tools/testing/selftests/x86/Makefile b/tools/testing/selftests/x86/Makefile index d0bb32bd5538..5c8757a25998 100644 --- a/tools/testing/selftests/x86/Makefile +++ b/tools/testing/selftests/x86/Makefile @@ -40,6 +40,13 @@ CFLAGS := -O2 -g

Re: [PATCH 0/8] selftests: x86: build suite with clang

2024-06-07 Thread John Hubbard
On 6/7/24 2:17 PM, Dave Hansen wrote: On 6/7/24 13:50, Shuah Khan wrote: These patches usually go through x86 repo. I need ack from x86 maintainers to take these. I don't see x86 list cc'ed. Please make sure to include everybody on these threads to get quicker response. John Hubbard (cc'd

Re: [PATCH v2 1/2] selftests/lib.mk: handle both LLVM=1 and CC=clang builds

2024-06-07 Thread John Hubbard
On 6/7/24 10:15 AM, Nathan Chancellor wrote: On Fri, Jun 07, 2024 at 12:12:19PM +0100, Ryan Roberts wrote: On 04/06/2024 05:55, John Hubbard wrote: On 6/3/24 3:47 PM, Nathan Chancellor wrote: ... If we are concluding that CC=clang is an invalid way to do this, then I guess we should report

Re: [PATCH v2 1/2] selftests/lib.mk: handle both LLVM=1 and CC=clang builds

2024-06-03 Thread John Hubbard
On 6/3/24 3:47 PM, Nathan Chancellor wrote: On Mon, Jun 03, 2024 at 04:32:30PM +0100, Mark Brown wrote: On Fri, May 31, 2024 at 11:37:50AM -0700, John Hubbard wrote: The kselftests may be built in a couple different ways: make LLVM=1 make CC=clang In order to handle both cases, set

Re: [PATCH v2 2/2] selftests/lib.mk: silence some clang warnings that gcc already ignores

2024-06-03 Thread John Hubbard
On 5/31/24 11:37 AM, John Hubbard wrote: gcc defaults to silence (off) for the following warnings, but clang defaults to the opposite. The warnings are not useful for the kernel itself, which is why they have remained disabled in gcc for the main kernel build. And it is only due to including

Re: [PATCH v2 1/2] selftests/lib.mk: handle both LLVM=1 and CC=clang builds

2024-06-03 Thread John Hubbard
On 6/3/24 10:09 AM, John Hubbard wrote: On 6/3/24 8:32 AM, Mark Brown wrote: On Fri, May 31, 2024 at 11:37:50AM -0700, John Hubbard wrote: The kselftests may be built in a couple different ways: make LLVM=1 make CC=clang In order to handle both cases, set LLVM=1 if CC=clang

Re: [PATCH v2 1/2] selftests/lib.mk: handle both LLVM=1 and CC=clang builds

2024-06-03 Thread John Hubbard
On 6/3/24 8:32 AM, Mark Brown wrote: On Fri, May 31, 2024 at 11:37:50AM -0700, John Hubbard wrote: The kselftests may be built in a couple different ways: make LLVM=1 make CC=clang In order to handle both cases, set LLVM=1 if CC=clang. That way,the rest of lib.mk, and any Makefiles

[PATCH v2 2/2] selftests/fchmodat2: fix clang build failure due to -static-libasan

2024-05-31 Thread John Hubbard
the Address Sanitizer if -fsanitize is specified. Therefore, simply omit -static-libasan for clang builds. And leave behind a comment, because the whole reason for static linking might not be obvious. Cc: Ryan Roberts Signed-off-by: John Hubbard --- tools/testing/selftests/fchmodat2/Makefile | 11

[PATCH v2 1/2] selftests/openat2: fix clang build failures: -static-libasan, LOCAL_HDRS

2024-05-31 Thread John Hubbard
-by: Ryan Roberts Signed-off-by: John Hubbard --- tools/testing/selftests/openat2/Makefile | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/openat2/Makefile b/tools/testing/selftests/openat2/Makefile index 254d676a2689..185dc76ebb5f 100644

[PATCH v2 0/2] selftests/openat2, fchmodat2: fix clang build failures

2024-05-31 Thread John Hubbard
t; to work in addition to "make LLVM=1" [2]. [1] https://lore.kernel.org/518dd1e3-e31a-41c3-b488-9b75a64b6...@arm.com [2] https://lore.kernel.org/20240531183751.100541-2-jhubb...@nvidia.com John Hubbard (2): selftests/openat2: fix clang build failures: -static-libasan, LOCAL_HDRS self

[PATCH v3 3/3] selftests/futex: pass _GNU_SOURCE without a value to the compiler

2024-05-31 Thread John Hubbard
, as if you had passed in: $(CC) -D_GNU_SOURCE=1 That, in turn, leads to warnings under both gcc and clang, like this: futex_requeue_pi.c:20: warning: "_GNU_SOURCE" redefined Fix this by using the "-D_GNU_SOURCE=" form. Reviewed-by: Edward Liaw Reviewed-by: Davidlohr Bueso

[PATCH v3 0/3] selftests/futex: clang-inspired fixes

2024-05-31 Thread John Hubbard
to the commit description. Changes since the first version: 1) Rebased onto Linux 6.10-rc1 2) Added Reviewed-by's. ...and it turns out that all three patches are still required, on -rc1, in order to get a clean clang build. Enjoy! thanks, John Hubbard John Hubbard (3): selftests/futex: don't

[PATCH v3 2/3] selftests/futex: don't pass a const char* to asprintf(3)

2024-05-31 Thread John Hubbard
://lore.kernel.org/all/20240329-selftests-libmk-llvm-rfc-v1-1-2f9ed7d1c...@valentinobst.de/ Fixes: f17d8a87ecb5 ("selftests: fuxex: Report a unique test name per run of futex_requeue_pi") Reviewed-by: Davidlohr Bueso Signed-off-by: John Hubbard --- tools/testing/selftests/futex/

[PATCH v3 1/3] selftests/futex: don't redefine .PHONY targets (all, clean)

2024-05-31 Thread John Hubbard
The .PHONY targets "all" and "clean" are both already defined in the file that is included in the very next line: ../lib.mk. Remove this duplicate code. Reviewed-by: Davidlohr Bueso Signed-off-by: John Hubbard --- tools/testing/selftests/futex/Makefile | 2 -

[PATCH v3 6/7] selftests/x86: remove (or use) unused variables and functions

2024-05-31 Thread John Hubbard
d but probably wants to be returned from main(), as a non-zero result. That result is also unused right now, so another option would be to delete it entirely, but this way, main() also gets fixed. It was missing a return value. Signed-off-by: John Hubbard --- tools/testing/selftests/x86/amx.

[PATCH v3 5/7] selftests/x86: avoid -no-pie warnings from clang during compilation

2024-05-31 Thread John Hubbard
le without (wastefully) restructuring the Makefile. Avoid the warning by simply disabling that warning, for clang builds. Signed-off-by: John Hubbard --- tools/testing/selftests/x86/Makefile | 7 +++ 1 file changed, 7 insertions(+) diff --git a/tools/testing/selftests/x86/Makefile b/too

  1   2   3   >