Re: [PATCH v2 2/6] iommufd/hw_pagetable: Use domain_alloc_user op for domain allocation

2023-10-16 Thread Liu, Jingqi
On 10/17/2023 1:48 AM, Nicolin Chen wrote: On Mon, Oct 16, 2023 at 04:16:05PM +0800, Liu, Jingqi wrote: @@ -88,10 +90,19 @@ iommufd_hw_pagetable_alloc(struct iommufd_ctx *ictx, struct iommufd_ioas *ioas, refcount_inc(>obj.users); hwpt->ioas = ioas; - hwpt->domain =

Re: [RFC PATCH v2 1/7] bpf: Introduce BPF_PROG_TYPE_VNET_HASH

2023-10-16 Thread Jason Wang
On Tue, Oct 17, 2023 at 7:53 AM Alexei Starovoitov wrote: > > On Sun, Oct 15, 2023 at 10:10 AM Akihiko Odaki > wrote: > > > > On 2023/10/16 1:07, Alexei Starovoitov wrote: > > > On Sun, Oct 15, 2023 at 7:17 AM Akihiko Odaki > > > wrote: > > >> > > >> diff --git a/include/uapi/linux/bpf.h

[PATCH] selftests/efivarfs: create-read: fix a resource leak

2023-10-16 Thread zhujun2
The opened file should be closed in main(), otherwise resource leak will occur Signed-off-by: zhujun2 --- tools/testing/selftests/efivarfs/create-read.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/testing/selftests/efivarfs/create-read.c

[PATCH] selftests:modify the incorrect print format

2023-10-16 Thread zhujun2
when the argument type is 'unsigned int',printf '%u' in format string Signed-off-by: zhujun2 --- tools/testing/selftests/kselftest.h | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/testing/selftests/kselftest.h b/tools/testing/selftests/kselftest.h

Re: [PATCH] kunit: run test suites only after module initialization completes

2023-10-16 Thread Jinjie Ruan
On 2023/10/17 4:35, Marco Pagani wrote: > Commit 2810c1e99867 ("kunit: Fix wild-memory-access bug in > kunit_free_suite_set()") is causing all test suites to run (when > built as modules) while still in MODULE_STATE_COMING. In that state, > test modules are not fully initialized and lack sysfs

Re: [RFC PATCH v2 1/7] bpf: Introduce BPF_PROG_TYPE_VNET_HASH

2023-10-16 Thread Willem de Bruijn
On Mon, Oct 16, 2023 at 7:53 PM Alexei Starovoitov wrote: > > On Sun, Oct 15, 2023 at 10:10 AM Akihiko Odaki > wrote: > > > > On 2023/10/16 1:07, Alexei Starovoitov wrote: > > > On Sun, Oct 15, 2023 at 7:17 AM Akihiko Odaki > > > wrote: > > >> > > >> diff --git a/include/uapi/linux/bpf.h

Re: [RFC PATCH v2 1/7] bpf: Introduce BPF_PROG_TYPE_VNET_HASH

2023-10-16 Thread Alexei Starovoitov
On Sun, Oct 15, 2023 at 10:10 AM Akihiko Odaki wrote: > > On 2023/10/16 1:07, Alexei Starovoitov wrote: > > On Sun, Oct 15, 2023 at 7:17 AM Akihiko Odaki > > wrote: > >> > >> diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h > >> index 0448700890f7..298634556fab 100644 > >> ---

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

2023-10-16 Thread Peter Zijlstra
On Mon, Oct 16, 2023 at 11:50:34AM -0700, srinivas pandruvada wrote: I'll respond to the rest tomorrow, it's far too late. > > > Also, same question as to the amd folks; what serializes those > > > static > > > variables? > > > > That's a good one. > > This function which is checking static

Re: [PATCH v2] selftests: futex: remove duplicate unneeded defines

2023-10-16 Thread Peter Zijlstra
On Mon, Oct 16, 2023 at 01:21:20PM -0600, Shuah Khan wrote: > On 10/6/23 03:55, Muhammad Usama Anjum wrote: > > Kselftests are kernel tests and must be build with kernel headers from > > same source version. The kernel headers are already being included > > correctly in futex selftest Makefile

[PATCH] kunit: run test suites only after module initialization completes

2023-10-16 Thread Marco Pagani
Commit 2810c1e99867 ("kunit: Fix wild-memory-access bug in kunit_free_suite_set()") is causing all test suites to run (when built as modules) while still in MODULE_STATE_COMING. In that state, test modules are not fully initialized and lack sysfs kobjects. This behavior can cause a crash if the

Re: [PATCH v2] selftests: futex: remove duplicate unneeded defines

2023-10-16 Thread Shuah Khan
On 10/6/23 03:55, Muhammad Usama Anjum wrote: Kselftests are kernel tests and must be build with kernel headers from same source version. The kernel headers are already being included correctly in futex selftest Makefile with the help of KHDR_INCLUDE. In this patch, only the dead code is being

Re: [PATCH] selftests:modify the incorrect print format

2023-10-16 Thread Shuah Khan
On 10/15/23 20:50, zhujun2 wrote: printf %d in format string requires 'int' but the argument type is 'unsigned int' This line to long. Character limit is < 75/line. How did you find this problem? Please add the details to the commit log. Signed-off-by: zhujun2 --- thanks, -- Shuah

Re: [PATCH v2] selftests/x86/lam: Zero out buffer for readlink()

2023-10-16 Thread Shuah Khan
On 10/16/23 02:47, kirill.shute...@linux.intel.com wrote: On Mon, Oct 16, 2023 at 02:24:46PM +0800, Binbin Wu wrote: Zero out the buffer for readlink() since readlink() does not append a terminating null byte to the buffer. Also change the buffer length passed to readlink() to 'PATH_MAX - 1'

Re: [PATCH v4 0/2] Fix issues observed in selftests/amd-pstate

2023-10-16 Thread Shuah Khan
On 10/12/23 03:32, Swapnil Sapkal wrote: This series fixes issues observed with selftests/amd-pstate while running performance comparison tests with different governors. First patch changes relative paths with absolute paths and also change it with correct paths wherever it is broken. The second

Re: [PATCH v3 2/3] userfaultfd: UFFDIO_MOVE uABI

2023-10-16 Thread Peter Xu
David, On Mon, Oct 16, 2023 at 08:01:10PM +0200, David Hildenbrand wrote: > [...] > > > > > Actually, even though I have no solid clue, but I had a feeling that > > > > there > > > > can be some interesting way to leverage this across-mm movement, while > > > > keeping things all safe (by e.g.

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

2023-10-16 Thread srinivas pandruvada
On Mon, 2023-10-16 at 19:27 +0200, Wysocki, Rafael J wrote: > On 10/16/2023 12:58 PM, Peter Zijlstra wrote: > > On Mon, Oct 16, 2023 at 06:20:53AM +, Meng, Li (Jassmine) > > wrote: > > > > > +static void amd_pstate_init_prefcore(struct amd_cpudata > > > > > *cpudata) { > > > > > + int ret,

Re: [PATCH v4 10/17] iommufd: Support IOMMU_HWPT_ALLOC allocation with user data

2023-10-16 Thread Nicolin Chen
On Mon, Oct 16, 2023 at 08:59:07AM -0300, Jason Gunthorpe wrote: > On Mon, Oct 16, 2023 at 03:03:04PM +0800, Yi Liu wrote: > > Current nesting series actually extends HWPT_ALLOC ioctl to accept user > > data for allocating domain with vendor specific data. Nested translation > > happens to be the

Re: [PATCH v4 01/17] iommu: Add hwpt_type with user_data for domain_alloc_user op

2023-10-16 Thread Nicolin Chen
On Mon, Oct 16, 2023 at 08:54:07AM -0300, Jason Gunthorpe wrote: > On Mon, Oct 16, 2023 at 11:28:15AM +0800, Yi Liu wrote: > > On 2023/10/14 01:56, Nicolin Chen wrote: > > > On Fri, Oct 13, 2023 at 11:04:56AM -0300, Jason Gunthorpe wrote: > > > > On Fri, Oct 13, 2023 at 12:33:13PM +0800, Yi Liu

Re: [PATCH v3 2/3] userfaultfd: UFFDIO_MOVE uABI

2023-10-16 Thread David Hildenbrand
[...] Actually, even though I have no solid clue, but I had a feeling that there can be some interesting way to leverage this across-mm movement, while keeping things all safe (by e.g. elaborately requiring other proc to create uffd and deliver to this proc). Okay, but no real use cases yet.

Re: [PATCH v2 2/6] iommufd/hw_pagetable: Use domain_alloc_user op for domain allocation

2023-10-16 Thread Nicolin Chen
On Mon, Oct 16, 2023 at 04:16:05PM +0800, Liu, Jingqi wrote: > @@ -88,10 +90,19 @@ iommufd_hw_pagetable_alloc(struct iommufd_ctx *ictx, > struct iommufd_ioas *ioas, >refcount_inc(>obj.users); >hwpt->ioas = ioas; > > - hwpt->domain = iommu_domain_alloc(idev->dev->bus); > -

Re: [PATCH v2 1/6] iommu: Add new iommu op to create domains owned by userspace

2023-10-16 Thread Nicolin Chen
On Mon, Oct 16, 2023 at 09:04:54AM -0300, Jason Gunthorpe wrote: > On Sun, Oct 15, 2023 at 12:14:01AM -0700, Nicolin Chen wrote: > > On Thu, Sep 28, 2023 at 12:15:23AM -0700, Yi Liu wrote: > > > > > diff --git a/include/uapi/linux/iommufd.h b/include/uapi/linux/iommufd.h > > > index

Re: [RFC PATCH v1 0/8] Introduce mseal() syscall

2023-10-16 Thread Jann Horn
On Mon, Oct 16, 2023 at 4:38 PM wrote: > > From: Jeff Xu > > This patchset proposes a new mseal() syscall for the Linux kernel. > > Modern CPUs support memory permissions such as RW and NX bits. Linux has > supported NX since the release of kernel version 2.6.8 in August 2004 [1]. > The memory

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

2023-10-16 Thread Wysocki, Rafael J
On 10/16/2023 12:58 PM, Peter Zijlstra wrote: On Mon, Oct 16, 2023 at 06:20:53AM +, Meng, Li (Jassmine) wrote: +static void amd_pstate_init_prefcore(struct amd_cpudata *cpudata) { + int ret, prio; + u32 highest_perf; + static u32 max_highest_perf = 0, min_highest_perf = U32_MAX;

Re: [RFC PATCH v1 0/8] Introduce mseal() syscall

2023-10-16 Thread Linus Torvalds
On Mon, 16 Oct 2023 at 07:38, wrote: > > This patchset proposes a new mseal() syscall for the Linux kernel. So I have no objections to adding some kind of "lock down memory mappings" model, but this isn't it. First off, the simple stuff: the commit messages are worthless. Having check seal

Re: [RFC PATCH v1 0/8] Introduce mseal() syscall

2023-10-16 Thread Matthew Wilcox
On Mon, Oct 16, 2023 at 02:38:19PM +, jef...@chromium.org wrote: > Modern CPUs support memory permissions such as RW and NX bits. Linux has > supported NX since the release of kernel version 2.6.8 in August 2004 [1]. This seems like a confusing way to introduce the subject. Here, you're

Re: [RFC PATCH v1 1/8] Add mseal syscall

2023-10-16 Thread Greg KH
On Mon, Oct 16, 2023 at 02:38:20PM +, jef...@chromium.org wrote: > +#ifdef CONFIG_MSEAL > + /* > + * bit masks for seal. > + * need this since vm_flags is full. > + */ > + unsigned long vm_seals; /* seal flags, see mm.h. */ "unsigned long" and yet: > diff --git

[RFC PATCH v1 8/8] selftest mm/mseal mprotect/munmap/mremap/mmap

2023-10-16 Thread jeffxu
From: Jeff Xu selftest for sealing mprotect/munmap/mremap/mmap Signed-off-by: Jeff Xu --- tools/testing/selftests/mm/Makefile |1 + tools/testing/selftests/mm/mseal_test.c | 1428 +++ 2 files changed, 1429 insertions(+) create mode 100644

[RFC PATCH v1 3/8] mseal: add can_modify_mm and can_modify_vma

2023-10-16 Thread jeffxu
From: Jeff Xu can_modify_mm: checks sealing flags for given memory range. can_modify_vma: checks sealing flags for given vma. Signed-off-by: Jeff Xu --- include/linux/mm.h | 34 ++ mm/mseal.c | 60 ++ 2 files

[RFC PATCH v1 7/8] mseal mmap

2023-10-16 Thread jeffxu
From: Jeff Xu check seal for mmap(2) Signed-off-by: Jeff Xu --- fs/aio.c | 5 +++-- include/linux/mm.h | 5 - ipc/shm.c | 3 ++- mm/internal.h | 4 ++-- mm/mmap.c | 13 + mm/nommu.c | 6 -- mm/util.c | 8 +--- 7

[RFC PATCH v1 6/8] mseal mremap

2023-10-16 Thread jeffxu
From: Jeff Xu check seal for mremap(2) Signed-off-by: Jeff Xu --- mm/mremap.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/mm/mremap.c b/mm/mremap.c index e43f9ceaa29d..2288f9d0b126 100644 --- a/mm/mremap.c +++ b/mm/mremap.c @@ -836,7 +836,15 @@ static unsigned long

[RFC PATCH v1 5/8] mseal munmap

2023-10-16 Thread jeffxu
From: Jeff Xu check seal for munmap(2). Signed-off-by: Jeff Xu --- include/linux/mm.h | 2 +- mm/mmap.c | 22 ++ mm/mremap.c| 5 +++-- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index

[RFC PATCH v1 4/8] mseal: seal mprotect

2023-10-16 Thread jeffxu
From: Jeff Xu check sealing for mprotect(2). Signed-off-by: Jeff Xu --- mm/mprotect.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/mm/mprotect.c b/mm/mprotect.c index 130db91d3a8c..5b67c66d55f7 100644 --- a/mm/mprotect.c +++ b/mm/mprotect.c @@ -753,6 +753,12 @@ static int

[RFC PATCH v1 2/8] Wire up mseal syscall

2023-10-16 Thread jeffxu
From: Jeff Xu Wire up mseal syscall for all architectures. Signed-off-by: Jeff Xu --- arch/alpha/kernel/syscalls/syscall.tbl | 1 + arch/arm/tools/syscall.tbl | 1 + arch/arm64/include/asm/unistd.h | 2 +- arch/arm64/include/asm/unistd32.h | 2 ++

[RFC PATCH v1 1/8] Add mseal syscall

2023-10-16 Thread jeffxu
From: Jeff Xu mseal() prevents system calls from modifying the metadata of virtual addresses. Five syscalls can be sealed, as specified by bitmasks: MM_SEAL_MPROTECT: Deny mprotect(2)/pkey_mprotect(2). MM_SEAL_MUNMAP: Deny munmap(2). MM_SEAL_MMAP: Deny mmap(2). MM_SEAL_MREMAP: Deny mremap(2).

[RFC PATCH v1 0/8] Introduce mseal() syscall

2023-10-16 Thread jeffxu
From: Jeff Xu This patchset proposes a new mseal() syscall for the Linux kernel. Modern CPUs support memory permissions such as RW and NX bits. Linux has supported NX since the release of kernel version 2.6.8 in August 2004 [1]. The memory permission feature improves security stance on memory

Re: [PATCH] iommufd/selftest: Rework TEST_LENGTH to test min_size explicitly

2023-10-16 Thread Jason Gunthorpe
On Sun, Oct 15, 2023 at 12:46:48AM -0700, Nicolin Chen wrote: > TEST_LENGTH passing ".size = sizeof(struct _struct) - 1" expects -EINVAL > from "if (ucmd.user_size < op->min_size)" check in iommufd_fops_ioctl(). > This has been working when min_size is exactly the size of the structure. > >

[PATCH v7 11/11] selftests/bpf/sockopt: Add io_uring support

2023-10-16 Thread Breno Leitao
Expand the sockopt test to use also check for io_uring {g,s}etsockopt commands operations. This patch starts by marking each test if they support io_uring support or not. Right now, io_uring cmd getsockopt() has a limitation of only accepting level == SOL_SOCKET, otherwise it returns

[PATCH v7 07/11] selftests/net: Extract uring helpers to be reusable

2023-10-16 Thread Breno Leitao
Instead of defining basic io_uring functions in the test case, move them to a common directory, so, other tests can use them. This simplify the test code and reuse the common liburing infrastructure. This is basically a copy of what we have in io_uring_zerocopy_tx with some minor improvements to

[PATCH net-next v5 1/5] net: bridge: Set BR_FDB_ADDED_BY_USER early in fdb_add_entry

2023-10-16 Thread Johannes Nixdorf
In preparation of the following fdb limit for dynamically learned entries, allow fdb_create to detect that the entry was added by the user. This way it can skip applying the limit in this case. Reviewed-by: Ido Schimmel Acked-by: Nikolay Aleksandrov Signed-off-by: Johannes Nixdorf ---

[PATCH net-next v5 2/5] net: bridge: Track and limit dynamically learned FDB entries

2023-10-16 Thread Johannes Nixdorf
A malicious actor behind one bridge port may spam the kernel with packets with a random source MAC address, each of which will create an FDB entry, each of which is a dynamic allocation in the kernel. There are roughly 2^48 different MAC addresses, further limited by the rhashtable they are

[PATCH net-next v5 5/5] selftests: forwarding: bridge_fdb_learning_limit: Add a new selftest

2023-10-16 Thread Johannes Nixdorf
Add a suite covering the fdb_n_learned and fdb_max_learned bridge features, touching all special cases in accounting at least once. Acked-by: Nikolay Aleksandrov Signed-off-by: Johannes Nixdorf --- tools/testing/selftests/net/forwarding/Makefile| 3 +-

[PATCH net-next v5 0/5] bridge: Add a limit on learned FDB entries

2023-10-16 Thread Johannes Nixdorf
Introduce a limit on the amount of learned FDB entries on a bridge, configured by netlink with a build time default on bridge creation in the kernel config. For backwards compatibility the kernel config default is disabling the limit (0). Without any limit a malicious actor may OOM a kernel by

[PATCH net-next v5 4/5] net: bridge: Set strict_start_type for br_policy

2023-10-16 Thread Johannes Nixdorf
Set any new attributes added to br_policy to be parsed strictly, to prevent userspace from passing garbage. Signed-off-by: Johannes Nixdorf --- net/bridge/br_netlink.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c index

[PATCH net-next v5 3/5] net: bridge: Add netlink knobs for number / max learned FDB entries

2023-10-16 Thread Johannes Nixdorf
The previous patch added accounting and a limit for the number of dynamically learned FDB entries per bridge. However it did not provide means to actually configure those bounds or read back the count. This patch does that. Two new netlink attributes are added for the accounting and limit of

Re: [PATCH bpf-next v3] selftests/bpf: Use pkg-config to determine ld flags

2023-10-16 Thread Akihiko Odaki
On 2023/10/16 21:52, Daniel Borkmann wrote: On 10/16/23 2:43 PM, Akihiko Odaki wrote: When linking statically, libraries may require other dependencies to be included to ld flags. In particular, libelf may require libzstd. Use pkg-config to determine such dependencies. Signed-off-by: Akihiko

[PATCH bpf-next v4] selftests/bpf: Use pkg-config to determine ld flags

2023-10-16 Thread Akihiko Odaki
When linking statically, libraries may require other dependencies to be included to ld flags. In particular, libelf may require libzstd. Use pkg-config to determine such dependencies. Signed-off-by: Akihiko Odaki --- V3 -> V4: Added "2> /dev/null". V2 -> V3: Added missing "echo". V1 -> V2:

Re: [PATCH bpf-next v3] selftests/bpf: Use pkg-config to determine ld flags

2023-10-16 Thread Daniel Borkmann
On 10/16/23 2:43 PM, Akihiko Odaki wrote: When linking statically, libraries may require other dependencies to be included to ld flags. In particular, libelf may require libzstd. Use pkg-config to determine such dependencies. Signed-off-by: Akihiko Odaki --- V2 -> V3: Added missing "echo". V1

Re: [PATCH v2] selftests/bpf: Use pkg-config to determine ld flags

2023-10-16 Thread Akihiko Odaki
On 2023/10/16 21:19, Daniel Borkmann wrote: On 10/16/23 1:54 PM, Akihiko Odaki wrote: When linking statically, libraries may require other dependencies to be included to ld flags. In particular, libelf may require libzstd. Use pkg-config to determine such dependencies. Signed-off-by: Akihiko

[PATCH bpf-next v3] selftests/bpf: Use pkg-config to determine ld flags

2023-10-16 Thread Akihiko Odaki
When linking statically, libraries may require other dependencies to be included to ld flags. In particular, libelf may require libzstd. Use pkg-config to determine such dependencies. Signed-off-by: Akihiko Odaki --- V2 -> V3: Added missing "echo". V1 -> V2: Implemented fallback, referring to

Re: [PATCH v2] selftests/bpf: Use pkg-config to determine ld flags

2023-10-16 Thread Daniel Borkmann
On 10/16/23 1:54 PM, Akihiko Odaki wrote: When linking statically, libraries may require other dependencies to be included to ld flags. In particular, libelf may require libzstd. Use pkg-config to determine such dependencies. Signed-off-by: Akihiko Odaki --- V1 -> V2: Implemented fallback,

Re: [PATCH v2 1/6] iommu: Add new iommu op to create domains owned by userspace

2023-10-16 Thread Jason Gunthorpe
On Sun, Oct 15, 2023 at 12:14:01AM -0700, Nicolin Chen wrote: > On Thu, Sep 28, 2023 at 12:15:23AM -0700, Yi Liu wrote: > > > diff --git a/include/uapi/linux/iommufd.h b/include/uapi/linux/iommufd.h > > index b4ba0c0cbab6..4a7c5c8fdbb4 100644 > > --- a/include/uapi/linux/iommufd.h > > +++

Re: [PATCH v4 05/17] iommufd: Separate kernel-managed HWPT alloc/destroy/abort functions

2023-10-16 Thread Jason Gunthorpe
On Mon, Oct 16, 2023 at 08:26:25AM +, Tian, Kevin wrote: > > From: Jason Gunthorpe > > Sent: Friday, October 13, 2023 10:06 PM > > > > On Fri, Oct 13, 2023 at 07:13:34AM +, Tian, Kevin wrote: > > > > From: Jason Gunthorpe > > > > Sent: Friday, October 13, 2023 3:10 AM > > > > > > > >

Re: [PATCH v4 10/17] iommufd: Support IOMMU_HWPT_ALLOC allocation with user data

2023-10-16 Thread Jason Gunthorpe
On Mon, Oct 16, 2023 at 03:03:04PM +0800, Yi Liu wrote: > On 2023/10/14 08:51, Nicolin Chen wrote: > > On Fri, Oct 13, 2023 at 09:07:09PM -0300, Jason Gunthorpe wrote: > > > On Fri, Oct 13, 2023 at 01:58:59PM -0700, Nicolin Chen wrote: > > > > On Fri, Oct 13, 2023 at 12:19:23PM -0300, Jason

Re: [PATCH v4 08/17] iommufd: Always setup MSI and anforce cc on kernel-managed domains

2023-10-16 Thread Jason Gunthorpe
On Mon, Oct 16, 2023 at 08:48:03AM +, Tian, Kevin wrote: > > From: Nicolin Chen > > Sent: Saturday, October 14, 2023 8:45 AM > > > > On Tue, Sep 26, 2023 at 01:16:35AM -0700, Tian, Kevin wrote: > > > > From: Liu, Yi L > > > > Sent: Thursday, September 21, 2023 3:51 PM > > > > > > > > From:

Re: [PATCH bpf-next] selftests/bpf: Use pkg-config to determine ld flags

2023-10-16 Thread Akihiko Odaki
On 2023/10/16 20:39, Daniel Borkmann wrote: On 10/15/23 3:39 PM, Akihiko Odaki wrote: When linking statically, libraries may require other dependencies to be included to ld flags. In particular, libelf may require libzstd. Use pkg-config to determine such dependencies. Is this not covered via

[PATCH v2] selftests/bpf: Use pkg-config to determine ld flags

2023-10-16 Thread Akihiko Odaki
When linking statically, libraries may require other dependencies to be included to ld flags. In particular, libelf may require libzstd. Use pkg-config to determine such dependencies. Signed-off-by: Akihiko Odaki --- V1 -> V2: Implemented fallback, referring to HOSTPKG_CONFIG.

Re: [PATCH v4 01/17] iommu: Add hwpt_type with user_data for domain_alloc_user op

2023-10-16 Thread Jason Gunthorpe
On Mon, Oct 16, 2023 at 11:28:15AM +0800, Yi Liu wrote: > On 2023/10/14 01:56, Nicolin Chen wrote: > > On Fri, Oct 13, 2023 at 11:04:56AM -0300, Jason Gunthorpe wrote: > > > On Fri, Oct 13, 2023 at 12:33:13PM +0800, Yi Liu wrote: > > > > > > > not really. Below the users of the struct

Re: [PATCH bpf-next] selftests/bpf: Use pkg-config to determine ld flags

2023-10-16 Thread Daniel Borkmann
On 10/15/23 3:39 PM, Akihiko Odaki wrote: When linking statically, libraries may require other dependencies to be included to ld flags. In particular, libelf may require libzstd. Use pkg-config to determine such dependencies. Is this not covered via -lz or is it that the name differs? Anyway,

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

2023-10-16 Thread Peter Zijlstra
On Mon, Oct 16, 2023 at 06:20:53AM +, Meng, Li (Jassmine) wrote: > > > +static void amd_pstate_init_prefcore(struct amd_cpudata *cpudata) { > > > + int ret, prio; > > > + u32 highest_perf; > > > + static u32 max_highest_perf = 0, min_highest_perf = U32_MAX; > > > > What serializes

RE: [PATCH v4 08/17] iommufd: Always setup MSI and anforce cc on kernel-managed domains

2023-10-16 Thread Tian, Kevin
> From: Nicolin Chen > Sent: Saturday, October 14, 2023 8:45 AM > > On Tue, Sep 26, 2023 at 01:16:35AM -0700, Tian, Kevin wrote: > > > From: Liu, Yi L > > > Sent: Thursday, September 21, 2023 3:51 PM > > > > > > From: Nicolin Chen > > > > > > Now enforce_cache_coherency and msi_cookie are

RE: [PATCH] iommufd/selftest: Rework TEST_LENGTH to test min_size explicitly

2023-10-16 Thread Tian, Kevin
> From: Nicolin Chen > Sent: Sunday, October 15, 2023 3:47 PM > > TEST_LENGTH passing ".size = sizeof(struct _struct) - 1" expects -EINVAL > from "if (ucmd.user_size < op->min_size)" check in iommufd_fops_ioctl(). > This has been working when min_size is exactly the size of the structure. > >

Re: [PATCH v2] selftests/x86/lam: Zero out buffer for readlink()

2023-10-16 Thread kirill . shutemov
On Mon, Oct 16, 2023 at 02:24:46PM +0800, Binbin Wu wrote: > Zero out the buffer for readlink() since readlink() does not append a > terminating null byte to the buffer. Also change the buffer length > passed to readlink() to 'PATH_MAX - 1' to ensure the resulting string > is always null

Re: [PATCH] selftests: net: remove unused variables

2023-10-16 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to netdev/net-next.git (main) by David S. Miller : On Sun, 15 Oct 2023 23:30:39 -0700 you wrote: > These variables are never referenced in the code, just remove them > > Signed-off-by: zhujun2 > --- > tools/testing/selftests/net/af_unix/scm_pidfd.c | 1 - >

RE: [PATCH v5 04/11] iommu/vt-d: Add helper to setup pasid nested translation

2023-10-16 Thread Tian, Kevin
> From: Liu, Yi L > Sent: Friday, October 13, 2023 8:40 PM > > >> + * > >> + * This is used for nested translation based vIOMMU. e.g. guest IOVA and > >> + * guest shared virtual address. In this case, the first-level page tables > >> + * are used for GVA/GIOVA-GPA translation in the guest, the

RE: [PATCH v4 05/17] iommufd: Separate kernel-managed HWPT alloc/destroy/abort functions

2023-10-16 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Friday, October 13, 2023 10:06 PM > > On Fri, Oct 13, 2023 at 07:13:34AM +, Tian, Kevin wrote: > > > From: Jason Gunthorpe > > > Sent: Friday, October 13, 2023 3:10 AM > > > > > > Also, we probably should feed enforce_cache_coherency through the > > >

Re: [PATCH v4 10/17] iommufd: Support IOMMU_HWPT_ALLOC allocation with user data

2023-10-16 Thread Yi Liu
On 2023/10/14 08:51, Nicolin Chen wrote: On Fri, Oct 13, 2023 at 09:07:09PM -0300, Jason Gunthorpe wrote: On Fri, Oct 13, 2023 at 01:58:59PM -0700, Nicolin Chen wrote: On Fri, Oct 13, 2023 at 12:19:23PM -0300, Jason Gunthorpe wrote: On Thu, Sep 21, 2023 at 12:51:31AM -0700, Yi Liu wrote:

[PATCH] selftests: net: remove unused variables

2023-10-16 Thread zhujun2
These variables are never referenced in the code, just remove them Signed-off-by: zhujun2 --- tools/testing/selftests/net/af_unix/scm_pidfd.c | 1 - tools/testing/selftests/net/af_unix/test_unix_oob.c | 2 -- tools/testing/selftests/net/nettest.c | 5 +++-- 3 files changed, 3

[PATCH v2] selftests/x86/lam: Zero out buffer for readlink()

2023-10-16 Thread Binbin Wu
Zero out the buffer for readlink() since readlink() does not append a terminating null byte to the buffer. Also change the buffer length passed to readlink() to 'PATH_MAX - 1' to ensure the resulting string is always null terminated. Fixes: 833c12ce0f430 ("selftests/x86/lam: Add inherit test

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

2023-10-16 Thread Meng, Li (Jassmine)
[AMD Official Use Only - General] Hi Peter: > -Original Message- > From: Peter Zijlstra > Sent: Saturday, October 14, 2023 12:01 AM > To: Meng, Li (Jassmine) > Cc: Rafael J . Wysocki ; Huang, Ray > ; linux...@vger.kernel.org; linux- > ker...@vger.kernel.org; x...@kernel.org;