Re: [PATCH] selftests/bpf: Fix incorrect parameters in NULL pointer checking

2024-08-23 Thread Hao Ge
Hi Yonghong Thank you very much for taking the time to review my patch. On 8/22/24 05:03, Yonghong Song wrote: On 8/19/24 7:34 PM, Hao Ge wrote: From: Hao Ge Smatch reported the following warning: ./tools/testing/selftests/bpf/testing_helpers.c:455 get_xlated_program() warn: v

Re: [PATCH] selftests/bpf: Fix incorrect parameters in NULL pointer checking

2024-08-23 Thread Hao Ge
Hi Dan and Alexei I apologize for any inconvenience my mistake may have caused to both of you. On 8/22/24 06:31, Dan Carpenter wrote: On Wed, Aug 21, 2024 at 03:07:27PM -0700, Alexei Starovoitov wrote: On Wed, Aug 21, 2024 at 2:50 PM Dan Carpenter wrote: On Wed, Aug 21, 2024 at 02:03:17PM

Re: [PATCH 2/3] selftests: kvm: s390: Add uc_skey VM test case

2024-08-23 Thread Janosch Frank
On 8/19/24 6:00 PM, Christoph Schlameuss wrote: On Fri Aug 16, 2024 at 4:36 PM CEST, Janosch Frank wrote: On 8/15/24 5:45 PM, Christoph Schlameuss wrote: [...] +TEST_F(uc_kvm, uc_skey) +{ + u64 test_vaddr = self->base_gpa + VM_MEM_SIZE - (SZ_1M / 2); + struct kvm_sync_regs *sync_re

Re: [PATCH 1/3] selftests: kvm: s390: Add uc_map_unmap VM test case

2024-08-23 Thread Janosch Frank
On 8/19/24 6:03 PM, Christoph Schlameuss wrote: On Fri Aug 16, 2024 at 4:29 PM CEST, Janosch Frank wrote: On 8/15/24 5:45 PM, Christoph Schlameuss wrote: Add a test case verifying basic running and interaction of ucontrol VMs. Fill the segment and page tables for allocated memory and map memory

Re: [PATCH v11 24/39] arm64/signal: Set up and restore the GCS context for signal handlers

2024-08-23 Thread Catalin Marinas
On Thu, Aug 22, 2024 at 02:15:27AM +0100, Mark Brown wrote: > When invoking a signal handler we use the GCS configuration and stack > for the current thread. > > Since we implement signal return by calling the signal handler with a > return address set up pointing to a trampoline in the vDSO we ne

Re: [PATCH v11 25/39] arm64/signal: Expose GCS state in signal frames

2024-08-23 Thread Catalin Marinas
On Thu, Aug 22, 2024 at 02:15:28AM +0100, Mark Brown wrote: > +static int preserve_gcs_context(struct gcs_context __user *ctx) > +{ > + int err = 0; > + u64 gcspr; > + > + /* > + * We will add a cap token to the frame, include it in the > + * GCSPR_EL0 we report to support sta

Re: [PATCH v11 26/39] arm64/ptrace: Expose GCS via ptrace and core files

2024-08-23 Thread Catalin Marinas
On Thu, Aug 22, 2024 at 02:15:29AM +0100, Mark Brown wrote: > Provide a new register type NT_ARM_GCS reporting the current GCS mode > and pointer for EL0. Due to the interactions with allocation and > deallocation of Guarded Control Stacks we do not permit any changes to > the GCS mode via ptrace,

Re: [PATCH v11 27/39] arm64: Add Kconfig for Guarded Control Stack (GCS)

2024-08-23 Thread Catalin Marinas
On Thu, Aug 22, 2024 at 02:15:30AM +0100, Mark Brown wrote: > diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig > index a2f8ff354ca6..772f9ba99fe8 100644 > --- a/arch/arm64/Kconfig > +++ b/arch/arm64/Kconfig > @@ -2137,6 +2137,26 @@ config ARM64_EPAN > if the cpu does not implement the f

Re: [PATCH v11 25/39] arm64/signal: Expose GCS state in signal frames

2024-08-23 Thread Mark Brown
On Fri, Aug 23, 2024 at 10:37:19AM +0100, Catalin Marinas wrote: > On Thu, Aug 22, 2024 at 02:15:28AM +0100, Mark Brown wrote: > > + gcs_preserve_current_state(); > > + gcspr = current->thread.gcspr_el0 - 8; > > + __put_user_error(gcspr, &ctx->gcspr, err); > Do we actually need to store th

Re: [PATCH v2 3/3] kselftest: Provide __cpuid_count() stub on non-x86 archs

2024-08-23 Thread Ilpo Järvinen
On Thu, 22 Aug 2024, Reinette Chatre wrote: > Hi Ilpo, > > On 8/22/24 1:11 AM, Ilpo Järvinen wrote: > > Building resctrl selftest fails on ARM because it uses __cpuid_count() > > that fails the build with error: > > > >CC resctrl_tests > > In file included from resctrl.h:24, > >

Re: [PATCH] selftests/livepatch: wait for atomic replace to occur

2024-08-23 Thread Petr Mladek
Hi, this is 2nd version of the patch. There should have been used [PATCH v2] in the Subject to make it clear in the mailbox. On Thu 2024-08-22 13:31:22, Ryan Sullivan wrote: > On some machines with a large number of CPUs there is a sizable delay > between an atomic replace occurring and when sysf

Re: [PATCH 1/3] selftests: kvm: s390: Add uc_map_unmap VM test case

2024-08-23 Thread Christoph Schlameuss
On Fri Aug 23, 2024 at 10:02 AM CEST, Janosch Frank wrote: > On 8/19/24 6:03 PM, Christoph Schlameuss wrote: > > On Fri Aug 16, 2024 at 4:29 PM CEST, Janosch Frank wrote: > >> On 8/15/24 5:45 PM, Christoph Schlameuss wrote: > >>> Add a test case verifying basic running and interaction of ucontrol V

Re: [PATCH] selftests/livepatch: wait for atomic replace to occur

2024-08-23 Thread Ryan B. Sullivan
Changes from v2: Adds: Reported-by: CKI Project Closes: https://datawarehouse.cki-project.org/kcidb/tests/redhat:1413102084-x86_64-kernel_upt_28 >From 9d9bfb21e86a3a79fb92fd22d927329510c6a672 Mon Sep 17 00:00:00 2001 From: Ryan Sullivan Date: Thu, 22 Aug 2024 12:19:54 -0400 Subj

[PATCH v3 0/5] KVM: s390: selftests: Add regression tests for CPU subfunctions

2024-08-23 Thread Hariharan Mari
This patch series introduces a set of regression tests for various s390x CPU subfunctions in KVM. The tests ensure that the KVM implementation accurately reflects the behavior of actual CPU instructions for these subfunctions. The series adds tests for a total of 15 instructions across five patche

[PATCH v3 1/5] KVM: s390: selftests: Add regression tests for SORTL and DFLTCC CPU subfunctions

2024-08-23 Thread Hariharan Mari
Introduce new regression tests to verify the ASM inline block in the SORTL and DFLTCC CPU subfunctions for the s390x architecture. These tests ensure that future changes to the ASM code are properly validated. The test procedure: 1. Create a VM and request the KVM_S390_VM_CPU_MACHINE_SUBFUNC attr

[PATCH v3 2/5] KVM: s390: selftests: Add regression tests for PRNO, KDSA and KMA crypto subfunctions

2024-08-23 Thread Hariharan Mari
Extend the existing regression test framework for s390x CPU subfunctions to include tests for the PRNO (Perform Random Number Operation), KDSA (Compute Digital Signature Authentication) and KMA (Cipher Message with Authentication) crypto functions. The test procedure follows the established patter

[PATCH v3 3/5] KVM: s390: selftests: Add regression tests for KMCTR, KMF, KMO and PCC crypto subfunctions

2024-08-23 Thread Hariharan Mari
Extend the existing regression test framework for s390x CPU subfunctions to include tests for the KMCTR (Cipher Message with Counter) KMO (Cipher Message with Output Feedback), KMF (Cipher Message with Cipher Feedback) and PCC (Perform Cryptographic Computation) crypto functions. The test procedur

[PATCH v3 4/5] KVM: s390: selftests: Add regression tests for KMAC, KMC, KM, KIMD and KLMD crypto subfunctions

2024-08-23 Thread Hariharan Mari
Extend the existing regression test framework for s390x CPU subfunctions to include tests for the KMAC (Compute Message Authentication Code), KMC (Cipher Message with Chaining), KM (Cipher Message) KIMD (Compute Intermediate Message Digest) and KLMD (Compute Last Message Digest) crypto functions.

[PATCH v3 5/5] KVM: s390: selftests: Add regression tests for PLO subfunctions

2024-08-23 Thread Hariharan Mari
Extend the existing regression test framework for s390x CPU subfunctions to include tests for the Perform Locked Operation (PLO) subfunction functions. PLO was introduced in the very first 64-bit machine generation. Hence it is assumed PLO is always installed in the Z Arch. The test procedure foll

Re: [PATCH 1/3] selftests: kvm: s390: Add uc_map_unmap VM test case

2024-08-23 Thread Janosch Frank
On 8/23/24 3:03 PM, Christoph Schlameuss wrote: On Fri Aug 23, 2024 at 10:02 AM CEST, Janosch Frank wrote: On 8/19/24 6:03 PM, Christoph Schlameuss wrote: On Fri Aug 16, 2024 at 4:29 PM CEST, Janosch Frank wrote: On 8/15/24 5:45 PM, Christoph Schlameuss wrote: Add a test case verifying basic

Re: [PATCH v5 04/30] arm64: disable trapping of POR_EL0 to EL2

2024-08-23 Thread Will Deacon
On Thu, Aug 22, 2024 at 04:10:47PM +0100, Joey Gouly wrote: > Allow EL0 or EL1 to access POR_EL0 without being trapped to EL2. > > Signed-off-by: Joey Gouly > Cc: Catalin Marinas > Cc: Will Deacon > Acked-by: Catalin Marinas > Reviewed-by: Anshuman Khandual > --- > arch/arm64/include/asm/el2

Re: [PATCH v5 08/30] KVM: arm64: make kvm_at() take an OP_AT_*

2024-08-23 Thread Will Deacon
On Thu, Aug 22, 2024 at 04:10:51PM +0100, Joey Gouly wrote: > To allow using newer instructions that current assemblers don't know about, > replace the `at` instruction with the underlying SYS instruction. > > Signed-off-by: Joey Gouly > Cc: Marc Zyngier > Cc: Oliver Upton > Cc: Catalin Marinas

Re: [PATCH v3 5/5] KVM: s390: selftests: Add regression tests for PLO subfunctions

2024-08-23 Thread Christoph Schlameuss
On Fri Aug 23, 2024 at 3:05 PM CEST, Hariharan Mari wrote: > Extend the existing regression test framework for s390x CPU subfunctions > to include tests for the Perform Locked Operation (PLO) subfunction > functions. > > PLO was introduced in the very first 64-bit machine generation. > Hence it is

Re: [PATCH v5 08/30] KVM: arm64: make kvm_at() take an OP_AT_*

2024-08-23 Thread Marc Zyngier
On Fri, 23 Aug 2024 14:48:11 +0100, Will Deacon wrote: > > On Thu, Aug 22, 2024 at 04:10:51PM +0100, Joey Gouly wrote: > > To allow using newer instructions that current assemblers don't know about, > > replace the `at` instruction with the underlying SYS instruction. > > > > Signed-off-by: Joey

Re: [PATCH net-next v3 2/8] selftests/net: Provide test_snprintf() helper

2024-08-23 Thread Dmitry Safonov
On Thu, 22 Aug 2024 at 11:13, Simon Horman wrote: > > On Wed, Aug 21, 2024 at 10:35:10PM +0100, Dmitry Safonov wrote: > > Hi Simon, > > > > On Wed, 21 Aug 2024 at 20:10, Simon Horman wrote: > > > [..] > > > Hi Dmitry, > > > > > > Some minor nits, as it looks like there will be a v4. > > > > Thank

Re: [PATCH v5 06/30] arm64: context switch POR_EL0 register

2024-08-23 Thread Will Deacon
On Thu, Aug 22, 2024 at 04:10:49PM +0100, Joey Gouly wrote: > POR_EL0 is a register that can be modified by userspace directly, > so it must be context switched. > > Signed-off-by: Joey Gouly > Cc: Catalin Marinas > Cc: Will Deacon > Reviewed-by: Catalin Marinas > --- > arch/arm64/include/asm

Re: [PATCH v3 1/5] KVM: s390: selftests: Add regression tests for SORTL and DFLTCC CPU subfunctions

2024-08-23 Thread Christoph Schlameuss
On Fri Aug 23, 2024 at 3:05 PM CEST, Hariharan Mari wrote: > Introduce new regression tests to verify the ASM inline block in the SORTL > and DFLTCC CPU subfunctions for the s390x architecture. These tests ensure > that future changes to the ASM code are properly validated. > > The test procedure:

[PATCH net-next v14 01/11] mm: page_frag: add a test module for page_frag

2024-08-23 Thread Yunsheng Lin
The testing is done by ensuring that the fragment allocated from a frag_frag_cache instance is pushed into a ptr_ring instance in a kthread binded to a specified cpu, and a kthread binded to a specified cpu will pop the fragment from the ptr_ring and free the fragment. CC: Alexander Duyck Signed-

[PATCH net-next v14 02/11] mm: move the page fragment allocator from page_alloc into its own file

2024-08-23 Thread Yunsheng Lin
Inspired by [1], move the page fragment allocator from page_alloc into its own c file and header file, as we are about to make more change for it to replace another page_frag implementation in sock.c As this patchset is going to replace 'struct page_frag' with 'struct page_frag_cache' in sched.h,

[PATCH net-next v14 04/11] mm: page_frag: avoid caller accessing 'page_frag_cache' directly

2024-08-23 Thread Yunsheng Lin
Use appropriate frag_page API instead of caller accessing 'page_frag_cache' directly. CC: Alexander Duyck Signed-off-by: Yunsheng Lin Reviewed-by: Alexander Duyck Acked-by: Chuck Lever --- drivers/vhost/net.c | 2 +- include/linux/page_frag_cache.h

Re: [PATCH v11 25/39] arm64/signal: Expose GCS state in signal frames

2024-08-23 Thread Catalin Marinas
On Fri, Aug 23, 2024 at 11:25:30AM +0100, Mark Brown wrote: > On Fri, Aug 23, 2024 at 10:37:19AM +0100, Catalin Marinas wrote: > > On Thu, Aug 22, 2024 at 02:15:28AM +0100, Mark Brown wrote: > > > > + gcs_preserve_current_state(); > > > + gcspr = current->thread.gcspr_el0 - 8; > > > > + __put_use

Re: [PATCH v2 3/3] kselftest: Provide __cpuid_count() stub on non-x86 archs

2024-08-23 Thread Reinette Chatre
Hi Ilpo, On 8/23/24 3:47 AM, Ilpo Järvinen wrote: On Thu, 22 Aug 2024, Reinette Chatre wrote: On 8/22/24 1:11 AM, Ilpo Järvinen wrote: Building resctrl selftest fails on ARM because it uses __cpuid_count() that fails the build with error: CC resctrl_tests In file included from resct

Re: [PATCH rc 2/2] iommu: Do not return 0 from map_pages if it doesn't do anything

2024-08-23 Thread Will Deacon
On Thu, Aug 22, 2024 at 11:45:55AM -0300, Jason Gunthorpe wrote: > These three implementations of map_pages() all succeed if a mapping is > requested with no read or write. Since they return back to __iommu_map() > leaving the mapped output as 0 it triggers an infinite loop. Therefore > nothing is

[PATCH net-next] selftests: forwarding: no_forwarding: Down ports on cleanup

2024-08-23 Thread Petr Machata
This test neglects to put ports down on cleanup. Fix it. Fixes: 476a4f05d9b8 ("selftests: forwarding: add a no_forwarding.sh test") Signed-off-by: Petr Machata --- tools/testing/selftests/net/forwarding/no_forwarding.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/testing/selftes

Re: [PATCH rc 1/2] iommufd: Do not allow creating areas without READ or WRITE

2024-08-23 Thread Nicolin Chen
On Thu, Aug 22, 2024 at 11:45:54AM -0300, Jason Gunthorpe wrote: > This results in passing 0 or just IOMMU_CACHE to iommu_map(). Most of > the page table formats don't like this: > > amdv1 - -EINVAL > armv7s - returns 0, doesn't update mapped > arm-lpae - returns 0 doesn't update mapped >

Re: [PATCH v5 06/30] arm64: context switch POR_EL0 register

2024-08-23 Thread Catalin Marinas
On Fri, Aug 23, 2024 at 03:45:32PM +0100, Will Deacon wrote: > On Thu, Aug 22, 2024 at 04:10:49PM +0100, Joey Gouly wrote: > > +static void permission_overlay_switch(struct task_struct *next) > > +{ > > + if (!system_supports_poe()) > > + return; > > + > > + current->thread.por_el0 =

Re: [PATCH v3] kselftest/arm64: signal: fix/refactor SVE vector length enumeration

2024-08-23 Thread Will Deacon
On Wed, 21 Aug 2024 17:44:01 +0100, Andre Przywara wrote: > Currently a number of SVE/SME related tests have almost identical > functions to enumerate all supported vector lengths. However over time > the copy&pasted code has diverged, allowing some bugs to creep in: > - fake_sigreturn_sme_change_v

Re: [PATCH v5 06/30] arm64: context switch POR_EL0 register

2024-08-23 Thread Will Deacon
On Fri, Aug 23, 2024 at 05:41:06PM +0100, Catalin Marinas wrote: > On Fri, Aug 23, 2024 at 03:45:32PM +0100, Will Deacon wrote: > > On Thu, Aug 22, 2024 at 04:10:49PM +0100, Joey Gouly wrote: > > > +static void permission_overlay_switch(struct task_struct *next) > > > +{ > > > + if (!system_support

Re: [PATCH net-next] selftests: forwarding: no_forwarding: Down ports on cleanup

2024-08-23 Thread Simon Horman
On Fri, Aug 23, 2024 at 06:25:37PM +0200, Petr Machata wrote: > This test neglects to put ports down on cleanup. Fix it. > > Fixes: 476a4f05d9b8 ("selftests: forwarding: add a no_forwarding.sh test") > Signed-off-by: Petr Machata Reviewed-by: Simon Horman

[PATCH nf-next v2 1/2] netfilter: Make IP_NF_IPTABLES_LEGACY selectable

2024-08-23 Thread Breno Leitao
This option makes IP_NF_IPTABLES_LEGACY user selectable, giving users the option to configure iptables without enabling any other config. Suggested-by: Florian Westphal Signed-off-by: Breno Leitao --- net/ipv4/netfilter/Kconfig | 19 +++ tools/testing/selftests/net/confi

[PATCH nf-next v2 2/2] netfilter: Make IP6_NF_IPTABLES_LEGACY selectable

2024-08-23 Thread Breno Leitao
This option makes IP6_NF_IPTABLES_LEGACY user selectable, giving users the option to configure iptables without enabling any other config. Signed-off-by: Breno Leitao --- net/ipv6/netfilter/Kconfig | 22 -- tools/testing/selftests/net/config | 1 + 2 files changed, 1

Re: [PATCH v5 06/30] arm64: context switch POR_EL0 register

2024-08-23 Thread Catalin Marinas
On Fri, Aug 23, 2024 at 06:08:36PM +0100, Will Deacon wrote: > On Fri, Aug 23, 2024 at 05:41:06PM +0100, Catalin Marinas wrote: > > On Fri, Aug 23, 2024 at 03:45:32PM +0100, Will Deacon wrote: > > > On Thu, Aug 22, 2024 at 04:10:49PM +0100, Joey Gouly wrote: > > > > +static void permission_overlay_

[RFC PATCH v1 6/6] selftests/rseq: Implement NUMA node id vs mm_cid invariant test

2024-08-23 Thread Mathieu Desnoyers
This test validates that the mapping between a mm_cid and a NUMA node id remains invariant for the process lifetime for a process with a number of threads >= number of allowed CPUs. In other words, it validates that if any thread within the process running on behalf of a mm_cid N observes a NUMA no

[RFC PATCH v1 5/6] selftests/rseq: x86: Implement rseq_load_u32_u32

2024-08-23 Thread Mathieu Desnoyers
Allow loading a pair of u32 within a rseq critical section. It can be used in situations where both rseq_abi()->mm_cid and rseq_abi()->node_id need to be sampled atomically with respect to preemption, signal delivery and migration. Signed-off-by: Mathieu Desnoyers Reviewed-by: Shuah Khan Cc: Pet

Re: Re: [PATCH 1/1] Improve missing mods error message and make shell script executable

2024-08-23 Thread David Hunter
> If you say "also" there's a good chance the commit should be split into two.. I am splitting original patch into 2 separate patches. I forgot to do the reply all command on kernel lore. Here is the link to version 2 for the improving the missing modules error message: https://lore.kernel.org

Re: [PATCH bpf-next v2 4/8] libbpf: Support BTF.ext loading and output in either endianness

2024-08-23 Thread Andrii Nakryiko
On Thu, Aug 22, 2024 at 4:36 PM Andrii Nakryiko wrote: > > I ran out of time looking through this, I'll try to get back to this > patch set later today or tomorrow. So please don't repost, but see my > comments below. > > On Thu, Aug 22, 2024 at 2:25 AM Tony Ambardar wrote: > > > > From: Tony Amb

Re: [PATCH bpf-next v2 5/8] libbpf: Support opening bpf objects of either endianness

2024-08-23 Thread Andrii Nakryiko
On Thu, Aug 22, 2024 at 2:25 AM Tony Ambardar wrote: > > From: Tony Ambardar > > Allow bpf_object__open() to access files of either endianness, and convert > included BPF programs to native byte-order in-memory for introspection. > > Signed-off-by: Tony Ambardar > --- > tools/lib/bpf/libbpf.c

Re: [PATCH bpf-next v2 6/8] libbpf: Support linking bpf objects of either endianness

2024-08-23 Thread Andrii Nakryiko
On Thu, Aug 22, 2024 at 2:25 AM Tony Ambardar wrote: > > From: Tony Ambardar > > Allow static linking object files of either endianness, checking that input > files have consistent byte-order, and setting output endianness from input. > > Linking requires in-memory processing of programs, relocat

Re: [PATCH bpf-next v2 7/8] libbpf: Support creating light skeleton of either endianness

2024-08-23 Thread Andrii Nakryiko
On Thu, Aug 22, 2024 at 2:25 AM Tony Ambardar wrote: > > From: Tony Ambardar > > Track target endianness in 'struct bpf_gen' and process in-memory data in > native byte-order, but on finalization convert the embedded loader BPF > insns to target endianness. > > The light skeleton also includes a

[PATCH 0/2] Exposing nice CPU usage to userspace

2024-08-23 Thread Joshua
From: Joshua Hahn Niced CPU usage is a metric reported in host-level /proc/stat, but is not reported in cgroup-level statistics in cpu.stat. However, when a host contains multiple tasks across different workloads, it becomes difficult to gauage how much of the task is being spent on niced process

[PATCH 1/2] Tracking cgroup-level niced CPU time

2024-08-23 Thread Joshua
From: Joshua Hahn Cgroup-level CPU statistics currently include time spent on user/system processes, but do not include niced CPU time (despite already being tracked). This patch exposes niced CPU time to the userspace, allowing users to get a better understanding of their hardware limits and can

[PATCH 2/2] Selftests for niced CPU statistics

2024-08-23 Thread Joshua
From: Joshua Hahn Creates a cgroup with a single nice CPU hog process running. fork() is called to generate the nice process because un-nicing is not possible (see man nice(3)). If fork() was not used to generate the CPU hog, we would run the rest of the cgroup selftest suite as a nice process. -

Re: [PATCH v2 8/9] KVM: selftests: Add a CoCo-specific test for KVM_PRE_FAULT_MEMORY

2024-08-23 Thread Pratik R. Sampat
On 8/16/2024 2:23 PM, Pratik R. Sampat wrote: > From: Michael Roth > > SEV, SEV-ES, and SNP have a few corner cases where there is potential > for KVM_PRE_FAULT_MEMORY to behave differently depending on when it is > issued during initial guest setup. Exercising these various paths > requires a

[PATCH 1/2] tcp: add SO_PEEK_OFF socket option tor TCPv6

2024-08-23 Thread jmaloy
From: Jon Maloy When we added the SO_PEEK_OFF socket option to TCP we forgot to add it even for TCP on IPv6. We do that here. Fixes: 05ea491641d3 ("tcp: add support for SO_PEEK_OFF socket option") Reviewed-by: David Gibson Reviewed-by: Stefano Brivio Tested-by: Stefano Brivio Signed-off-by:

[PATCH 0/2] Adding SO_PEEK_OFF for TCPv6

2024-08-23 Thread jmaloy
From: Jon Maloy Adding SO_PEEK_OFF for TCPv6 and selftest for both TCPv4 and TCPv6. Jon Maloy (2): tcp: add SO_PEEK_OFF socket option tor TCPv6 selftests: add selftest for tcp SO_PEEK_OFF support net/ipv6/af_inet6.c | 1 + tools/testing/selftests/net/Makefile

[PATCH 2/2] selftests: add selftest for tcp SO_PEEK_OFF support

2024-08-23 Thread jmaloy
From: Jon Maloy We add a selftest to check that the new feature added in commit 05ea491641d3 ("tcp: add support for SO_PEEK_OFF socket option") works correctly. Reviewed-by: Stefano Brivio Tested-by: Stefano Brivio Signed-off-by: Jon Maloy --- tools/testing/selftests/net/Makefile |

Re: [PATCH v11 25/39] arm64/signal: Expose GCS state in signal frames

2024-08-23 Thread Mark Brown
On Fri, Aug 23, 2024 at 04:59:11PM +0100, Catalin Marinas wrote: > On Fri, Aug 23, 2024 at 11:25:30AM +0100, Mark Brown wrote: > > We could store either the cap token or the interrupted GCSPR_EL0 (the > > address below the cap token). It felt more joined up to go with the cap > > token since noti

[PATCH net-next v4 2/8] selftests/net: Provide test_snprintf() helper

2024-08-23 Thread Dmitry Safonov via B4 Relay
From: Dmitry Safonov <0x7f454...@gmail.com> Instead of pre-allocating a fixed-sized buffer of TEST_MSG_BUFFER_SIZE and printing into it, call vsnprintf() with str = NULL, which will return the needed size of the buffer. This hack is documented in man 3 vsnprintf. Essentially, in C++ terms, it re-

[PATCH net-next v4 1/8] selftests/net: Clean-up double assignment

2024-08-23 Thread Dmitry Safonov via B4 Relay
From: Dmitry Safonov <0x7f454...@gmail.com> Correct copy'n'paste typo: the previous line already initialises get_all to 1. Reported-by: Nassiri, Mohammad Closes: https://lore.kernel.org/all/dm6pr04mb4202bc58a9fd5bdd24a16e8ec5...@dm6pr04mb4202.namprd04.prod.outlook.com/ Signed-off-by: Dmitry Saf

[PATCH net-next v4 3/8] selftests/net: Be consistent in kconfig checks

2024-08-23 Thread Dmitry Safonov via B4 Relay
From: Dmitry Safonov <0x7f454...@gmail.com> Most of the functions in tcp-ao lib/ return negative errno or -1 in case of a failure. That creates inconsistencies in lib/kconfig, which saves what was the error code. As well as the uninitialized kconfig value is -1, which also may be the result of a c

[PATCH net-next v4 0/8] net/selftests: TCP-AO selftests updates

2024-08-23 Thread Dmitry Safonov via B4 Relay
First 3 patches are more-or-less cleanups/preparations. Patches 4/5 are fixes for netns file descriptors leaks/open. Patch 6 was sent to me/contributed off-list by Mohammad, who wants 32-bit kernels to run TCP-AO. Patch 7 is a workaround/fix for slow VMs. Albeit, I can't reproduce the issue, but

[PATCH net-next v4 4/8] selftests/net: Open /proc/thread-self in open_netns()

2024-08-23 Thread Dmitry Safonov via B4 Relay
From: Dmitry Safonov <0x7f454...@gmail.com> It turns to be that open_netns() is called rarely from the child-thread and more often from parent-thread. Yet, on initialization of kconfig checks, either of threads may reach kconfig_lock mutex first. VRF-related checks do create a temporary ksft-check

[PATCH net-next v4 8/8] selftests/net: Add trace events matching to tcp_ao

2024-08-23 Thread Dmitry Safonov via B4 Relay
From: Dmitry Safonov <0x7f454...@gmail.com> Setup trace points, add a new ftrace instance in order to not interfere with the rest of the system, filtering by net namespace cookies. Raise a new background thread that parses trace_pipe, matches them with the list of expected events. Wiring up trace

[PATCH net-next v4 6/8] selftests/tcp_ao: Fix printing format for uint64_t

2024-08-23 Thread Dmitry Safonov via B4 Relay
From: Mohammad Nassiri It's not safe to use '%zu' specifier for printing uint64_t on 32-bit systems. For uint64_t, we should use the 'PRIu64' macro from the inttypes.h library. This ensures that the uint64_t is printed correctly from the selftests regardless of the system architecture. Signed-of

[PATCH net-next v4 5/8] selftests/net: Don't forget to close nsfd after switch_save_ns()

2024-08-23 Thread Dmitry Safonov via B4 Relay
From: Dmitry Safonov <0x7f454...@gmail.com> The switch_save_ns() helper suppose to help switching to another namespace for some action and to return back to original namespace. The fd should be closed. Signed-off-by: Dmitry Safonov <0x7f454...@gmail.com> --- tools/testing/selftests/net/tcp_ao/l

[PATCH net-next v4 7/8] selftests/net: Synchronize client/server before counters checks

2024-08-23 Thread Dmitry Safonov via B4 Relay
From: Dmitry Safonov <0x7f454...@gmail.com> On tests that are expecting failure the timeout value is TEST_RETRANSMIT_SEC == 1 second. Which is big enough for most of devices under tests. But on a particularly slow machine/VM, 1 second might be not enough for another thread to be scheduled and atte

Re: [PATCH v2 8/9] KVM: selftests: Add a CoCo-specific test for KVM_PRE_FAULT_MEMORY

2024-08-23 Thread Tom Lendacky
On 8/23/24 15:23, Pratik R. Sampat wrote: > > > On 8/16/2024 2:23 PM, Pratik R. Sampat wrote: >> From: Michael Roth >> >> SEV, SEV-ES, and SNP have a few corner cases where there is potential >> for KVM_PRE_FAULT_MEMORY to behave differently depending on when it is >> issued during initial guest

Re: [PATCH bpf-next 1/2] selftests: bpf: use KHDR_INCLUDES for the UAPI headers

2024-08-23 Thread Alexei Starovoitov
On Sat, Aug 17, 2024 at 7:51 AM Matthieu Baerts wrote: > > Hi Alexei, > > Thank you for the review. > > On 17/08/2024 09:22, Alexei Starovoitov wrote: > > On Fri, Aug 16, 2024 at 7:56 PM Matthieu Baerts (NGI0) > > wrote: > >> > >> Instead of duplicating UAPI header files in 'tools/include/uapi',

Re: [PATCH 2/2] selftests: add selftest for tcp SO_PEEK_OFF support

2024-08-23 Thread Jason Xing
Hello Jon, On Sat, Aug 24, 2024 at 5:19 AM wrote: > > From: Jon Maloy > > We add a selftest to check that the new feature added in > commit 05ea491641d3 ("tcp: add support for SO_PEEK_OFF socket option") > works correctly. > > Reviewed-by: Stefano Brivio > Tested-by: Stefano Brivio > Signed-of

Re: [PATCH 1/2] tcp: add SO_PEEK_OFF socket option tor TCPv6

2024-08-23 Thread Jason Xing
On Sat, Aug 24, 2024 at 5:19 AM wrote: > > From: Jon Maloy > > When we added the SO_PEEK_OFF socket option to TCP we forgot > to add it even for TCP on IPv6. Even though you said "we forgot", I'm not sure if this patch series belongs to net-next material... > > We do that here. > > Fixes: 05ea4

Re: [RFC PATCH v1 2/4] KVM: SVM: Enable Bus lock threshold exit

2024-08-23 Thread Manali Shukla
Hi Sean, Thank you for reviewing my patches. On 8/17/2024 1:24 AM, Sean Christopherson wrote: > On Tue, Jul 09, 2024, Manali Shukla wrote: >> From: Nikunj A Dadhania >> >> Malicious guests can cause bus locks to degrade the performance of >> system. Non-WB(write-back) and misaligned locked RMW(re