Re: [RFC PATCH 0/4] Add hazard pointers to kernel

2024-09-18 Thread Linus Torvalds
On Thu, 19 Sept 2024 at 00:44, Neeraj Upadhyay wrote: > > While we were working on this problem, this refcount scalability issue got > resolved recently with conditional ref acquisition [3] (however, there are > new > developments in apparmor code which might bring back the refcount problem > [

[RESEND PATCH v3] virtio_net: Fix mismatched buf address when unmapping for small packets

2024-09-18 Thread Wenbo Li
Currently, the virtio-net driver will perform a pre-dma-mapping for small or mergeable RX buffer. But for small packets, a mismatched address without VIRTNET_RX_PAD and xdp_headroom is used for unmapping. That will result in unsynchronized buffers when SWIOTLB is enabled, for example, when running

Re: [RFC PATCH 1/4] hazptr: Add initial implementation of hazard pointers

2024-09-18 Thread Jann Horn
On Tue, Sep 17, 2024 at 4:33 PM Boqun Feng wrote: > Hazard pointers [1] provide a way to dynamically distribute refcounting > and can be used to improve the scalability of refcounting without > significant space cost. > +static inline void *__hazptr_tryprotect(hazptr_t *hzp, > +

[PATCH RESEND v2] selftests/futex: Order calls in futex_requeue

2024-09-18 Thread Edward Liaw
Fixes a race between parent and child threads in futex_requeue. Similar to fbf4dec70277 ("selftests/futex: Order calls to futex_lock_pi"), which fixed a flake in futex_lock_pi due to racing between the parent and child threads. The same issue can occur in the futex_requeue test, because it expect

Re: [RFC PATCH 0/4] Add hazard pointers to kernel

2024-09-18 Thread Neeraj Upadhyay
On 9/18/2024 12:48 PM, Linus Torvalds wrote: > On Tue, 17 Sept 2024 at 16:34, Boqun Feng wrote: >> >> This series introduces hazard pointers [1] to kernel space. A TL;DR >> description of hazard pointers is "a scalable refcounting mechanim >> with RCU-like API". More information can be found at [2

[PATCH v2 5/6] KVM: x86: selftests: Test core events

2024-09-18 Thread Colton Lewis
Test events on core counters by iterating through every combination of events in amd_pmu_zen_events with every core counter. For each combination, calculate the appropriate register addresses for the event selection/control register and the counter register. The base addresses and layout schemes c

[PATCH v2 6/6] KVM: x86: selftests: Test PerfMonV2

2024-09-18 Thread Colton Lewis
Test PerfMonV2, which defines global registers to enable multiple performance counters with a single MSR write, in its own function. If the feature is available, ensure the global control register has the ability to start and stop the performance counters and the global status register correctly f

[PATCH v2 4/6] KVM: x86: selftests: Test read/write core counters

2024-09-18 Thread Colton Lewis
Run a basic test to ensure we can write an arbitrary value to the core counters and read it back. Signed-off-by: Colton Lewis --- .../selftests/kvm/x86_64/pmu_counters_test.c | 54 +++ 1 file changed, 54 insertions(+) diff --git a/tools/testing/selftests/kvm/x86_64/pmu_counters

[PATCH v2 3/6] KVM: x86: selftests: Set up AMD VM in pmu_counters_test

2024-09-18 Thread Colton Lewis
Branch in main() depending on if the CPU is Intel or AMD. They are subject to vastly different requirements because the AMD PMU lacks many properties defined by the Intel PMU including the entire CPUID 0xa function where Intel stores all the PMU properties. AMD lacks this as well as any consistent

[PATCH v2 2/6] KVM: x86: selftests: Define AMD PMU CPUID leaves

2024-09-18 Thread Colton Lewis
This defined the CPUID calls to determine what extensions and properties are available. AMD reference manual names listed below. * PerfCtrExtCore (six core counters instead of four) * PerfCtrExtNB (four counters for northbridge events) * PerfCtrExtL2I (four counters for L2 cache events) * PerfMonV

[PATCH v2 1/6] KVM: x86: selftests: Fix typos in macro variable use

2024-09-18 Thread Colton Lewis
Without the leading underscore, these variables are referencing a variable in the calling scope. It only worked before by accident because all calling scopes had a variable with the right name. Fixes: cd34fd8c758e ("KVM: selftests: Test PMC virtualization with forced emulation") Signed-off-by: Co

[PATCH v2 0/6] Extend pmu_counters_test to AMD CPUs

2024-09-18 Thread Colton Lewis
Extend pmu_counters_test to AMD CPUs. As the AMD PMU is quite different from Intel with different events and feature sets, this series introduces a new code path to test it, specifically focusing on the core counters including the PerfCtrExtCore and PerfMonV2 features. Northbridge counters and cac

Re: [PATCH v5] ptp: Add support for the AMZNC10C 'vmclock' device

2024-09-18 Thread David Woodhouse
On Tue, 2024-09-03 at 15:56 +0200, Paolo Abeni wrote: > I'm sorry for the late feedback. No problem. I've addressed it all apart from the uint64_t part. I'll concede the pre-C99 nonsense where it matches existing code, but we've always also allowed code in the kernel to use the proper C language t

Re: [PATCH v1 5/5] remoteproc: add support for Microchip IPC remoteproc platform driver

2024-09-18 Thread Valentina.FernandezAlanis
On 16/09/2024 21:18, Krzysztof Kozlowski wrote: > EXTERNAL EMAIL: Do not click links or open attachments unless you know the > content is safe > > On 12/09/2024 19:00, Valentina Fernandez wrote: >> The Microchip family of RISC-V SoCs typically has one or more clusters. >> These clusters can be co

Re: [PATCH v2 5/5] remoteproc: arm64: corstone1000: Add the External Systems driver

2024-09-18 Thread Abdellatif El Khlifi
Hi Mathieu, > Introduce remoteproc support for Corstone-1000 external systems > > The Corstone-1000 IoT Reference Design Platform supports up to two > external systems processors. These processors can be switched on or off > using their reset registers. > > For more details, please see the SSE-7

Re: [PATCH v1 2/5] dt-bindings: mailbox: add binding for Microchip IPC mailbox driver

2024-09-18 Thread Rob Herring
On Mon, Sep 16, 2024 at 05:31:36PM +0100, Conor Dooley wrote: > On Thu, Sep 12, 2024 at 04:23:44PM -0500, Samuel Holland wrote: > > Hi Valentina, > > > > On 2024-09-12 12:00 PM, Valentina Fernandez wrote: > > > Add a dt-binding for the Microchip Inter-Processor Communication (IPC) > > > mailbox co

Re: [RFC PATCH 1/4] hazptr: Add initial implementation of hazard pointers

2024-09-18 Thread Alan Huang
2024年9月17日 22:33,Boqun Feng wrote: > > Hazard pointers [1] provide a way to dynamically distribute refcounting > and can be used to improve the scalability of refcounting without > significant space cost. > > Hazard pointers are similar to RCU: they build the synchronization > between two part,

Re: [PATCH v3] virtio_net: Fix mismatched buf address when unmapping for small packets

2024-09-18 Thread Michael S. Tsirkin
On Wed, Sep 18, 2024 at 09:20:05PM +0800, Wenbo Li wrote: > Currently, the virtio-net driver will perform a pre-dma-mapping for > small or mergeable RX buffer. But for small packets, a mismatched address > without VIRTNET_RX_PAD and xdp_headroom is used for unmapping. > > That will result in unsyn

Re: [PATCH v9 4/7] remoteproc: core: Add TEE interface support for firmware release

2024-09-18 Thread Arnaud POULIQUEN
Hello Mathieu, On 8/30/24 11:51, Arnaud Pouliquen wrote: > Add support for releasing remote processor firmware through > the Trusted Execution Environment (TEE) interface. > > The tee_rproc_release_fw() function is called in the following cases: > > - An error occurs in rproc_start() between the

Re: [GIT PULL] slab updates for 6.11

2024-09-18 Thread Uladzislau Rezki
Hello, Linus! On Wed, Sep 18, 2024 at 9:06 AM Linus Torvalds wrote: > > On Mon, 16 Sept 2024 at 11:45, Vlastimil Babka wrote: > > > > There's a small conflict with the rcu tree: > > https://lore.kernel.org/lkml/20240812124748.37250...@canb.auug.org.au/ > > Hmm. The conflict resolution is trivial

Re: [GIT PULL] livepatching for 6.12

2024-09-18 Thread pr-tracker-bot
The pull request you sent on Mon, 16 Sep 2024 16:43:55 +0200: > git://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching.git > tags/livepatching-for-6.12 has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/c8d8a35d094626808cd07ed0758e14c7e4cf61ac Thank you!

[PATCH v3] virtio_net: Fix mismatched buf address when unmapping for small packets

2024-09-18 Thread Wenbo Li
Currently, the virtio-net driver will perform a pre-dma-mapping for small or mergeable RX buffer. But for small packets, a mismatched address without VIRTNET_RX_PAD and xdp_headroom is used for unmapping. That will result in unsynchronized buffers when SWIOTLB is enabled, for example, when running

Re: [RFC PATCH 1/3] ipv4: Run a reverse sk_lookup on sendmsg.

2024-09-18 Thread Willem de Bruijn
Tiago Lam wrote: > In order to check if egress traffic should be allowed through, we run a > reverse socket lookup (i.e. normal socket lookup with the src/dst > addresses and ports reversed) to check if the corresponding ingress > traffic is allowed in. The subject and this description makes it so

Re: [PATCH net-next v2 2/3] selftests: nic_basic_tests: Add selftest case for speed and duplex state checks

2024-09-18 Thread Willem de Bruijn
Mohan Prasad J wrote: > Add selftest case for testing the speed and duplex state of > local NIC driver and the partner based on the supported > link modes obtained from the ethtool. Speed and duplex states > are varied and verified using ethtool. > > Signed-off-by: Mohan Prasad J > --- > .../dri

Re: [PATCH net-next v2 1/3] selftests: nic_basic_tests: Add selftest file for basic tests of NIC

2024-09-18 Thread Andrew Lunn
> > So i don't think this is a valid test. To really test autoneg off, you need > > to > > configure both ends of the link. > > I will change the implementation to configure both the ends of the link > appropriately in the next version. That would be good, but it does make the test and the test

Re: [PATCH net-next v2 1/3] selftests: nic_basic_tests: Add selftest file for basic tests of NIC

2024-09-18 Thread Andrew Lunn
> > Since you have batteries included python: > > > > ethtool --json enp2s0 > > [sudo] password for andrew: > > [ { > > "ifname": "enp2s0", > > "supported-ports": [ "TP","MII" ], > > "supported-link-modes": [ > > "10baseT/Half","10baseT/Full","100baseT/Half","100baseT/Full"

Re: [PATCH 12/19] kthread: Default affine kthread to its preferred NUMA node

2024-09-18 Thread Michal Hocko
On Wed 18-09-24 11:37:42, Frederic Weisbecker wrote: > Le Tue, Sep 17, 2024 at 01:07:25PM +0200, Michal Hocko a écrit : [...] > > I am not objecting to patch per se. I am just not sure this is really > > needed. It is great to have kernel threads bound to non isolated cpus by > > default if they ha

RE: [PATCH net-next v2 1/3] selftests: nic_basic_tests: Add selftest file for basic tests of NIC

2024-09-18 Thread Mohan.Prasad
Hi Andrew, Thank you for the review comments. > EXTERNAL EMAIL: Do not click links or open attachments unless you know the > content is safe > > On Tue, Sep 17, 2024 at 08:04:07AM +0530, Mohan Prasad J wrote: > > Add selftest file to test basic features of a NIC driver. > > Tests for link modes,

RE: [PATCH net-next v2 1/3] selftests: nic_basic_tests: Add selftest file for basic tests of NIC

2024-09-18 Thread Mohan.Prasad
Hi Andrew, Thanks for the review comments. > EXTERNAL EMAIL: Do not click links or open attachments unless you know the > content is safe > > > +def verify_link_up(ifname: str) -> None: > > +"""Verify whether the link is up""" > > +with open(f"/sys/class/net/{ifname}/operstate", "r") as

RE: [PATCH net-next v2 1/3] selftests: nic_basic_tests: Add selftest file for basic tests of NIC

2024-09-18 Thread Mohan.Prasad
Hello Andrew, Thanks for the review comments. > EXTERNAL EMAIL: Do not click links or open attachments unless you know the > content is safe > > On Tue, Sep 17, 2024 at 08:04:07AM +0530, Mohan Prasad J wrote: > > Add selftest file to test basic features of a NIC driver. > > Tests for link modes,

Re: [PATCH 12/19] kthread: Default affine kthread to its preferred NUMA node

2024-09-18 Thread Frederic Weisbecker
Le Tue, Sep 17, 2024 at 01:07:25PM +0200, Michal Hocko a écrit : > On Tue 17-09-24 12:34:51, Frederic Weisbecker wrote: > > Le Tue, Sep 17, 2024 at 08:26:49AM +0200, Michal Hocko a écrit : > > > On Tue 17-09-24 00:49:16, Frederic Weisbecker wrote: > > > > Kthreads attached to a preferred NUMA node

Re: [RFC PATCH 1/4] hazptr: Add initial implementation of hazard pointers

2024-09-18 Thread Mathieu Desnoyers
On 2024-09-17 16:33, Boqun Feng wrote: [...] The synchronization between readers and updaters is built around "hazard pointer slots": a slot readers can use to store a pointer value. Reader side protection: 1. Read the value of a pointer to the target data element. 2. Store it to a h

RE: [PATCH v2 17/19] iommu/arm-smmu-v3: Add arm_smmu_viommu_cache_invalidate

2024-09-18 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Saturday, September 14, 2024 10:51 PM > > On Fri, Sep 13, 2024 at 02:33:59AM +, Tian, Kevin wrote: > > > From: Jason Gunthorpe > > > Sent: Thursday, September 12, 2024 7:08 AM > > > > > > On Wed, Sep 11, 2024 at 08:13:01AM +, Tian, Kevin wrote: > > > > > >

Re: [GIT PULL] slab updates for 6.11

2024-09-18 Thread pr-tracker-bot
The pull request you sent on Mon, 16 Sep 2024 11:45:42 +0200: > git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab.git > tags/slab-for-6.12 has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/bdf56c7580d267a123cc71ca0f2459c797b76fde Thank you! -- Deet-doot-dot, I

Re: [GIT PULL] RCU changes for v6.12

2024-09-18 Thread pr-tracker-bot
The pull request you sent on Sat, 14 Sep 2024 08:15:27 +0530: > git://git.kernel.org/pub/scm/linux/kernel/git/rcu/linux.git > tags/rcu.release.v6.12 has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/067610ebaaec53809794807842a2fcf5f1f5b9eb Thank you! -- Deet-doot-dot,

[PATCH bpf-next v2 2/2] bpf, selftests: Add test case for cgroup skb to get net_cls classid helpers

2024-09-18 Thread Feng zhou
From: Feng Zhou This patch adds a test for cgroup skb to get classid. Signed-off-by: Feng Zhou --- .../bpf/prog_tests/cg_skb_get_classid.c | 87 +++ .../selftests/bpf/progs/cg_skb_get_classid.c | 19 2 files changed, 106 insertions(+) create mode 100644 tools/testi

[PATCH bpf-next v2 1/2] bpf: cg_skb add get classid helper

2024-09-18 Thread Feng zhou
From: Feng Zhou At cg_skb hook point, can get classid for v1 or v2, allowing users to do more functions such as acl. Signed-off-by: Feng Zhou --- net/core/filter.c | 4 1 file changed, 4 insertions(+) diff --git a/net/core/filter.c b/net/core/filter.c index e4a4454df5f9..a4aa39b6dbba 100

[PATCH bpf-next v2 0/2] Cgroup skb add helper to get net_cls's classid

2024-09-18 Thread Feng zhou
From: Feng Zhou 0001: Cgroup skb add bpf_skb_cgroup_classid_proto. 0002: Add a testcase for it. Feng Zhou (2): bpf: cg_skb add get classid helper bpf, selftests: Add test case for cgroup skb to get net_cls classid helpers Changelog: v1->v2: Addressed comments from Martin KaFai Lau - Jus

Re: [RFC PATCH 0/4] Add hazard pointers to kernel

2024-09-18 Thread Linus Torvalds
On Tue, 17 Sept 2024 at 16:34, Boqun Feng wrote: > > This series introduces hazard pointers [1] to kernel space. A TL;DR > description of hazard pointers is "a scalable refcounting mechanim > with RCU-like API". More information can be found at [2]. Please give actual "this is useful for X, and h

Re: [GIT PULL] slab updates for 6.11

2024-09-18 Thread Linus Torvalds
On Mon, 16 Sept 2024 at 11:45, Vlastimil Babka wrote: > > There's a small conflict with the rcu tree: > https://lore.kernel.org/lkml/20240812124748.37250...@canb.auug.org.au/ Hmm. The conflict resolution is trivial, but the code itself looks buggy. Look here, commit 2b55d6a42d14 ("rcu/kvfree: Ad

Re: [RESEND PATCH v2] list: test: Mending tests for list_cut_position()

2024-09-18 Thread David Gow
On Tue, 10 Sept 2024 at 12:35, I Hsin Cheng wrote: > > Mending test for list_cut_position*() for the missing check of integer > "i" after the second loop. The variable should be checked for second > time to make sure both lists after the cut operation are formed as > expected. > > Signed-off-by: I