Re: [PATCH v4 00/14] security: digest_cache LSM

2024-04-15 Thread Bagas Sanjaya
On Mon, Apr 15, 2024 at 04:24:22PM +0200, Roberto Sassu wrote: > From: Roberto Sassu > > Integrity detection and protection has long been a desirable feature, to > reach a large user base and mitigate the risk of flaws in the software > and attacks. > > However, while solutions exist, they

[PATCH v2 17/17] selftests: riscv: Support xtheadvector in vector tests

2024-04-15 Thread Charlie Jenkins
Extend existing vector tests to be compatible with the xtheadvector instruction set. Signed-off-by: Charlie Jenkins --- .../selftests/riscv/vector/v_exec_initval_nolibc.c | 23 -- tools/testing/selftests/riscv/vector/v_helpers.c | 24 +-

[PATCH v2 16/17] selftests: riscv: Fix vector tests

2024-04-15 Thread Charlie Jenkins
Overhaul the riscv vector tests to use kselftest_harness to help the test cases correctly report the results and decouple the individual test cases from each other. With this refactoring, only run the test cases is vector is reported and properly report the test case as skipped otherwise. The

[PATCH v2 15/17] riscv: hwprobe: Document vendor extensions and xtheadvector extension

2024-04-15 Thread Charlie Jenkins
Document support for vendor extensions using the key RISCV_HWPROBE_KEY_VENDOR_EXT_0 and xtheadvector extension using the key RISCV_ISA_VENDOR_EXT_XTHEADVECTOR. Signed-off-by: Charlie Jenkins --- Documentation/arch/riscv/hwprobe.rst | 12 1 file changed, 12 insertions(+) diff --git

[PATCH v2 14/17] riscv: hwprobe: Add vendor extension probing

2024-04-15 Thread Charlie Jenkins
Add a new hwprobe key "RISCV_HWPROBE_KEY_VENDOR_EXT_0" which allows userspace to probe for the new RISCV_ISA_VENDOR_EXT_XTHEADVECTOR vendor extension. This new key will allow userspace code to probe for which vendor extensions are supported. This API is modeled to be consistent with

[PATCH v2 13/17] riscv: vector: Support xtheadvector save/restore

2024-04-15 Thread Charlie Jenkins
Use alternatives to add support for xtheadvector vector save/restore routines. Signed-off-by: Charlie Jenkins --- arch/riscv/Kconfig | 2 + arch/riscv/Kconfig.vendor | 11 ++ arch/riscv/include/asm/csr.h | 6 + arch/riscv/include/asm/switch_to.h

[PATCH v2 11/17] riscv: csr: Add CSR encodings for VCSR_VXRM/VCSR_VXSAT

2024-04-15 Thread Charlie Jenkins
The VXRM vector csr for xtheadvector has an encoding of 0xa and VXSAT has an encoding of 0x9. Co-developed-by: Heiko Stuebner Signed-off-by: Charlie Jenkins --- arch/riscv/include/asm/csr.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/riscv/include/asm/csr.h

[PATCH v2 10/17] RISC-V: define the elements of the VCSR vector CSR

2024-04-15 Thread Charlie Jenkins
From: Heiko Stuebner The VCSR CSR contains two elements VXRM[2:1] and VXSAT[0]. Define constants for those to access the elements in a readable way. Acked-by: Guo Ren Reviewed-by: Conor Dooley Signed-off-by: Heiko Stuebner Signed-off-by: Charlie Jenkins --- arch/riscv/include/asm/csr.h |

[PATCH v2 09/17] riscv: uaccess: Add alternative for xtheadvector uaccess

2024-04-15 Thread Charlie Jenkins
At this time, use the fallback uaccess routines rather than customizing the vectorized uaccess routines to be compatible with xtheadvector. Signed-off-by: Charlie Jenkins --- arch/riscv/lib/uaccess.S | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/riscv/lib/uaccess.S

[PATCH v2 08/17] riscv: drivers: Convert xandespmu to use the vendor extension framework

2024-04-15 Thread Charlie Jenkins
Migrate xandespmu out of riscv_isa_ext and into a new Andes-specific vendor namespace. Signed-off-by: Charlie Jenkins --- arch/riscv/include/asm/hwcap.h | 4 +++- arch/riscv/include/asm/vendor_extensions.h | 3 +++ arch/riscv/kernel/cpufeature.c

[PATCH v2 07/17] riscv: Introduce vendor variants of extension helpers

2024-04-15 Thread Charlie Jenkins
Vendor extensions are maintained in riscv_isa_vendor (separate from standard extensions which live in riscv_isa). Create vendor variants for the existing extension helpers to interface with the riscv_isa_vendor bitmap. There is a good amount of overlap between these functions, so the alternative

[PATCH v2 06/17] riscv: Extend cpufeature.c to detect vendor extensions

2024-04-15 Thread Charlie Jenkins
Create a private namespace for each vendor above 0x8000. During the probing of hardware capabilities, the vendorid of each hart is used to resolve the vendor extension compatibility. Signed-off-by: Charlie Jenkins --- arch/riscv/include/asm/cpufeature.h| 28 +

[PATCH v2 05/17] riscv: Fix extension subset checking

2024-04-15 Thread Charlie Jenkins
This loop is supposed to check if ext->subset_ext_ids[j] is valid, rather than if ext->subset_ext_ids[i] is valid, before setting the extension id ext->subset_ext_ids[j] in isainfo->isa. Signed-off-by: Charlie Jenkins Reviewed-by: Conor Dooley Fixes: 0d8295ed975b ("riscv: add ISA extension

[PATCH v2 04/17] riscv: dts: allwinner: Add xtheadvector to the D1/D1s devicetree

2024-04-15 Thread Charlie Jenkins
The D1/D1s SoCs support xtheadvector which should be included in the devicetree. Also include vendorid for the cpu. Signed-off-by: Charlie Jenkins --- arch/riscv/boot/dts/allwinner/sun20i-d1s.dtsi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[PATCH v2 03/17] dt-bindings: riscv: Add vendorid

2024-04-15 Thread Charlie Jenkins
vendorid are required during DT parsing to determine known hardware capabilities. This parsing happens before the whole system has booted, so only the boot hart is online and able to report the value of its vendorid. Signed-off-by: Charlie Jenkins ---

[PATCH v2 02/17] dt-bindings: riscv: Add xtheadvector ISA extension description

2024-04-15 Thread Charlie Jenkins
The xtheadvector ISA extension is described on the T-Head extension spec Github page [1] at commit 95358cb2cca9. Link: https://github.com/T-head-Semi/thead-extension-spec/blob/95358cb2cca9489361c61d3 35e03d3134b14133f/xtheadvector.adoc [1] Signed-off-by: Charlie Jenkins ---

[PATCH v2 01/17] riscv: cpufeature: Fix thead vector hwcap removal

2024-04-15 Thread Charlie Jenkins
The riscv_cpuinfo struct that contains mvendorid and marchid is not populated until all harts are booted which happens after the DT parsing. Use the vendorid/archid values from the DT if available or assume all harts have the same values as the boot hart as a fallback. Fixes: d82f32202e0d

[PATCH v2 00/17] riscv: Support vendor extensions and xtheadvector

2024-04-15 Thread Charlie Jenkins
This patch series ended up much larger than expected, please bear with me! The goal here is to support vendor extensions, starting at probing the device tree and ending with reporting to userspace. The main design objective was to allow vendors to operate independently of each other. This has

Re: [PATCH 02/19] riscv: cpufeature: Fix thead vector hwcap removal

2024-04-15 Thread Charlie Jenkins
On Sat, Apr 13, 2024 at 12:40:26AM +0100, Conor Dooley wrote: > On Fri, Apr 12, 2024 at 02:31:42PM -0700, Charlie Jenkins wrote: > > On Fri, Apr 12, 2024 at 10:27:47PM +0100, Conor Dooley wrote: > > > On Fri, Apr 12, 2024 at 01:48:46PM -0700, Charlie Jenkins wrote: > > > > On Fri, Apr 12, 2024 at

Re: [PATCH v4 27/27] docs: ntsync: Add documentation for the ntsync uAPI.

2024-04-15 Thread Randy Dunlap
On 4/15/24 6:08 PM, Elizabeth Figura wrote: > Add an overall explanation of the driver architecture, and complete and > precise > specification for its intended behaviour. > > Reviewed-by: Bagas Sanjaya > Signed-off-by: Elizabeth Figura Tested-by: Randy Dunlap Thanks. > --- >

[PATCH v4 27/27] docs: ntsync: Add documentation for the ntsync uAPI.

2024-04-15 Thread Elizabeth Figura
Add an overall explanation of the driver architecture, and complete and precise specification for its intended behaviour. Reviewed-by: Bagas Sanjaya Signed-off-by: Elizabeth Figura --- Documentation/userspace-api/index.rst | 1 + Documentation/userspace-api/ntsync.rst | 399

[PATCH v4 20/27] selftests: ntsync: Add some tests for manual-reset event state.

2024-04-15 Thread Elizabeth Figura
Test event-specific ioctls NTSYNC_IOC_EVENT_SET, NTSYNC_IOC_EVENT_RESET, NTSYNC_IOC_EVENT_PULSE, NTSYNC_IOC_EVENT_READ for manual-reset events, and waiting on manual-reset events. Signed-off-by: Elizabeth Figura --- .../testing/selftests/drivers/ntsync/ntsync.c | 89 +++ 1 file

[PATCH v4 26/27] maintainers: Add an entry for ntsync.

2024-04-15 Thread Elizabeth Figura
Add myself as maintainer, supported by CodeWeavers. Signed-off-by: Elizabeth Figura --- MAINTAINERS | 9 + 1 file changed, 9 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 41a013dfebbc..09ae011a8d91 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -15728,6 +15728,15 @@ T:

[PATCH v4 23/27] selftests: ntsync: Add tests for alertable waits.

2024-04-15 Thread Elizabeth Figura
Test the "alert" functionality of NTSYNC_IOC_WAIT_ALL and NTSYNC_IOC_WAIT_ANY, when a wait is woken with an alert and when it is woken by an object. Signed-off-by: Elizabeth Figura --- .../testing/selftests/drivers/ntsync/ntsync.c | 179 +- 1 file changed, 176 insertions(+), 3

[PATCH v4 00/30] NT synchronization primitive driver

2024-04-15 Thread Elizabeth Figura
This patch series implements a new char misc driver, /dev/ntsync, which is used to implement Windows NT synchronization primitives. NT synchronization primitives are unique in that the wait functions both are vectored, operate on multiple types of object with different behaviour (mutex,

[PATCH v4 24/27] selftests: ntsync: Add some tests for wakeup signaling via alerts.

2024-04-15 Thread Elizabeth Figura
Expand the alert tests to cover alerting a thread mid-wait, to test that the relevant scheduling logic works correctly. Signed-off-by: Elizabeth Figura --- .../testing/selftests/drivers/ntsync/ntsync.c | 62 +++ 1 file changed, 62 insertions(+) diff --git

[PATCH v4 09/27] ntsync: Introduce NTSYNC_IOC_EVENT_PULSE.

2024-04-15 Thread Elizabeth Figura
This corresponds to the NT syscall NtPulseEvent(). This wakes up any waiters as if the event had been set, but does not set the event, instead resetting it if it had been signalled. Thus, for a manual-reset event, all waiters are woken, whereas for an auto-reset event, at most one waiter is

[PATCH v4 25/27] selftests: ntsync: Add a stress test for contended waits.

2024-04-15 Thread Elizabeth Figura
Test a more realistic usage pattern, and one with heavy contention, in order to actually exercise ntsync's internal synchronization. This test has several threads in a tight loop acquiring a mutex, modifying some shared data, and then releasing the mutex. At the end we check if the data is

[PATCH v4 22/27] selftests: ntsync: Add some tests for wakeup signaling with events.

2024-04-15 Thread Elizabeth Figura
Expand the contended wait tests, which previously only covered events and semaphores, to cover events as well. Signed-off-by: Elizabeth Figura --- .../testing/selftests/drivers/ntsync/ntsync.c | 151 +- 1 file changed, 147 insertions(+), 4 deletions(-) diff --git

[PATCH v4 13/27] ntsync: Introduce alertable waits.

2024-04-15 Thread Elizabeth Figura
NT waits can optionally be made "alertable". This is a special channel for thread wakeup that is mildly similar to SIGIO. A thread has an internal single bit of "alerted" state, and if a thread is alerted while an alertable wait, the wait will return a special value, consume the "alerted" state,

[PATCH v4 05/27] ntsync: Introduce NTSYNC_IOC_MUTEX_KILL.

2024-04-15 Thread Elizabeth Figura
This does not correspond to any NT syscall. Rather, when a thread dies, it should be called by the NT emulator for each mutex. NT mutexes are robust (in the pthread sense). When an NT thread dies, any mutexes it owned are immediately released. Acquisition of those mutexes by other threads will

[PATCH v4 07/27] ntsync: Introduce NTSYNC_IOC_EVENT_SET.

2024-04-15 Thread Elizabeth Figura
This corresponds to the NT syscall NtSetEvent(). This sets the event to the signaled state, and returns its previous state. Signed-off-by: Elizabeth Figura --- drivers/misc/ntsync.c | 37 + include/uapi/linux/ntsync.h | 1 + 2 files changed, 38

[PATCH v4 02/27] ntsync: Introduce NTSYNC_IOC_WAIT_ALL.

2024-04-15 Thread Elizabeth Figura
This is similar to NTSYNC_IOC_WAIT_ANY, but waits until all of the objects are simultaneously signaled, and then acquires all of them as a single atomic operation. Signed-off-by: Elizabeth Figura --- drivers/misc/ntsync.c | 243 ++--

[PATCH v4 01/27] ntsync: Introduce NTSYNC_IOC_WAIT_ANY.

2024-04-15 Thread Elizabeth Figura
This corresponds to part of the functionality of the NT syscall NtWaitForMultipleObjects(). Specifically, it implements the behaviour where the third argument (wait_any) is TRUE, and it does not handle alertable waits. Those features have been split out into separate patches to ease review. This

[PATCH v4 06/27] ntsync: Introduce NTSYNC_IOC_CREATE_EVENT.

2024-04-15 Thread Elizabeth Figura
This correspond to the NT syscall NtCreateEvent(). An NT event holds a single bit of state denoting whether it is signaled or unsignaled. There are two types of events: manual-reset and automatic-reset. When an automatic-reset event is acquired via a wait function, its state is reset to

[PATCH v4 18/27] selftests: ntsync: Add some tests for wakeup signaling with WINESYNC_IOC_WAIT_ANY.

2024-04-15 Thread Elizabeth Figura
Test contended "wait-for-any" waits, to make sure that scheduling and wakeup logic works correctly. Signed-off-by: Elizabeth Figura --- .../testing/selftests/drivers/ntsync/ntsync.c | 150 ++ 1 file changed, 150 insertions(+) diff --git

[PATCH v4 21/27] selftests: ntsync: Add some tests for auto-reset event state.

2024-04-15 Thread Elizabeth Figura
Test event-specific ioctls NTSYNC_IOC_EVENT_SET, NTSYNC_IOC_EVENT_RESET, NTSYNC_IOC_EVENT_PULSE, NTSYNC_IOC_EVENT_READ for auto-reset events, and waiting on auto-reset events. Signed-off-by: Elizabeth Figura --- .../testing/selftests/drivers/ntsync/ntsync.c | 59 +++ 1 file

[PATCH v4 10/27] ntsync: Introduce NTSYNC_IOC_SEM_READ.

2024-04-15 Thread Elizabeth Figura
This corresponds to the NT syscall NtQuerySemaphore(). This returns the current count and maximum count of the semaphore. Signed-off-by: Elizabeth Figura --- drivers/misc/ntsync.c | 21 + include/uapi/linux/ntsync.h | 1 + 2 files changed, 22 insertions(+) diff

[PATCH v4 16/27] selftests: ntsync: Add some tests for NTSYNC_IOC_WAIT_ANY.

2024-04-15 Thread Elizabeth Figura
Test basic synchronous functionality of NTSYNC_IOC_WAIT_ANY, when objects are considered signaled or not signaled, and how they are affected by a successful wait. Signed-off-by: Elizabeth Figura --- .../testing/selftests/drivers/ntsync/ntsync.c | 119 ++ 1 file changed, 119

[PATCH v4 11/27] ntsync: Introduce NTSYNC_IOC_MUTEX_READ.

2024-04-15 Thread Elizabeth Figura
This corresponds to the NT syscall NtQueryMutant(). This returns the recursion count, owner, and abandoned state of the mutex. Signed-off-by: Elizabeth Figura --- drivers/misc/ntsync.c | 23 +++ include/uapi/linux/ntsync.h | 1 + 2 files changed, 24 insertions(+)

[PATCH v4 14/27] selftests: ntsync: Add some tests for semaphore state.

2024-04-15 Thread Elizabeth Figura
Wine has tests for its synchronization primitives, but these are more accessible to kernel developers, and also allow us to test some edge cases that Wine does not care about. This patch adds tests for semaphore-specific ioctls NTSYNC_IOC_SEM_POST and NTSYNC_IOC_SEM_READ, and waiting on

[PATCH v4 08/27] ntsync: Introduce NTSYNC_IOC_EVENT_RESET.

2024-04-15 Thread Elizabeth Figura
This corresponds to the NT syscall NtResetEvent(). This sets the event to the unsignaled state, and returns its previous state. Signed-off-by: Elizabeth Figura --- drivers/misc/ntsync.c | 22 ++ include/uapi/linux/ntsync.h | 1 + 2 files changed, 23 insertions(+)

[PATCH v4 17/27] selftests: ntsync: Add some tests for NTSYNC_IOC_WAIT_ALL.

2024-04-15 Thread Elizabeth Figura
Test basic synchronous functionality of NTSYNC_IOC_WAIT_ALL, and when objects are considered simultaneously signaled. Signed-off-by: Elizabeth Figura --- .../testing/selftests/drivers/ntsync/ntsync.c | 99 ++- 1 file changed, 97 insertions(+), 2 deletions(-) diff --git

[PATCH v4 03/27] ntsync: Introduce NTSYNC_IOC_CREATE_MUTEX.

2024-04-15 Thread Elizabeth Figura
This corresponds to the NT syscall NtCreateMutant(). An NT mutex is recursive, with a 32-bit recursion counter. When acquired via NtWaitForMultipleObjects(), the recursion counter is incremented by one. The OS records the thread which acquired it. However, in order to keep this driver

[PATCH v4 19/27] selftests: ntsync: Add some tests for wakeup signaling with WINESYNC_IOC_WAIT_ALL.

2024-04-15 Thread Elizabeth Figura
Test contended "wait-for-all" waits, to make sure that scheduling and wakeup logic works correctly, and that the wait only exits once objects are all simultaneously signaled. Signed-off-by: Elizabeth Figura --- .../testing/selftests/drivers/ntsync/ntsync.c | 98 +++ 1 file

[PATCH v4 15/27] selftests: ntsync: Add some tests for mutex state.

2024-04-15 Thread Elizabeth Figura
Test mutex-specific ioctls NTSYNC_IOC_MUTEX_UNLOCK and NTSYNC_IOC_MUTEX_READ, and waiting on mutexes. Signed-off-by: Elizabeth Figura --- .../testing/selftests/drivers/ntsync/ntsync.c | 196 ++ 1 file changed, 196 insertions(+) diff --git

[PATCH v4 12/27] ntsync: Introduce NTSYNC_IOC_EVENT_READ.

2024-04-15 Thread Elizabeth Figura
This corresponds to the NT syscall NtQueryEvent(). This returns the signaled state of the event and whether it is manual-reset. Signed-off-by: Elizabeth Figura --- drivers/misc/ntsync.c | 21 + include/uapi/linux/ntsync.h | 1 + 2 files changed, 22 insertions(+)

[PATCH v4 04/27] ntsync: Introduce NTSYNC_IOC_MUTEX_UNLOCK.

2024-04-15 Thread Elizabeth Figura
This corresponds to the NT syscall NtReleaseMutant(). This syscall decrements the mutex's recursion count by one, and returns the previous value. If the mutex is not owned by the given owner ID, the function instead fails and returns -EPERM. Signed-off-by: Elizabeth Figura ---

[PATCH net-next v2 6/6] selftests: drv-net: add a trivial ping test

2024-04-15 Thread Jakub Kicinski
Add a very simple test for testing with a remote system. Both IPv4 and IPv6 connectivity is optional so tests will XFail is env doesn't define an address for the given family. Using netdevsim: $ ./run_kselftest.sh -t drivers/net:ping.py TAP version 13 1..1 # timeout set to 45 # selftests:

[PATCH net-next v2 5/6] selftests: drv-net: construct environment for running tests which require an endpoint

2024-04-15 Thread Jakub Kicinski
Nothing surprising here, hopefully. Wrap the variables from the environment into a class or spawn a netdevsim based env and pass it to the tests. Signed-off-by: Jakub Kicinski --- .../testing/selftests/drivers/net/README.rst | 33 +++ .../selftests/drivers/net/lib/py/env.py | 98

[PATCH net-next v2 4/6] selftests: drv-net: factor out parsing of the env

2024-04-15 Thread Jakub Kicinski
The tests with a remote end will use a different class, for clarity, but will also need to parse the env. So factor parsing the env out to a function. Signed-off-by: Jakub Kicinski --- .../selftests/drivers/net/lib/py/env.py | 43 +++ 1 file changed, 26 insertions(+), 17

[PATCH net-next v2 3/6] selftests: drv-net: define endpoint structures

2024-04-15 Thread Jakub Kicinski
Define the remote endpoint "model". To execute most meaningful device driver tests we need to be able to communicate with a remote system, and have it send traffic to the device under test. Various test environments will have different requirements. 0) "Local" netdevsim-based testing can simply

[PATCH net-next v2 2/6] selftests: drv-net: add config for netdevsim

2024-04-15 Thread Jakub Kicinski
Real driver testing will obviously require enabling more options, but will require more manual setup in the first place. For CIs running purely software tests we need to enable netdevsim. Signed-off-by: Jakub Kicinski --- tools/testing/selftests/drivers/net/config | 2 ++ 1 file changed, 2

[PATCH net-next v2 1/6] selftests: drv-net: add stdout to the command failed exception

2024-04-15 Thread Jakub Kicinski
ping prints all the info to stdout. To make debug easier capture stdout in the Exception raised when command unexpectedly fails. Signed-off-by: Jakub Kicinski --- tools/testing/selftests/net/lib/py/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[PATCH net-next v2 0/6] selftests: drv-net: support testing with a remote system

2024-04-15 Thread Jakub Kicinski
Hi! Implement support for tests which require access to a remote system / endpoint which can generate traffic. This series concludes the "groundwork" for upstream driver tests. I wanted to support the three models which came up in discussions: - SW testing with netdevsim - "local" testing with

Re: [PATCH v10 3/5] selftest mm/mseal memory sealing

2024-04-15 Thread Kees Cook
On Mon, Apr 15, 2024 at 01:27:32PM -0700, Jeff Xu wrote: > On Mon, Apr 15, 2024 at 11:32 AM Muhammad Usama Anjum > wrote: > > > > Please fix following for this and fifth patch as well: > > > > --> checkpatch.pl --codespell tools/testing/selftests/mm/mseal_test.c > > > > WARNING: Macros with flow

Re: [PATCH V2] KVM: selftests: Take large C-state exit latency into consideration

2024-04-15 Thread Sean Christopherson
On Fri, Apr 12, 2024, Zide Chen wrote: > Currently, the migration worker delays 1-10 us, assuming that one > KVM_RUN iteration only takes a few microseconds. But if C-state exit > latencies are large enough, for example, hundreds or even thousands > of microseconds on server CPUs, it may happen

Re: [PATCH v4 01/14] lib: Add TLV parser

2024-04-15 Thread Randy Dunlap
On 4/15/24 12:19 PM, Jarkko Sakkinen wrote: > On Mon Apr 15, 2024 at 5:24 PM EEST, Roberto Sassu wrote: >> From: Roberto Sassu >> >> Add a parser of a generic TLV format: > > What is TLV? type-length-value i.e., a descriptor that contains a value. IIUC. -- #Randy

Re: [PATCH v10 3/5] selftest mm/mseal memory sealing

2024-04-15 Thread Jeff Xu
On Mon, Apr 15, 2024 at 11:32 AM Muhammad Usama Anjum wrote: > > Please fix following for this and fifth patch as well: > > --> checkpatch.pl --codespell tools/testing/selftests/mm/mseal_test.c > > WARNING: Macros with flow control statements should be avoided > #42: FILE:

Re: [PATCH net-next 1/5] selftests: drv-net: define endpoint structures

2024-04-15 Thread Petr Machata
Willem de Bruijn writes: > 1. Cleaning up remote state in all conditions, including timeout/kill. > >Some tests require a setup phase before the test, and a matching >cleanup phase. If any of the configured state is variable (even >just a randomized filepath) this needs to be

Re: [PATCH v4 13/14] selftests/digest_cache: Add selftests for digest_cache LSM

2024-04-15 Thread Jarkko Sakkinen
On Mon Apr 15, 2024 at 5:24 PM EEST, Roberto Sassu wrote: > From: Roberto Sassu > > Add tests to verify the correctness of the digest_cache LSM, in all_test.c. > > Add the kernel module digest_cache_kern.ko, to let all_test call the API > of the digest_cache LSM through the newly introduced

Re: [PATCH v4 11/14] digest_cache: Reset digest cache on file/directory change

2024-04-15 Thread Jarkko Sakkinen
On Mon Apr 15, 2024 at 5:24 PM EEST, Roberto Sassu wrote: > From: Roberto Sassu > > Register six new LSM hooks, path_truncate, file_release, inode_unlink, > inode_rename, inode_post_setxattr and inode_post_removexattr, to monitor > digest lists/directory modifications. > > If an action affects a

Re: [PATCH v4 10/14] digest cache: Prefetch digest lists if requested

2024-04-15 Thread Jarkko Sakkinen
On Mon Apr 15, 2024 at 5:24 PM EEST, Roberto Sassu wrote: > From: Roberto Sassu > > A desirable goal when doing integrity measurements is that they are done > always in the same order across boots, so that the resulting PCR value > becomes predictable and suitable for sealing policies. However,

Re: [PATCH v3 04/29] riscv: zicfilp / zicfiss in dt-bindings (extensions.yaml)

2024-04-15 Thread Rob Herring
On Wed, Apr 10, 2024 at 02:37:21PM -0700, Deepak Gupta wrote: > On Wed, Apr 10, 2024 at 4:58 AM Rob Herring wrote: > > > > On Wed, Apr 03, 2024 at 04:34:52PM -0700, Deepak Gupta wrote: > > > Make an entry for cfi extensions in extensions.yaml. > > > > > > Signed-off-by: Deepak Gupta > > > --- >

Re: [PATCH v4 09/14] digest_cache: Add support for directories

2024-04-15 Thread Jarkko Sakkinen
On Mon Apr 15, 2024 at 5:24 PM EEST, Roberto Sassu wrote: > From: Roberto Sassu > > In the environments where xattrs are not available (e.g. in the initial ram > disk), the digest_cache LSM cannot precisely determine which digest list in > a directory contains the desired reference digest.

Re: [PATCH v4 04/14] digest_cache: Add hash tables and operations

2024-04-15 Thread Jarkko Sakkinen
On Mon Apr 15, 2024 at 5:24 PM EEST, Roberto Sassu wrote: > From: Roberto Sassu > > Add a linked list of hash tables to the digest cache, one per algorithm, > containing the digests extracted from digest lists. > > The number of hash table slots is determined by dividing the number of > digests

Re: [PATCH v4 03/14] digest_cache: Add securityfs interface

2024-04-15 Thread Jarkko Sakkinen
On Mon Apr 15, 2024 at 5:24 PM EEST, Roberto Sassu wrote: > From: Roberto Sassu > > Add the digest_cache_path file in securityfs, to let root change/read the > default path (file or directory) from where digest lists are looked up. > > An RW semaphore prevents the default path from changing while

Re: [PATCH v4 02/14] security: Introduce the digest_cache LSM

2024-04-15 Thread Jarkko Sakkinen
On Mon Apr 15, 2024 at 5:24 PM EEST, Roberto Sassu wrote: > From: Roberto Sassu > > Introduce the digest_cache LSM, to collect digests from various sources > (called digest lists), and to store them in kernel memory, in a set of hash > tables forming a digest cache. Extracted digests can be used

Re: [GIT PULL] Kselftest fixes update for Linux 6.9-rc5

2024-04-15 Thread pr-tracker-bot
The pull request you sent on Mon, 15 Apr 2024 10:23:12 -0600: > git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest > tags/linux_kselftest-fixes-6.9-rc5 has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/3fdfcd98f002ade3f92038f7c164d45b2e8b7a79 Thank

Re: [PATCH v4 01/14] lib: Add TLV parser

2024-04-15 Thread Jarkko Sakkinen
On Mon Apr 15, 2024 at 5:24 PM EEST, Roberto Sassu wrote: > From: Roberto Sassu > > Add a parser of a generic TLV format: What is TLV? BR, Jarkko

Re: [PATCH v4 00/14] security: digest_cache LSM

2024-04-15 Thread Jarkko Sakkinen
On Mon Apr 15, 2024 at 5:24 PM EEST, Roberto Sassu wrote: > From: Roberto Sassu > > Integrity detection and protection has long been a desirable feature, to > reach a large user base and mitigate the risk of flaws in the software > and attacks. > > However, while solutions exist, they struggle to

Re: [PATCH v10 1/5] mseal: Wire up mseal syscall

2024-04-15 Thread Jeff Xu
On Mon, Apr 15, 2024 at 11:21 AM Linus Torvalds wrote: > > On Mon, 15 Apr 2024 at 11:11, Muhammad Usama Anjum > wrote: > > > > It isn't logical to wire up something which isn't present > > Actually, with system calls, the rules end up being almost opposite. > > There's no point in adding the

Re: [PATCH] KVM: selftests: Avoid assuming "sudo" exists

2024-04-15 Thread Muhammad Usama Anjum
{ > - echo "$1" | sudo tee -a "$2" > /dev/null > + echo "$1" | maybe_sudo tee -a "$2" > /dev/null > } > > NXECUTABLE="$(dirname $0)/nx_huge_pages_test" > > --- > base-commit: 2c71fdf02a95b3dd425b42f28fd47fb2b1d22702 > change-id: 20240415-kvm-selftests-no-sudo-1a55f831f882 > > Best regards, -- BR, Muhammad Usama Anjum

Re: [PATCH v1] KVM: s390x: selftests: Add shared zeropage test

2024-04-15 Thread Muhammad Usama Anjum
On 4/12/24 1:43 PM, David Hildenbrand wrote: > Let's test that we can have shared zeropages in our process as long as > storage keys are not getting used, that shared zeropages are properly > unshared (replaced by anonymous pages) once storage keys are enabled, > and that no new shared zeropages

Re: [PATCH net-next v2 0/6] selftests: net: exercise page pool reporting via netlink

2024-04-15 Thread patchwork-bot+netdevbpf
Hello: This series was applied to netdev/net-next.git (main) by Jakub Kicinski : On Fri, 12 Apr 2024 07:14:30 -0700 you wrote: > Add a basic test for page pool netlink reporting. > > v2: > - pass args as *args (patch 3) > - improve the test and add busy wait helper (patch 6) > v1:

Re: [PATCH 2/2] selftests: power_supply: Make it POSIX-compliant

2024-04-15 Thread Muhammad Usama Anjum
On 4/15/24 8:32 PM, Nícolas F. R. A. Prado wrote: > There is one use of bash specific syntax in the script. Change it to the > equivalent POSIX syntax. This doesn't change functionality and allows > the test to be run on shells other than bash. > > Reported-by: Mike Looijmans > Closes: >

Re: [PATCH 1/2] selftests: ktap_helpers: Make it POSIX-compliant

2024-04-15 Thread Muhammad Usama Anjum
On 4/15/24 8:32 PM, Nícolas F. R. A. Prado wrote: > There are a couple uses of bash specific syntax in the script. Change > them to the equivalent POSIX syntax. This doesn't change functionality > and allows non-bash test scripts to make use of these helpers. > > Reported-by: Mike Looijmans >

Re: [PATCH v10 3/5] selftest mm/mseal memory sealing

2024-04-15 Thread Muhammad Usama Anjum
Please fix following for this and fifth patch as well: --> checkpatch.pl --codespell tools/testing/selftests/mm/mseal_test.c WARNING: Macros with flow control statements should be avoided #42: FILE: tools/testing/selftests/mm/mseal_test.c:42: +#define FAIL_TEST_IF_FALSE(c) do {\ +

Re: [PATCH v10 1/5] mseal: Wire up mseal syscall

2024-04-15 Thread Linus Torvalds
On Mon, 15 Apr 2024 at 11:11, Muhammad Usama Anjum wrote: > > It isn't logical to wire up something which isn't present Actually, with system calls, the rules end up being almost opposite. There's no point in adding the code if it's not reachable. So adding the system call code before adding

Re: [PATCH v10 1/5] mseal: Wire up mseal syscall

2024-04-15 Thread Muhammad Usama Anjum
On 4/15/24 9:35 PM, jef...@chromium.org wrote: > From: Jeff Xu > > Wire up mseal syscall for all architectures. It isn't logical to wire up something which isn't present. Please first add the mseal() and then wire up. Please swap first and second patches. I've seen this same comment before. >

RE: [PATCH v2 00/25] Enable FRED with KVM VMX

2024-04-15 Thread Li, Xin3
> This patch set enables the Intel flexible return and event delivery > (FRED) architecture with KVM VMX to allow guests to utilize FRED. > > > Intel VMX architecture is extended to run FRED guests, and the major changes > are: > > 1) New VMCS fields for FRED context management, which

Re: [PATCH net-next 4/5] selftests: drv-net: construct environment for running tests which require an endpoint

2024-04-15 Thread Jakub Kicinski
On Mon, 15 Apr 2024 11:28:47 -0400 Willem de Bruijn wrote: > > If I have to (: > > Endpoint isn't great. > > But remote doesn't seem much better, and it doesn't have a nice > > abbreviation :( > > It pairs well with local. > > Since in some tests the (local) machine under test is the sender

[PATCH v10 3/5] selftest mm/mseal memory sealing

2024-04-15 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 | 1836 +++ 3 files changed, 1838

[PATCH v10 5/5] selftest mm/mseal read-only elf memory segment

2024-04-15 Thread jeffxu
From: Jeff Xu Sealing read-only of elf mapping so it can't be changed by mprotect. Signed-off-by: Jeff Xu --- tools/testing/selftests/mm/.gitignore | 1 + tools/testing/selftests/mm/Makefile | 1 + tools/testing/selftests/mm/seal_elf.c | 183 ++ 3 files changed,

[PATCH v10 4/5] mseal:add documentation

2024-04-15 Thread jeffxu
From: Jeff Xu Add documentation for mseal(). Signed-off-by: Jeff Xu --- Documentation/userspace-api/index.rst | 1 + Documentation/userspace-api/mseal.rst | 199 ++ 2 files changed, 200 insertions(+) create mode 100644 Documentation/userspace-api/mseal.rst diff

[PATCH v10 2/5] mseal: add mseal syscall

2024-04-15 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

[PATCH v10 1/5] mseal: Wire up mseal syscall

2024-04-15 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 ++

[PATCH v10 0/5] Introduce mseal

2024-04-15 Thread jeffxu
From: Jeff Xu This is V10 version, it rebases v9 patch to 6.9.rc3. We also applied and tested mseal() in chrome and chromebook. -- This patchset proposes a new mseal() syscall for the Linux kernel. In a nutshell, mseal() protects

[GIT PULL] Kselftest fixes update for Linux 6.9-rc5

2024-04-15 Thread Shuah Khan
Hi Linus, Please pull the following kselftest fixes update for Linux 6.9-rc5. This kselftest fixes update for Linux 6.9-rc5 consists of a fix to kselftest harness to prevent infinite loop triggered in an assert in FIXTURE_TEARDOWN and a fix to a problem seen in being able to stop

Re: [PATCH net-next 1/5] selftests: drv-net: define endpoint structures

2024-04-15 Thread Paolo Abeni
On Mon, 2024-04-15 at 07:19 -0700, Jakub Kicinski wrote: > On Mon, 15 Apr 2024 10:57:31 +0200 Paolo Abeni wrote: > > If I read correctly the above will do a full ssh handshake for each > > command. If the test script/setup is complex, I think/fear the overhead > > could become a bit cumbersome. >

Re: [PATCH net-next 5/5] selftests: drv-net: add a trivial ping test

2024-04-15 Thread Paolo Abeni
On Mon, 2024-04-15 at 07:33 -0700, Jakub Kicinski wrote: > On Mon, 15 Apr 2024 11:31:05 +0200 Paolo Abeni wrote: > > On Fri, 2024-04-12 at 16:37 -0700, Jakub Kicinski wrote: > > > +def ping_v4(cfg) -> None: > > > +if not cfg.v4: > > > +raise KsftXfailEx() > > > + > > > +cmd(f"ping

Re: [PATCH] selftests: iommu: add config needed for iommufd_fail_nth

2024-04-15 Thread Jason Gunthorpe
On Sun, Apr 14, 2024 at 07:39:58PM +0500, Muhammad Usama Anjum wrote: > On 4/5/24 5:10 AM, Jason Gunthorpe wrote: > > On Mon, Mar 25, 2024 at 02:11:41PM +0500, Muhammad Usama Anjum wrote: > >> On 3/25/24 2:00 PM, Muhammad Usama Anjum wrote: > >>> Add FAULT_INJECTION_DEBUG_FS and FAILSLAB

Re: [PATCH net-next 1/5] selftests: drv-net: define endpoint structures

2024-04-15 Thread Paolo Abeni
On Mon, 2024-04-15 at 07:19 -0700, Jakub Kicinski wrote: > On Mon, 15 Apr 2024 10:57:31 +0200 Paolo Abeni wrote: > > If I read correctly the above will do a full ssh handshake for each > > command. If the test script/setup is complex, I think/fear the overhead > > could become a bit cumbersome. >

Re: [PATCH] selftests: Mark ksft_exit_fail_perror() as __noreturn

2024-04-15 Thread Nathan Chancellor
On Sun, Apr 14, 2024 at 11:26:53AM +0500, Muhammad Usama Anjum wrote: > Let the compilers (clang) know that this function would just call > exit() and would never return. It is needed to avoid false positive > static analysis errors. All similar functions calling exit() > unconditionally have been

Re: [PATCH v2 bpf-next 2/6] selftests/bpf: Implement socket kfuncs for bpf_testmod

2024-04-15 Thread Jordan Rife
> It would be better to check if args->msglen > sizeof(arg->msg) although > this function is just for test cases. Same for args->addr.addrlen. Ack. I will add this. Thanks, Jordan On Fri, Apr 12, 2024 at 6:26 PM Kui-Feng Lee wrote: > > > > On 4/12/24 09:52, Jordan Rife wrote: > > This patch

[PATCH 2/2] selftests: power_supply: Make it POSIX-compliant

2024-04-15 Thread Nícolas F . R . A . Prado
There is one use of bash specific syntax in the script. Change it to the equivalent POSIX syntax. This doesn't change functionality and allows the test to be run on shells other than bash. Reported-by: Mike Looijmans Closes:

[PATCH 1/2] selftests: ktap_helpers: Make it POSIX-compliant

2024-04-15 Thread Nícolas F . R . A . Prado
There are a couple uses of bash specific syntax in the script. Change them to the equivalent POSIX syntax. This doesn't change functionality and allows non-bash test scripts to make use of these helpers. Reported-by: Mike Looijmans Closes:

[PATCH 0/2] selftests: Make sh helper and power supply test POSIX-compliant

2024-04-15 Thread Nícolas F . R . A . Prado
: 20240415-supply-selftest-posix-sh-aee99cf85e8f Best regards, -- Nícolas F. R. A. Prado

Re: [PATCH net-next 0/5] selftests: drv-net: support testing with a remote system

2024-04-15 Thread Willem de Bruijn
Jakub Kicinski wrote: > Hi! > > Implement support for tests which require access to a remote system / > endpoint which can generate traffic. > This series concludes the "groundwork" for upstream driver tests. > > I wanted to support the three models which came up in discussions: > - SW testing

Re: [PATCH net-next 4/5] selftests: drv-net: construct environment for running tests which require an endpoint

2024-04-15 Thread Willem de Bruijn
Jakub Kicinski wrote: > On Sun, 14 Apr 2024 12:45:43 -0400 Willem de Bruijn wrote: > > Overall, this is really cool stuff (obviously)! > > > > REMOTE instead of EP? > > If I have to (: > Endpoint isn't great. > But remote doesn't seem much better, and it doesn't have a nice > abbreviation :( It

  1   2   >