Re: [PATCH v3] tracing/selftests: Add test to test the trace_marker

2023-12-13 Thread Alexander Kapshuk
The REs used in the sed commands below may be simplified as shown if desired. On Wed, Dec 13, 2023 at 2:22 AM Steven Rostedt wrote: > > From: "Steven Rostedt (Google)" > > Add a test that writes longs strings, some over the size of the sub buffer > and make sure that the entire content is there.

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

2023-12-13 Thread David Hildenbrand
On 13.12.23 06:55, John Hubbard wrote: On 12/12/23 21:52, John Hubbard wrote: On 12/12/23 19:58, Muhammad Usama Anjum wrote: ... Oh, this sounds like it would work nicely. No more "make headers" required (hooray!). Instead, the new approach would be "selftests are allowed to include from tools/

Re: Should I add BPF kfuncs for userspace apps? And how?

2023-12-13 Thread Benjamin Tissoires
On Tue, Dec 12, 2023 at 1:41 PM Akihiko Odaki wrote: > > On 2023/12/12 19:39, Benjamin Tissoires wrote: > > Hi, > > > > On Tue, Dec 12, 2023 at 9:11 AM Akihiko Odaki > > wrote: > >> > >> Hi, > > Hi, > > Thanks for reply. > > >> > >> It is said eBPF is a safe way to extend kernels and that is ver

Re: [PATCH] selftests/ftrace: Add test to exercize function tracer across cpu hotplug

2023-12-13 Thread Naveen N Rao
On Wed, Dec 13, 2023 at 09:40:38AM +0900, Masami Hiramatsu wrote: > Hi Naveen, > > On Tue, 12 Dec 2023 14:26:07 +0530 > Naveen N Rao wrote: > > > Add a test to exercize cpu hotplug with the function tracer active to > > ensure that sensitive functions in idle path are excluded from being > > tra

[PATCH v2] selftests/ftrace: Add test to exercize function tracer across cpu hotplug

2023-12-13 Thread Naveen N Rao
Add a test to exercize cpu hotplug with the function tracer active to ensure that sensitive functions in idle path are excluded from being traced. This helps catch issues such as the one fixed by commit 4b3338aaa74d ("powerpc/ftrace: Fix stack teardown in ftrace_no_trace"). Signed-off-by: Naveen N

Re: [net-next v1 09/16] page_pool: device memory support

2023-12-13 Thread Yunsheng Lin
On 2023/12/12 22:28, Mina Almasry wrote: ... >> >> the page_ref_*() API may be avoided using the below patch: >> https://patchwork.kernel.org/project/netdevbpf/patch/20231113130041.58124-7-linyunsh...@huawei.com/ >> > > Even after the patch above, you're still calling page_ref_count() in > the p

Re: [PATCH v6 0/6] iommufd: Add nesting infrastructure (part 2/2)

2023-12-13 Thread Jason Gunthorpe
On Tue, Dec 12, 2023 at 12:05:41PM -0800, Nicolin Chen wrote: > > > // iommufd_private.h > > > > > > enum iommufd_object_type { > > > ... > > > + IOMMUFD_OBJ_VIOMMU, > > > ... > > > }; > > > > > > +struct iommufd_viommu { > > > + struct iommufd_object obj; > > > + struct iommufd_hwpt_paging *

Re: [PATCH v2] selftests/ftrace: Add test to exercize function tracer across cpu hotplug

2023-12-13 Thread Google
On Wed, 13 Dec 2023 17:08:02 +0530 Naveen N Rao wrote: > Add a test to exercize cpu hotplug with the function tracer active to > ensure that sensitive functions in idle path are excluded from being > traced. This helps catch issues such as the one fixed by commit > 4b3338aaa74d ("powerpc/ftrace:

Re: [PATCH v2 3/6] iommufd: Initializing and releasing IO page fault data

2023-12-13 Thread Jason Gunthorpe
On Wed, Dec 13, 2023 at 02:15:28AM +, Tian, Kevin wrote: > > From: Baolu Lu > > Sent: Wednesday, December 13, 2023 10:05 AM > > > > > >> 2. This is not intended to work only with idxd and uacce. right? > > > It should work everywhere, I suspect Intel Team didn't hit this > > > because they are

Re: [PATCH RESEND v3] KVM: selftests: Initialise dynamically allocated configuration names

2023-12-13 Thread Paolo Bonzini
On 12/11/23 14:08, Mark Brown wrote: When we dynamically generate a name for a configuration in get-reg-list we use strcat() to append to a buffer allocated using malloc() but we never initialise that buffer. Since malloc() offers no guarantees regarding the contents of the memory it returns this

Re: [PATCH v7 02/39] prctl: arch-agnostic prctl for shadow stack

2023-12-13 Thread Mark Brown
On Tue, Dec 12, 2023 at 04:50:38PM -0800, Deepak Gupta wrote: > A theoretical scenario (no current workloads should've this case > because no shadow stack) > - User mode did _ENABLE on the main thread. Shadow stack was allocated > for the current > thread. > - User mode created a bunch worker t

Re: [PATCHv2 net-next 09/13] selftests/net: convert fib_nexthops.sh to run it in unique namespace

2023-12-13 Thread Ido Schimmel
On Wed, Dec 13, 2023 at 02:08:52PM +0800, Hangbin Liu wrote: > Here is the test result after conversion. > > ]# ./fib_nexthops.sh > > Basic functional tests > -- > TEST: List with nothing defined [ OK ] > TEST: Nexthop get on non-existe

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

2023-12-13 Thread Liu, Yi L
> From: Jason Gunthorpe > Sent: Tuesday, December 12, 2023 10:40 PM > > On Tue, Dec 12, 2023 at 01:45:16PM +, Liu, Yi L wrote: > > > From: Jason Gunthorpe > > > Sent: Monday, December 11, 2023 9:22 PM > > > > > > On Mon, Dec 11, 2023 at 03:53:40PM +0800, Yi Liu wrote: > > > > > > > > > From

Re: [PATCH v7 02/39] prctl: arch-agnostic prctl for shadow stack

2023-12-13 Thread Mark Brown
On Tue, Dec 12, 2023 at 09:22:59PM +, Edgecombe, Rick P wrote: > On Tue, 2023-12-12 at 20:26 +, Mark Brown wrote: > > In general if things have a need to get at prctl()s via ptrace we > > should > > just fix that, at least for arm64 there's things like the vector > > lengths > > that are c

Re: [PATCHv2 net-next 12/13] selftests/net: convert fib_tests.sh to run it in unique namespace

2023-12-13 Thread Ido Schimmel
On Wed, Dec 13, 2023 at 02:08:55PM +0800, Hangbin Liu wrote: > Here is the test result after conversion. > > # ./fib_tests.sh > > Single path route test > Start point > TEST: IPv4 fibmatch [ OK > ] > > ... > > Fib6 garbage collectio

Re: [PATCH v4 03/11] KVM: selftests: Add CONFIG_64BIT definition for the build

2023-12-13 Thread Andrew Jones
On Tue, Dec 12, 2023 at 05:31:12PM +0800, Haibo Xu wrote: > Since only 64bit KVM selftests were supported on all architectures, > add the CONFIG_64BIT definition in kvm/Makefile to ensure only 64bit > definitions were available in the corresponding included files. > > Suggested-by: Andrew Jones >

Re: [PATCHv2 net-next 13/13] selftests/net: convert fdb_flush.sh to run it in unique namespace

2023-12-13 Thread Ido Schimmel
On Wed, Dec 13, 2023 at 02:08:56PM +0800, Hangbin Liu wrote: > Here is the test result after conversion. > # ./fdb_flush.sh > TEST: vx10: Expected 5 FDB entries, got 5 [ OK ] > TEST: vx20: Expected 5 FDB entries, got 5 [ OK ] > ... > TEST: vx

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

2023-12-13 Thread Mark Brown
On Wed, Dec 13, 2023 at 08:58:06AM +0500, Muhammad Usama Anjum wrote: > On 12/13/23 7:14 AM, John Hubbard wrote: > > Oh, this sounds like it would work nicely. No more "make headers" > > required (hooray!). Instead, the new approach would be "selftests are > > allowed to include from tools/include

Re: [PATCH v4 05/11] tools: riscv: Add header file vdso/processor.h

2023-12-13 Thread Andrew Jones
On Tue, Dec 12, 2023 at 05:31:14PM +0800, Haibo Xu wrote: > Borrow the cpu_relax() definitions from kernel's > arch/riscv/include/asm/vdso/processor.h to tools/ for riscv. > > Signed-off-by: Haibo Xu > --- > tools/arch/riscv/include/asm/vdso/processor.h | 32 +++ > 1 file changed

Re: [PATCH v4 08/11] KVM: riscv: selftests: Add guest helper to get vcpu id

2023-12-13 Thread Andrew Jones
On Tue, Dec 12, 2023 at 05:31:17PM +0800, Haibo Xu wrote: > Add guest_get_vcpuid() helper to simplify accessing to per-cpu > private data. The sscratch CSR was used to store the vcpu id. > > Signed-off-by: Haibo Xu > Reviewed-by: Andrew Jones > --- > tools/testing/selftests/kvm/include/aarch64/

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

2023-12-13 Thread Jason Gunthorpe
On Wed, Dec 13, 2023 at 01:47:54PM +, Liu, Yi L wrote: > > From: Jason Gunthorpe > > Sent: Tuesday, December 12, 2023 10:40 PM > > > > On Tue, Dec 12, 2023 at 01:45:16PM +, Liu, Yi L wrote: > > > > From: Jason Gunthorpe > > > > Sent: Monday, December 11, 2023 9:22 PM > > > > > > > > On M

Re: [PATCH v4 10/11] KVM: riscv: selftests: Add sstc timer test

2023-12-13 Thread Andrew Jones
On Tue, Dec 12, 2023 at 05:31:19PM +0800, Haibo Xu wrote: > Add a KVM selftests to validate the Sstc timer functionality. > The test was ported from arm64 arch timer test. > > Signed-off-by: Haibo Xu > --- > tools/testing/selftests/kvm/Makefile | 1 + > .../selftests/kvm/aarch64/arch_

Re: [PATCH v4 11/11] KVM: selftests: Enable tunning of err_margin_us in arch timer test

2023-12-13 Thread Andrew Jones
On Tue, Dec 12, 2023 at 05:31:20PM +0800, Haibo Xu wrote: > There are intermittent failures occured when stressing the > arch-timer test in a Qemu VM: > > Guest assert failed, vcpu 0; stage; 4; iter: 3 > Test Assertion Failure >aarch64/arch_timer.c:196: config_iter + 1 == irq_iter

Re: [PATCH v3] tracing/selftests: Add test to test the trace_marker

2023-12-13 Thread Steven Rostedt
On Wed, 13 Dec 2023 10:09:50 +0200 Alexander Kapshuk wrote: > The REs used in the sed commands below may be simplified as shown if desired. > > On Wed, Dec 13, 2023 at 2:22 AM Steven Rostedt wrote: > > > > From: "Steven Rostedt (Google)" > > > > Add a test that writes longs strings, some over

Re: [PATCH v3 4/4] KVM: riscv: selftests: Add Svadu Extension to get-reg-list testt

2023-12-13 Thread Andrew Jones
On Thu, Nov 02, 2023 at 12:01:25PM +, Yong-Xuan Wang wrote: > Update the get-reg-list test to test the Svadu Extension is available > for guest OS. > > Signed-off-by: Yong-Xuan Wang > --- > .../testing/selftests/kvm/riscv/get-reg-list.c | 18 ++ > 1 file changed, 18 insertion

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

2023-12-13 Thread Maxime Ripard
On Fri, 8 Dec 2023 18:09:29 +0800, david...@google.com wrote: > Tests for drivers often require a struct device to pass to other > functions. While it's possible to create these with > root_device_register(), or to use something like a platform device, this > is both a misuse of those APIs, and can

Re: [PATCH v3 12/25] arm64: handle PKEY/POE faults

2023-12-13 Thread Joey Gouly
Hi, On Mon, Dec 11, 2023 at 06:18:17PM +, Catalin Marinas wrote: > On Fri, Nov 24, 2023 at 04:34:57PM +, Joey Gouly wrote: > > @@ -497,6 +498,23 @@ static void do_bad_area(unsigned long far, unsigned > > long esr, > > #define VM_FAULT_BADMAP((__force vm_fault_t)0x01) > >

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

2023-12-13 Thread Maxime Ripard
Hi David, On Fri, Dec 08, 2023 at 06:09:28PM +0800, david...@google.com wrote: > KUnit tests often need to provide a struct device, and thus far have > mostly been using root_device_register() or platform devices to create > a 'fake device' for use with, e.g., code which uses device-managed > reso

Re: [PATCH v2] selftests/ftrace: Add test to exercize function tracer across cpu hotplug

2023-12-13 Thread Steven Rostedt
On Wed, 13 Dec 2023 21:54:50 +0900 Masami Hiramatsu (Google) wrote: > On Wed, 13 Dec 2023 17:08:02 +0530 > Naveen N Rao wrote: > > > Add a test to exercize cpu hotplug with the function tracer active to > > ensure that sensitive functions in idle path are excluded from being > > traced. This he

Re: [PATCH v3] tracing/selftests: Add test to test the trace_marker

2023-12-13 Thread Alexander Kapshuk
On Wed, Dec 13, 2023 at 4:57 PM Steven Rostedt wrote: > > On Wed, 13 Dec 2023 10:09:50 +0200 > Alexander Kapshuk wrote: > > > The REs used in the sed commands below may be simplified as shown if > > desired. > > > > On Wed, Dec 13, 2023 at 2:22 AM Steven Rostedt wrote: > > > > > > From: "Steven

Re: [PATCH 01/15] KVM: riscv: selftests: Generate ISA extension reg_list using macros

2023-12-13 Thread Andrew Jones
On Tue, Nov 28, 2023 at 08:23:43PM +0530, Anup Patel wrote: > Various ISA extension reg_list have common pattern so let us generate > these using macros. > > We define two macros for the above purpose: > 1) KVM_ISA_EXT_SIMPLE_CONFIG - Macro to generate reg_list for >ISA extension without any a

[PATCH v4] tracing/selftests: Add test to test the trace_marker

2023-12-13 Thread Steven Rostedt
From: "Steven Rostedt (Google)" Add a test that writes longs strings, some over the size of the sub buffer and make sure that the entire content is there. Signed-off-by: Steven Rostedt (Google) --- Changes since v3: https://lore.kernel.org/linux-trace-kernel/20231212192317.0fb6b...@gandalf.loc

Re: [PATCH 01/15] KVM: riscv: selftests: Generate ISA extension reg_list using macros

2023-12-13 Thread Anup Patel
On Wed, Dec 13, 2023 at 9:22 PM Andrew Jones wrote: > > On Tue, Nov 28, 2023 at 08:23:43PM +0530, Anup Patel wrote: > > Various ISA extension reg_list have common pattern so let us generate > > these using macros. > > > > We define two macros for the above purpose: > > 1) KVM_ISA_EXT_SIMPLE_CONFIG

Re: [PATCH 02/15] RISC-V: KVM: Allow Zbc extension for Guest/VM

2023-12-13 Thread Andrew Jones
On Tue, Nov 28, 2023 at 08:23:44PM +0530, Anup Patel wrote: > We extend the KVM ISA extension ONE_REG interface to allow KVM > user space to detect and enable Zbc extension for Guest/VM. > > Signed-off-by: Anup Patel > --- > arch/riscv/include/uapi/asm/kvm.h | 1 + > arch/riscv/kvm/vcpu_onereg.c

Re: [PATCH 03/15] KVM: riscv: selftests: Add Zbc extension to get-reg-list test

2023-12-13 Thread Andrew Jones
On Tue, Nov 28, 2023 at 08:23:45PM +0530, Anup Patel wrote: > The KVM RISC-V allows Zbc extension for Guest/VM so let us add > this extension to get-reg-list test. > > Signed-off-by: Anup Patel > --- > tools/testing/selftests/kvm/riscv/get-reg-list.c | 4 > 1 file changed, 4 insertions(+) >

Re: [PATCH 04/15] RISC-V: KVM: Allow scalar crypto extensions for Guest/VM

2023-12-13 Thread Andrew Jones
On Tue, Nov 28, 2023 at 08:23:46PM +0530, Anup Patel wrote: > We extend the KVM ISA extension ONE_REG interface to allow KVM > user space to detect and enable scalar crypto extensions for > Guest/VM. This includes extensions Zbkb, Zbkc, Zbkx, Zknd, Zkne, > Zknh, Zkr, Zksed, Zksh, and Zkt. > > Sign

Re: [PATCH v7 02/39] prctl: arch-agnostic prctl for shadow stack

2023-12-13 Thread Deepak Gupta
On Wed, Dec 13, 2023 at 5:37 AM Mark Brown wrote: > > On Tue, Dec 12, 2023 at 04:50:38PM -0800, Deepak Gupta wrote: > > > A theoretical scenario (no current workloads should've this case > > because no shadow stack) > > > - User mode did _ENABLE on the main thread. Shadow stack was allocated > > f

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

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

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

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

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

2023-12-13 Thread Rae Moar
Add KUNIT_INIT_TABLE to the INIT_DATA linker section. Alter the KUnit macros to create init tests: kunit_test_init_section_suites Update lib/kunit/executor.c to run both the suites in KUNIT_TABLE and KUNIT_INIT_TABLE. Reviewed-by: David Gow Signed-off-by: Rae Moar --- include/asm-generic/vmli

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

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

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

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

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

2023-12-13 Thread Rae Moar
Expand the documentation on the KUnit debugfs filesystem on the run_manual.rst page. Add section describing how to access results using debugfs. Add section describing how to run tests after boot using debugfs. Reviewed-by: David Gow Signed-off-by: Rae Moar --- Documentation/dev-tools/kunit/r

Re: [PATCH v7 02/39] prctl: arch-agnostic prctl for shadow stack

2023-12-13 Thread Mark Brown
On Wed, Dec 13, 2023 at 11:43:49AM -0800, Deepak Gupta wrote: > On Wed, Dec 13, 2023 at 5:37 AM Mark Brown wrote: > > On Tue, Dec 12, 2023 at 04:50:38PM -0800, Deepak Gupta wrote: > > > How will it do that (currently _ENABLE is married to _WRITE and _PUSH) ? > > That's feeling moderately firmly

Re: [PATCH v6 0/6] iommufd: Add nesting infrastructure (part 2/2)

2023-12-13 Thread Nicolin Chen
On Wed, Dec 13, 2023 at 08:40:55AM -0400, Jason Gunthorpe wrote: > On Tue, Dec 12, 2023 at 12:05:41PM -0800, Nicolin Chen wrote: > > > > // iommufd_private.h > > > > > > > > enum iommufd_object_type { > > > > ... > > > > + IOMMUFD_OBJ_VIOMMU, > > > > ... > > > > }; > > > > >

Re: [PATCH v7 20/39] arm64/gcs: Context switch GCS state for EL0

2023-12-13 Thread Deepak Gupta
On Wed, Nov 22, 2023 at 1:45 AM Mark Brown wrote: > + > +/* > + * Apply the GCS mode configured for the specified task to the > + * hardware. > + */ > +void gcs_set_el0_mode(struct task_struct *task) > +{ > + u64 gcscre0_el1 = GCSCRE0_EL1_nTR; > + > + if (task->thread.gcs_el0_mode & PR

Re: [PATCH v7 20/39] arm64/gcs: Context switch GCS state for EL0

2023-12-13 Thread Mark Brown
On Wed, Dec 13, 2023 at 11:59:45AM -0800, Deepak Gupta wrote: > On Wed, Nov 22, 2023 at 1:45 AM Mark Brown wrote: > > + if (task->thread.gcs_el0_mode & PR_SHADOW_STACK_ENABLE) > > + gcscre0_el1 |= GCSCRE0_EL1_RVCHKEN | GCSCRE0_EL1_PCRSEL; > If the intent is to disable, is the

Re: [PATCH v3 01/29] selftests/resctrl: Convert perror() to ksft_perror() or ksft_print_msg()

2023-12-13 Thread Reinette Chatre
Hi Ilpo, On 12/11/2023 4:17 AM, Ilpo Järvinen wrote: > The resctrl selftest code contains a number of perror() calls. Some of > them come with hash character and some don't. The kselftest framework > provides ksft_perror() that is compatible with test output formatting > so it should be used inste

Re: [PATCH v3 02/29] selftests/resctrl: Return -1 instead of errno on error

2023-12-13 Thread Reinette Chatre
Hi Ilpo, On 12/11/2023 4:17 AM, Ilpo Järvinen wrote: > A number of functions in the resctrl selftests return errno. It is > problematic because errno is positive which is often counterintuitive. > Also, every sites returning errno prints the error message already with every sites -> every site >

Re: [PATCH v3 04/29] selftests/resctrl: Change function comments to say < 0 on error

2023-12-13 Thread Reinette Chatre
Hi Ilpo, On 12/11/2023 4:18 AM, Ilpo Järvinen wrote: > A number function comments state the function return non-zero on > failure but in reality they can only return 0 on success and < 0 on > error. > > Update the comments to say < 0 on error to match the behavior. > > While at it, improve cat_v

Re: [PATCH v3 07/29] selftests/resctrl: Refactor get_cbm_mask() and rename to get_full_cbm()

2023-12-13 Thread Reinette Chatre
Hi Ilpo, On 12/11/2023 4:18 AM, Ilpo Järvinen wrote: > -int get_cbm_mask(char *cache_type, char *cbm_mask) > +static int get_bit_mask(const char *filename, unsigned long *mask) > { > - char cbm_mask_path[1024]; > FILE *fp; > > - if (!cbm_mask) > + if (!filename || !mask) >

Re: [PATCH v3 09/29] selftests/resctrl: Create cache_portion_size() helper

2023-12-13 Thread Reinette Chatre
Hi Ilpo, On 12/11/2023 4:18 AM, Ilpo Järvinen wrote: > +/* > + * cache_portion_size - Calculate the size of a cache portion > + * @cache_size: Total cache size in bytes > + * @portion_mask:Cache portion mask > + * @full_cache_mask: Full Cache Bit Mask (CBM) for the cache > + * > +

Re: [PATCH v3 10/29] selftests/resctrl: Exclude shareable bits from schemata in CAT test

2023-12-13 Thread Reinette Chatre
Hi Ilpo, On 12/11/2023 4:18 AM, Ilpo Järvinen wrote: > CAT test doesn't take shareable bits into account, i.e., the test might > be sharing cache with some devices (e.g., graphics). > > Introduce get_mask_no_shareable() and use it to provision an > environment for CAT test where the allocated LLC

Re: [PATCH v3 11/29] selftests/resctrl: Split measure_cache_vals()

2023-12-13 Thread Reinette Chatre
Hi Ilpo, On 12/11/2023 4:18 AM, Ilpo Järvinen wrote: > measure_cache_vals() does a different thing depending on the test case > that called it: > - For CAT, it measures LLC misses through perf. > - For CMT, it measures LLC occupancy through resctrl. > > Split these two functionalities into ow

Re: [PATCH v3 20/29] selftests/resctrl: Replace file write with volatile variable

2023-12-13 Thread Reinette Chatre
Hi Ilpo, On 12/11/2023 4:18 AM, Ilpo Järvinen wrote: > The fill_buf code prevents compiler optimizating the entire read loop > away by writing the final value of the variable into a file. While it > achieves the goal, writing into a file requires significant amount of > work within the innermost t

Re: [PATCH v3 22/29] selftests/resctrl: Rewrite Cache Allocation Technology (CAT) test

2023-12-13 Thread Reinette Chatre
Hi Ilpo, On 12/11/2023 4:18 AM, Ilpo Järvinen wrote: > CAT test spawns two processes into two different control groups with > exclusive schemata. Both the processes alloc a buffer from memory > matching their allocated LLC block size and flush the entire buffer out > of caches. Since the processes

Re: [PATCH v3 23/29] selftests/resctrl: Restore the CPU affinity after CAT test

2023-12-13 Thread Reinette Chatre
Hi Ilpo, On 12/11/2023 4:18 AM, Ilpo Järvinen wrote: > CAT test does not reset the CPU affinity after the benchmark. > This is relatively harmless as is because CAT test is the last > benchmark to run, however, more tests may be added later. > > Store the CPU affinity the first time taskset_bench

Re: [PATCH v3 24/29] selftests/resctrl: Create struct for input parameters

2023-12-13 Thread Reinette Chatre
Hi Ilpo, On 12/11/2023 4:18 AM, Ilpo Järvinen wrote: > resctrl_tests reads a set of parameters and passes them individually > for each tests which causes variations in the call signature between > the tests. > > Add struct input_params to hold all input parameters. It can be easily > passed to ev

Re: [PATCH v3 25/29] selftests/resctrl: Introduce generalized test framework

2023-12-13 Thread Reinette Chatre
Hi Ilpo, On 12/11/2023 4:18 AM, Ilpo Järvinen wrote: > Each test currently has a "run test" function in per test file and > another resctrl_tests.c. The functions in resctrl_tests.c are almost > identical. > > Generalize the one in resctrl_tests.c such that it can be shared > between all of the t

Re: [PATCH v3 27/29] selftests/resctrl: Add helper to convert L2/3 to integer

2023-12-13 Thread Reinette Chatre
Hi Ilpo, On 12/11/2023 4:18 AM, Ilpo Järvinen wrote: > "L2"/"L3" conversion to integer is embedded into get_cache_size() > which prevents reuse. > > Create a helper for the cache string to integer conversion to make > it reusable. > > Signed-off-by: Ilpo Järvinen > --- Reviewed-by: Reinette Ch

Re: [PATCH v3 28/29] selftests/resctrl: Rename resource ID to domain ID

2023-12-13 Thread Reinette Chatre
Hi Ilpo, On 12/11/2023 4:18 AM, Ilpo Järvinen wrote: > Kernel-side calls the instances of a resource domains. > > Change the resource_id naming in the selftest code to domain_id to > match the kernel side better. > > Suggested-by: Maciej Wieczór-Retman > Signed-off-by: Ilpo Järvinen > --- Rev

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

2023-12-13 Thread John Hubbard
On 12/13/23 01:59, David Hildenbrand wrote: ... Another variation though, would be to run "make headers", and snapshot some of those files into tools/include. ^ this is what I had in mind If you're writing a test that needs some new fancy thing, update the relevant header. OK, and Mark Bro

Re: [PATCH v4] tracing/selftests: Add test to test the trace_marker

2023-12-13 Thread Google
On Wed, 13 Dec 2023 11:15:27 -0500 Steven Rostedt wrote: > From: "Steven Rostedt (Google)" > > Add a test that writes longs strings, some over the size of the sub buffer > and make sure that the entire content is there. This looks good to me. and tested. Acked-by: Masami Hiramatsu (Google) T

Re: [PATCH bpf-next v5 9/9] bpf: xfrm: Add selftest for bpf_xdp_get_xfrm_state()

2023-12-13 Thread Daniel Xu
On Wed, Dec 13, 2023 at 12:13:51AM +0100, Kumar Kartikeya Dwivedi wrote: > On Tue, 12 Dec 2023 at 20:52, Daniel Xu wrote: > > > > cc Kumar > > > > On Tue, Dec 12, 2023 at 09:17:02AM -0700, Daniel Xu wrote: > > > On Mon, Dec 11, 2023 at 04:25:06PM -0800, Eyal Birger wrote: > > > > On Mon, Dec 11, 2

Re: [PATCH bpf-next v5 9/9] bpf: xfrm: Add selftest for bpf_xdp_get_xfrm_state()

2023-12-13 Thread Eyal Birger
On Wed, Dec 13, 2023 at 3:15 PM Daniel Xu wrote: > > On Wed, Dec 13, 2023 at 12:13:51AM +0100, Kumar Kartikeya Dwivedi wrote: > > On Tue, 12 Dec 2023 at 20:52, Daniel Xu wrote: > > > > > > cc Kumar > > > > > > On Tue, Dec 12, 2023 at 09:17:02AM -0700, Daniel Xu wrote: > > > > On Mon, Dec 11, 2023

Re: [PATCH bpf-next v5 5/9] bpf: selftests: Add verifier tests for CO-RE bitfield writes

2023-12-13 Thread Martin KaFai Lau
On 12/11/23 12:20 PM, Daniel Xu wrote: Add some tests that exercise BPF_CORE_WRITE_BITFIELD() macro. Since some non-trivial bit fiddling is going on, make sure various edge cases (such as adjacent bitfields and bitfields at the edge of structs) are exercised. Hi DanielXu, I have pushed the libb

Re: [PATCH bpf-next v5 5/9] bpf: selftests: Add verifier tests for CO-RE bitfield writes

2023-12-13 Thread Daniel Xu
On Wed, Dec 13, 2023 at 03:58:39PM -0800, Martin KaFai Lau wrote: > On 12/11/23 12:20 PM, Daniel Xu wrote: > > Add some tests that exercise BPF_CORE_WRITE_BITFIELD() macro. Since some > > non-trivial bit fiddling is going on, make sure various edge cases (such > > as adjacent bitfields and bitfield

Re: [RFC PATCH v3 11/11] mseal:add documentation

2023-12-13 Thread Jeff Xu
On Tue, Dec 12, 2023 at 4:39 PM Linus Torvalds wrote: > > On Tue, 12 Dec 2023 at 15:17, wrote: > > + > > +**types**: bit mask to specify the sealing types, they are: > > I really want a real-life use-case for more than one bit of "don't modify". > For the real-life use case question, Stephen Rött

Re: [net-next v1 03/16] queue_api: define queue api

2023-12-13 Thread Jakub Kicinski
On Thu, 7 Dec 2023 16:52:34 -0800 Mina Almasry wrote: > This API enables the net stack to reset the queues used for devmem. Nice, thanks for moving this forward. FWIW when I started hacking on it the API looked more like: https://github.com/kuba-moo/linux/commit/7af8abfa4fdff248e21fc76aecc334004a

Re: [RFC PATCH v3 11/11] mseal:add documentation

2023-12-13 Thread Theo de Raadt
Jeff Xu wrote: > > Or when would you *ever* say "seal this area, but mprotect()" is ok. > > > The fact that openBSD allows RW=>RO transaction, as in its man page [2] > > " At present, mprotect(2) may reduce permissions on immutable pages > marked PROT_READ | PROT_WRITE to the less permissiv

Re: [net-next v1 05/16] net: netdev netlink api to bind dma-buf to a net device

2023-12-13 Thread Jakub Kicinski
On Thu, 7 Dec 2023 16:52:36 -0800 Mina Almasry wrote: > +name: type > +doc: rx or tx queue > +type: u8 > +enum: queue-type nit: the queue/napi GET was applied to net-next, would be good to stick to the same types (s/u8/u32)

Re: [RFC PATCH v3 11/11] mseal:add documentation

2023-12-13 Thread Linus Torvalds
On Wed, 13 Dec 2023 at 16:36, Jeff Xu wrote: > > > > IOW, when would you *ever* say "seal this area, but MADV_DONTNEED is ok"? > > > The MADV_DONTNEED is OK for file-backed mapping. Right. It makes no semantic difference. So there's no point to it. My point was that you added this magic flag for

Re: [PATCH 8/8] iommu/vt-d: Add set_dev_pasid callback for nested domain

2023-12-13 Thread Yang, Weijiang
On 11/27/2023 2:34 PM, Yi Liu wrote: From: Lu Baolu This allows the upper layers to set a nested type domain to a PASID of a device if the PASID feature is supported by the IOMMU hardware. The set_dev_pasid callback for non-nest domain has already be there, so this only needs to add it for nes

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

2023-12-13 Thread David Gow
On Thu, 14 Dec 2023 at 03:44, Rae Moar wrote: > > Add example_init_test_suite to allow for testing the feature of running > test suites marked as init to indicate they use init data and/or > functions. > > This suite should always pass and uses a simple init function. > > This suite can also be us

Re: Should I add BPF kfuncs for userspace apps? And how?

2023-12-13 Thread Akihiko Odaki
On 2023/12/13 19:22, Benjamin Tissoires wrote: On Tue, Dec 12, 2023 at 1:41 PM Akihiko Odaki wrote: On 2023/12/12 19:39, Benjamin Tissoires wrote: Hi, On Tue, Dec 12, 2023 at 9:11 AM Akihiko Odaki wrote: Hi, Hi, Thanks for reply. It is said eBPF is a safe way to extend kernels and t

Re: [net-next v1 00/16] Device Memory TCP

2023-12-13 Thread patchwork-bot+netdevbpf
Hello: This series was applied to netdev/net-next.git (main) by Jakub Kicinski : On Thu, 7 Dec 2023 16:52:31 -0800 you wrote: > Major changes in v1: > -- > > 1. Implemented MVP queue API ndos to remove the userspace-visible >driver reset. > > 2. Fixed issues in the napi_pp_put_

Re: [PATCH v4 02/11] KVM: arm64: selftests: Split arch_timer test code

2023-12-13 Thread Anup Patel
Hi Marc, Hi Oliver, On Tue, Dec 12, 2023 at 2:49 PM Haibo Xu wrote: > > Split the arch-neutral test code out of aarch64/arch_timer.c > and put them into a common arch_timer.c. This is a preparation > to share timer test codes in riscv. > > Suggested-by: Andrew Jones > Signed-off-by: Haibo Xu >

Re: [PATCH v4 11/11] KVM: selftests: Enable tunning of err_margin_us in arch timer test

2023-12-13 Thread Anup Patel
Hi Marc, Hi Oliver, On Tue, Dec 12, 2023 at 2:52 PM Haibo Xu wrote: > > There are intermittent failures occured when stressing the > arch-timer test in a Qemu VM: > > Guest assert failed, vcpu 0; stage; 4; iter: 3 > Test Assertion Failure >aarch64/arch_timer.c:196: config_iter +

Re: [net-next v1 00/16] Device Memory TCP

2023-12-13 Thread Christoph Hellwig
On Thu, Dec 14, 2023 at 06:20:27AM +, patchwork-bot+netdev...@kernel.org wrote: > Hello: > > This series was applied to netdev/net-next.git (main) > by Jakub Kicinski : Umm, this is still very broken in intraction with other subsystems. Please don't push ahead so quickly.

Re: [net-next v1 00/16] Device Memory TCP

2023-12-13 Thread Mina Almasry
On Wed, Dec 13, 2023 at 10:49 PM Christoph Hellwig wrote: > > On Thu, Dec 14, 2023 at 06:20:27AM +, patchwork-bot+netdev...@kernel.org > wrote: > > Hello: > > > > This series was applied to netdev/net-next.git (main) > > by Jakub Kicinski : > > Umm, this is still very broken in intraction wit

Re: [net-next v1 00/16] Device Memory TCP

2023-12-13 Thread Christoph Hellwig
On Wed, Dec 13, 2023 at 10:51:25PM -0800, Mina Almasry wrote: > On Wed, Dec 13, 2023 at 10:49 PM Christoph Hellwig wrote: > > > > On Thu, Dec 14, 2023 at 06:20:27AM +, > > patchwork-bot+netdev...@kernel.org wrote: > > > Hello: > > > > > > This series was applied to netdev/net-next.git (main)