Re: [RFC 00/31] objtool, livepatch: Livepatch module generation

2024-09-05 Thread Josh Poimboeuf
On Wed, Sep 04, 2024 at 09:14:00PM -0700, Josh Poimboeuf wrote: > + if (!!nr_objs) { ^^ oops Fixed version: diff --git a/scripts/livepatch/module.c b/scripts/livepatch/module.c index 101cabf6b2f1..2908999efa21 100644 --- a/scripts/livepatch/module.c +++ b/scripts/live

Re: [PATCH v4.19-v5.10] virtio_net: Fix napi_skb_cache_put warning

2024-09-05 Thread Greg KH
On Wed, Sep 04, 2024 at 02:08:53AM -0700, Shivani Agarwal wrote: > From: Breno Leitao > > [ Upstream commit f8321fa75102246d7415a6af441872f6637c93ab ] > > After the commit bdacf3e34945 ("net: Use nested-BH locking for > napi_alloc_cache.") was merged, the following warning began to appear: > >

[PATCH v2 0/2] SGX NUMA fix

2024-09-05 Thread Aaron Lu
Hi, A soft lockup issue was found during some SGX testing and it turned out to be a problem in SGX code related to NUMA, please see patch1/2 for details. While Dave reviewed v1 of patch1/2, he suggested dumping an info when a node has both CPUs and memory but no EPC section, so that's patch2/2.

[PATCH v2 1/2] x86/sgx: Fix deadlock in SGX NUMA node search

2024-09-05 Thread Aaron Lu
When the current node doesn't have an EPC section configured by firmware and all other EPC sections are used up, CPU can get stuck inside the while loop that looks for an available EPC page from remote nodes indefinitely, leading to a soft lockup. Note how nid_of_current will never be equal to nid

[PATCH v2 2/2] x86/sgx: Log information when a node lacks an EPC section

2024-09-05 Thread Aaron Lu
For optimized performance, firmware typically distributes EPC sections evenly across different NUMA nodes. However, there are scenarios where a node may have both CPUs and memory but no EPC section configured. For example, in an 8-socket system with a Sub-Numa-Cluster=2 setup, there are a total of

Re: [PATCH net-next] virtio_net: Fix napi_skb_cache_put warning

2024-09-05 Thread Breno Leitao
Hello Leonardo, good to see you here, On Tue, Sep 03, 2024 at 01:28:50PM -0300, Leonardo Bras wrote: > Please help me check if the following is correct: > ### > Any tree which includes df133f3f9625 ("virtio_net: bulk free tx skbs") > should also include your patch, since it fixes stuff in there.

Re: [PATCH v2] module: abort module loading when sysfs setup suffer errors

2024-09-05 Thread Luis Chamberlain
On Wed, Sep 04, 2024 at 08:41:07PM +0800, Chunhui Li wrote: > When insmod a kernel module, if fails in add_notes_attrs or > add_sysfs_attrs such as memory allocation fail, mod_sysfs_setup > will still return success, but we can't access user interface > on android device. > > Patch for make mod_sy

Re: [PATCH 5/5] KVM: VMX: Always honor guest PAT on CPUs that support self-snoop

2024-09-05 Thread Yan Zhao
On Wed, Sep 04, 2024 at 05:41:06PM -0700, Sean Christopherson wrote: > On Wed, Sep 04, 2024, Yan Zhao wrote: > > On Wed, Sep 04, 2024 at 10:28:02AM +0800, Yan Zhao wrote: > > > On Tue, Sep 03, 2024 at 06:20:27PM +0200, Vitaly Kuznetsov wrote: > > > > Sean Christopherson writes: > > > > > > > > >

[PATCH] Date: Remove unused macro

2024-09-05 Thread zhangjiao2
From: zhang jiao This macro NSEC_PER_SEC is never referenced in the code. Just remove it. Signed-off-by: zhang jiao --- tools/testing/selftests/timers/skew_consistency.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/testing/selftests/timers/skew_consistency.c b/tools/testing/self

Re: [PATCH v4 1/2] Introduce klp_ops into klp_func structure

2024-09-05 Thread Miroslav Benes
Hi, the subject is missing "livepatch: " prefix and I would prefer something like "livepatch: Move struct klp_ops to struct klp_func" On Wed, 28 Aug 2024, Wardenjohn wrote: > Before introduce feature "using". Klp transition will need an > easier way to get klp_ops from klp_func. I think that

Re: [PATCH v4 2/2] livepatch: Add using attribute to klp_func for using function show

2024-09-05 Thread Miroslav Benes
Hi, On Wed, 28 Aug 2024, Wardenjohn wrote: > One system may contains more than one livepatch module. We can see > which patch is enabled. If some patches applied to one system > modifing the same function, livepatch will use the function enabled > on top of the function stack. However, we can not

[PATCH] Date: Remove unused macro

2024-09-05 Thread zhangjiao2
From: zhang jiao This macro NSEC_PER_SEC is never referenced in the code. Just remove it. Signed-off-by: zhang jiao --- tools/testing/selftests/timers/change_skew.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/testing/selftests/timers/change_skew.c b/tools/testing/selftests/tim

[PATCH bpf-next v1 1/3] selftests/bpf: fix some typos in selftests

2024-09-05 Thread Lin Yikai
Hi, fix some spelling errors in selftest, the details are as follows: -in the codes: test_bpf_sk_stoarge_map_iter_fd(void) ->test_bpf_sk_storage_map_iter_fd(void) load BTF from btf_data.o->load BTF from btf_data.bpf.o -in the code comments: preample->preamb

[PATCH bpf-next v1 2/3] bpftool: fix some typos in bpftool

2024-09-05 Thread Lin Yikai
Hi, fix some spelling errors in bpftool, the details are as follows: -in file "bpftool-gen.rst" libppf->libbpf -in the code comments: ouptut->output Signed-off-by: Lin Yikai --- tools/bpf/bpftool/Documentation/bpftool-gen.rst | 2 +- tools/bpf/bpftool/feature.c

[PATCH bpf-next v1 3/3] libbpf: fix some typos in libbpf

2024-09-05 Thread Lin Yikai
Hi, fix some spelling errors in libbpf, the details are as follows: -in the code comments: termintaing->terminating architecutre->architecture requring->requiring recored->recoded sanitise->sanities allowd->allowed abover->above see b

Re: [PATCH v6 1/2] selftests: Rename sigaltstack to generic signal

2024-09-05 Thread Mark Brown
On Thu, Sep 05, 2024 at 11:26:02AM +0530, Dev Jain wrote: > On 9/4/24 22:35, Shuah Khan wrote: > > So who does the backports whenevenr something changes? You are adding > > work where as the automated process would just work without this > > change. It doesn't matter if there is another test that

Re: [PATCH 06/19] dt-bindings: power: rpmpd: Add QCS8300 power domains

2024-09-05 Thread Konrad Dybcio
On 4.09.2024 10:33 AM, Jingyi Wang wrote: > From: Shazad Hussain > > Add compatible and constants for the power domains exposed by the RPMH > in the Qualcomm QCS8300 platform. > > Signed-off-by: Shazad Hussain > Signed-off-by: Tingguo Cheng > Signed-off-by: Jingyi Wang > --- > .../devicetree

Re: [PATCH 06/19] dt-bindings: power: rpmpd: Add QCS8300 power domains

2024-09-05 Thread Konrad Dybcio
On 5.09.2024 1:30 PM, Konrad Dybcio wrote: > On 4.09.2024 10:33 AM, Jingyi Wang wrote: >> From: Shazad Hussain >> >> Add compatible and constants for the power domains exposed by the RPMH >> in the Qualcomm QCS8300 platform. >> >> Signed-off-by: Shazad Hussain >> Signed-off-by: Tingguo Cheng >>

Re: [PATCH 5/6] selftests/resctrl: Do not compare performance counters and resctrl at low bandwidth

2024-09-05 Thread Ilpo Järvinen
On Wed, 4 Sep 2024, Reinette Chatre wrote: > On 9/4/24 4:43 AM, Ilpo Järvinen wrote: > > On Fri, 30 Aug 2024, Reinette Chatre wrote: > > > On 8/30/24 4:42 AM, Ilpo Järvinen wrote: > > > > On Thu, 29 Aug 2024, Reinette Chatre wrote: > > > > > > > > > The MBA test incrementally throttles memory band

Re: [PATCH 2/6] selftests/resctrl: Ensure measurements skip initialization of default benchmark

2024-09-05 Thread Ilpo Järvinen
On Wed, 4 Sep 2024, Reinette Chatre wrote: > On 9/4/24 4:57 AM, Ilpo Järvinen wrote: > > On Fri, 30 Aug 2024, Reinette Chatre wrote: > > > On 8/30/24 3:56 AM, Ilpo Järvinen wrote: > > > > On Thu, 29 Aug 2024, Reinette Chatre wrote: > > > > > @@ -699,111 +639,80 @@ int resctrl_val(const struct resc

[PATCH 10/18] kunit: string-stream-test: Include instead of

2024-09-05 Thread Uros Bizjak
Usage of pseudo-random functions requires inclusion of header instead of . Signed-off-by: Uros Bizjak Cc: Brendan Higgins Cc: David Gow Cc: Rae Moar Cc: linux-kselft...@vger.kernel.org Cc: kunit-...@googlegroups.com --- lib/kunit/string-stream-test.c | 1 + 1 file changed, 1 insertion(+) di

[PATCH v3 0/9] SEV Kernel Selftests

2024-09-05 Thread Pratik R. Sampat
This series primarily introduces SEV-SNP test for the kernel selftest framework. It tests boot, ioctl, pre fault, and fallocate in various combinations to exercise both positive and negative launch flow paths. Patch 1 - Adds a wrapper for the ioctl calls that decouple ioctl and asserts, which enab

[PATCH v3 1/9] KVM: selftests: Decouple SEV ioctls from asserts

2024-09-05 Thread Pratik R. Sampat
Add variants of sev, sev-es launch path that return the status of the ioctl call instead of asserting for success. This enables both positive and negative testing of the path. No functional impact intended. Signed-off-by: Pratik R. Sampat Tested-by: Peter Gonda Tested-by: Srikanth Aithal ---

[PATCH v3 2/9] KVM: selftests: Add a basic SNP smoke test

2024-09-05 Thread Pratik R. Sampat
Extend sev_smoke_test to also run a minimal SEV-SNP smoke test that initializes and sets up private memory regions required to run a simple SEV-SNP guest. Similar to its SEV-ES smoke test counterpart, this also does not support GHCB and ucall yet and uses the GHCB MSR protocol to trigger an exit o

[PATCH v3 3/9] KVM: selftests: Add SNP to shutdown testing

2024-09-05 Thread Pratik R. Sampat
Parameterize the shutdown test to include the SEV-SNP VM type Signed-off-by: Pratik R. Sampat Tested-by: Peter Gonda Tested-by: Srikanth Aithal --- tools/testing/selftests/kvm/x86_64/sev_smoke_test.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/testing/s

[PATCH v3 4/9] KVM: selftests: SEV IOCTL test

2024-09-05 Thread Pratik R. Sampat
Introduce tests for sev and sev-es ioctl that exercises the boot path of launch, update and finish on an invalid policy. Signed-off-by: Pratik R. Sampat Tested-by: Peter Gonda Tested-by: Srikanth Aithal --- .../selftests/kvm/x86_64/sev_smoke_test.c | 84 +++ 1 file changed,

[PATCH v3 5/9] KVM: selftests: SNP IOCTL test

2024-09-05 Thread Pratik R. Sampat
Introduce testing of SNP ioctl calls. Tests attributes such as flags, page types, and policies in various combinations along the SNP launch path. Signed-off-by: Pratik R. Sampat Tested-by: Peter Gonda Tested-by: Srikanth Aithal --- .../testing/selftests/kvm/include/kvm_util.h | 11 ++ .../se

[PATCH v3 6/9] KVM: selftests: SEV-SNP test for KVM_SEV_INIT2

2024-09-05 Thread Pratik R. Sampat
Add SEV-SNP VM type to exercise the KVM_SEV_INIT2 call. Also ensure that SNP case is skipped for scenarios where CPUID supports it but KVM does not so that a failure is not reported for such cases. Signed-off-by: Pratik R. Sampat Tested-by: Peter Gonda Tested-by: Srikanth Aithal --- .../testi

[PATCH v3 7/9] KVM: selftests: Add interface to manually flag protected/encrypted ranges

2024-09-05 Thread Pratik R. Sampat
From: Michael Roth For SEV and SNP, currently __vm_phy_pages_alloc() handles setting the region->protected_phy_pages bitmap to mark that the region needs to be encrypted/measured into the initial guest state prior to finalizing/starting the guest. It also marks what GPAs need to be mapped as encr

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

2024-09-05 Thread Pratik R. Sampat
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 bit more fine-grained control over when the KVM_PRE_FAULT_ME

[PATCH v3 9/9] KVM: selftests: Interleave fallocate for KVM_PRE_FAULT_MEMORY

2024-09-05 Thread Pratik R. Sampat
fallocate triggers gmem_prepare(), and KVM_PRE_FAULT_MEMORY can cause guest page faults at unexpected points. Therefore, introduce several test cases to interleave fallocate, hole punching through various parts of the SNP launch lifecycle, and observe both positive and negative vcpcu_run exit statu

Re: [PATCH 02/15] kbuild: split device tree build rules into scripts/Makefile.dtbs

2024-09-05 Thread Rob Herring
On Thu, Sep 05, 2024 at 08:47:38AM +0900, Masahiro Yamada wrote: > scripts/Makefile.lib is included not only from scripts/Makefile.build > but also from scripts/Makefile.{modfinal,package,vmlinux,vmlinux_o}, > where DT build rules are not required. > > Split the DT build rules out to scripts/Makef

Re: [PATCH 03/15] kbuild: move non-boot builtin DTBs to .init.rodata section

2024-09-05 Thread Rob Herring
On Thu, Sep 05, 2024 at 08:47:39AM +0900, Masahiro Yamada wrote: > Some architectures support embedding boot DTB(s) in vmlinux. These > architectures, except MIPS and MicroBlaze, expect a single DTB in > the .dtb.init.rodata section. MIPS embeds multiple DTBs in vmlinux. > MicroBlaze embeds a DTB i

Re: [PATCH v4 2/2] livepatch: Add using attribute to klp_func for using function show

2024-09-05 Thread zhang warden
Hi, Josh. > Most of this information is already available in sysfs, with the > exception of patch stacking order. > Well, this is the problem my patch want to fix. But my patch is more simpler, it just shows the stack top of the target function, which is the only thing users care. > > We wan

Re: [PATCH 04/15] kbuild: add generic support for built-in boot DTBs

2024-09-05 Thread Rob Herring
On Thu, Sep 05, 2024 at 08:47:40AM +0900, Masahiro Yamada wrote: > Some architectures embed boot DTBs in vmlinux. A potential issue for > these architectures is a race condition during parallel builds because > Kbuild descends into arch/*/boot/dts/ twice. > > One build thread is initiated by the '

Re: [PATCH v4 2/2] livepatch: Add using attribute to klp_func for using function show

2024-09-05 Thread zhang warden
Hi Miroslav, > > > I am not a fan. Josh wrote most of my objections already so I will not > repeat them. I understand that the attribute might be useful but the > amount of code it adds to sensitive functions like > klp_complete_transition() is no fun. > OK, the point I make changes to klp_

Re: [PATCH v2 1/2] x86/sgx: Fix deadlock in SGX NUMA node search

2024-09-05 Thread Jarkko Sakkinen
On Thu Sep 5, 2024 at 11:08 AM EEST, Aaron Lu wrote: > When the current node doesn't have an EPC section configured by firmware > and all other EPC sections are used up, CPU can get stuck inside the > while loop that looks for an available EPC page from remote nodes > indefinitely, leading to a sof

Re: [PATCH v2 2/2] x86/sgx: Log information when a node lacks an EPC section

2024-09-05 Thread Jarkko Sakkinen
On Thu Sep 5, 2024 at 11:08 AM EEST, Aaron Lu wrote: > For optimized performance, firmware typically distributes EPC sections > evenly across different NUMA nodes. However, there are scenarios where > a node may have both CPUs and memory but no EPC section configured. For > example, in an 8-socket

Re: [PATCH v4 1/2] Introduce klp_ops into klp_func structure

2024-09-05 Thread zhang warden
Hi, Miroslav > On Sep 5, 2024, at 18:10, Miroslav Benes wrote: > > Hi, > > the subject is missing "livepatch: " prefix and I would prefer something > like > > "livepatch: Move struct klp_ops to struct klp_func" > > On Wed, 28 Aug 2024, Wardenjohn wrote: > >> Before introduce feature "using

Re: [PATCH 14/15] kbuild: rename CONFIG_GENERIC_BUILTIN_DTB to CONFIG_BUILTIN_DTB

2024-09-05 Thread Rob Herring
On Thu, Sep 05, 2024 at 08:47:50AM +0900, Masahiro Yamada wrote: > Now that all architectures have migrated to the generic built-in > DTB support, the GENERIC_ prefix is no longer necessary. > > Signed-off-by: Masahiro Yamada > --- > > Makefile | 2 +- > arch/arc/Kco

[PATCH RFC v2 00/10] extensible syscalls: CHECK_FIELDS to allow for easier feature detection

2024-09-05 Thread Aleksa Sarai
This is something that I've been thinking about for a while. We had a discussion at LPC 2020 about this[1] but the proposals suggested there never materialised. In short, it is quite difficult for userspace to detect the feature capability of syscalls at runtime. This is something a lot of program

[PATCH RFC v2 01/10] uaccess: add copy_struct_to_user helper

2024-09-05 Thread Aleksa Sarai
This is based on copy_struct_from_user(), but there is one additional case to consider when creating a syscall that returns an extensible-struct to userspace -- how should data in the struct that cannot fit into the userspace struct be handled (ksize > usize)? There are three possibilies: 1. The

[PATCH RFC v2 02/10] sched_getattr: port to copy_struct_to_user

2024-09-05 Thread Aleksa Sarai
sched_getattr(2) doesn't care about trailing non-zero bytes in the (ksize > usize) case, so just use copy_struct_to_user() without checking ignored_trailing. Signed-off-by: Aleksa Sarai --- kernel/sched/syscalls.c | 42 ++ 1 file changed, 2 insertions(+),

[PATCH RFC v2 03/10] openat2: explicitly return -E2BIG for (usize > PAGE_SIZE)

2024-09-05 Thread Aleksa Sarai
While we do currently return -EFAULT in this case, it seems prudent to follow the behaviour of other syscalls like clone3. It seems quite unlikely that anyone depends on this error code being EFAULT, but we can always revert this if it turns out to be an issue. Cc: # v5.6+ Fixes: fddb5d430ad9 ("o

[PATCH RFC v2 04/10] openat2: add CHECK_FIELDS flag to usize argument

2024-09-05 Thread Aleksa Sarai
In order for userspace to be able to know what flags and fields the kernel supports, it is currently necessary for them to do a bunch of fairly subtle self-checks where you need to get a syscall to return a non-EINVAL error or no-op for each flag you wish to use. If you get -EINVAL you know the fla

[PATCH RFC v2 05/10] selftests: openat2: add 0xFF poisoned data after misaligned struct

2024-09-05 Thread Aleksa Sarai
We should also verify that poisoned data after a misaligned struct is also handled correctly by is_zeroed_user(). This test passes with no kernel changes needed, so is_zeroed_user() was correct already. Fixes: b28a10aedcd4 ("selftests: add openat2(2) selftests") Signed-off-by: Aleksa Sarai --- t

[PATCH RFC v2 06/10] selftests: openat2: add CHECK_FIELDS selftests

2024-09-05 Thread Aleksa Sarai
Signed-off-by: Aleksa Sarai --- tools/testing/selftests/openat2/Makefile | 2 + tools/testing/selftests/openat2/openat2_test.c | 161 - 2 files changed, 161 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/openat2/Makefile b/tools/testing/selfte

[PATCH RFC v2 07/10] clone3: add CHECK_FIELDS flag to usize argument

2024-09-05 Thread Aleksa Sarai
As with openat2(2), this allows userspace to easily figure out what flags and fields are supported by clone3(2). For fields which are not flag-based, we simply set every bit in the field so that a naive bitwise-and would show that any value of the field is valid. For args->exit_signal, since we ha

[PATCH RFC v2 08/10] selftests: clone3: add CHECK_FIELDS selftests

2024-09-05 Thread Aleksa Sarai
Signed-off-by: Aleksa Sarai --- tools/testing/selftests/clone3/.gitignore | 1 + tools/testing/selftests/clone3/Makefile| 4 +- .../testing/selftests/clone3/clone3_check_fields.c | 264 + 3 files changed, 267 insertions(+), 2 deletions(-) diff --git a

[PATCH RFC v2 09/10] mount_setattr: add CHECK_FIELDS flag to usize argument

2024-09-05 Thread Aleksa Sarai
As with openat2(2), this allows userspace to easily figure out what flags and fields are supported by mount_setattr(2). As with clone3(2), for fields which are not flag-based, we simply set every bit in the field so that a naive bitwise-and would show that any value of the field is valid. The inte

[PATCH RFC v2 10/10] selftests: mount_setattr: add CHECK_FIELDS selftest

2024-09-05 Thread Aleksa Sarai
While we're at it -- to make testing for error codes with ASSERT_* easier, make the sys_* wrappers return -errno in case of an error. For some reason, the include doesn't correct import , leading to compilation errors -- so just import manually. Signed-off-by: Aleksa Sarai --- tools/include/u

Re: [PATCH] kunit: Fix missing kerneldoc comment

2024-09-05 Thread Shuah Khan
On 9/4/24 20:47, David Gow wrote: Add a missing kerneldoc comment for the 'test' test context parameter, fixing the following warning: include/kunit/test.h:492: warning: Function parameter or struct member 'test' not described in 'kunit_kfree_const' Reported-by: Stephen Rothwell Closes: https

Re: [PATCH v2 01/19] iommufd: Reorder struct forward declarations

2024-09-05 Thread Jason Gunthorpe
On Tue, Aug 27, 2024 at 09:59:38AM -0700, Nicolin Chen wrote: > Reorder struct forward declarations to alphabetic order to simplify > maintenance, as upcoming patches will add more to the list. > > No functional change intended. > > Signed-off-by: Nicolin Chen > --- > include/linux/iommufd.h |

Re: [PATCH v2 02/19] iommufd/viommu: Add IOMMUFD_OBJ_VIOMMU and IOMMU_VIOMMU_ALLOC ioctl

2024-09-05 Thread Jason Gunthorpe
On Tue, Aug 27, 2024 at 09:59:39AM -0700, Nicolin Chen wrote: > +/** > + * struct iommu_viommu_alloc - ioctl(IOMMU_VIOMMU_ALLOC) > + * @size: sizeof(struct iommu_viommu_alloc) > + * @flags: Must be 0 > + * @type: Type of the virtual IOMMU. Must be defined in enum > iommu_viommu_type > + * @dev_id:

Re: [PATCH v2 03/19] iommu: Pass in a viommu pointer to domain_alloc_user op

2024-09-05 Thread Jason Gunthorpe
On Tue, Aug 27, 2024 at 09:59:40AM -0700, Nicolin Chen wrote: > With a viommu object wrapping a potentially shareable S2 domain, a nested > domain should be allocated by associating to a viommu instead. Driver can > store this viommu pointer somewhere, so as to later use it calling viommu > helpers

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

2024-09-05 Thread Jason Gunthorpe
On Tue, Aug 27, 2024 at 09:59:41AM -0700, Nicolin Chen wrote: > Now a VIOMMU can wrap a shareable nested parent HWPT. So, it can act like > a nested parent HWPT to allocate a nested HWPT. > > Support that in the IOMMU_HWPT_ALLOC ioctl handler, and update its kdoc. > > Also, associate a viommu to

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

2024-09-05 Thread Jason Gunthorpe
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. Given some of the other discussions around CC I suspect we should rename these to 'create/

Re: [PATCH v2 08/19] iommufd/viommu: Add cache_invalidate for IOMMU_VIOMMU_TYPE_DEFAULT

2024-09-05 Thread Jason Gunthorpe
On Tue, Aug 27, 2024 at 09:59:45AM -0700, Nicolin Chen wrote: > Add a default_viommu_ops with a new op for cache invaldiation, similar to > the cache_invalidate_user op in structure iommu_domain_ops, but wider. An > IOMMU driver that allocated a nested domain with a core-managed viommu is > able to

Re: [PATCH] Date: Remove unused macro

2024-09-05 Thread Shuah Khan
On 9/5/24 02:13, zhangjiao2 wrote: From: zhang jiao This macro NSEC_PER_SEC is never referenced in the code. Just remove it. I think I commented on your patch on futex - include how you found the problem in change logs. Also you have to include subsystem prefix in the subject line: selftests

Re: [PATCH] Date: Remove unused macro

2024-09-05 Thread Shuah Khan
On 9/5/24 02:52, zhangjiao2 wrote: From: zhang jiao This macro NSEC_PER_SEC is never referenced in the code. Just remove it. Is this duplicate patch? I think I commented on your patch on futex - include how you found the problem in change logs. Also you have to include subsystem prefix in th

Re: [PATCH v2 09/19] iommufd: Allow hwpt_id to carry viommu_id for IOMMU_HWPT_INVALIDATE

2024-09-05 Thread Jason Gunthorpe
On Tue, Aug 27, 2024 at 09:59:46AM -0700, Nicolin Chen wrote: > With a VIOMMU object, use space can flush any IOMMU related cache that can > be directed using the viommu. It is similar to IOMMU_HWPT_INVALIDATE uAPI, > but can cover a wider range than IOTLB, such as device cache or desciprtor > cach

Re: [PATCH v2 10/19] iommufd/viommu: Add vdev_id helpers for IOMMU drivers

2024-09-05 Thread Jason Gunthorpe
On Tue, Aug 27, 2024 at 09:59:47AM -0700, Nicolin Chen wrote: > Driver can call the iommufd_viommu_find_device() to find a device pointer > using its per-viommu virtual ID. The returned device must be protected by > the pair of iommufd_viommu_lock/unlock_vdev_id() function. > > Put these three fun

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

2024-09-05 Thread Jason Gunthorpe
On Tue, Aug 27, 2024 at 09:59:54AM -0700, Nicolin Chen wrote: > +static int arm_smmu_viommu_cache_invalidate(struct iommufd_viommu *viommu, > + struct iommu_user_data_array *array) > +{ > + struct iommu_domain *domain = iommufd_viommu_to_parent_domain(vi

Re: [PATCH] remoteproc:remove redundant dev_err message

2024-09-05 Thread Mathieu Poirier
On Thu, Sep 05, 2024 at 02:54:17AM +0800, Liu Jing wrote: > devm_ioremap_resource already contains error message, so remove > the redundant dev_err message > > Signed-off-by: Liu Jing > > diff --git a/drivers/remoteproc/da8xx_remoteproc.c > b/drivers/remoteproc/da8xx_remoteproc.c > index 9041a0

Re: [PATCH v2 16/19] iommu/arm-smmu-v3: Add arm_smmu_cache_invalidate_user

2024-09-05 Thread Jason Gunthorpe
On Tue, Aug 27, 2024 at 09:59:53AM -0700, Nicolin Chen wrote: > static const struct iommu_domain_ops arm_smmu_nested_ops = { > .get_msi_mapping_domain = arm_smmu_get_msi_mapping_domain, > .attach_dev = arm_smmu_attach_dev_nested, > .free = arm_smmu_domain_nested_free, > + .c

[PATCH 1/1] mm/damon/tests/core-kunit: skip damon_test_nr_accesses_to_accesses_bp() if aggr_interval is zero

2024-09-05 Thread SeongJae Park
The aggregation interval of test purpose damon_attrs for damon_test_nr_accesses_to_accesses_bp() becomes zero on 32 bit architecture, since size of int and long types are same. As a result, damon_nr_accesses_to_accesses_bp() call with the test data triggers divide-by-zero exception. damon_nr_acce

Re: [PATCH v5] remoteproc: xlnx: add sram support

2024-09-05 Thread Mathieu Poirier
On Wed, Sep 04, 2024 at 06:16:47PM +, Shah, Tanmay wrote: > Hi Mathieu, > > I agree with your assessment, and I agree with your proposal. > I appreciate you fixing the patch before applying. > I have applied this patch. > My email client (Thunderbird) has some issues, hence sending email for

Re: [PATCH v4 2/2] livepatch: Add using attribute to klp_func for using function show

2024-09-05 Thread Josh Poimboeuf
On Thu, Sep 05, 2024 at 10:03:52PM +0800, zhang warden wrote: > >>Here I can give you an example. > We are going to fix a problem of io_uring. > Our team made a livepatch of io_sq_offload_create. > This livepatch module is deployed to some running servers. > > Then, another team make some change t

Re: [PATCH v4 2/2] livepatch: Add using attribute to klp_func for using function show

2024-09-05 Thread Josh Poimboeuf
On Thu, Sep 05, 2024 at 12:23:20PM +0200, Miroslav Benes wrote: > I am not a fan. Josh wrote most of my objections already so I will not > repeat them. I understand that the attribute might be useful but the > amount of code it adds to sensitive functions like > klp_complete_transition() is no f

Re: [PATCH] kunit: Fix missing kerneldoc comment

2024-09-05 Thread Kees Cook
On Thu, Sep 05, 2024 at 10:47:55AM +0800, David Gow wrote: > Add a missing kerneldoc comment for the 'test' test context parameter, > fixing the following warning: > > include/kunit/test.h:492: warning: Function parameter or struct member 'test' > not described in 'kunit_kfree_const' > > Reporte

Re: [PATCH v2 02/19] iommufd/viommu: Add IOMMUFD_OBJ_VIOMMU and IOMMU_VIOMMU_ALLOC ioctl

2024-09-05 Thread Nicolin Chen
On Thu, Sep 05, 2024 at 12:53:02PM -0300, Jason Gunthorpe wrote: > On Tue, Aug 27, 2024 at 09:59:39AM -0700, Nicolin Chen wrote: > > +/** > > + * struct iommu_viommu_alloc - ioctl(IOMMU_VIOMMU_ALLOC) > > + * @size: sizeof(struct iommu_viommu_alloc) > > + * @flags: Must be 0 > > + * @type: Type of t

Re: [GIT PULL] KUnit fixes update for Linux 6.11-rc7

2024-09-05 Thread pr-tracker-bot
The pull request you sent on Wed, 4 Sep 2024 15:39:40 -0600: > git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest > tags/linux_kselftest-kunit-fixes-6.11-rc7 has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/120434e5b305defa1fb1e7a38421ed08f93243d5 Than

Re: [PATCH v2 06/19] gendwarfksyms: Add a cache for processed DIEs

2024-09-05 Thread Sami Tolvanen
Hi Petr, On Mon, Sep 2, 2024 at 3:05 AM Petr Pavlu wrote: > > On 8/15/24 19:39, Sami Tolvanen wrote: > > +void die_map_free(void) > > +{ > > + struct hlist_node *tmp; > > + unsigned int stats[LAST + 1]; > > + struct die *cd; > > + int i; > > + > > + memset(stats, 0, sizeof(sta

Re: [PATCH v2 03/19] iommu: Pass in a viommu pointer to domain_alloc_user op

2024-09-05 Thread Nicolin Chen
On Thu, Sep 05, 2024 at 12:54:54PM -0300, Jason Gunthorpe wrote: > On Tue, Aug 27, 2024 at 09:59:40AM -0700, Nicolin Chen wrote: > > With a viommu object wrapping a potentially shareable S2 domain, a nested > > domain should be allocated by associating to a viommu instead. Driver can > > store this

Re: [PATCH v2 08/19] gendwarfksyms: Expand subroutine_type

2024-09-05 Thread Sami Tolvanen
On Tue, Sep 3, 2024 at 8:11 AM Petr Pavlu wrote: > > On 8/15/24 19:39, Sami Tolvanen wrote: > > > > +static int __process_subroutine_type(struct state *state, struct die > > *cache, > > + Dwarf_Die *die, const char *type) > > +{ > > + check(process(state, cach

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

2024-09-05 Thread Nicolin Chen
On Thu, Sep 05, 2024 at 01:03:53PM -0300, Jason Gunthorpe wrote: > 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. > > Given some of t

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

2024-09-05 Thread Jason Gunthorpe
On Thu, Sep 05, 2024 at 10:37:45AM -0700, Nicolin Chen wrote: > we only have virtual device ID in its data structure. Also, the > virtual device sounds a bit confusing, given we already have idev. idev is "iommufd device" which is the physical device The virtual device is the host side handle of

Re: [PATCH v2 02/19] iommufd/viommu: Add IOMMUFD_OBJ_VIOMMU and IOMMU_VIOMMU_ALLOC ioctl

2024-09-05 Thread Jason Gunthorpe
On Thu, Sep 05, 2024 at 10:10:38AM -0700, Nicolin Chen wrote: > On Thu, Sep 05, 2024 at 12:53:02PM -0300, Jason Gunthorpe wrote: > > On Tue, Aug 27, 2024 at 09:59:39AM -0700, Nicolin Chen wrote: > > > +/** > > > + * struct iommu_viommu_alloc - ioctl(IOMMU_VIOMMU_ALLOC) > > > + * @size: sizeof(struc

Re: [PATCH v2 10/19] iommufd/viommu: Add vdev_id helpers for IOMMU drivers

2024-09-05 Thread Nicolin Chen
On Thu, Sep 05, 2024 at 01:14:15PM -0300, Jason Gunthorpe wrote: > On Tue, Aug 27, 2024 at 09:59:47AM -0700, Nicolin Chen wrote: > > Driver can call the iommufd_viommu_find_device() to find a device pointer > > using its per-viommu virtual ID. The returned device must be protected by > > the pair o

Re: [PATCH v2 16/19] iommu/arm-smmu-v3: Add arm_smmu_cache_invalidate_user

2024-09-05 Thread Nicolin Chen
On Thu, Sep 05, 2024 at 01:23:17PM -0300, Jason Gunthorpe wrote: > On Tue, Aug 27, 2024 at 09:59:53AM -0700, Nicolin Chen wrote: > > > static const struct iommu_domain_ops arm_smmu_nested_ops = { > > .get_msi_mapping_domain = arm_smmu_get_msi_mapping_domain, > > .attach_dev = arm_smmu_att

Re: [PATCH v1 04/10] iommufd/viommu: Allow drivers to control vdev_id lifecycle

2024-09-05 Thread Jason Gunthorpe
On Tue, Aug 27, 2024 at 10:02:06AM -0700, Nicolin Chen wrote: > The iommufd core provides a lookup helper for an IOMMU driver to find a > device pointer by device's per-viommu virtual ID. Yet a driver may need > an inverted lookup to find a device's per-viommu virtual ID by a device > pointer, e.g.

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

2024-09-05 Thread Nicolin Chen
On Thu, Sep 05, 2024 at 01:20:39PM -0300, Jason Gunthorpe wrote: > On Tue, Aug 27, 2024 at 09:59:54AM -0700, Nicolin Chen wrote: > > > +static int arm_smmu_viommu_cache_invalidate(struct iommufd_viommu *viommu, > > + struct iommu_user_data_array *array) > > +{

[PATCH] selftests:resctrl: Fix build failure on archs without __cpuid_count()

2024-09-05 Thread Shuah Khan
When resctrl is built on architectures without __cpuid_count() support, build fails. resctrl uses __cpuid_count() defined in kselftest.h. Even though the problem is seen while building resctrl on aarch64, this error can be seen on any platform that doesn't support CPUID. CPUID is a x86/x86-64 fea

Re: [PATCH v2 02/19] iommufd/viommu: Add IOMMUFD_OBJ_VIOMMU and IOMMU_VIOMMU_ALLOC ioctl

2024-09-05 Thread Nicolin Chen
On Thu, Sep 05, 2024 at 02:41:00PM -0300, Jason Gunthorpe wrote: > > > > + * @out_viommu_id: Output virtual IOMMU ID for the allocated object > > > > + * > > > > + * Allocate a virtual IOMMU object that holds a (shared) nesting > > > > parent HWPT > > > > > > Allocate a virtual IOMMU object that

Re: [PATCH v4 0/4] selftests: Fix cpuid / vendor checking build issues

2024-09-05 Thread Shuah Khan
On 9/4/24 06:54, Ilpo Järvinen wrote: On Wed, 4 Sep 2024, Shuah Khan wrote: On 9/4/24 06:18, Ilpo Järvinen wrote: On Tue, 3 Sep 2024, Shuah Khan wrote: On 9/3/24 08:45, Ilpo Järvinen wrote: This series first generalizes resctrl selftest non-contiguous CAT check to not assume non-AMD vendor

Re: [PATCH 2/6] selftests/resctrl: Ensure measurements skip initialization of default benchmark

2024-09-05 Thread Reinette Chatre
Hi Ilpo, On 9/5/24 5:10 AM, Ilpo Järvinen wrote: On Wed, 4 Sep 2024, Reinette Chatre wrote: On 9/4/24 4:57 AM, Ilpo Järvinen wrote: On Fri, 30 Aug 2024, Reinette Chatre wrote: On 8/30/24 3:56 AM, Ilpo Järvinen wrote: On Thu, 29 Aug 2024, Reinette Chatre wrote: @@ -699,111 +639,80 @@ int r

Re: [PATCH 5/6] selftests/resctrl: Do not compare performance counters and resctrl at low bandwidth

2024-09-05 Thread Reinette Chatre
Hi Ilpo, On 9/5/24 4:45 AM, Ilpo Järvinen wrote: On Wed, 4 Sep 2024, Reinette Chatre wrote: On 9/4/24 4:43 AM, Ilpo Järvinen wrote: On Fri, 30 Aug 2024, Reinette Chatre wrote: On 8/30/24 4:42 AM, Ilpo Järvinen wrote: On Thu, 29 Aug 2024, Reinette Chatre wrote: The MBA test incrementally th

Re: [PATCH v2 11/19] gendwarfksyms: Limit structure expansion

2024-09-05 Thread Sami Tolvanen
On Tue, Sep 3, 2024 at 8:15 AM Petr Pavlu wrote: > > On 8/15/24 19:39, Sami Tolvanen wrote: > > Expand each structure type only once per exported symbol. This > > is necessary to support self-referential structures, which would > > otherwise result in infinite recursion, but is still sufficient fo

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

2024-09-05 Thread Jason Gunthorpe
On Thu, Sep 05, 2024 at 11:00:49AM -0700, Nicolin Chen wrote: > On Thu, Sep 05, 2024 at 01:20:39PM -0300, Jason Gunthorpe wrote: > > On Tue, Aug 27, 2024 at 09:59:54AM -0700, Nicolin Chen wrote: > > > > > +static int arm_smmu_viommu_cache_invalidate(struct iommufd_viommu > > > *viommu, > > > +

Re: [PATCH v2 2/2] x86/sgx: Log information when a node lacks an EPC section

2024-09-05 Thread Dave Hansen
On 9/5/24 07:24, Jarkko Sakkinen wrote: >> +for_each_online_node(nid) { >> +if (!node_isset(nid, sgx_numa_mask) && >> +node_state(nid, N_MEMORY) && node_state(nid, N_CPU)) >> +pr_info("node%d has both CPUs and memory but doesn't >> have an EPC se

Re: [PATCH v4 15/15] fs/fuse/virtio_fs: allow idmapped mounts

2024-09-05 Thread Stefan Hajnoczi
On Tue, Sep 03, 2024 at 05:16:26PM +0200, Alexander Mikhalitsyn wrote: > Allow idmapped mounts for virtiofs. > It's absolutely safe as for virtiofs we have the same > feature negotiation mechanism as for classical fuse > filesystems. This does not affect any existing > setups anyhow. > > virtiofsd

Re: [PATCH v2] selftests: futex: Fix missing free in main

2024-09-05 Thread Shuah Khan
On 9/4/24 20:01, zhangjiao2 wrote: From: zhang jiao By readind the code, I found there is no free() after asprintf(). Just free it. Signed-off-by: zhang jiao --- v1->v2: Set a flag to determine if test_name needs free. tools/testing/selftests/futex/functional/futex_requeue_

Re: [PATCH bpf-next v1 1/3] selftests/bpf: fix some typos in selftests

2024-09-05 Thread patchwork-bot+netdevbpf
Hello: This series was applied to bpf/bpf-next.git (master) by Alexei Starovoitov : On Thu, 5 Sep 2024 19:03:05 +0800 you wrote: > Hi, fix some spelling errors in selftest, the details are as follows: > > -in the codes: > test_bpf_sk_stoarge_map_iter_fd(void) > ->test_bpf_sk

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

2024-09-05 Thread Nicolin Chen
On Thu, Sep 05, 2024 at 02:43:26PM -0300, Jason Gunthorpe wrote: > On Thu, Sep 05, 2024 at 10:37:45AM -0700, Nicolin Chen wrote: > > > we only have virtual device ID in its data structure. Also, the > > virtual device sounds a bit confusing, given we already have idev. > > idev is "iommufd device

Re: [PATCH bpf-next v2 0/2] selftests/bpf: Enable vmtest for cross-compile arm64 on x86_64 host, and fix some issues.

2024-09-05 Thread Andrii Nakryiko
On Wed, Aug 28, 2024 at 5:17 AM Lin Yikai wrote: > > These two patch enable the use of "vmtest.sh" for cross-compile arm64 on > x86_64 host. > This is essential for utilizing BPF on Android (arm64), > as the compilation server is running on Ubuntu (x86). > > Following previous guidance from V1, t

Re: [PATCH v4 0/4] selftests: Fix cpuid / vendor checking build issues

2024-09-05 Thread Reinette Chatre
Hi Shuah, On 9/5/24 11:06 AM, Shuah Khan wrote: On 9/4/24 06:54, Ilpo Järvinen wrote: On Wed, 4 Sep 2024, Shuah Khan wrote: On 9/4/24 06:18, Ilpo Järvinen wrote: On Tue, 3 Sep 2024, Shuah Khan wrote: On 9/3/24 08:45, Ilpo Järvinen wrote: This series first generalizes resctrl selftest non-

Re: [PATCH] selftests:resctrl: Fix build failure on archs without __cpuid_count()

2024-09-05 Thread Reinette Chatre
Hi Shuah, Thank you very much for looking into this. On 9/5/24 11:02 AM, Shuah Khan wrote: When resctrl is built on architectures without __cpuid_count() support, build fails. resctrl uses __cpuid_count() defined in kselftest.h. Even though the problem is seen while building resctrl on aarch64

Re: [PATCH] selftests:resctrl: Fix build failure on archs without __cpuid_count()

2024-09-05 Thread Shuah Khan
On 9/5/24 14:45, Reinette Chatre wrote: Hi Shuah, Thank you very much for looking into this. On 9/5/24 11:02 AM, Shuah Khan wrote: When resctrl is built on architectures without __cpuid_count() support, build fails. resctrl uses __cpuid_count() defined in kselftest.h. Even though the problem

Re: [PATCH v4 0/4] selftests: Fix cpuid / vendor checking build issues

2024-09-05 Thread Shuah Khan
On 9/5/24 14:43, Reinette Chatre wrote: Hi Shuah, On 9/5/24 11:06 AM, Shuah Khan wrote: On 9/4/24 06:54, Ilpo Järvinen wrote: On Wed, 4 Sep 2024, Shuah Khan wrote: On 9/4/24 06:18, Ilpo Järvinen wrote: On Tue, 3 Sep 2024, Shuah Khan wrote: On 9/3/24 08:45, Ilpo Järvinen wrote: This serie

Re: [PATCH v2 1/1] lib/llist_kunit.c: add KUnit tests for llist

2024-09-05 Thread Rae Moar
On Tue, Sep 3, 2024 at 5:40 PM Artur Alves wrote: > > Add KUnit tests for the llist data structure. They test the vast > majority of methods and macros defined in include/linux/llist.h. > > These are inspired by the existing tests for the 'list' doubly > linked in lib/list-test.c [1]. Each test ca

  1   2   >