[PATCH v2] selftests/move_mount_set_group:Make tests build with old libc

2024-01-09 Thread Hu Yadi
From: "Hu.Yadi" Replace SYS_ with __NR_. Using the __NR_ notation, provided by UAPI, is useful to build tests on systems without the SYS_ definitions. Replace SYS_move_mount with __NR_move_mount Signed-off-by: Hu.Yadi Suggested-by:Jiao Reviewed-by:Berlin --- Changes v1 -> v2: - Fix mail

[PATCH] selftests/landlock:Fix two build issues

2024-01-09 Thread Hu Yadi
From: "Hu.Yadi" Two issues comes up while building selftest/landlock: the first one is as to gettid net_test.c: In function ‘set_service’: net_test.c:91:45: warning: implicit declaration of function ‘gettid’; did you mean ‘getgid’? [-Wimplicit-function-declaration]

RE: [PATCH V12 1/7] x86: Drop CPU_SUP_INTEL from SCHED_MC_PRIO for the expansion.

2024-01-09 Thread Meng, Li (Jassmine)
[AMD Official Use Only - General] Hi Petkov: > -Original Message- > From: Borislav Petkov > Sent: Tuesday, January 9, 2024 6:45 PM > To: Meng, Li (Jassmine) > Cc: Rafael J . Wysocki ; Huang, Ray > ; linux...@vger.kernel.org; linux- > ker...@vger.kernel.org; x...@kernel.org;

[PATCH] selftests/move_mount_set_group:Make tests build with old libc

2024-01-09 Thread Hu Yadi
From: "Hu.Yadi" Replace SYS_ with __NR_. Using the __NR_ notation, provided by UAPI, is useful to build tests on systems without the SYS_ definitions. Replace SYS_move_mount with __NR_move_mount Signed-off-by: Hu.Yadi Suggested-by:jiaox...@h3c.com Reviewed-by:ber...@h3c.com ---

Re: [RFC PATCH v2 2/3] KVM: selftests: add selftest driver for KVM to test memory slots for MMIO BARs

2024-01-09 Thread Yuan Yao
On Fri, Jan 05, 2024 at 05:46:07PM +0800, Yan Zhao wrote: > On Thu, Jan 04, 2024 at 04:16:04PM +0800, Yuan Yao wrote: > > On Wed, Jan 03, 2024 at 04:44:57PM +0800, Yan Zhao wrote: > > > This driver is for testing KVM memory slots for device MMIO BARs that are > > > mapped to pages serving as

Re: [PATCH 1/1] selftests/mm: new test that steals pages

2024-01-09 Thread Andrew Morton
On Fri, 5 Jan 2024 07:54:19 -0800 Breno Leitao wrote: > This test stresses the race between of madvise(DONTNEED), a page fault > and a parallel huge page mmap, which should fail due to lack of > available page available for mapping. > > This test case must run on a system with one and only one

Re: [RFC PATCH v5 1/4] mseal: Wire up mseal syscall

2024-01-09 Thread Jeff Xu
On Tue, Jan 9, 2024 at 10:32 AM Geert Uytterhoeven wrote: > > Hi Jeff, > > On Tue, Jan 9, 2024 at 4:46 PM wrote: > > From: Jeff Xu > > > > Wire up mseal syscall for all architectures. > > > > Signed-off-by: Jeff Xu > > Thanks for the update! > > > --- a/arch/m68k/kernel/syscalls/syscall.tbl >

Re: [RFC PATCH v5 0/4] Introduce mseal()

2024-01-09 Thread Jeff Xu
On Tue, Jan 9, 2024 at 11:47 AM Kees Cook wrote: > > On Tue, Jan 09, 2024 at 03:45:38PM +, jef...@chromium.org wrote: > > This patchset proposes a new mseal() syscall for the Linux kernel. > > Thanks for continuing to work on this! Given Linus's general approval > on the v4, I think this

Re: [GIT PULL] Kselftest next update for Linux 6.8-rc1

2024-01-09 Thread pr-tracker-bot
The pull request you sent on Tue, 9 Jan 2024 12:21:35 -0700: > git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest > tags/linux_kselftest-next-6.8-rc1 has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/ab27740f76654ed58dd32ac0ba0031c18a6dea3b Thank you!

Re: [GIT PULL] nolibc changes for Linux 6.8-rc1

2024-01-09 Thread pr-tracker-bot
The pull request you sent on Mon, 8 Jan 2024 17:41:31 -0700: > git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest > tags/linux_kselftest-nolibc-6.8-rc1 has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/5d09f61e505a614250df24a0f7e646802e40fc87 Thank

Re: [GIT PULL] KUnit next update for Linux 6.8-rc1

2024-01-09 Thread pr-tracker-bot
The pull request you sent on Tue, 9 Jan 2024 11:37:35 -0700: > git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest > tags/linux_kselftest-kunit-6.8-rc1 has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/41daf06ea14fdccb34224fbcc5c4f2a6d17814e2 Thank you!

Re: [PATCH bpf-next v2 15/15] selftests/bpf: states pruning checks for scalar vs STACK_{MISC,ZERO}

2024-01-09 Thread Andrii Nakryiko
On Mon, Jan 8, 2024 at 12:53 PM Maxim Mikityanskiy wrote: > > From: Eduard Zingerman > > Check that stacksafe() considers the following old vs cur stack spill > state combinations equivalent: > - spill of unbound scalar vs combination of STACK_{MISC,ZERO,INVALID} > - STACK_MISC vs spill of

Re: [PATCH RESEND v4 1/3] kselftests: lib.mk: Add TEST_GEN_MODS_DIR variable

2024-01-09 Thread Marcos Paulo de Souza
On Tue, 2024-01-09 at 12:31 -0700, Shuah Khan wrote: > On 1/8/24 10:13, Marcos Paulo de Souza wrote: > > On Wed, 2024-01-03 at 15:09 -0700, Shuah Khan wrote: > > > > > > > Copying source files and object files doesn't sound right. This > > > isn't > > > how the ksleftest installs work. Let's fix

[PATCH v5 3/3] selftests: livepatch: Test livepatching a heavily called syscall

2024-01-09 Thread Marcos Paulo de Souza
The test proves that a syscall can be livepatched. It is interesting because syscalls are called a tricky way. Also the process gets livepatched either when sleeping in the userspace or when entering or leaving the kernel space. The livepatch is a bit tricky: 1. The syscall function name is

[PATCH v5 2/3] livepatch: Move tests from lib/livepatch to selftests/livepatch

2024-01-09 Thread Marcos Paulo de Souza
The modules are being moved from lib/livepatch to tools/testing/selftests/livepatch/test_modules. This code moving will allow writing more complex tests, like for example an userspace C code that will call a livepatched kernel function. The modules are now built as out-of-tree modules, but being

[PATCH v5 1/3] kselftests: lib.mk: Add TEST_GEN_MODS_DIR variable

2024-01-09 Thread Marcos Paulo de Souza
Add TEST_GEN_MODS_DIR variable for kselftests. It can point to a directory containing kernel modules that will be used by selftest scripts. The modules are built as external modules for the running kernel. As a result they are always binary compatible and the same tests can be used for older or

[PATCH v5 0/3] livepatch: Move modules to selftests and add a new test

2024-01-09 Thread Marcos Paulo de Souza
Changes in v5: * Fixed an issue found by Joe that copied Kbuild files along with the test modules to the installation directory. * Added Joe Lawrense review tags. Changes in v4: * Documented how to compile the livepatch selftests without running the tests (Joe) * Removed the mention to

Re: [PATCH bpf-next v2 14/15] bpf: Optimize state pruning for spilled scalars

2024-01-09 Thread Andrii Nakryiko
On Mon, Jan 8, 2024 at 12:53 PM Maxim Mikityanskiy wrote: > > From: Eduard Zingerman > > Changes for scalar ID tracking of spilled unbound scalars lead to > certain verification performance regression. This commit mitigates the > regression by exploiting the following properties maintained by >

Re: [PATCH bpf-next v2 13/15] selftests/bpf: Add test cases for narrowing fill

2024-01-09 Thread Andrii Nakryiko
On Mon, Jan 8, 2024 at 12:53 PM Maxim Mikityanskiy wrote: > > From: Maxim Mikityanskiy > > The previous commit allowed to preserve boundaries and track IDs of > scalars on narrowing fills. Add test cases for that pattern. > > Signed-off-by: Maxim Mikityanskiy > Acked-by: Eduard Zingerman > ---

Re: [PATCH bpf-next v2 12/15] bpf: Preserve boundaries and track scalars on narrowing fill

2024-01-09 Thread Andrii Nakryiko
On Mon, Jan 8, 2024 at 12:53 PM Maxim Mikityanskiy wrote: > > From: Maxim Mikityanskiy > > When the width of a fill is smaller than the width of the preceding > spill, the information about scalar boundaries can still be preserved, > as long as it's coerced to the right width (done by

Re: [PATCH bpf-next v2 09/15] selftests/bpf: Test assigning ID to scalars on spill

2024-01-09 Thread Andrii Nakryiko
On Mon, Jan 8, 2024 at 12:53 PM Maxim Mikityanskiy wrote: > > From: Maxim Mikityanskiy > > The previous commit implemented assigning IDs to registers holding > scalars before spill. Add the test cases to check the new functionality. > > Signed-off-by: Maxim Mikityanskiy > Acked-by: Eduard

[PATCH 3/3] treewide: Update LLVM Bugzilla links

2024-01-09 Thread Nathan Chancellor
LLVM moved their issue tracker from their own Bugzilla instance to GitHub issues. While all of the links are still valid, they may not necessarily show the most up to date information around the issues, as all updates will occur on GitHub, not Bugzilla. Another complication is that the Bugzilla

[PATCH 2/3] arch and include: Update LLVM Phabricator links

2024-01-09 Thread Nathan Chancellor
reviews.llvm.org was LLVM's Phabricator instances for code review. It has been abandoned in favor of GitHub pull requests. While the majority of links in the kernel sources still work because of the work Fangrui has done turning the dynamic Phabricator instance into a static archive, there are

[PATCH 1/3] selftests/bpf: Update LLVM Phabricator links

2024-01-09 Thread Nathan Chancellor
reviews.llvm.org was LLVM's Phabricator instances for code review. It has been abandoned in favor of GitHub pull requests. While the majority of links in the kernel sources still work because of the work Fangrui has done turning the dynamic Phabricator instance into a static archive, there are

[PATCH 0/3] Update LLVM Phabricator and Bugzilla links

2024-01-09 Thread Nathan Chancellor
/bpf/prog_tests/xdpwall.c | 2 +- .../selftests/bpf/progs/test_core_reloc_type_id.c | 2 +- 23 files changed, 40 insertions(+), 40 deletions(-) --- base-commit: 0dd3ee31125508cd67f7e7172247f05b7fd1753a change-id: 20240109-update-llvm-links-d03f9d649e1e Best regards, -- Nathan Chancellor

[PATCH v1 2/2] selftest: breakpoints: clear the format string warning and secure the output

2024-01-09 Thread Mirsad Todorovac
GCC 13.2.0 compiler reported the following warning: breakpoint_test.c: In function ‘check_success’: breakpoint_test.c:287:17: warning: format not a string literal and no format arguments [-Wformat-security] 287 | ksft_test_result_pass(msg); |

[PATCH v1 1/2] selftest: breakpoints: fix a minor typo in the format string

2024-01-09 Thread Mirsad Todorovac
GCC 13.2.0 reported a format string warning: step_after_suspend_test.c: In function ‘run_test’: step_after_suspend_test.c:92:32: warning: too many arguments for format [-Wformat-extra-args] 92 | ksft_print_msg("waitpid() failed: $s\n", strerror(errno)); |

[PATCH v1 0/2] selftest: breakpoints: minor format string fixes

2024-01-09 Thread Mirsad Todorovac
Minor consistency fixes. They clear a couple of compiler format string warnings. [1/2] is the fix of an obvious typo in the format specifier [2/2] is securing the print function against spurious format specifiers in passed paramater string Mirsad Todorovac (2): selftest: breakpoints:

Re: [RFC PATCH v5 2/4] mseal: add mseal syscall

2024-01-09 Thread Matthew Wilcox
On Tue, Jan 09, 2024 at 03:45:40PM +, jef...@chromium.org wrote: > +extern bool can_modify_mm(struct mm_struct *mm, unsigned long start, > + unsigned long end); > +extern bool can_modify_mm_madv(struct mm_struct *mm, unsigned long start, > + unsigned long end, int

Re: [RFC PATCH v5 0/4] Introduce mseal()

2024-01-09 Thread Kees Cook
On Tue, Jan 09, 2024 at 03:45:38PM +, jef...@chromium.org wrote: > This patchset proposes a new mseal() syscall for the Linux kernel. Thanks for continuing to work on this! Given Linus's general approval on the v4, I think this series can also drop the "RFC" part -- this code is looking to

Re: [PATCH RESEND v4 1/3] kselftests: lib.mk: Add TEST_GEN_MODS_DIR variable

2024-01-09 Thread Shuah Khan
On 1/8/24 10:13, Marcos Paulo de Souza wrote: On Wed, 2024-01-03 at 15:09 -0700, Shuah Khan wrote: Copying source files and object files doesn't sound right. This isn't how the ksleftest installs work. Let's fix this. Hi Shuah, what do you think about the proposed solution? Could you

Re: [PATCH v2 0/4] kselftest: alsa: Fix a couple of format specifiers and function parameters

2024-01-09 Thread Mirsad Goran Todorovac
On 1/9/2024 3:16 PM, Takashi Iwai wrote: On Sun, 07 Jan 2024 18:37:00 +0100, Mirsad Todorovac wrote: Minor fixes of compiler warnings and one bug in the number of parameters which would not crash the test but it is better fixed for correctness sake. As the general climate in the Linux kernel

[GIT PULL] Kselftest next update for Linux 6.8-rc1

2024-01-09 Thread Shuah Khan
Hi Linus, Please pull the following Kselftest update for Linux 6.8-rc1. This kselftest update for Linux 6.8-rc1 consists of enhancements to reporting test results, fixes to root and user run behavior and fixing ksft_print_msg() calls. diff is attached. thanks, -- Shuah

[GIT PULL] KUnit next update for Linux 6.8-rc1

2024-01-09 Thread Shuah Khan
Hi Linus, Please pull the following KUnit next update for Linux 6.8-rc1. This KUnit update for Linux 6.8-rc1 consists of: - a new feature that adds APIs for managing devices introducing a set of helper functions which allow devices (internally a struct kunit_device) to be created and

Re: [RFC PATCH v5 1/4] mseal: Wire up mseal syscall

2024-01-09 Thread Geert Uytterhoeven
Hi Jeff, On Tue, Jan 9, 2024 at 4:46 PM wrote: > From: Jeff Xu > > Wire up mseal syscall for all architectures. > > Signed-off-by: Jeff Xu Thanks for the update! > --- a/arch/m68k/kernel/syscalls/syscall.tbl > +++ b/arch/m68k/kernel/syscalls/syscall.tbl > @@ -456,3 +456,4 @@ > 454common

Re: [RFC PATCH] find_vma BPF test: increase length CPU computation

2024-01-09 Thread Song Liu
On Tue, Jan 9, 2024 at 1:57 AM Alessandro Carminati (Red Hat) wrote: > > Some aarch64 systems running a PREEMPT_RT patched kernel, needs > more time to complete the test. > This change mirrors: > commit ba83af059153 ("Improve stability of find_vma BPF test") > addressing similar requirements and

Re: [PATCH v2 4/4] selftests/resctrl: Add non-contiguous CBMs CAT test

2024-01-09 Thread Reinette Chatre
Hi Ilpo, On 1/9/2024 1:13 AM, Ilpo Järvinen wrote: > On Mon, 8 Jan 2024, Reinette Chatre wrote: > >> Hi Maciej, >> >> On 12/12/2023 6:52 AM, Maciej Wieczor-Retman wrote: >>> Add tests for both L2 and L3 CAT to verify the return values >>> generated by writing non-contiguous CBMs don't contradict

Re: [PATCH v2] Documentation: KUnit: Update the instructions on how to test static functions

2024-01-09 Thread Arthur Grillo
On 09/01/24 02:44, David Gow wrote: > On Tue, 9 Jan 2024 at 04:24, Arthur Grillo wrote: >> >> Now that we have the VISIBLE_IF_KUNIT and EXPORT_SYMBOL_IF_KUNIT macros, >> update the instructions to stop recommending including .c files. >> >> Signed-off-by: Arthur Grillo >> --- >> Changes in

[RFC PATCH v5 4/4] mseal:add documentation

2024-01-09 Thread jeffxu
From: Jeff Xu Add documentation for mseal(). Signed-off-by: Jeff Xu --- Documentation/userspace-api/mseal.rst | 181 ++ 1 file changed, 181 insertions(+) create mode 100644 Documentation/userspace-api/mseal.rst diff --git a/Documentation/userspace-api/mseal.rst

[RFC PATCH v5 3/4] selftest mm/mseal memory sealing

2024-01-09 Thread jeffxu
From: Jeff Xu selftest for memory sealing change in mmap() and mseal(). Signed-off-by: Jeff Xu --- tools/testing/selftests/mm/.gitignore |1 + tools/testing/selftests/mm/Makefile |1 + tools/testing/selftests/mm/mseal_test.c | 1989 +++ 3 files changed, 1991

[RFC PATCH v5 2/4] mseal: add mseal syscall

2024-01-09 Thread jeffxu
From: Jeff Xu The new mseal() is an syscall on 64 bit CPU, and with following signature: int mseal(void addr, size_t len, unsigned long flags) addr/len: memory range. flags: reserved. mseal() blocks following operations for the given memory range. 1> Unmapping, moving to another location, and

[RFC PATCH v5 0/4] Introduce mseal()

2024-01-09 Thread jeffxu
From: Jeff Xu This patchset proposes a new mseal() syscall for the Linux kernel. In a nutshell, mseal() protects the VMAs of a given virtual memory range against modifications, such as changes to their permission bits. Modern CPUs support memory permissions, such as the read/write (RW) and

[RFC PATCH v5 1/4] mseal: Wire up mseal syscall

2024-01-09 Thread jeffxu
From: Jeff Xu Wire up mseal syscall for all architectures. Signed-off-by: Jeff Xu --- arch/alpha/kernel/syscalls/syscall.tbl | 1 + arch/arm/tools/syscall.tbl | 1 + arch/arm64/include/asm/unistd.h | 2 +- arch/arm64/include/asm/unistd32.h | 2 ++

Re: [PATCH v3] kunit: run test suites only after module initialization completes

2024-01-09 Thread Marco Pagani
On 2024-01-08 08:27, David Gow wrote: > On Wed, 6 Dec 2023 at 23:07, Marco Pagani wrote: >> >> Commit 2810c1e99867 ("kunit: Fix wild-memory-access bug in >> kunit_free_suite_set()") fixed a wild-memory-access bug that could have >> happened during the loading phase of test suites built and

Re: [PATCH v2 0/4] kselftest: alsa: Fix a couple of format specifiers and function parameters

2024-01-09 Thread Takashi Iwai
On Sun, 07 Jan 2024 18:37:00 +0100, Mirsad Todorovac wrote: > > Minor fixes of compiler warnings and one bug in the number of parameters which > would not crash the test but it is better fixed for correctness sake. > > As the general climate in the Linux kernel community is to fix all compiler >

Re: [PATCH V12 1/7] x86: Drop CPU_SUP_INTEL from SCHED_MC_PRIO for the expansion.

2024-01-09 Thread Borislav Petkov
On Tue, Dec 05, 2023 at 02:35:31PM +0800, Meng Li wrote: > amd-pstate driver also uses SCHED_MC_PRIO, so decouple the requirement > of CPU_SUP_INTEL from the dependencies to allow compilation in kernels > without Intel CPU support. > > Tested-by: Oleksandr Natalenko > Reviewed-by: Mario

[RFC PATCH] find_vma BPF test: increase length CPU computation

2024-01-09 Thread Alessandro Carminati (Red Hat)
Some aarch64 systems running a PREEMPT_RT patched kernel, needs more time to complete the test. This change mirrors: commit ba83af059153 ("Improve stability of find_vma BPF test") addressing similar requirements and allowing the QTI SA8775P based systems, and others, to complete the test when

Re: [PATCH v2 4/4] selftests/resctrl: Add non-contiguous CBMs CAT test

2024-01-09 Thread Ilpo Järvinen
On Mon, 8 Jan 2024, Reinette Chatre wrote: > Hi Maciej, > > On 12/12/2023 6:52 AM, Maciej Wieczor-Retman wrote: > > Add tests for both L2 and L3 CAT to verify the return values > > generated by writing non-contiguous CBMs don't contradict the > > reported non-contiguous support information. > >