[PATCH] Fixed an open function not judging the return value and closed the open function

2023-12-04 Thread liujing
Signed-off-by: liujing --- tools/testing/selftests/proc/proc-pid-vm.c | 5 + 1 file changed, 5 insertions(+) diff --git a/tools/testing/selftests/proc/proc-pid-vm.c b/tools/testing/selftests/proc/proc-pid-vm.c index cacbd2a4aec9..5fc9b46f236f 100644 --- a/tools/testing/selftests/proc/proc-p

Re: [PATCH ipsec-next v3 0/9] Add bpf_xdp_get_xfrm_state() kfunc

2023-12-04 Thread Steffen Klassert
On Fri, Dec 01, 2023 at 05:16:04PM -0700, Daniel Xu wrote: > On Fri, Dec 01, 2023 at 04:10:18PM -0800, Alexei Starovoitov wrote: > > On Fri, Dec 1, 2023 at 12:23 PM Daniel Xu wrote: > > > > > > include/net/xfrm.h| 9 + > > > net/xfrm/Makefile

Re: [PATCH v8 1/6] list_lru: allows explicit memcg and NUMA node selection

2023-12-04 Thread Chengming Zhou
On 2023/12/1 04:35, Johannes Weiner wrote: > On Thu, Nov 30, 2023 at 12:07:41PM -0800, Nhat Pham wrote: >> On Thu, Nov 30, 2023 at 11:57 AM Matthew Wilcox wrote: >>> >>> On Thu, Nov 30, 2023 at 11:40:18AM -0800, Nhat Pham wrote: This patch changes list_lru interface so that the caller must ex

[PATCH] tools/testing/selftests/x86: add dlclose function in the test_vsyscall.c

2023-12-04 Thread liujing
in the init_vdso function of test_vsyscall.c, Missing a dlclose function in the end Signed-off-by: liujing --- tools/testing/selftests/x86/test_vsyscall.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/testing/selftests/x86/test_vsyscall.c b/tools/testing/selftests/x86/test_vsysca

[PATCH] tools/testing/selftests/x86: add dlclose function in the vdso_restorer.c

2023-12-04 Thread liujing
in the main function of vdso_restorer.c,there is a dlopen function, but there is no dlclose function to close the file Signed-off-by: liujing --- tools/testing/selftests/x86/vdso_restorer.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing/selftests/x86/vdso_restorer.c b/tools

Re: [PATCH v5 5/5] selftests/mm: add UFFDIO_MOVE ioctl test

2023-12-04 Thread Ryan Roberts
On 04/12/2023 04:09, Suren Baghdasaryan wrote: > On Sat, Dec 2, 2023 at 2:11 AM David Hildenbrand wrote: >> >> On 02.12.23 09:04, Ryan Roberts wrote: >>> On 01/12/2023 20:47, David Hildenbrand wrote: On 01.12.23 10:29, Ryan Roberts wrote: > On 21/11/2023 17:16, Suren Baghdasaryan wrote: >

[PATCH][NEXT] selftests/bpf: Fix spelling mistake "get_signaure_size" -> "get_signature_size"

2023-12-04 Thread Colin Ian King
There is a spelling mistake in an ASSERT_GT message. Fix it. Signed-off-by: Colin Ian King --- tools/testing/selftests/bpf/prog_tests/verify_pkcs7_sig.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/bpf/prog_tests/verify_pkcs7_sig.c b/tools/testing/

Re: [PATCH bpf-next v3 3/3] selftests/bpf: add Launch Time request to xdp_hw_metadata

2023-12-04 Thread Jesper Dangaard Brouer
On 12/3/23 17:51, Song Yoong Siang wrote: This patch is tested with stmmac on Intel Tiger Lake platform. Refer to result below, the delta between pre-determined launch time and actual HW transmit complete time is around 24 us. Is there any NIC setup (e.g. ethtool/qdisc) requirements to enabl

Re: [PATCH bpf-next v3 2/3] net: stmmac: add Launch Time support to XDP ZC

2023-12-04 Thread Jesper Dangaard Brouer
On 12/3/23 17:51, Song Yoong Siang wrote: This patch enables Launch Time (Time-Based Scheduling) support to XDP zero copy via XDP Tx metadata framework. Signed-off-by: Song Yoong Siang --- drivers/net/ethernet/stmicro/stmmac/stmmac.h | 2 ++ As requested before, I think we need to se

Re: [PATCH v3 00/25] Permission Overlay Extension

2023-12-04 Thread Marc Zyngier
Hi Joey, On Fri, 24 Nov 2023 16:34:45 +, Joey Gouly wrote: > > Hello everyone, > > This series implements the Permission Overlay Extension introduced in 2022 > VMSA enhancements [1]. It is based on v6.7-rc2. > > Changes since v2[2]: > # Added ptrace support and selftest > # Add

Re: [PATCH v3 9/9] KVM: riscv: selftests: Add sstc timer test

2023-12-04 Thread Andrew Jones
On Mon, Dec 04, 2023 at 10:42:24AM +0800, Haibo Xu wrote: > On Fri, Sep 15, 2023 at 2:21 PM Haibo Xu wrote: > > > > On Thu, Sep 14, 2023 at 5:52 PM Andrew Jones > > wrote: > > > > > > On Thu, Sep 14, 2023 at 09:37:03AM +0800, Haibo Xu wrote: > > > > Add a KVM selftests to validate the Sstc timer

Re: [xdp-hints] Re: [PATCH bpf-next v3 2/3] net: stmmac: add Launch Time support to XDP ZC

2023-12-04 Thread Florian Bezdeka
On Mon, 2023-12-04 at 11:36 +0100, Jesper Dangaard Brouer wrote: > On 12/3/23 17:51, Song Yoong Siang wrote: > > This patch enables Launch Time (Time-Based Scheduling) support to XDP zero > > copy via XDP Tx metadata framework. > > > > Signed-off-by: Song Yoong Siang > > --- > > drivers/net/ethe

Re: [PATCH v6 2/6] iommufd: Add IOMMU_HWPT_INVALIDATE

2023-12-04 Thread Jason Gunthorpe
On Fri, Dec 01, 2023 at 02:12:28PM -0800, Nicolin Chen wrote: > > Why is timeout linked to these two? Or rather, it doesn't have to be > > linked like that. Any gerror is effectively synchronous because it > > halts the queue and allows SW time to inspect which command failed and > > record the ger

Re: [PATCH bpf-next v3 2/3] net: stmmac: add Launch Time support to XDP ZC

2023-12-04 Thread Willem de Bruijn
Jesper Dangaard Brouer wrote: > > > On 12/3/23 17:51, Song Yoong Siang wrote: > > This patch enables Launch Time (Time-Based Scheduling) support to XDP zero > > copy via XDP Tx metadata framework. > > > > Signed-off-by: Song Yoong Siang > > --- > > drivers/net/ethernet/stmicro/stmmac/stmmac.h

RE: [PATCH bpf-next v2 2/3] net: stmmac: Add txtime support to XDP ZC

2023-12-04 Thread Willem de Bruijn
Song, Yoong Siang wrote: > On Friday, December 1, 2023 11:02 PM, Jesper Dangaard Brouer wrote: > >On 12/1/23 07:24, Song Yoong Siang wrote: > >> This patch enables txtime support to XDP zero copy via XDP Tx > >> metadata framework. > >> > >> Signed-off-by: Song Yoong Siang > >> --- > >> drivers/n

Re: [PATCH bpf-next v3 3/3] selftests/bpf: add Launch Time request to xdp_hw_metadata

2023-12-04 Thread Willem de Bruijn
Jesper Dangaard Brouer wrote: > > > On 12/3/23 17:51, Song Yoong Siang wrote: > > This patch is tested with stmmac on Intel Tiger Lake platform. Refer to > > result below, the delta between pre-determined launch time and actual HW > > transmit complete time is around 24 us. > > Is there any NIC

[PATCH v10 13/19] KVM: selftests / xen: map shared_info using HVA rather than GFN

2023-12-04 Thread Paul Durrant
From: Paul Durrant Using the HVA of the shared_info page is more efficient, so if the capability (KVM_XEN_HVM_CONFIG_SHARED_INFO_HVA) is present use that method to do the mapping. NOTE: Have the juggle_shinfo_state() thread map and unmap using both GFN and HVA, to make sure the older mecha

[PATCH v10 10/19] KVM: xen: (re-)initialize shared_info if guest (32/64-bit) mode is set

2023-12-04 Thread Paul Durrant
From: Paul Durrant If the shared_info PFN cache has already been initialized then the content of the shared_info page needs to be (re-)initialized whenever the guest mode is (re)set. Setting the guest mode is either done explicitly by the VMM via the KVM_XEN_ATTR_TYPE_LONG_MODE attribute, or impl

[PATCH v10 14/19] KVM: selftests / xen: re-map vcpu_info using HVA rather than GPA

2023-12-04 Thread Paul Durrant
From: Paul Durrant If the relevant capability (KVM_XEN_HVM_CONFIG_SHARED_INFO_HVA) is present then re-map vcpu_info using the HVA part way through the tests to make sure then there is no functional change. Signed-off-by: Paul Durrant Reviewed-by: David Woodhouse --- Cc: Sean Christopherson Cc

[PATCH v10 18/19] KVM: pfncache: check the need for invalidation under read lock first

2023-12-04 Thread Paul Durrant
From: Paul Durrant Taking a write lock on a pfncache will be disruptive if the cache is heavily used (which only requires a read lock). Hence, in the MMU notifier callback, take read locks on caches to check for a match; only taking a write lock to actually perform an invalidation (after a anothe

[PATCH v10 15/19] KVM: xen: advertize the KVM_XEN_HVM_CONFIG_SHARED_INFO_HVA capability

2023-12-04 Thread Paul Durrant
From: Paul Durrant Now that all relevant kernel changes and selftests are in place, enable the new capability. Signed-off-by: Paul Durrant Reviewed-by: David Woodhouse --- Cc: Sean Christopherson Cc: Paolo Bonzini Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc

[PATCH v10 17/19] KVM: xen: don't block on pfncache locks in kvm_xen_set_evtchn_fast()

2023-12-04 Thread Paul Durrant
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. Instead, use read_trylock() and treat failure to lock the same as an invalid cache. [1] https://lore.kernel.org/lkml/99771ef3a49

[PATCH v10 11/19] KVM: xen: allow shared_info to be mapped by fixed HVA

2023-12-04 Thread Paul Durrant
From: Paul Durrant The shared_info page is not guest memory as such. It is a dedicated page allocated by the VMM and overlaid onto guest memory in a GFN chosen by the guest and specified in the XENMEM_add_to_physmap hypercall. The guest may even request that shared_info be moved from one GFN to a

[PATCH v10 16/19] KVM: xen: split up kvm_xen_set_evtchn_fast()

2023-12-04 Thread Paul Durrant
From: Paul Durrant The implementation of kvm_xen_set_evtchn_fast() is a rather lengthy piece of code that performs two operations: updating of the shared_info evtchn_pending mask, and updating of the vcpu_info evtchn_pending_sel mask. Introduce a separate function to perform each of those operati

[PATCH v10 01/19] KVM: pfncache: Add a map helper function

2023-12-04 Thread Paul Durrant
From: Paul Durrant There is a pfncache unmap helper but mapping is open-coded. Arguably this is fine because mapping is done in only one place, hva_to_pfn_retry(), but adding the helper does make that function more readable. No functional change intended. Signed-off-by: Paul Durrant Reviewed-b

[PATCH v10 04/19] KVM: pfncache: add a mark-dirty helper

2023-12-04 Thread Paul Durrant
From: Paul Durrant At the moment pages are marked dirty by open-coded calls to mark_page_dirty_in_slot(), directly deferefencing the gpa and memslot from the cache. After a subsequent patch these may not always be set so add a helper now so that caller will protected from the need to know about t

[PATCH v10 05/19] KVM: pfncache: remove KVM_GUEST_USES_PFN usage

2023-12-04 Thread Paul Durrant
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. Moreover, all existing callers specify KVM_HOST_USES_PFN so the usage check in hva_to_pfn_retry() and hence the 'usage' argument to k

[PATCH v10 06/19] KVM: pfncache: stop open-coding offset_in_page()

2023-12-04 Thread Paul Durrant
From: Paul Durrant Some code in pfncache uses offset_in_page() but in other places it is open- coded. Use offset_in_page() consistently everywhere. Signed-off-by: Paul Durrant Reviewed-by: David Woodhouse --- Cc: Sean Christopherson Cc: Paolo Bonzini Cc: David Woodhouse v8: - New in this

[PATCH v10 02/19] KVM: pfncache: remove unnecessary exports

2023-12-04 Thread Paul Durrant
From: Paul Durrant There is no need for the existing kvm_gpc_XXX() functions to be exported. Clean up now before additional functions are added in subsequent patches. Signed-off-by: Paul Durrant Reviewed-by: David Woodhouse --- Cc: Sean Christopherson Cc: David Woodhouse Cc: Paolo Bonzini

[PATCH v10 08/19] KVM: pfncache: allow a cache to be activated with a fixed (userspace) HVA

2023-12-04 Thread Paul Durrant
From: Paul Durrant Some pfncache pages may actually be overlays on guest memory that have a fixed HVA within the VMM. It's pointless to invalidate such cached mappings if the overlay is moved so allow a cache to be activated directly with the HVA to cater for such cases. A subsequent patch will m

[PATCH v10 00/19] KVM: xen: update shared_info and vcpu_info handling

2023-12-04 Thread Paul Durrant
From: Paul Durrant There are four new patches in the series over what was in version 9 [1]: * KVM: xen: separate initialization of shared_info cache and content * KVM: xen: (re-)initialize shared_info if guest (32/64-bit) mode is set These deal with a missing re-initialization of shared_info if

[PATCH v10 09/19] KVM: xen: separate initialization of shared_info cache and content

2023-12-04 Thread Paul Durrant
From: Paul Durrant A subsequent patch will allow shared_info to be initialized using either a GPA or a user-space (i.e. VMM) HVA. To make that patch cleaner, separate the initialization of the shared_info content from the activation of the pfncache. Signed-off-by: Paul Durrant --- Cc: Sean Chri

[PATCH v10 03/19] KVM: xen: mark guest pages dirty with the pfncache lock held

2023-12-04 Thread Paul Durrant
From: Paul Durrant Sampling gpa and memslot from an unlocked pfncache may yield inconsistent values so, since there is no problem with calling mark_page_dirty_in_slot() with the pfncache lock held, relocate the calls in kvm_xen_update_runstate_guest() and kvm_xen_inject_pending_events() according

[PATCH v10 07/19] KVM: pfncache: include page offset in uhva and use it consistently

2023-12-04 Thread Paul Durrant
From: Paul Durrant Currently the pfncache page offset is sometimes determined using the gpa and sometimes the khva, whilst the uhva is always page-aligned. After a subsequent patch is applied the gpa will not always be valid so adjust the code to include the page offset in the uhva and use it con

Re: [PATCH v2 0/6] IOMMUFD: Deliver IO page faults to user space

2023-12-04 Thread Joel Granados
On Thu, Oct 26, 2023 at 10:49:24AM +0800, Lu Baolu wrote: > Hi folks, > > This series implements the functionality of delivering IO page faults to > user space through the IOMMUFD framework for nested translation. Nested Does this mean the IOPF_CAPABLE HWPT needs to be parented by a HWPT created w

Re: [PATCH][NEXT] selftests/bpf: Fix spelling mistake "get_signaure_size" -> "get_signature_size"

2023-12-04 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to bpf/bpf-next.git (master) by Daniel Borkmann : On Mon, 4 Dec 2023 09:39:40 + you wrote: > There is a spelling mistake in an ASSERT_GT message. Fix it. > > Signed-off-by: Colin Ian King > --- > tools/testing/selftests/bpf/prog_tests/verify_pkcs7_sig.c | 2 +

[PATCH v10 19/19] KVM: xen: allow vcpu_info content to be 'safely' copied

2023-12-04 Thread Paul Durrant
From: Paul Durrant If the guest sets an explicit vcpu_info GPA then, for any of the first 32 vCPUs, the content of the default vcpu_info in the shared_info page must be copied into the new location. Because this copy may race with event delivery (which updates the 'evtchn_pending_sel' field in vc

[PATCH v10 12/19] KVM: xen: allow vcpu_info to be mapped by fixed HVA

2023-12-04 Thread Paul Durrant
From: Paul Durrant If the guest does not explicitly set the GPA of vcpu_info structure in memory then, for guests with 32 vCPUs or fewer, the vcpu_info embedded in the shared_info page may be used. As described in a previous commit, the shared_info page is an overlay at a fixed HVA within the VMM

Re: [PATCH v2 0/6] IOMMUFD: Deliver IO page faults to user space

2023-12-04 Thread Jason Gunthorpe
On Mon, Dec 04, 2023 at 04:07:44PM +0100, Joel Granados wrote: > On Thu, Oct 26, 2023 at 10:49:24AM +0800, Lu Baolu wrote: > > Hi folks, > > > > This series implements the functionality of delivering IO page faults to > > user space through the IOMMUFD framework for nested translation. Nested > Do

Re: [PATCH v5 5/5] selftests/mm: add UFFDIO_MOVE ioctl test

2023-12-04 Thread Suren Baghdasaryan
On Mon, Dec 4, 2023 at 1:27 AM Ryan Roberts wrote: > > On 04/12/2023 04:09, Suren Baghdasaryan wrote: > > On Sat, Dec 2, 2023 at 2:11 AM David Hildenbrand wrote: > >> > >> On 02.12.23 09:04, Ryan Roberts wrote: > >>> On 01/12/2023 20:47, David Hildenbrand wrote: > On 01.12.23 10:29, Ryan Rob

Re: [PATCH v8 1/6] list_lru: allows explicit memcg and NUMA node selection

2023-12-04 Thread Nhat Pham
On Mon, Dec 4, 2023 at 12:30 AM Chengming Zhou wrote: > > On 2023/12/1 04:35, Johannes Weiner wrote: > > On Thu, Nov 30, 2023 at 12:07:41PM -0800, Nhat Pham wrote: > >> On Thu, Nov 30, 2023 at 11:57 AM Matthew Wilcox > >> wrote: > >>> > >>> On Thu, Nov 30, 2023 at 11:40:18AM -0800, Nhat Pham wro

Re: [PATCH v5 5/5] selftests/mm: add UFFDIO_MOVE ioctl test

2023-12-04 Thread David Hildenbrand
On 04.12.23 17:35, Suren Baghdasaryan wrote: On Mon, Dec 4, 2023 at 1:27 AM Ryan Roberts wrote: On 04/12/2023 04:09, Suren Baghdasaryan wrote: On Sat, Dec 2, 2023 at 2:11 AM David Hildenbrand wrote: On 02.12.23 09:04, Ryan Roberts wrote: On 01/12/2023 20:47, David Hildenbrand wrote: On 0

Re: [PATCH v3 01/25] arm64/sysreg: add system register POR_EL{0,1}

2023-12-04 Thread Catalin Marinas
On Fri, Nov 24, 2023 at 04:34:46PM +, Joey Gouly wrote: > Add POR_EL{0,1} according to DDI0601 2023-03. > > Signed-off-by: Joey Gouly > Cc: Catalin Marinas > Cc: Will Deacon > Reviewed-by: Mark Brown Acked-by: Catalin Marinas

Re: [PATCH v3 02/25] arm64/sysreg: update CPACR_EL1 register

2023-12-04 Thread Catalin Marinas
On Fri, Nov 24, 2023 at 04:34:47PM +, Joey Gouly wrote: > Add E0POE bit that traps accesses to POR_EL0 from EL0. Nitpick: s/traps/enables/ Acked-by: Catalin Marinas

Re: [PATCH v5 5/5] selftests/mm: add UFFDIO_MOVE ioctl test

2023-12-04 Thread Suren Baghdasaryan
On Mon, Dec 4, 2023 at 10:27 AM David Hildenbrand wrote: > > On 04.12.23 17:35, Suren Baghdasaryan wrote: > > On Mon, Dec 4, 2023 at 1:27 AM Ryan Roberts wrote: > >> > >> On 04/12/2023 04:09, Suren Baghdasaryan wrote: > >>> On Sat, Dec 2, 2023 at 2:11 AM David Hildenbrand wrote: > > On

Re: [PATCH v3 03/25] arm64: cpufeature: add Permission Overlay Extension cpucap

2023-12-04 Thread Catalin Marinas
On Fri, Nov 24, 2023 at 04:34:48PM +, Joey Gouly wrote: > --- a/arch/arm64/Kconfig > +++ b/arch/arm64/Kconfig > @@ -2078,6 +2078,22 @@ config ARM64_EPAN > if the cpu does not implement the feature. > endmenu # "ARMv8.7 architectural features" > > +menu "ARMv8.9 architectural features

Re: [PATCH] Fixed an open function not judging the return value and closed the open function

2023-12-04 Thread Andrew Morton
On Mon, 4 Dec 2023 03:05:54 -0500 liujing wrote: > Signed-off-by: liujing > --- > tools/testing/selftests/proc/proc-pid-vm.c | 5 + > 1 file changed, 5 insertions(+) > > diff --git a/tools/testing/selftests/proc/proc-pid-vm.c > b/tools/testing/selftests/proc/proc-pid-vm.c > index cacbd2a

[PATCH] mm, memcg: cg2 memory{.swap,}.peak write handlers

2023-12-04 Thread David Finkel
Other mechanisms for querying the peak memory usage of either a process or v1 memory cgroup allow for resetting the high watermark. Restore parity with those mechanisms. For example: - Any write to memory.max_usage_in_bytes in a cgroup v1 mount resets the high watermark. - writing "5" to the

[PATCH 2/2] selftest/bpf: Test returning zero from a perf bpf program suppresses SIGIO.

2023-12-04 Thread Kyle Huey
The test sets a hardware breakpoint and uses a bpf program to suppress the I/O availability signal if the ip matches the expected value. Signed-off-by: Kyle Huey --- .../selftests/bpf/prog_tests/perf_skip.c | 95 +++ .../selftests/bpf/progs/test_perf_skip.c | 23 +

[PATCH AUTOSEL 6.6 02/32] kunit: Warn if tests are slow

2023-12-04 Thread Sasha Levin
From: Maxime Ripard [ Upstream commit f8f2847f739dc899d0e563eac01299dadefa64ff ] Kunit recently gained support to setup attributes, the first one being the speed of a given test, then allowing to filter out slow tests. A slow test is defined in the documentation as taking more than one second.

[PATCH AUTOSEL 6.6 03/32] kunit: Reset suite counter right before running tests

2023-12-04 Thread Sasha Levin
From: Michal Wajdeczko [ Upstream commit 2e3c94aed51eabbe9c1c0ee515371ea5441c2fa7 ] Today we reset the suite counter as part of the suite cleanup, called from the module exit callback, but it might not work that well as one can try to collect results without unloading a previous test (either uni

[PATCH bpf-next v4 00/10] Add bpf_xdp_get_xfrm_state() kfunc

2023-12-04 Thread Daniel Xu
This patchset adds two kfunc helpers, bpf_xdp_get_xfrm_state() and bpf_xdp_xfrm_state_release() that wrap xfrm_state_lookup() and xfrm_state_put(). The intent is to support software RSS (via XDP) for the ongoing/upcoming ipsec pcpu work [0]. Recent experiments performed on (hopefully) reproducible

[PATCH bpf-next v4 05/10] bpf: selftests: test_loader: Support __btf_path() annotation

2023-12-04 Thread Daniel Xu
This commit adds support for per-prog btf_custom_path. This is necessary for testing CO-RE relocations on non-vmlinux types using test_loader infrastructure. Acked-by: Andrii Nakryiko Signed-off-by: Daniel Xu --- tools/testing/selftests/bpf/progs/bpf_misc.h | 1 + tools/testing/selftests/bpf/te

[PATCH bpf-next v4 06/10] libbpf: selftests: Add verifier tests for CO-RE bitfield writes

2023-12-04 Thread Daniel Xu
Add some tests that exercise BPF_CORE_WRITE_BITFIELD() macro. Since some non-trivial bit fiddling is going on, make sure various edge cases (such as adjacent bitfields and bitfields at the edge of structs) are exercised. Acked-by: Andrii Nakryiko Signed-off-by: Daniel Xu --- .../selftests/bpf/p

[PATCH bpf-next v4 07/10] bpf: selftests: test_tunnel: Setup fresh topology for each subtest

2023-12-04 Thread Daniel Xu
This helps with determinism b/c individual setup/teardown prevents leaking state between different subtests. Signed-off-by: Daniel Xu --- tools/testing/selftests/bpf/prog_tests/test_tunnel.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/bpf/pr

[PATCH bpf-next v4 08/10] bpf: selftests: test_tunnel: Use vmlinux.h declarations

2023-12-04 Thread Daniel Xu
vmlinux.h declarations are more ergnomic, especially when working with kfuncs. The uapi headers are often incomplete for kfunc definitions. This commit also switches bitfield accesses to use CO-RE helpers. Switching to vmlinux.h definitions makes the verifier very unhappy with raw bitfield accesse

[PATCH bpf-next v4 09/10] bpf: selftests: Move xfrm tunnel test to test_progs

2023-12-04 Thread Daniel Xu
test_progs is better than a shell script b/c C is a bit easier to maintain than shell. Also it's easier to use new infra like memory mapped global variables from C via bpf skeleton. Co-developed-by: Antony Antony Signed-off-by: Antony Antony Signed-off-by: Daniel Xu --- .../selftests/bpf/prog_

[PATCH bpf-next v4 10/10] bpf: xfrm: Add selftest for bpf_xdp_get_xfrm_state()

2023-12-04 Thread Daniel Xu
This commit extends test_tunnel selftest to test the new XDP xfrm state lookup kfunc. Co-developed-by: Antony Antony Signed-off-by: Antony Antony Signed-off-by: Daniel Xu --- .../selftests/bpf/prog_tests/test_tunnel.c| 20 ++-- .../selftests/bpf/progs/test_tunnel_kern.c| 51 +++

Re: [PATCH 2/2] selftest/bpf: Test returning zero from a perf bpf program suppresses SIGIO.

2023-12-04 Thread Andrii Nakryiko
On Mon, Dec 4, 2023 at 12:14 PM Kyle Huey wrote: > > The test sets a hardware breakpoint and uses a bpf program to suppress the > I/O availability signal if the ip matches the expected value. > > Signed-off-by: Kyle Huey > --- > .../selftests/bpf/prog_tests/perf_skip.c | 95

[PATCH v3 1/6] kunit: move KUNIT_TABLE out of INIT_DATA

2023-12-04 Thread Rae Moar
Alter the linker section of KUNIT_TABLE to move it out of INIT_DATA and into DATA_DATA. Data for KUnit tests does not need to be in the init section. In order to run tests again after boot the KUnit data cannot be labeled as init data as the kernel could write over it. Add a KUNIT_INIT_TABLE in

[PATCH v3 2/6] kunit: add KUNIT_INIT_TABLE to init linker section

2023-12-04 Thread Rae Moar
Add KUNIT_INIT_TABLE to the INIT_DATA linker section. Alter the KUnit macros to create init tests: kunit_test_init_section_suites Update lib/kunit/executor.c to run both the suites in KUNIT_TABLE and KUNIT_INIT_TABLE. Signed-off-by: Rae Moar --- include/asm-generic/vmlinux.lds.h | 9 - in

[PATCH v3 4/6] kunit: add is_init test attribute

2023-12-04 Thread Rae Moar
Add is_init test attribute of type bool. Add to_string, get, and filter methods to lib/kunit/attributes.c. Mark each of the tests in the init section with the is_init=true attribute. Add is_init to the attributes documentation. Signed-off-by: Rae Moar --- .../dev-tools/kunit/running_tips.rst

[PATCH v3 3/6] kunit: add example suite to test init suites

2023-12-04 Thread Rae Moar
Add example_init_test_suite to allow for testing the feature of running test suites marked as init to indicate they use init data and/or functions. This suite should always pass and uses a simple init function. This suite can also be used to test the is_init attribute introduced in the next patch

[PATCH v3 5/6] kunit: add ability to run tests after boot using debugfs

2023-12-04 Thread Rae Moar
Add functionality to run built-in tests after boot by writing to a debugfs file. Add a new debugfs file labeled "run" for each test suite to use for this purpose. As an example, write to the file using the following: echo "any string" > /sys/kernel/debugfs/kunit//run This will trigger the test

[PATCH v3 6/6] Documentation: Add debugfs docs with run after boot

2023-12-04 Thread Rae Moar
Expand the documentation on the KUnit debugfs filesystem on the run_manual.rst page. Add section describing how to access results using debugfs. Add section describing how to run tests after boot using debugfs. Signed-off-by: Rae Moar --- Changes since v2: - Add info to documentation about cle

Re: [PATCH] mm, memcg: cg2 memory{.swap,}.peak write handlers

2023-12-04 Thread Shakeel Butt
On Mon, Dec 4, 2023 at 11:42 AM David Finkel wrote: > > Other mechanisms for querying the peak memory usage of either a process > or v1 memory cgroup allow for resetting the high watermark. Restore > parity with those mechanisms. > > For example: > - Any write to memory.max_usage_in_bytes in a cg

Re: [PATCH RFT v4 5/5] kselftest/clone3: Test shadow stack support

2023-12-04 Thread Edgecombe, Rick P
On Tue, 2023-11-28 at 18:22 +, Mark Brown wrote: > + > +#define ENABLE_SHADOW_STACK > +static inline void enable_shadow_stack(void) > +{ > +   int ret = ARCH_PRCTL(ARCH_SHSTK_ENABLE, ARCH_SHSTK_SHSTK); > +   if (ret == 0) > +   shadow_stack_enabled = true; > +} > + > +#endif

Re: [PATCH RFT v4 2/5] fork: Add shadow stack support to clone3()

2023-12-04 Thread Edgecombe, Rick P
On Tue, 2023-11-28 at 18:22 +, Mark Brown wrote: > -unsigned long shstk_alloc_thread_stack(struct task_struct *tsk, > unsigned long clone_flags, > -  unsigned long stack_size) > +unsigned long shstk_alloc_thread_stack(struct task_struct *tsk, > + 

Re: [PATCH v8 1/6] list_lru: allows explicit memcg and NUMA node selection

2023-12-04 Thread Chris Li
On Thu, Nov 30, 2023 at 12:35 PM Johannes Weiner wrote: > > On Thu, Nov 30, 2023 at 12:07:41PM -0800, Nhat Pham wrote: > > On Thu, Nov 30, 2023 at 11:57 AM Matthew Wilcox wrote: > > > > > > On Thu, Nov 30, 2023 at 11:40:18AM -0800, Nhat Pham wrote: > > > > This patch changes list_lru interface so

Re: [PATCH v8 2/6] memcontrol: implement mem_cgroup_tryget_online()

2023-12-04 Thread Chris Li
Hi Nhat, Very minor nitpick. This patch can fold with the later patch that uses it. That makes the review easier, no need to cross reference different patches. It will also make it harder to introduce API that nobody uses. Chris On Thu, Nov 30, 2023 at 11:40 AM Nhat Pham wrote: > > This patch i

Re: [PATCH v8 2/6] memcontrol: implement mem_cgroup_tryget_online()

2023-12-04 Thread Nhat Pham
On Mon, Dec 4, 2023 at 4:36 PM Chris Li wrote: > > Hi Nhat, > > Very minor nitpick. This patch can fold with the later patch that uses > it. That makes the review easier, no need to cross reference different > patches. It will also make it harder to introduce API that nobody > uses. > > Chris > >

Re: [PATCH v8 1/6] list_lru: allows explicit memcg and NUMA node selection

2023-12-04 Thread Chengming Zhou
On 2023/12/5 01:48, Nhat Pham wrote: > On Mon, Dec 4, 2023 at 12:30 AM Chengming Zhou > wrote: >> >> On 2023/12/1 04:35, Johannes Weiner wrote: >>> On Thu, Nov 30, 2023 at 12:07:41PM -0800, Nhat Pham wrote: On Thu, Nov 30, 2023 at 11:57 AM Matthew Wilcox wrote: > > On Thu, Nov

Re: [PATCH bpf-next v4 06/10] libbpf: selftests: Add verifier tests for CO-RE bitfield writes

2023-12-04 Thread Andrii Nakryiko
On Mon, Dec 4, 2023 at 12:57 PM Daniel Xu wrote: > > Add some tests that exercise BPF_CORE_WRITE_BITFIELD() macro. Since some > non-trivial bit fiddling is going on, make sure various edge cases (such > as adjacent bitfields and bitfields at the edge of structs) are > exercised. > > Acked-by: Andr

Re: [PATCH v5 5/5] selftests/mm: add UFFDIO_MOVE ioctl test

2023-12-04 Thread Suren Baghdasaryan
On Mon, Dec 4, 2023 at 10:44 AM Suren Baghdasaryan wrote: > > On Mon, Dec 4, 2023 at 10:27 AM David Hildenbrand wrote: > > > > On 04.12.23 17:35, Suren Baghdasaryan wrote: > > > On Mon, Dec 4, 2023 at 1:27 AM Ryan Roberts wrote: > > >> > > >> On 04/12/2023 04:09, Suren Baghdasaryan wrote: > > >>

Re: [PATCH 0/3] sysctl: Fix out of bounds access for empty syscl ctl_tables

2023-12-04 Thread Luis Chamberlain
On Tue, Nov 21, 2023 at 12:02:17PM +0100, Joel Granados via B4 Relay wrote: > Fix an out of bounds access reported in > https://lore.kernel.org/oe-lkp/202311201431.57aae8f3-oliver.s...@intel.com > Make sure that the ctl_table header size is greater than 0 before > evaluating if a ctl_table is perma

[PATCH V12 0/7] amd-pstate preferred core

2023-12-04 Thread Meng Li
Hi all: The core frequency is subjected to the process variation in semiconductors. Not all cores are able to reach the maximum frequency respecting the infrastructure limits. Consequently, AMD has redefined the concept of maximum frequency of a part. This means that a fraction of cores can reach

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

2023-12-04 Thread Meng Li
amd-pstate driver also uses SCHED_MC_PRIO, so decouple the requirement of CPU_SUP_INTEL from the dependencies to allow compilation in kernels without Intel CPU support. Tested-by: Oleksandr Natalenko Reviewed-by: Mario Limonciello Reviewed-by: Huang Rui Reviewed-by: Perry Yuan Signed-off-by: M

[PATCH V12 2/7] acpi: cppc: Add get the highest performance cppc control

2023-12-04 Thread Meng Li
Add support for getting the highest performance to the generic CPPC driver. This enables downstream drivers such as amd-pstate to discover and use these values. Please refer to the ACPI_Spec for details on continuous performance control of CPPC. Tested-by: Oleksandr Natalenko Reviewed-by: Mario

[PATCH V12 3/7] cpufreq: amd-pstate: Enable amd-pstate preferred core supporting.

2023-12-04 Thread Meng Li
amd-pstate driver utilizes the functions and data structures provided by the ITMT architecture to enable the scheduler to favor scheduling on cores which can be get a higher frequency with lower voltage. We call it amd-pstate preferrred core. Here sched_set_itmt_core_prio() is called to set priori

[PATCH V12 4/7] cpufreq: Add a notification message that the highest perf has changed

2023-12-04 Thread Meng Li
ACPI 6.5 section 8.4.6.1.1.1 specifies that Notify event 0x85 can be emmitted to cause the the OSPM to re-evaluate the highest performance register. Add support for this event. Tested-by: Oleksandr Natalenko Reviewed-by: Mario Limonciello Reviewed-by: Huang Rui Reviewed-by: Perry Yuan Signed-o

[PATCH V12 5/7] cpufreq: amd-pstate: Update amd-pstate preferred core ranking dynamically

2023-12-04 Thread Meng Li
Preferred core rankings can be changed dynamically by the platform based on the workload and platform conditions and accounting for thermals and aging. When this occurs, cpu priority need to be set. Tested-by: Oleksandr Natalenko Reviewed-by: Mario Limonciello Reviewed-by: Wyes Karny Reviewed-b

[PATCH V12 6/7] Documentation: amd-pstate: introduce amd-pstate preferred core

2023-12-04 Thread Meng Li
Introduce amd-pstate preferred core. check preferred core state set by the kernel parameter: $ cat /sys/devices/system/cpu/amd-pstate/prefcore Tested-by: Oleksandr Natalenko Reviewed-by: Wyes Karny Reviewed-by: Mario Limonciello Reviewed-by: Huang Rui Reviewed-by: Perry Yuan Signed-off-by: M

[PATCH V12 7/7] Documentation: introduce amd-pstate preferrd core mode kernel command line options

2023-12-04 Thread Meng Li
amd-pstate driver support enable/disable preferred core. Default enabled on platforms supporting amd-pstate preferred core. Disable amd-pstate preferred core with "amd_prefcore=disable" added to the kernel command line. Signed-off-by: Meng Li Reviewed-by: Mario Limonciello Reviewed-by: Wyes Karn

[PATCH 0/4] kunit: Add helpers for creating test-managed devices

2023-12-04 Thread davidgow
KUnit tests often need to provide a struct device, and thus far have mostly been using root_device_register() or platform devices to create a 'fake device' for use with, e.g., code which uses device-managed resources. This has several disadvantages, including not being designed for test use, scatte

[PATCH 1/4] kunit: Add APIs for managing devices

2023-12-04 Thread davidgow
Tests for drivers often require a struct device to pass to other functions. While it's possible to create these with root_device_register(), or to use something like a platform device, this is both a misuse of those APIs, and can be difficult to clean up after, for example, a failed assertion. Add

[PATCH 2/4] fortify: test: Use kunit_device

2023-12-04 Thread davidgow
Using struct root_device to create fake devices for tests is something of a hack. The new struct kunit_device is meant for this purpose, so use it instead. Signed-off-by: David Gow --- lib/fortify_kunit.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/fortify_kunit.

[PATCH 3/4] overflow: Replace fake root_device with kunit_device

2023-12-04 Thread davidgow
Using struct root_device to create fake devices for tests is something of a hack. The new struct kunit_device is meant for this purpose, so use it instead. Signed-off-by: David Gow --- lib/overflow_kunit.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/overflow_kuni

[PATCH 4/4] ASoC: topology: Replace fake root_device with kunit_device in tests

2023-12-04 Thread davidgow
Using struct root_device to create fake devices for tests is something of a hack. The new struct kunit_device is meant for this purpose, so use it instead. Signed-off-by: David Gow --- sound/soc/soc-topology-test.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/s

Re: [PATCH v3 9/9] KVM: riscv: selftests: Add sstc timer test

2023-12-04 Thread Haibo Xu
On Mon, Dec 4, 2023 at 7:32 PM Andrew Jones wrote: > > On Mon, Dec 04, 2023 at 10:42:24AM +0800, Haibo Xu wrote: > > On Fri, Sep 15, 2023 at 2:21 PM Haibo Xu wrote: > > > > > > On Thu, Sep 14, 2023 at 5:52 PM Andrew Jones > > > wrote: > > > > > > > > On Thu, Sep 14, 2023 at 09:37:03AM +0800, Ha