Re: [PATCH v8 8/8] clk: Add KUnit tests for clks registered with struct clk_parent_data

2024-09-27 Thread Guenter Roeck
On 9/27/24 13:45, Shuah Khan wrote: On 9/27/24 10:19, Guenter Roeck wrote: Copying devicetree maintainers. On Thu, Sep 26, 2024 at 09:39:38PM -0700, Guenter Roeck wrote: On Thu, Sep 26, 2024 at 09:14:11PM -0700, Guenter Roeck wrote: Hi Stephen, On Thu, Jul 18, 2024 at 02:05:07PM -0700, Steph

Re: [RFC PATCH] compiler.h: Introduce ptr_eq() to preserve address dependency

2024-09-27 Thread Boqun Feng
On Fri, Sep 27, 2024 at 07:05:53PM -0400, Mathieu Desnoyers wrote: > On 2024-09-27 22:33, Mathieu Desnoyers wrote: > [...] > > > --- > > include/linux/compiler.h | 62 > > 1 file changed, 62 insertions(+) > > > > I'm wondering if this really belongs in

Re: [RFC PATCH] compiler.h: Introduce ptr_eq() to preserve address dependency

2024-09-27 Thread Boqun Feng
[Cc Gary] On Fri, Sep 27, 2024 at 04:33:34PM -0400, Mathieu Desnoyers wrote: > Compiler CSE and SSA GVN optimizations can cause the address dependency > of addresses returned by rcu_dereference to be lost when comparing those > pointers with either constants or previously loaded pointers. > > Int

Re: [RFC PATCH] compiler.h: Introduce ptr_eq() to preserve address dependency

2024-09-27 Thread Mathieu Desnoyers
On 2024-09-27 22:33, Mathieu Desnoyers wrote: [...] --- include/linux/compiler.h | 62 1 file changed, 62 insertions(+) I'm wondering if this really belongs in compiler.h, or if it's so RCU/HP specific that it should be implemented in rcupdate.h ?

Re: [PATCH] selftests: vDSO: align stack for O2-optimized memcpy

2024-09-27 Thread Shuah Khan
On 9/27/24 11:24, Jason A. Donenfeld wrote: Hi Shuah, On Tue, Sep 24, 2024 at 01:47:23PM +0200, Jason A. Donenfeld wrote: When switching on -O2, gcc generates SSE2 instructions that assume a 16-byte aligned stack, which the standalone test's start point wasn't aligning. Fix this with the usual

Re: [PATCH v8 8/8] clk: Add KUnit tests for clks registered with struct clk_parent_data

2024-09-27 Thread Guenter Roeck
Copying devicetree maintainers. On Thu, Sep 26, 2024 at 09:39:38PM -0700, Guenter Roeck wrote: > On Thu, Sep 26, 2024 at 09:14:11PM -0700, Guenter Roeck wrote: > > Hi Stephen, > > > > On Thu, Jul 18, 2024 at 02:05:07PM -0700, Stephen Boyd wrote: > > > Test that clks registered with 'struct clk_pa

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

2024-09-27 Thread Jonas Oberhauser
Am 9/27/2024 um 10:10 PM schrieb Mathieu Desnoyers: On 2024-09-27 21:23, Jonas Oberhauser wrote: [...] That idea seems to be confirmed by this (atrocious, not to be copied!) example: int fct_escape_address_of_b(void) { int *a, *b; do { a = READ_ONCE(p); asm vola

Re: [PATCH v4] memfd: `MFD_NOEXEC_SEAL` should not imply `MFD_ALLOW_SEALING`

2024-09-27 Thread Barnabás Pőcze
Hi Gentle ping. Is there any chance we could move forward with this? I am not aware of any breakage it would cause; but longer the wait, the higher the likelihood. Regards, Barnabás Pőcze 2024. június 30., vasárnap 20:49 keltezéssel, Barnabás Pőcze írta: > `MFD_NOEXEC_SEAL` should remove th

Re: [PATCH] remoteproc: qcom: Fix NULL pointer in glink_subdev_stop()

2024-09-27 Thread Bjorn Andersson
On Sat, Sep 28, 2024 at 01:07:43AM +0530, Mukesh Ojha wrote: > On Wed, Sep 25, 2024 at 08:41:55PM -0700, Bjorn Andersson wrote: > > On Wed, Sep 25, 2024 at 04:03:51PM +0530, Mukesh Ojha wrote: > > > Multiple call to glink_subdev_stop() for the same remoteproc can happen > > > if rproc_stop() fails

[GIT PULL] Modules changes for v6.12-rc1

2024-09-27 Thread Luis Chamberlain
The following changes since commit 47ac09b91befbb6a235ab620c32af719f8208399: Linux 6.11-rc4 (2024-08-18 13:17:27 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git/ tags/modules-6.12-rc1 for you to fetch changes up to b319cea80539d

Re: [PATCH -next] selftests/bpf: Use ARRAY_SIZE for array length

2024-09-27 Thread Andrii Nakryiko
On Fri, Sep 27, 2024 at 1:23 AM Jiapeng Chong wrote: > > Use of macro ARRAY_SIZE to calculate array size minimizes > the redundant code and improves code reusability. > > ./tools/testing/selftests/bpf/prog_tests/core_reloc_raw.c:98:34-35: WARNING: > Use ARRAY_SIZE. > ./tools/testing/selftests/bpf

Re: [PATCH v2 00/19] iommufd: Add VIOMMU infrastructure (Part-1)

2024-09-27 Thread Nicolin Chen
On Fri, Sep 27, 2024 at 08:12:20PM +0800, Yi Liu wrote: > On 2024/9/27 14:32, Nicolin Chen wrote: > > On Fri, Sep 27, 2024 at 01:54:45PM +0800, Yi Liu wrote: > > > > > > Baolu told me that Intel may have the same: different domain IDs > > > > > > on different IOMMUs; multiple IOMMU instances on one

Re: [PATCH bpf-next 2/2] selftests: bpf: Add missing per-arch include path

2024-09-27 Thread Andrii Nakryiko
On Fri, Sep 27, 2024 at 6:14 AM Björn Töpel wrote: > > From: Björn Töpel > > The prog_tests programs do not include the per-arch tools include > path, e.g. tools/arch/riscv/include. Some architectures depend those > files to build properly. > > Include tools/arch/$(SUBARCH)/include in the selftes

Re: [PATCH v8 8/8] clk: Add KUnit tests for clks registered with struct clk_parent_data

2024-09-27 Thread Shuah Khan
On 9/27/24 10:19, Guenter Roeck wrote: Copying devicetree maintainers. On Thu, Sep 26, 2024 at 09:39:38PM -0700, Guenter Roeck wrote: On Thu, Sep 26, 2024 at 09:14:11PM -0700, Guenter Roeck wrote: Hi Stephen, On Thu, Jul 18, 2024 at 02:05:07PM -0700, Stephen Boyd wrote: Test that clks regist

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

2024-09-27 Thread Mathieu Desnoyers
On 2024-09-27 21:23, Jonas Oberhauser wrote: [...] That idea seems to be confirmed by this (atrocious, not to be copied!) example: int fct_escape_address_of_b(void) {     int *a, *b;     do {     a = READ_ONCE(p);     asm volatile ("" : : : "memory");     b = READ_ONCE(p);   

Re: [PATCH bpf-next 1/2] libbpf: Add missing per-arch include path

2024-09-27 Thread Andrii Nakryiko
On Fri, Sep 27, 2024 at 6:14 AM Björn Töpel wrote: > > From: Björn Töpel > > libbpf does not include the per-arch tools include path, e.g. > tools/arch/riscv/include. Some architectures depend those files to > build properly. > > Include tools/arch/$(SUBARCH)/include in the libbpf build. > > Fixe

Re: [PATCH v2 04/19] iommufd: Allow pt_id to carry viommu_id for IOMMU_HWPT_ALLOC

2024-09-27 Thread Nicolin Chen
On Fri, Sep 27, 2024 at 08:12:40PM +0800, Yi Liu wrote: > External email: Use caution opening links or attachments > > > On 2024/9/27 14:02, Nicolin Chen wrote: > > On Fri, Sep 27, 2024 at 01:38:08PM +0800, Yi Liu wrote: > > > > > Does it mean each vIOMMU of VM can only have > > > > > one s2 HWPT

[RFC PATCH] compiler.h: Introduce ptr_eq() to preserve address dependency

2024-09-27 Thread Mathieu Desnoyers
Compiler CSE and SSA GVN optimizations can cause the address dependency of addresses returned by rcu_dereference to be lost when comparing those pointers with either constants or previously loaded pointers. Introduce ptr_eq() to compare two addresses while preserving the address dependencies for l

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

2024-09-27 Thread Linus Torvalds
On Fri, 27 Sept 2024 at 12:28, Linus Torvalds wrote: > > Dammit, people, read the code I posted. Actually, no, apologies. You were right, and I was wrong. It does need both of the sources of the comparison to be hidden, because while even hiding just one side makes the comparison result "meaning

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

2024-09-27 Thread Mathieu Desnoyers
On 2024-09-27 20:13, Linus Torvalds wrote: On Fri, 27 Sept 2024 at 10:53, Mathieu Desnoyers wrote: (b) the value barrier needs to be on *both* values so that the order of the equality testing doesn't matter. If we use OPTIMIZER_HIDE_VAR() on both parameters, it indeed minimizes the odds

Re: [PATCH v2 04/19] iommufd: Allow pt_id to carry viommu_id for IOMMU_HWPT_ALLOC

2024-09-27 Thread Nicolin Chen
On Fri, Sep 27, 2024 at 08:59:25AM -0300, Jason Gunthorpe wrote: > On Thu, Sep 26, 2024 at 11:02:37PM -0700, Nicolin Chen wrote: > > On Fri, Sep 27, 2024 at 01:38:08PM +0800, Yi Liu wrote: > > > > > Does it mean each vIOMMU of VM can only have > > > > > one s2 HWPT? > > > > > > > > Giving some exa

Re: [PATCH] remoteproc: qcom: Fix NULL pointer in glink_subdev_stop()

2024-09-27 Thread Mukesh Ojha
On Wed, Sep 25, 2024 at 08:41:55PM -0700, Bjorn Andersson wrote: > On Wed, Sep 25, 2024 at 04:03:51PM +0530, Mukesh Ojha wrote: > > Multiple call to glink_subdev_stop() for the same remoteproc can happen > > if rproc_stop() fails from Process-A that leaves the rproc state to > > RPROC_CRASHED state

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

2024-09-27 Thread Linus Torvalds
On Fri, 27 Sept 2024 at 12:12, Jonas Oberhauser wrote: > > I think it depends on which one you hide. No. Dammit, people, read the code I posted. > But for > > z = a; > hide(z); > if (z==b) { *b; } No. I *intentionally* made it an inline function, and only hid the arguments to the equali

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

2024-09-27 Thread Jonas Oberhauser
Two comments inline, Am 9/27/2024 um 6:38 AM schrieb Boqun Feng: compilers can replace 'ptr' with 'head' because of the equality, and even putting barrier() here cannot prevent compiler to rewrite the else branch into: else { barrier(); return head;

[PATCH 3/3] selftests: KVM: Add test case for MMIO during event delivery

2024-09-27 Thread Ivan Orlov
Extend the 'set_memory_region_test' with a test case which covers the MMIO during event delivery error handling. The test case 1) Tries to set an IDT descriptor base to point to an MMIO address 2) Generates a #GP 3) Verifies that we got a correct exit reason (KVM_EXIT_INTERNAL_ERROR) and suberr

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

2024-09-27 Thread Jonas Oberhauser
Am 9/27/2024 um 8:13 PM schrieb Linus Torvalds: Because even hiding the value one from the compiler will mean that it can't use the comparison to decide that the originals are equal, even if one of them is unhidden. No? Linus I think it depends on which one you hide. If yo

Re: [PATCH] openrisc: Implement fixmap to fix eralycon

2024-09-27 Thread Stafford Horne
Review from myself, I sent this one out pretty quickly just to get some conversation started. In the subject if should be 'earlycon' no 'eralycon'. On Fri, Sep 27, 2024 at 03:56:56PM +0100, Stafford Horne wrote: > With commit 53c98e35dcbc ("openrisc: mm: remove unneeded early ioremap > code") it

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

2024-09-27 Thread Linus Torvalds
On Fri, 27 Sept 2024 at 10:53, Mathieu Desnoyers wrote: > > > (b) the value barrier needs to be on *both* values so that the order > > of the equality testing doesn't matter. > > If we use OPTIMIZER_HIDE_VAR() on both parameters, it indeed minimizes > the odds that someone get the order wrong, b

Re: [PATCH] selftests/mm: Fixed incorrect buffer->mirror size in hmm2 double_map test

2024-09-27 Thread Andrew Morton
On Fri, 27 Sep 2024 16:21:30 +0530 Donet Tom wrote: > >> Test Result with this patch > >> === > >> # RUN hmm2.hmm2_device_private.double_map ... > >> #OK hmm2.hmm2_device_private.double_map > >> ok 53 hmm2.hmm2_device_private.double_map > >> >

Re: [PATCH v2 1/5] dt-bindings: remoteproc: sse710: Add the External Systems remote processors

2024-09-27 Thread Robin Murphy
On 22/08/2024 6:09 pm, Abdellatif El Khlifi wrote: Add devicetree binding schema for the External Systems remote processors The External Systems remote processors are provided on the Corstone-1000 IoT Reference Design Platform via the SSE-710 subsystem. For more details about the External Syste

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

2024-09-27 Thread Mathieu Desnoyers
On 2024-09-27 19:23, Linus Torvalds wrote: On Fri, 27 Sept 2024 at 10:17, Mathieu Desnoyers wrote: The barrier() is ineffective at fixing the issue. It does not prevent the compiler CSE from losing the address dependency: Ok. Thanks for actually specifying code. That needs to be (a) in a

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

2024-09-27 Thread Linus Torvalds
On Fri, 27 Sept 2024 at 10:17, Mathieu Desnoyers wrote: > > The barrier() is ineffective at fixing the issue. > It does not prevent the compiler CSE from losing the > address dependency: Ok. Thanks for actually specifying code. That needs to be (a) in a comment (b) the value barrier needs to

Re: [PATCH] selftests: vDSO: align stack for O2-optimized memcpy

2024-09-27 Thread Jason A. Donenfeld
Hi Shuah, On Tue, Sep 24, 2024 at 01:47:23PM +0200, Jason A. Donenfeld wrote: > When switching on -O2, gcc generates SSE2 instructions that assume a > 16-byte aligned stack, which the standalone test's start point wasn't > aligning. Fix this with the usual alignnent sequence. > > Fixes: ecb8bd70d

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

2024-09-27 Thread Mathieu Desnoyers
On 2024-09-27 18:44, Linus Torvalds wrote: On Thu, 26 Sept 2024 at 18:38, Boqun Feng wrote: Note that ADDRESS_EQ() only hide first parameter, so this should be ADDRESS_EQ(b, a). Yeah, please stop making things unnecessarily complicated. Just use a barrier(). Please. Stop these stupid games

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

2024-09-27 Thread Linus Torvalds
On Thu, 26 Sept 2024 at 18:38, Boqun Feng wrote: > > Note that ADDRESS_EQ() only hide first parameter, so this should be > ADDRESS_EQ(b, a). Yeah, please stop making things unnecessarily complicated. Just use a barrier(). Please. Stop these stupid games until you can show why it matters. And b

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

2024-09-27 Thread Alan Huang
2024年9月27日 12:28,Boqun Feng wrote: > > On Fri, Sep 27, 2024 at 09:37:50AM +0800, Boqun Feng wrote: >> >> >> On Fri, Sep 27, 2024, at 9:30 AM, Mathieu Desnoyers wrote: >>> On 2024-09-27 02:01, Boqun Feng wrote: #define ADDRESS_EQ(var, expr) \ ({ \ bool _cmp_res = (unsigned lon

[PATCH 2/3] KVM: vmx, svm, mmu: Process MMIO during event delivery

2024-09-27 Thread Ivan Orlov
Currently, the situation when guest accesses MMIO during event delivery is handled differently in VMX and SVM: on VMX KVM returns internal error with suberror = KVM_INTERNAL_ERROR_DELIVERY_EV, when SVM simply goes into infinite loop trying to deliver an event again and again. Such a situation coul

[PATCH 1/3] KVM: x86, vmx: Add function for event delivery error generation

2024-09-27 Thread Ivan Orlov
Extract KVM_INTERNAL_ERROR_DELIVERY_EV internal error generation into the SVM/VMX-agnostic 'kvm_prepare_ev_delivery_failure_exit' function, as it is done for KVM_INTERNAL_ERROR_EMULATION. The order of internal.data array entries is preserved as is, so it is going to be the same on VMX platforms (ve

[PATCH 0/3] Handle MMIO during event delivery error on SVM

2024-09-27 Thread Ivan Orlov
Currently, the situation when guest accesses MMIO during event delivery is handled differently in VMX and SVM: on VMX KVM returns internal error with suberror = KVM_INTERNAL_ERROR_DELIVERY_EV, when SVM simply goes into infinite loop trying to deliver an event again and again. This patch series eli

[PATCH] openrisc: Implement fixmap to fix eralycon

2024-09-27 Thread Stafford Horne
With commit 53c98e35dcbc ("openrisc: mm: remove unneeded early ioremap code") it was commented that early ioremap was not used in OpenRISC. I acked this but was wrong. Earlycon now fails with the below trace: Kernel command line: earlycon [ cut here ] WARNING:

Re: [PATCH v2 06/19] iommufd/viommu: Add IOMMU_VIOMMU_SET/UNSET_VDEV_ID ioctl

2024-09-27 Thread Mostafa Saleh
On Fri, Sep 27, 2024 at 3:58 PM Jason Gunthorpe wrote: > > On Fri, Sep 27, 2024 at 02:22:20PM +, Mostafa Saleh wrote: > > > > We don't support multi SID through this interface, at least in this > > > version. > > > > > > To do multi-sid you have to inform the VM of all the different pSIDs > >

[PATCH] virtio: Fixes errors: uninitialized symbol

2024-09-27 Thread Alessandro Zanni
This fix solves multiple Smatch static checker uninitialized errors: drivers/virtio/virtio_ring.c:1516 virtqueue_add_packed() error: uninitialized symbol 'prev'. drivers/virtio/virtio_ring.c:1524 virtqueue_add_packed() error: uninitialized symbol 'head_flags'. drivers/virtio/virtio_ring.c:645 vi

Re: [PATCH] selftests/powerpc: Rm the unnecessary remove function.

2024-09-27 Thread IBM
zhangjiao2 writes: > From: zhang jiao > > Path is not initialized before use, > remove the unnecessary remove function. > > Signed-off-by: zhang jiao > --- > tools/testing/selftests/powerpc/mm/tlbie_test.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/tools/testing/selftests/powerpc/

Re: [PATCH v2 1/2] exec: add a flag for "reasonable" execveat() comm

2024-09-27 Thread Eric W. Biederman
Tycho Andersen writes: > From: Tycho Andersen > > Zbigniew mentioned at Linux Plumber's that systemd is interested in > switching to execveat() for service execution, but can't, because the > contents of /proc/pid/comm are the file descriptor which was used, > instead of the path to the binary.

[PATCH] selftests: clone3: Avoid fragile struct poking

2024-09-27 Thread Björn Töpel
From: Björn Töpel The struct libcap in the selftest, and the what libcap is actually using doesn't match, so the test fail. Libcap internals have changed, but the selftest hasn't. Fix by avoid poking the libcap internals. Signed-off-by: Björn Töpel --- .../clone3/clone3_cap_checkpoint_restore

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

2024-09-27 Thread Mathieu Desnoyers
On 2024-09-27 16:43, Mathieu Desnoyers wrote: On 2024-09-27 12:59, Mathieu Desnoyers wrote: On 2024-09-27 06:28, Boqun Feng wrote: [...] I replaced ADDRESS_EQ(a, b) with ADDRESS_EQ(b, a), and the compile result shows it can prevent the issue: I see, yes. It prevents the issue by making the c

Re: [PATCH RFT v9 4/8] fork: Add shadow stack support to clone3()

2024-09-27 Thread Edgecombe, Rick P
On Fri, 2024-09-27 at 10:50 +0200, Christian Brauner wrote: > The legacy clone system call had required userspace to know in which > direction the stack was growing and then pass down the stack pointer > appropriately (e.g., parisc grows upwards). > > And in fact, the old clone() system call did t

[PATCH v2 2/2] selftests/exec: add a test to enforce execveat()'s comm

2024-09-27 Thread Tycho Andersen
From: Tycho Andersen We want to ensure that /proc/self/comm stays useful for execveat() callers. Signed-off-by: Tycho Andersen --- tools/testing/selftests/exec/execveat.c | 25 + 1 file changed, 25 insertions(+) diff --git a/tools/testing/selftests/exec/execveat.c b/t

[PATCH v2 1/2] exec: add a flag for "reasonable" execveat() comm

2024-09-27 Thread Tycho Andersen
From: Tycho Andersen Zbigniew mentioned at Linux Plumber's that systemd is interested in switching to execveat() for service execution, but can't, because the contents of /proc/pid/comm are the file descriptor which was used, instead of the path to the binary. This makes the output of tools like

Re: [PATCH v2 06/19] iommufd/viommu: Add IOMMU_VIOMMU_SET/UNSET_VDEV_ID ioctl

2024-09-27 Thread Jason Gunthorpe
On Fri, Sep 27, 2024 at 02:22:20PM +, Mostafa Saleh wrote: > > We don't support multi SID through this interface, at least in this > > version. > > > > To do multi-sid you have to inform the VM of all the different pSIDs > > the device has and then setup the vSID/pSID translation to map them

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

2024-09-27 Thread Mathieu Desnoyers
On 2024-09-27 12:59, Mathieu Desnoyers wrote: On 2024-09-27 06:28, Boqun Feng wrote: [...] I replaced ADDRESS_EQ(a, b) with ADDRESS_EQ(b, a), and the compile result shows it can prevent the issue: I see, yes. It prevents the issue by making the compiler create a copy of the value "modified" b

Re: [PATCH] Documentation: Add description to stack_order interface

2024-09-27 Thread Miroslav Benes
On Wed, 25 Sep 2024, Wardenjohn wrote: > Update description of klp_patch stack_order sysfs interface to > livepatch ABI documentation. > > Signed-off-by: Wardenjohn > > diff --git a/Documentation/ABI/testing/sysfs-kernel-livepatch > b/Documentation/ABI/testing/sysfs-kernel-livepatch > index a5

Re: [PATCH v2 06/19] iommufd/viommu: Add IOMMU_VIOMMU_SET/UNSET_VDEV_ID ioctl

2024-09-27 Thread Mostafa Saleh
On Fri, Sep 27, 2024 at 11:01:41AM -0300, Jason Gunthorpe wrote: > On Fri, Sep 27, 2024 at 01:50:52PM +, Mostafa Saleh wrote: > > > My understanding of IOMMUFD is very little, but AFAICT, that means that > > it’s assumed that each device can only have one stream ID(RID)? > > > > As I can see

Re: [PATCH] livepatch: introduce 'stack_order' sysfs interface to klp_patch

2024-09-27 Thread Miroslav Benes
Hi, I would change the subject to something like "livepatch: Add "stack_order" sysfs attribute" to keep it somehow consistent with what we have there so far. On Wed, 25 Sep 2024, Wardenjohn wrote: > This feature can provide livepatch patch order information. > With the order of sysfs interface

Re: [PATCH v2 06/19] iommufd/viommu: Add IOMMU_VIOMMU_SET/UNSET_VDEV_ID ioctl

2024-09-27 Thread Jason Gunthorpe
On Fri, Sep 27, 2024 at 01:50:52PM +, Mostafa Saleh wrote: > My understanding of IOMMUFD is very little, but AFAICT, that means that > it’s assumed that each device can only have one stream ID(RID)? > > As I can see in patch 17 in arm_smmu_convert_viommu_vdev_id(), it > converts the virtual I

Re: [PATCH v2 06/19] iommufd/viommu: Add IOMMU_VIOMMU_SET/UNSET_VDEV_ID ioctl

2024-09-27 Thread Mostafa Saleh
Hi Nicolin, On Tue, Aug 27, 2024 at 09:59:43AM -0700, Nicolin Chen wrote: > Introduce a pair of new ioctls to set/unset a per-viommu virtual device id > that should be linked to a physical device id via an idev pointer. > > Continue the support IOMMU_VIOMMU_TYPE_DEFAULT for a core-managed viommu.

Re: [PATCH net v3] selftests: forwarding: no_forwarding: Fix issue related with assigning two different vids to the same interface.

2024-09-27 Thread Vladimir Oltean
Hi Kacper, On Fri, Sep 27, 2024 at 08:28:24PM +0900, Kacper Ludwinski wrote: > Fix typo. > Currently, the second bridge command overwrites the first one. > Fix this by adding this VID to the interface behind $swp2. > > Fixes: 476a4f05d9b8 ("selftests: forwarding: add a no_forwarding.sh test") > S

Re: [PATCH] selftests/mm: Add missing free.

2024-09-27 Thread David Hildenbrand
On 27.09.24 05:01, zhangjiao2 wrote: From: zhang jiao There is a memory leak in mkdirty, just free src before return. Now explain to me why we care. The program will return immediately afterwards? -- Cheers, David / dhildenb

Re: [PATCH v2 00/19] iommufd: Add VIOMMU infrastructure (Part-1)

2024-09-27 Thread Yi Liu
On 2024/9/27 14:32, Nicolin Chen wrote: On Fri, Sep 27, 2024 at 01:54:45PM +0800, Yi Liu wrote: Baolu told me that Intel may have the same: different domain IDs on different IOMMUs; multiple IOMMU instances on one chip: https://lore.kernel.org/linux-iommu/cf4fe15c-8bcb-4132-a1fd-b2c8ddf27...@lin

[PATCH bpf-next 2/2] selftests: bpf: Add missing per-arch include path

2024-09-27 Thread Björn Töpel
From: Björn Töpel The prog_tests programs do not include the per-arch tools include path, e.g. tools/arch/riscv/include. Some architectures depend those files to build properly. Include tools/arch/$(SUBARCH)/include in the selftests bpf build. Fixes: 6d74d178fe6e ("tools: Add riscv barrier impl

[PATCH bpf-next 1/2] libbpf: Add missing per-arch include path

2024-09-27 Thread Björn Töpel
From: Björn Töpel libbpf does not include the per-arch tools include path, e.g. tools/arch/riscv/include. Some architectures depend those files to build properly. Include tools/arch/$(SUBARCH)/include in the libbpf build. Fixes: 6d74d178fe6e ("tools: Add riscv barrier implementation") Signed-of

Re: [PATCH v3 3/3] selftests: livepatch: test livepatching a kprobed function

2024-09-27 Thread Miroslav Benes
Hi, On Fri, 20 Sep 2024, Michael Vetter wrote: > +# Kprobe a function and verify that we can't livepatch that same function > +# when it uses a post_handler since only one IPMODIFY maybe be registered > +# to any given function at a time. > + > +start_test "livepatch interaction with kprobed func

Re: [PATCH v3 2/3] selftests: livepatch: save and restore kprobe state

2024-09-27 Thread Miroslav Benes
Hi, On Fri, 20 Sep 2024, Michael Vetter wrote: > Save the state of /sys/kernel/livepatch/debug/kprobes/enabled I believe it is /sys/kernel/debug/kprobes/enabled. > during setup_config() and restore it during cleanup(). > > This is in preparation for a future commit that will add a test > that

Re: [PATCH] selftests/net: Add missing va_end.

2024-09-27 Thread Simon Horman
On Fri, Sep 27, 2024 at 12:00:50PM +0800, zhangjiao2 wrote: > From: zhang jiao > > There is no va_end after va_copy, just add it. > > Signed-off-by: zhang jiao Thanks, this looks good to me. Reviewed-by: Simon Horman

Re: [PATCH v2 00/19] iommufd: Add VIOMMU infrastructure (Part-1)

2024-09-27 Thread Jason Gunthorpe
On Fri, Sep 27, 2024 at 08:12:20PM +0800, Yi Liu wrote: > > Perhaps calling it a slice sounds more accurate, as I guess all > > the confusion comes from the name "vIOMMU" that might be thought > > to be a user space object/instance that likely holds all virtual > > stuff like stage-1 HWPT or so? >

Re: [PATCH 0/4] Process some MMIO-related errors without KVM exit

2024-09-27 Thread Ivan Orlov
On Wed, Sep 25, 2024 at 05:06:45PM -0700, Sean Christopherson wrote: > > Yeah, but only because the alternative sucks worse. If KVM unconditionally > exited > with an emulation error, then unsuspecting (read: old) VMMs would likely > terminate > the guest, which gives guest userspace a way to D

Re: [PATCH v2 04/19] iommufd: Allow pt_id to carry viommu_id for IOMMU_HWPT_ALLOC

2024-09-27 Thread Yi Liu
On 2024/9/27 14:02, Nicolin Chen wrote: On Fri, Sep 27, 2024 at 01:38:08PM +0800, Yi Liu wrote: Does it mean each vIOMMU of VM can only have one s2 HWPT? Giving some examples here: - If a VM has 1 vIOMMU, there will be 1 vIOMMU object in the kernel holding one S2 HWPT. - If a VM has

Re: [PATCH v2 04/19] iommufd: Allow pt_id to carry viommu_id for IOMMU_HWPT_ALLOC

2024-09-27 Thread Jason Gunthorpe
On Thu, Sep 26, 2024 at 11:02:37PM -0700, Nicolin Chen wrote: > On Fri, Sep 27, 2024 at 01:38:08PM +0800, Yi Liu wrote: > > > > Does it mean each vIOMMU of VM can only have > > > > one s2 HWPT? > > > > > > Giving some examples here: > > > - If a VM has 1 vIOMMU, there will be 1 vIOMMU object in

[PATCH net v3] selftests: forwarding: no_forwarding: Fix issue related with assigning two different vids to the same interface.

2024-09-27 Thread Kacper Ludwinski
Fix typo. Currently, the second bridge command overwrites the first one. Fix this by adding this VID to the interface behind $swp2. Fixes: 476a4f05d9b8 ("selftests: forwarding: add a no_forwarding.sh test") Signed-off-by: Kacper Ludwinski --- tools/testing/selftests/net/forwarding/no_forwarding.

[PATCH v2] selftest: remoteproc: Add basic test for start/stop sequence

2024-09-27 Thread Wasim Nazir
This test includes: 1) Start/stop test for each rproc instance sequencially 2) Start/stop test for all rproc instances concurrently Changes in v2: - Update commit message - Addressed start/stop flow Signed-off-by: Wasim Nazir diff --git a/MAINTAINERS b/MAINTAINERS index a0cd96b8..02

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

2024-09-27 Thread Mathieu Desnoyers
On 2024-09-27 06:28, Boqun Feng wrote: On Fri, Sep 27, 2024 at 09:37:50AM +0800, Boqun Feng wrote: On Fri, Sep 27, 2024, at 9:30 AM, Mathieu Desnoyers wrote: On 2024-09-27 02:01, Boqun Feng wrote: #define ADDRESS_EQ(var, expr) \

Re: [PATCH] selftests/mm: Fixed incorrect buffer->mirror size in hmm2 double_map test

2024-09-27 Thread Donet Tom
On 9/27/24 12:48, Muhammad Usama Anjum wrote: On 9/27/24 10:07 AM, Donet Tom wrote: The hmm2 double_map test was failing due to an incorrect buffer->mirror size. The buffer->mirror size was 6, while buffer->ptr size was 6 * PAGE_SIZE. The test failed because the kernel's copy_to_user function

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

2024-09-27 Thread Arnaud POULIQUEN
Hello Bjorn, On 9/26/24 05:51, Bjorn Andersson wrote: > On Fri, Aug 30, 2024 at 11:51:44AM GMT, 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 fo

Re: [PATCH bpf-next v2 0/6] selftests/bpf: Various sockmap-related fixes

2024-09-27 Thread Jakub Sitnicki
On Fri, Sep 27, 2024 at 12:54 AM +02, Michal Luczaj wrote: > On 9/24/24 12:25, Michal Luczaj wrote: >> On 8/19/24 22:05, Jakub Sitnicki wrote: >>> On Wed, Aug 14, 2024 at 06:14 PM +02, Michal Luczaj wrote: On 8/6/24 19:45, Jakub Sitnicki wrote: > On Tue, Aug 06, 2024 at 07:18 PM +02, Micha

Re: [PATCH RFT v9 4/8] fork: Add shadow stack support to clone3()

2024-09-27 Thread Christian Brauner
On Wed, Aug 21, 2024 at 06:23:18PM GMT, Mark Brown wrote: > On Wed, Aug 21, 2024 at 03:54:49PM +, Edgecombe, Rick P wrote: > > On Wed, 2024-08-21 at 13:45 +0100, Mark Brown wrote: > > > > It's entirely possible it just leaked.  My own attempts to dig through > > > the archives haven't turned u

[PATCH] virtio: console: Fix atomicity violation in fill_readbuf()

2024-09-27 Thread Qiu-ji Chen
The atomicity violation issue is due to the invalidation of the function port_has_data()'s check caused by concurrency. Imagine a scenario where a port that contains data passes the validity check but is simultaneously assigned a value with no data. This could result in an empty port passing th

[PATCH -next] selftests/bpf: Use ARRAY_SIZE for array length

2024-09-27 Thread Jiapeng Chong
Use of macro ARRAY_SIZE to calculate array size minimizes the redundant code and improves code reusability. ./tools/testing/selftests/bpf/prog_tests/core_reloc_raw.c:98:34-35: WARNING: Use ARRAY_SIZE. ./tools/testing/selftests/bpf/prog_tests/core_reloc_raw.c:93:29-30: WARNING: Use ARRAY_SIZE. ./

Re: [PATCH] selftests/mm: Add missing free.

2024-09-27 Thread Muhammad Usama Anjum
On 9/27/24 8:01 AM, zhangjiao2 wrote: > From: zhang jiao > > There is a memory leak in mkdirty, just free src before return. > > Signed-off-by: zhang jiao Please find the first patch which missed this free() and add fixes-by tag. > --- > tools/testing/selftests/mm/mkdirty.c | 1 + > 1 file ch

Re: [PATCH v2 1/5] dt-bindings: remoteproc: sse710: Add the External Systems remote processors

2024-09-27 Thread Krzysztof Kozlowski
On 23/09/2024 19:19, Abdellatif El Khlifi wrote: >>> >>> The Host Base System Control [3] is the big block containing various >>> functionalities (MMIO registers). >>> Among the functionalities, the two remote cores registers (aka External >>> system 0 and 1). >>> The remote cores have two regis

Re: ARM64 Livepatch based on SFrame

2024-09-27 Thread Weinan Liu
We from Google are working on implementing SFrame unwinder for the Linux kernel, And we will be happy to collaborate with others for adding arm64 livepatch support Weinan

Re: [PATCH 11/20] sched: Handle CPU isolation on last resort fallback rq selection

2024-09-27 Thread Michal Hocko
On Fri 27-09-24 00:48:59, Frederic Weisbecker wrote: > When a kthread or any other task has an affinity mask that is fully > offline or unallowed, the scheduler reaffines the task to all possible > CPUs as a last resort. > > This default decision doesn't mix up very well with nohz_full CPUs that >

Re: [PATCH] selftests/mm: Fixed incorrect buffer->mirror size in hmm2 double_map test

2024-09-27 Thread Muhammad Usama Anjum
On 9/27/24 10:07 AM, Donet Tom wrote: > The hmm2 double_map test was failing due to an incorrect > buffer->mirror size. The buffer->mirror size was 6, while buffer->ptr > size was 6 * PAGE_SIZE. The test failed because the kernel's > copy_to_user function was attempting to copy a 6 * PAGE_SIZE buff