Re: [RFC PATCH v2 0/3] KVM: allow mapping of compound tail pages for IO or PFNMAP mapping

2024-02-20 Thread Yan Zhao
On Mon, Feb 12, 2024 at 07:07:25PM -0800, Sean Christopherson wrote: > On Wed, Jan 03, 2024, Yan Zhao wrote: > > This is a v2 for previous series [1] to allow mapping for compound tail > > pages for IO or PFNMAP mapping. > > > > Compared to v1, this version provides selftest to check functionality

Re: [PATCH v13 04/21] KVM: pfncache: add a mark-dirty helper

2024-02-20 Thread Paul Durrant
On 19/02/2024 21:42, Sean Christopherson wrote: On Thu, Feb 15, 2024, Paul Durrant wrote: +/** + * kvm_gpc_mark_dirty_in_slot - mark a cached guest page as dirty. + * + * @gpc: struct gfn_to_pfn_cache object. Meh, just omit the kerneldoc comment. + */ +static inline void kvm_gpc_mar

Re: [PATCH v13 05/21] KVM: pfncache: remove KVM_GUEST_USES_PFN usage

2024-02-20 Thread Paul Durrant
On 19/02/2024 21:43, Sean Christopherson wrote: On Thu, Feb 15, 2024, Paul Durrant wrote: From: Paul Durrant As noted in [1] the KVM_GUEST_USES_PFN usage flag is never set by any callers of kvm_gpc_init(), which also makes the 'vcpu' argument redundant. The changelog should explicitly call o

Re: [PATCH v13 09/21] KVM: pfncache: allow a cache to be activated with a fixed (userspace) HVA

2024-02-20 Thread Paul Durrant
On 19/02/2024 21:49, Sean Christopherson wrote: On Thu, Feb 15, 2024, Paul Durrant wrote: @@ -319,7 +340,16 @@ static int __kvm_gpc_refresh(struct gfn_to_pfn_cache *gpc, gpa_t gpa, int kvm_gpc_refresh(struct gfn_to_pfn_cache *gpc, unsigned long len) { - return __kvm_gpc_refresh(gp

Re: [PATCH] [PATCH] amd_pstate: fix erroneous highest_perf value on some CPUs

2024-02-20 Thread Oleksandr Natalenko
Hello. On neděle 18. února 2024 17:10:31 CET Lucas Lee Jing Yi wrote: > On a Ryzen 7840HS the highest_perf value is 196, not 166 as AMD assumed. > This leads to the advertised max clock speed to only be 4.35ghz instead of > 5.14ghz , leading to a large degradation in performance. > > Fix the bro

Re: [PATCH v13 12/21] KVM: x86/xen: allow shared_info to be mapped by fixed HVA

2024-02-20 Thread Paul Durrant
On 19/02/2024 21:53, Sean Christopherson wrote: On Thu, Feb 15, 2024, Paul Durrant wrote: @@ -715,13 +731,23 @@ int kvm_xen_hvm_get_attr(struct kvm *kvm, struct kvm_xen_hvm_attr *data) break; case KVM_XEN_ATTR_TYPE_SHARED_INFO: - if (kvm->arch.xen.shinfo_cac

Re: [PATCH v13 18/21] KVM: x86/xen: don't block on pfncache locks in kvm_xen_set_evtchn_fast()

2024-02-20 Thread Paul Durrant
On 19/02/2024 22:04, Sean Christopherson wrote: On Thu, Feb 15, 2024, Paul Durrant wrote: From: Paul Durrant As described in [1] compiling with CONFIG_PROVE_RAW_LOCK_NESTING shows that kvm_xen_set_evtchn_fast() is blocking on pfncache locks in IRQ context. There is only actually blocking with

Re: [PATCH v13 00/21] KVM: xen: update shared_info and vcpu_info handling

2024-02-20 Thread Paul Durrant
On 19/02/2024 22:06, Sean Christopherson wrote: On Thu, Feb 15, 2024, Paul Durrant wrote: David Woodhouse (1): KVM: pfncache: rework __kvm_gpc_refresh() to fix locking issues Paul Durrant (19): KVM: pfncache: Add a map helper function KVM: pfncache: remove unnecessary exports KVM: x

Re: [RFC PATCH v2 1/3] KVM: allow mapping of compound tail pages for IO or PFNMAP mapping

2024-02-20 Thread Yan Zhao
On Mon, Feb 12, 2024 at 07:17:21PM -0800, Sean Christopherson wrote: > On Wed, Jan 03, 2024, Yan Zhao wrote: > > Allow mapping of tail pages of compound pages for IO or PFNMAP mapping > > by trying and getting ref count of its head page. > > > > For IO or PFNMAP mapping, sometimes it's backed by c

[PATCH][next] selftests: sched: Fix spelling mistake "hiearchy" -> "hierarchy"

2024-02-20 Thread Colin Ian King
There is a spelling mistake in a printed message. Fix it. Signed-off-by: Colin Ian King --- tools/testing/selftests/sched/cs_prctl_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/sched/cs_prctl_test.c b/tools/testing/selftests/sched/cs_prctl_te

Re: [PATCH v3] bpf: Replace bpf_lpm_trie_key 0-length array with flexible array

2024-02-20 Thread Daniel Borkmann
On 2/20/24 12:41 AM, Kees Cook wrote: Replace deprecated 0-length array in struct bpf_lpm_trie_key with flexible array. Found with GCC 13: ../kernel/bpf/lpm_trie.c:207:51: warning: array subscript i is outside array bounds of 'const __u8[0]' {aka 'const unsigned char[]'} [-Warray-bounds=] 20

Re: [PATCH v13 00/21] KVM: xen: update shared_info and vcpu_info handling

2024-02-20 Thread Paul Durrant
On 20/02/2024 09:14, Paul Durrant wrote: On 19/02/2024 22:06, Sean Christopherson wrote: On Thu, Feb 15, 2024, Paul Durrant wrote: David Woodhouse (1):    KVM: pfncache: rework __kvm_gpc_refresh() to fix locking issues Paul Durrant (19):    KVM: pfncache: Add a map helper function    KVM: pfnc

Re: [PATCH] Fix implicit cast warning in test_klp_state.c

2024-02-20 Thread Shresth Prasad
Looking at the function definition now, I do see that the function returns a struct pointer but for me the compiler still complains about an implicit conversion from int to struct pointer. Is there any particular reason why this might be happening? I couldn't quite figure it out myself as I am

Re: [PATCH] Fix implicit cast warning in test_klp_state.c

2024-02-20 Thread Marcos Paulo de Souza
On Tue, 20 Feb 2024 17:23:49 +0530 (GMT+05:30) Shresth Prasad wrote: > Looking at the function definition now, I do see that the function returns a > struct pointer but for me the compiler still complains about an implicit > conversion from int to struct pointer. > > Is there any particular r

Re: [PATCH 1/3] pstore: add multi-backend support

2024-02-20 Thread Yuanhe Shu
On 2024/2/7 20:48, Kees Cook wrote: On Wed, Feb 07, 2024 at 10:19:19AM +0800, Yuanhe Shu wrote: Currently, pstore supports only one backend open at a time. Specifically, due to the global variable "psinfo", pstore only accepts the first registered backend. If a new backend wants to register l

Re: [PATCH 3/3] tools/testing: adjust pstore backend related selftest

2024-02-20 Thread Yuanhe Shu
On 2024/2/7 20:53, Kees Cook wrote: On Wed, Feb 07, 2024 at 10:19:21AM +0800, Yuanhe Shu wrote: Pstore now supports multiple backends, the module parameter pstore.backend varies from 'registered backend' to 'backends that are allowed to register'. Adjust selftests to match the change. Signed

[PATCH 0/3] selftests/resctrl: Simplify test cleanup functions

2024-02-20 Thread Maciej Wieczor-Retman
Cleaning up after tests is implemented separately for individual tests and called at the end of each test execution. Since these functions are very similar and a more generalized test framework was introduced a function pointer in the resctrl_test struct can be used to reduce the amount of function

[PATCH 1/3] selftests/resctrl: Add cleanup function to test framework

2024-02-20 Thread Maciej Wieczor-Retman
Resctrl selftests use very similar functions to cleanup after themselves. This creates a lot of code duplication. Also not being hooked to the test framework means that ctrl-c handler isn't aware of what test is currently running and executes all cleanups even though only one is needed. Add a func

[PATCH 2/3] selftests/resctrl: Simplify cleanup in ctrl-c handler

2024-02-20 Thread Maciej Wieczor-Retman
Ctrl-c handler isn't aware of what test is currently running. Because of that it executes all cleanups even if they aren't necessary. Since the ctrl-c handler uses the sigaction system no parameters can be passed to it as function arguments. Add a global variable to make ctrl-c handler aware of th

[PATCH 3/3] selftests/resctrl: Move cleanups out of individual tests

2024-02-20 Thread Maciej Wieczor-Retman
Every test calls its cleanup function at the end of it's test function. After the cleanup function pointer is added to the test framework this can be simplified to executing the callback function at the end of the generic test running function. Make test cleanup functions static and call them from

Re: [PATCH 0/3] selftests/resctrl: Simplify test cleanup functions

2024-02-20 Thread Maciej Wieczor-Retman
I forgot to add to the cover letter that this series applies cleanly on both kselftests/next and on top of my other series [1] currently in review. [1] https://lore.kernel.org/all/cover.1708072203.git.maciej.wieczor-ret...@intel.com/ -- Kind regards Maciej Wieczór-Retman

Re: [PATCH] Fix implicit cast warning in test_klp_state.c

2024-02-20 Thread Shresth Prasad
>What compiler version and architecture? Are you >compiling using flags like >W=1? >I would advise you to always add more information >about how the problem >manifests, and what you are executing. This can >help to nail down the issue >quicker. I'll keep that in mind. I'm on an x86_64 system wit

Re: [PATCH v2 2/2] KVM: s390: selftests: memop: add a simple AR test

2024-02-20 Thread Nina Schoetterl-Glausch
On Thu, 2024-02-15 at 21:53 +0100, Eric Farman wrote: > There is a selftest that checks for an (expected) error when an > invalid AR is specified, but not one that exercises the AR path. > > Add a simple test that mirrors the vanilla write/read test while > providing an AR. An AR that contains zer

Re: [PATCH v3 1/2] KVM: s390: fix access register usage in ioctls

2024-02-20 Thread Nina Schoetterl-Glausch
On Fri, 2024-02-16 at 22:36 +0100, Eric Farman wrote: > The routine ar_translation() can be reached by both the instruction > intercept path (where the access registers had been loaded with the > guest register contents), and the MEM_OP ioctls (which hadn't). > Since this routine saves the current

Re: [PATCH 2/3] selftests/resctrl: Simplify cleanup in ctrl-c handler

2024-02-20 Thread Ilpo Järvinen
On Tue, 20 Feb 2024, Maciej Wieczor-Retman wrote: > Ctrl-c handler isn't aware of what test is currently running. Because of > that it executes all cleanups even if they aren't necessary. Since the > ctrl-c handler uses the sigaction system no parameters can be passed > to it as function arguments

Re: [PATCH 3/3] selftests/resctrl: Move cleanups out of individual tests

2024-02-20 Thread Ilpo Järvinen
On Tue, 20 Feb 2024, Maciej Wieczor-Retman wrote: > Every test calls its cleanup function at the end of it's test function. > After the cleanup function pointer is added to the test framework this > can be simplified to executing the callback function at the end of the > generic test running funct

Re: [PATCH 2/3] selftests/resctrl: Simplify cleanup in ctrl-c handler

2024-02-20 Thread Maciej Wieczor-Retman
On 2024-02-20 at 15:45:23 +0200, Ilpo Järvinen wrote: >On Tue, 20 Feb 2024, Maciej Wieczor-Retman wrote: > >> Ctrl-c handler isn't aware of what test is currently running. Because of >> that it executes all cleanups even if they aren't necessary. Since the >> ctrl-c handler uses the sigaction syste

Re: [PATCH 3/3] selftests/resctrl: Move cleanups out of individual tests

2024-02-20 Thread Maciej Wieczor-Retman
On 2024-02-20 at 15:49:16 +0200, Ilpo Järvinen wrote: >On Tue, 20 Feb 2024, Maciej Wieczor-Retman wrote: > >> Every test calls its cleanup function at the end of it's test function. >> After the cleanup function pointer is added to the test framework this >> can be simplified to executing the callb

Re: [PATCH v3 1/2] KVM: s390: fix access register usage in ioctls

2024-02-20 Thread Christian Borntraeger
Am 16.02.24 um 22:36 schrieb Eric Farman: The routine ar_translation() can be reached by both the instruction intercept path (where the access registers had been loaded with the guest register contents), and the MEM_OP ioctls (which hadn't). Since this routine saves the current registers to vc

Re: [PATCH v3 1/2] KVM: s390: fix access register usage in ioctls

2024-02-20 Thread Janosch Frank
On 2/20/24 15:15, Christian Borntraeger wrote: Am 16.02.24 um 22:36 schrieb Eric Farman: The routine ar_translation() can be reached by both the instruction intercept path (where the access registers had been loaded with the guest register contents), and the MEM_OP ioctls (which hadn't). Since

Re: [PATCH 2/3] selftests/resctrl: Simplify cleanup in ctrl-c handler

2024-02-20 Thread Ilpo Järvinen
On Tue, 20 Feb 2024, Maciej Wieczor-Retman wrote: > On 2024-02-20 at 15:45:23 +0200, Ilpo Järvinen wrote: > >On Tue, 20 Feb 2024, Maciej Wieczor-Retman wrote: > > > >> Ctrl-c handler isn't aware of what test is currently running. Because of > >> that it executes all cleanups even if they aren't ne

Re: [PATCH v3 2/2] KVM: s390: selftests: memop: add a simple AR test

2024-02-20 Thread Christian Borntraeger
Am 16.02.24 um 22:36 schrieb Eric Farman: There is a selftest that checks for an (expected) error when an invalid AR is specified, but not one that exercises the AR path. Add a simple test that mirrors the vanilla write/read test while providing an AR. An AR that contains zero will direct the

Re: [PATCH v2 2/2] KVM: s390: selftests: memop: add a simple AR test

2024-02-20 Thread Eric Farman
On Tue, 2024-02-20 at 14:34 +0100, Nina Schoetterl-Glausch wrote: > On Thu, 2024-02-15 at 21:53 +0100, Eric Farman wrote: > > There is a selftest that checks for an (expected) error when an > > invalid AR is specified, but not one that exercises the AR path. > > > > Add a simple test that mirrors

Re: [PATCH v3 1/2] KVM: s390: fix access register usage in ioctls

2024-02-20 Thread Eric Farman
On Tue, 2024-02-20 at 15:19 +0100, Janosch Frank wrote: > On 2/20/24 15:15, Christian Borntraeger wrote: > > > > > > Am 16.02.24 um 22:36 schrieb Eric Farman: > > > The routine ar_translation() can be reached by both the > > > instruction > > > intercept path (where the access registers had been

Re: [PATCH v13 00/21] KVM: xen: update shared_info and vcpu_info handling

2024-02-20 Thread Sean Christopherson
On Thu, 15 Feb 2024 15:28:55 +, Paul Durrant wrote: > From: Paul Durrant > > This series contains a new patch from Sean added since v12 [1]: > > * KVM: s390: Refactor kvm_is_error_gpa() into kvm_is_gpa_in_memslot() > > This frees up the function name kvm_is_error_gpa() such that it can then

Re: [PATCH v13 00/21] KVM: xen: update shared_info and vcpu_info handling

2024-02-20 Thread Paul Durrant
On 20/02/2024 15:55, Sean Christopherson wrote: On Thu, 15 Feb 2024 15:28:55 +, Paul Durrant wrote: From: Paul Durrant This series contains a new patch from Sean added since v12 [1]: * KVM: s390: Refactor kvm_is_error_gpa() into kvm_is_gpa_in_memslot() This frees up the function name kvm

Re: [PATCH v13 00/21] KVM: xen: update shared_info and vcpu_info handling

2024-02-20 Thread Sean Christopherson
On Tue, Feb 20, 2024, Paul Durrant wrote: > On 20/02/2024 15:55, Sean Christopherson wrote: > > On Thu, 15 Feb 2024 15:28:55 +, Paul Durrant wrote: > > > From: Paul Durrant > > > > > > This series contains a new patch from Sean added since v12 [1]: > > > > > > * KVM: s390: Refactor kvm_is_er

Re: [PATCH v13 00/21] KVM: xen: update shared_info and vcpu_info handling

2024-02-20 Thread David Woodhouse
On 20 February 2024 17:15:06 CET, Sean Christopherson wrote: >On Tue, Feb 20, 2024, Paul Durrant wrote: >> On 20/02/2024 15:55, Sean Christopherson wrote: >> > On Thu, 15 Feb 2024 15:28:55 +, Paul Durrant wrote: >> > > From: Paul Durrant >> > > >> > > This series contains a new patch from Se

Re: [PATCH v8 00/38] arm64/gcs: Provide support for GCS in userspace

2024-02-20 Thread Stefan O'Rear
On Sat, Feb 3, 2024, at 7:25 AM, Mark Brown wrote: > The arm64 Guarded Control Stack (GCS) feature provides support for > hardware protected stacks of return addresses, intended to provide > hardening against return oriented programming (ROP) attacks and to make > it easier to gather call stacks fo

kselftest/next build: 3 builds: 2 failed, 1 passed, 2 errors, 3 warnings (v6.8-rc1-33-gf17d8a87ecb55)

2024-02-20 Thread kernelci.org bot
kselftest/next build: 3 builds: 2 failed, 1 passed, 2 errors, 3 warnings (v6.8-rc1-33-gf17d8a87ecb55) Full Build Summary: https://kernelci.org/build/kselftest/branch/next/kernel/v6.8-rc1-33-gf17d8a87ecb55/ Tree: kselftest Branch: next Git Describe: v6.8-rc1-33-gf17d8a87ecb55 Git Commit: f17d8a8

Re: [PATCH v13 00/21] KVM: xen: update shared_info and vcpu_info handling

2024-02-20 Thread Paul Durrant
On 20/02/2024 16:15, Sean Christopherson wrote: On Tue, Feb 20, 2024, Paul Durrant wrote: On 20/02/2024 15:55, Sean Christopherson wrote: On Thu, 15 Feb 2024 15:28:55 +, Paul Durrant wrote: From: Paul Durrant This series contains a new patch from Sean added since v12 [1]: * KVM: s390: R

Re: [PATCH bpf-next 2/5] bpf: tracing: support to attach program to multi hooks

2024-02-20 Thread Jiri Olsa
On Tue, Feb 20, 2024 at 11:51:02AM +0800, Menglong Dong wrote: SNIP > @@ -3228,7 +3260,9 @@ static int bpf_tracing_prog_attach(struct bpf_prog > *prog, > struct bpf_link_primer link_primer; > struct bpf_prog *tgt_prog = NULL; > struct bpf_trampoline *tr = NULL; > + struct b

Re: [PATCH bpf-next 1/5] bpf: tracing: add support to record and check the accessed args

2024-02-20 Thread Jiri Olsa
On Tue, Feb 20, 2024 at 11:51:01AM +0800, Menglong Dong wrote: SNIP > +static int get_ctx_arg_idx_aligned(struct btf *btf, const struct btf_type *t, > +int off) > +{ > + const struct btf_param *args; > + u32 offset = 0, nr_args; > + int i; > + > + n

Re: [PATCH net 03/13] mptcp: fix lockless access in subflow ULP diag

2024-02-20 Thread Paolo Abeni
On Mon, 2024-02-19 at 19:33 +0100, Eric Dumazet wrote: > On Mon, Feb 19, 2024 at 7:04 PM Paolo Abeni wrote: > > Thanks for the head-up. This later option looks preferable, to avoid > > quit a bit of noise with _ONCE annotation. Is there a syzkaller splat I > > could look at? if it landed on the ML

Re: [RFC 0/7] selftests: openvswitch: cleanups for running as selftests

2024-02-20 Thread Aaron Conole
Jakub Kicinski writes: > On Fri, 16 Feb 2024 10:28:39 -0500 Aaron Conole wrote: >> The series is a host of cleanups to the openvswitch selftest suite >> which should be ready to run under the netdev selftest runners using >> vng. For now, the testing has been done with RW directories, but >> add

Re: [PATCH net 03/13] mptcp: fix lockless access in subflow ULP diag

2024-02-20 Thread Eric Dumazet
On Tue, Feb 20, 2024 at 6:33 PM Paolo Abeni wrote: > > On Mon, 2024-02-19 at 19:33 +0100, Eric Dumazet wrote: > > On Mon, Feb 19, 2024 at 7:04 PM Paolo Abeni wrote: > > > Thanks for the head-up. This later option looks preferable, to avoid > > > quit a bit of noise with _ONCE annotation. Is there

kselftest/next kselftest-livepatch: 1 runs, 1 regressions (v6.8-rc1-33-gf17d8a87ecb55)

2024-02-20 Thread kernelci.org bot
kselftest/next kselftest-livepatch: 1 runs, 1 regressions (v6.8-rc1-33-gf17d8a87ecb55) Regressions Summary --- platform| arch | lab | compiler | defconfig | regressions +--+---+--+--

kselftest/next kselftest-lkdtm: 2 runs, 1 regressions (v6.8-rc1-33-gf17d8a87ecb55)

2024-02-20 Thread kernelci.org bot
kselftest/next kselftest-lkdtm: 2 runs, 1 regressions (v6.8-rc1-33-gf17d8a87ecb55) Regressions Summary --- platform| arch | lab | compiler | defconfig | regressions +--+---+--+--

Re: [PATCH bpf-next 1/5] bpf: tracing: add support to record and check the accessed args

2024-02-20 Thread Kui-Feng Lee
On 2/19/24 19:51, Menglong Dong wrote: In this commit, we add the 'accessed_args' field to struct bpf_prog_aux, which is used to record the accessed index of the function args in btf_ctx_access(). Meanwhile, we add the function btf_check_func_part_match() to compare the accessed function args

Re: [PATCH v8 00/38] arm64/gcs: Provide support for GCS in userspace

2024-02-20 Thread Edgecombe, Rick P
Hi, I worked on the x86 kernel shadow stack support. I think it is an interesting suggestion. Some questions below, and I will think more on it. On Tue, 2024-02-20 at 11:36 -0500, Stefan O'Rear wrote: > While discussing the ABI implications of shadow stacks in the context > of > Zicfiss and musl

Re: [PATCH v3] bpf: Replace bpf_lpm_trie_key 0-length array with flexible array

2024-02-20 Thread Kees Cook
On Tue, Feb 20, 2024 at 11:18:40AM +0100, Daniel Borkmann wrote: > On 2/20/24 12:41 AM, Kees Cook wrote: > > Replace deprecated 0-length array in struct bpf_lpm_trie_key with > > flexible array. Found with GCC 13: > [...] > This fails the BPF CI : > > [...] > INSTALL > /tmp/work/bpf/bpf/too

[PATCH v4] bpf: Replace bpf_lpm_trie_key 0-length array with flexible array

2024-02-20 Thread Kees Cook
Replace deprecated 0-length array in struct bpf_lpm_trie_key with flexible array. Found with GCC 13: ../kernel/bpf/lpm_trie.c:207:51: warning: array subscript i is outside array bounds of 'const __u8[0]' {aka 'const unsigned char[]'} [-Warray-bounds=] 207 |

Re: [musl] Re: [PATCH v8 00/38] arm64/gcs: Provide support for GCS in userspace

2024-02-20 Thread Rich Felker
On Tue, Feb 20, 2024 at 06:41:05PM +, Edgecombe, Rick P wrote: > Hi, > > I worked on the x86 kernel shadow stack support. I think it is an > interesting suggestion. Some questions below, and I will think more on > it. > > On Tue, 2024-02-20 at 11:36 -0500, Stefan O'Rear wrote: > > While discu

[PATCH net-next v3 00/11] selftests: kselftest_harness: support using xfail

2024-02-20 Thread Jakub Kicinski
Hi! When running selftests for our subsystem in our CI we'd like all tests to pass. Currently some tests use SKIP for cases they expect to fail, because the kselftest_harness limits the return codes to pass/fail/skip. Clean up and support the use of the full range of ksft exit codes under kselfte

[PATCH net-next v3 01/11] selftests: kselftest_harness: pass step via shared memory

2024-02-20 Thread Jakub Kicinski
Commit 0ef67a888375 ("selftests/harness: Report skip reason") added shared memory to communicate between harness and test. Use that instead of exit codes to send the failing step back to the harness. The exit codes are limited and because of the step passing we can't use the full range of KSFT_* ex

[PATCH net-next v3 02/11] selftests: kselftest_harness: use KSFT_* exit codes

2024-02-20 Thread Jakub Kicinski
Now that we no longer need low exit codes to communicate assertion steps - use normal KSFT exit codes. Acked-by: Kees Cook Tested-by: Jakub Sitnicki Signed-off-by: Jakub Kicinski --- CC: keesc...@chromium.org CC: l...@amacapital.net CC: w...@chromium.org CC: sh...@kernel.org CC: m...@digikod.ne

[PATCH net-next v3 03/11] selftests: kselftest_harness: generate test name once

2024-02-20 Thread Jakub Kicinski
Since we added variant support generating full test case name takes 4 string arguments. We're about to need it in another two places. Stop the duplication and print once into a temporary buffer. Suggested-by: Jakub Sitnicki Acked-by: Kees Cook Signed-off-by: Jakub Kicinski --- tools/testing/se

[PATCH net-next v3 04/11] selftests: kselftest_harness: save full exit code in metadata

2024-02-20 Thread Jakub Kicinski
Instead of tracking passed = 0/1 rename the field to exit_code and invert the values so that they match the KSFT_* exit codes. This will allow us to fold SKIP / XFAIL into the same value. Signed-off-by: Jakub Kicinski --- tools/testing/selftests/kselftest_harness.h | 48 +++ to

[PATCH net-next v3 05/11] selftests: kselftest_harness: use exit code to store skip

2024-02-20 Thread Jakub Kicinski
We always use skip in combination with exit_code being 0 (KSFT_PASS). This are basic KSFT / KTAP semantics. Store the right KSFT_* code in exit_code directly. This makes it easier to support tests reporting other extended KSFT_* codes like XFAIL / XPASS. Signed-off-by: Jakub Kicinski --- tools/

[PATCH net-next v3 06/11] selftests: kselftest: add ksft_test_result_code(), handling all exit codes

2024-02-20 Thread Jakub Kicinski
For generic test harness code it's more useful to deal with exit codes directly, rather than having to switch on them and call the right ksft_test_result_*() helper. Add such function to kselftest.h. Note that "directive" and "diagnostic" are what ktap docs call those parts of the message. Signed

[PATCH net-next v3 07/11] selftests: kselftest_harness: print test name for SKIP

2024-02-20 Thread Jakub Kicinski
Jakub points out that for parsers it's rather useful to always have the test name on the result line. Currently if we SKIP (or soon XFAIL or XPASS), we will print: ok 17 # SKIP SCTP doesn't support IP_BIND_ADDRESS_NO_PORT ^ no test name Always print the test name. KTAP format seems to

[PATCH net-next v3 08/11] selftests: kselftest_harness: separate diagnostic message with # in ksft_test_result_code()

2024-02-20 Thread Jakub Kicinski
According to the spec we should always print a # if we add a diagnostic message. Having the caller pass in the new line as part of diagnostic message makes handling this a bit counter-intuitive, so append the new line in the helper. Signed-off-by: Jakub Kicinski --- tools/testing/selftests/kself

[PATCH net-next v3 09/11] selftests: kselftest_harness: let PASS / FAIL provide diagnostic

2024-02-20 Thread Jakub Kicinski
Switch to printing KTAP line for PASS / FAIL with ksft_test_result_code(), this gives us the ability to report diagnostic messages. Signed-off-by: Jakub Kicinski --- tools/testing/selftests/kselftest_harness.h | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/tes

[PATCH net-next v3 10/11] selftests: kselftest_harness: support using xfail

2024-02-20 Thread Jakub Kicinski
Currently some tests report skip for things they expect to fail e.g. when given combination of parameters is known to be unsupported. This is confusing because in an ideal test environment and fully featured kernel no tests should be skipped. Selftest summary line already includes xfail and xpass

[PATCH net-next v3 11/11] selftests: ip_local_port_range: use XFAIL instead of SKIP

2024-02-20 Thread Jakub Kicinski
SCTP does not support IP_LOCAL_PORT_RANGE and we know it, so use XFAIL instead of SKIP. Reviewed-by: Kees Cook Tested-by: Jakub Sitnicki Signed-off-by: Jakub Kicinski --- tools/testing/selftests/net/ip_local_port_range.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a

Re: [PATCH v8 00/38] arm64/gcs: Provide support for GCS in userspace

2024-02-20 Thread Mark Brown
On Tue, Feb 20, 2024 at 06:41:05PM +, Edgecombe, Rick P wrote: > On Tue, 2024-02-20 at 11:36 -0500, Stefan O'Rear wrote: > > 2. Shadow stack faults on non-shadow stack pages, if flexible shadow > > stack > >    handling is in effect, cause the affected page to become a shadow > > stack > >   

Re: Linux 6.8-rc5

2024-02-20 Thread Linus Torvalds
On Tue, 20 Feb 2024 at 11:57, Linus Torvalds wrote: > > It turns out that that commit is buggy for another reason, but it's > hidden by the fact that apparently KUNIT_ASSERT_FALSE_MSG() doesn't > check the format string. The fix for that is this: --- a/include/kunit/test.h +++ b/include/kuni

[PATCH v18 6/6] ring-buffer/selftest: Add ring-buffer mapping test

2024-02-20 Thread Vincent Donnefort
This test maps a ring-buffer and validate the meta-page after reset and after emitting few events. Cc: Shuah Khan Cc: Shuah Khan Cc: linux-kselftest@vger.kernel.org Signed-off-by: Vincent Donnefort diff --git a/tools/testing/selftests/ring-buffer/Makefile b/tools/testing/selftests/ring-buffer

Re: [PATCH v6 3/5] selftests/resctrl: Split validate_resctrl_feature_request()

2024-02-20 Thread Reinette Chatre
Hi Maciej, On 2/16/2024 12:35 AM, Maciej Wieczor-Retman wrote: > validate_resctrl_feature_request() is used to test both if a resource is > present in the info directory, and if a passed monitoring feature is > present in the mon_features file. > > Refactor validate_resctrl_feature_request() into

Re: [PATCH v6 4/5] selftests/resctrl: Add resource_info_file_exists()

2024-02-20 Thread Reinette Chatre
Hi Maciej, On 2/16/2024 12:35 AM, Maciej Wieczor-Retman wrote: > Feature checking done by resctrl_mon_feature_exists() covers features > represented by the feature name presence inside the 'mon_features' file > in /sys/fs/resctrl/info/L3_MON directory. There exists a different way > to represent f

[PATCH v4 1/2] KVM: s390: fix access register usage in ioctls

2024-02-20 Thread Eric Farman
The routine ar_translation() can be reached by both the instruction intercept path (where the access registers had been loaded with the guest register contents), and the MEM_OP ioctls (which hadn't). Since this routine saves the current registers to vcpu->run, this routine erroneously saves host re

[PATCH v4 0/2] KVM: s390: Fix AR parameter in ioctl

2024-02-20 Thread Eric Farman
Hi Janosch, Here is a new (final?) version for the AR/MEM_OP issue I'm attempting to address. Hopefully they can be picked up to whatever tree makes sense. Changes: v4: [HC,CB,NSG] Add tags (thank you!) [NSG] Add commentary v3: https://lore.kernel.org/r/20240216213616.3819805-1-fa

[PATCH v4 2/2] KVM: s390: selftests: memop: add a simple AR test

2024-02-20 Thread Eric Farman
There is a selftest that checks for an (expected) error when an invalid AR is specified, but not one that exercises the AR path. Add a simple test that mirrors the vanilla write/read test while providing an AR. An AR that contains zero will direct the CPU to use the primary address space normally

Re: [PATCH] selftest/ftrace: fix typo in ftracetest script

2024-02-20 Thread Shuah Khan
On 1/31/24 07:52, Masami Hiramatsu (Google) wrote: Hi, On Mon, 29 Jan 2024 21:58:07 +0530 Kousik Sanagavarapu wrote: Fix a typo in ftracetest script which is run when running the kselftests for ftrace. s/faii/fail Thanks, this looks obvious typo. Signed-off-by: Kousik Sanagavarapu Ac

Re: [PATCH] selftests: ftrace: fix typo in test description

2024-02-20 Thread Shuah Khan
On 1/31/24 08:13, Masami Hiramatsu (Google) wrote: On Wed, 31 Jan 2024 14:33:06 +0100 Ali Zahraee wrote: The typo in the description shows up in test logs and output. This patch submission is part of my application to the Linux Foundation mentorship program: Linux kernel Bug Fixing Spring Unpa

Re: [PATCH] selftests: Move KTAP bash helpers to selftests common folder

2024-02-20 Thread Shuah Khan
On 2/12/24 08:01, Nícolas F. R. A. Prado wrote: On Tue, Jan 02, 2024 at 03:15:28PM +0100, Laura Nao wrote: Move bash helpers for outputting in KTAP format to the common selftests folder. This allows kselftests other than the dt one to source the file and make use of the helper functions. Define

Re: [PATCH 0/4] selftests: ktap_helpers: Add some missing helpers

2024-02-20 Thread Shuah Khan
On 1/31/24 15:02, Nícolas F. R. A. Prado wrote: This series adds a few missing functions to the shell KTAP helpers script which are present in the C counterpart, kselftest.h. This series depends on "selftests: Move KTAP bash helpers to selftests common folder" https://lore.kernel.org/all/2024010

Re: [PATCH v5 11/12] KVM: riscv: selftests: Change vcpu_has_ext to a common function

2024-02-20 Thread Atish Patra
On Mon, Jan 22, 2024 at 1:48 AM Haibo Xu wrote: > > Move vcpu_has_ext to the processor.c and rename it to __vcpu_has_ext > so that other test cases can use it for vCPU extension check. > > Signed-off-by: Haibo Xu > Reviewed-by: Andrew Jones > --- > tools/testing/selftests/kvm/include/riscv/proc

Re: Linux 6.8-rc5

2024-02-20 Thread Shuah Khan
On 2/20/24 13:16, Linus Torvalds wrote: On Tue, 20 Feb 2024 at 11:57, Linus Torvalds wrote: It turns out that that commit is buggy for another reason, but it's hidden by the fact that apparently KUNIT_ASSERT_FALSE_MSG() doesn't check the format string. The fix for that is this: --- a/inc

Re: [musl] Re: [PATCH v8 00/38] arm64/gcs: Provide support for GCS in userspace

2024-02-20 Thread Edgecombe, Rick P
On Tue, 2024-02-20 at 13:57 -0500, Rich Felker wrote: > On Tue, Feb 20, 2024 at 06:41:05PM +, Edgecombe, Rick P wrote: > > Hmm, could the shadow stack underflow onto the real stack then? Not > > sure how bad that is. INCSSP (incrementing the SSP register on x86) > > loops are not rare so it see

Re: [PATCH v8 00/38] arm64/gcs: Provide support for GCS in userspace

2024-02-20 Thread Edgecombe, Rick P
On Tue, 2024-02-20 at 20:14 +, Mark Brown wrote: > > Hmm, could the shadow stack underflow onto the real stack then? Not > > sure how bad that is. INCSSP (incrementing the SSP register on x86) > > loops are not rare so it seems like something that could happen. > > Yes, they'd trash any pages

Re: [PATCH v4 0/3] selftests: add missing gitignore files and include generated objects

2024-02-20 Thread Shuah Khan
On 2/13/24 17:03, Javier Carrasco wrote: This series aims to keep the git status clean after building the selftests by adding some missing .gitignore files and object inclusion in existing .gitignore files. This is one of the requirements listed in the selftests documentation for new tests, but i

Re: [PATCH] selftest: ftrace: fix minor typo in log

2024-02-20 Thread Shuah Khan
On 2/11/24 04:18, Vincenzo Mezzela wrote: Resolves a spelling error in the test log, preventing potential confusion. Signed-off-by: Vincenzo Mezzela --- It is submitted as part of my application to the "Linux Kernel Bug Fixing Spring Unpaid 2024" mentorship program of the Linux Foundation.

Re: [PATCH RESEND] selftests/ftrace: Add test to exercize function tracer across cpu hotplug

2024-02-20 Thread Shuah Khan
On 2/16/24 07:23, Steven Rostedt wrote: On Fri, 16 Feb 2024 15:26:26 +0530 Naveen N Rao wrote: Add a test to exercize cpu hotplug with the function tracer active to ensure that sensitive functions in idle path are excluded from being traced. This helps catch issues such as the one fixed by com

Re: [PATCH] tools: selftests: Remove unnecessary semicolons

2024-02-20 Thread Shuah Khan
On 2/13/24 05:23, Thorsten Blum wrote: Remove unnecessary semicolons reported by Coccinelle/coccicheck and the semantic patch at scripts/coccinelle/misc/semicolon.cocci. Signed-off-by: Thorsten Blum --- tools/testing/selftests/bpf/benchs/bench_local_storage_create.c | 2 +- tools/testing/sel

Re: [musl] Re: [PATCH v8 00/38] arm64/gcs: Provide support for GCS in userspace

2024-02-20 Thread dal...@libc.org
On Tue, Feb 20, 2024 at 11:30:22PM +, Edgecombe, Rick P wrote: > On Tue, 2024-02-20 at 13:57 -0500, Rich Felker wrote: > > On Tue, Feb 20, 2024 at 06:41:05PM +, Edgecombe, Rick P wrote: > > > Hmm, could the shadow stack underflow onto the real stack then? Not > > > sure how bad that is. INC

Re: [PATCH] selftest: ftrace: fix minor typo in log

2024-02-20 Thread Steven Rostedt
On Tue, 20 Feb 2024 16:41:01 -0700 Shuah Khan wrote: > Steve, > > I picked this up fpr next for Linux 6.9-rc1 Sure, and you can add my: Acked-by: Steven Rostedt (Google) Thanks Shuah, -- Steve

Re: [musl] Re: [PATCH v8 00/38] arm64/gcs: Provide support for GCS in userspace

2024-02-20 Thread Stefan O'Rear
On Tue, Feb 20, 2024, at 6:30 PM, Edgecombe, Rick P wrote: > On Tue, 2024-02-20 at 13:57 -0500, Rich Felker wrote: >> On Tue, Feb 20, 2024 at 06:41:05PM +, Edgecombe, Rick P wrote: >> > Hmm, could the shadow stack underflow onto the real stack then? Not >> > sure how bad that is. INCSSP (increm

Re: [PATCH 08/10] selftests/sched: Migrate cs_prctl_test to kselfttest

2024-02-20 Thread Shuah Khan
On 2/16/24 12:18, Chris Hyser wrote: On 2/16/24 13:31, Joel Fernandes (Google) wrote: This test begs to be a kselftest, is in the kselftest hierarchy and does not even use a single kselftest API. Convert it. It simplifies some of the code and the output also looks much nicer now:   Totals: pa

Re: [PATCH v3] selftests/mqueue: Set timeout to 180 seconds

2024-02-20 Thread Shuah Khan
On 2/19/24 17:08, SeongJae Park wrote: While mq_perf_tests runs with the default kselftest timeout limit, which is 45 seconds, the test takes about 60 seconds to complete on i3.metal AWS instances. Hence, the test always times out. Increase the timeout to 180 seconds. Fixes: 852c8cbf34d3 ("sel

Re: [PATCH 1/3] selftests: lib.mk: Do not process TEST_GEN_MODS_DIR

2024-02-20 Thread Shuah Khan
On 2/19/24 06:53, Marcos Paulo de Souza wrote: On Mon, 19 Feb 2024 09:15:15 -0300 Marcos Paulo de Souza wrote: On Mon, 19 Feb 2024 14:35:16 +0800 kernel test robot wrote: Hi Marcos, kernel test robot noticed the following build errors: [auto build test ERROR on 345e8abe4c355bc24bab3f4a56

Re: [PATCH 08/10] selftests/sched: Migrate cs_prctl_test to kselfttest

2024-02-20 Thread Joel Fernandes
On 2/20/2024 7:03 PM, Shuah Khan wrote: > On 2/16/24 12:18, Chris Hyser wrote: >> On 2/16/24 13:31, Joel Fernandes (Google) wrote: >> >>> This test begs to be a kselftest, is in the kselftest hierarchy and does >>> not even use a single kselftest API. Convert it. >>> >>> It simplifies some of th

Re: [PATCH 08/10] selftests/sched: Migrate cs_prctl_test to kselfttest

2024-02-20 Thread Joel Fernandes
On 2/20/2024 7:03 PM, Shuah Khan wrote: > On 2/16/24 12:18, Chris Hyser wrote: >> On 2/16/24 13:31, Joel Fernandes (Google) wrote: >> >>> This test begs to be a kselftest, is in the kselftest hierarchy and does >>> not even use a single kselftest API. Convert it. >>> >>> It simplifies some of th

Re: [PATCH][next] selftests: sched: Fix spelling mistake "hiearchy" -> "hierarchy"

2024-02-20 Thread Shuah Khan
On 2/20/24 02:23, Colin Ian King wrote: There is a spelling mistake in a printed message. Fix it. Signed-off-by: Colin Ian King --- tools/testing/selftests/sched/cs_prctl_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/sched/cs_prctl_test.c

Re: [musl] Re: [PATCH v8 00/38] arm64/gcs: Provide support for GCS in userspace

2024-02-20 Thread Edgecombe, Rick P
On Tue, 2024-02-20 at 18:54 -0500, dal...@libc.org wrote: > On Tue, Feb 20, 2024 at 11:30:22PM +, Edgecombe, Rick P wrote: > > On Tue, 2024-02-20 at 13:57 -0500, Rich Felker wrote: > > > On Tue, Feb 20, 2024 at 06:41:05PM +, Edgecombe, Rick P > > > wrote: > > > > Hmm, could the shadow stack

Re: [musl] Re: [PATCH v8 00/38] arm64/gcs: Provide support for GCS in userspace

2024-02-20 Thread Mark Brown
On Tue, Feb 20, 2024 at 06:59:58PM -0500, Stefan O'Rear wrote: > On Tue, Feb 20, 2024, at 6:30 PM, Edgecombe, Rick P wrote: > > Maybe I'm misunderstanding. I thought the proposal included allowing > > shadow stack access to convert normal address ranges to shadow stack, > > and normal writes to co

Re: [musl] Re: [PATCH v8 00/38] arm64/gcs: Provide support for GCS in userspace

2024-02-20 Thread Mark Brown
On Wed, Feb 21, 2024 at 12:35:48AM +, Edgecombe, Rick P wrote: > doing. But those threads might be using shadow stack instructions > (INCSSP, RSTORSSP, etc). These are a collection of instructions that > allow limited control of the SSP. When shadow stack gets disabled, > these suddenly turn i

Re: [PATCH net-next v3 05/11] selftests: kselftest_harness: use exit code to store skip

2024-02-20 Thread Kees Cook
On Tue, Feb 20, 2024 at 11:22:29AM -0800, Jakub Kicinski wrote: > We always use skip in combination with exit_code being 0 > (KSFT_PASS). This are basic KSFT / KTAP semantics. > Store the right KSFT_* code in exit_code directly. > > This makes it easier to support tests reporting other > extended

Re: [PATCH net-next v3 06/11] selftests: kselftest: add ksft_test_result_code(), handling all exit codes

2024-02-20 Thread Kees Cook
On Tue, Feb 20, 2024 at 11:22:30AM -0800, Jakub Kicinski wrote: > For generic test harness code it's more useful to deal with exit > codes directly, rather than having to switch on them and call > the right ksft_test_result_*() helper. Add such function to kselftest.h. > > Note that "directive" an

Re: [PATCH net-next v3 07/11] selftests: kselftest_harness: print test name for SKIP

2024-02-20 Thread Kees Cook
On Tue, Feb 20, 2024 at 11:22:31AM -0800, Jakub Kicinski wrote: > Jakub points out that for parsers it's rather useful to always > have the test name on the result line. Currently if we SKIP > (or soon XFAIL or XPASS), we will print: > > ok 17 # SKIP SCTP doesn't support IP_BIND_ADDRESS_NO_PORT >

  1   2   >