[PATCH v3 2/2] selftests/amd-pstate: Added option to provide perf binary path

2023-10-02 Thread Swapnil Sapkal
In selftests/amd-pstate, distro `perf` is used to capture `perf stat` while running microbenchmarks. Distro `perf` is not working with upstream kernel. Fixed this by providing an option to give the perf binary path. Signed-off-by: Swapnil Sapkal --- tools/testing/selftests/amd-pstate/gitsource.s

[PATCH v3 1/2] selftests/amd-pstate: Fix broken paths to run workloads in amd-pstate-ut

2023-10-02 Thread Swapnil Sapkal
In selftests/amd-pstate, tbench and gitsource microbenchmarks are used to compare the performance with different governors. In Current implementation relative path to run `amd_pstate_tracer.py` are broken. Fixed this by using absolute paths. Signed-off-by: Swapnil Sapkal --- .../x86/amd_pstate_t

[PATCH v3 0/2] Fix issues observed in selftests/amd-pstate

2023-10-02 Thread Swapnil Sapkal
This series fixes issues observed with selftests/amd-pstate while running performance comparison tests with different governors. First patch changes relative paths with absolute path and also change it with correct path wherever it is broken. The second patch adds an option to provide perf binary p

[PATCHv2 next 3/3] selftes/ptp: extend test to include ptp_gettimex64any()

2023-10-02 Thread Mahesh Bandewar
add -y/-Y options to support PTP_SYS_OFFSET_ANY2 op. where -y represents samples to collect while -Y is to choose the timebase from available options of cycles, real, mono, or raw. Signed-off-by: Mahesh Bandewar CC: Shuah Khan CC: Richard Cochran CC: "David S. Miller" CC: Rahul Rameshbabu CC:

[PATCH v3 6/6] KVM: riscv: selftests: Add condops extensions to get-reg-list test

2023-10-02 Thread Anup Patel
We have a new conditional operations related ISA extensions so let us add these extensions to get-reg-list test. Signed-off-by: Anup Patel Reviewed-by: Andrew Jones --- .../testing/selftests/kvm/riscv/get-reg-list.c | 17 + 1 file changed, 17 insertions(+) diff --git a/tools/t

[PATCH v3 5/6] KVM: riscv: selftests: Add smstateen registers to get-reg-list test

2023-10-02 Thread Anup Patel
We have a new smstateen registers as separate sub-type of CSR ONE_REG interface so let us add these registers to get-reg-list test. Signed-off-by: Anup Patel Reviewed-by: Andrew Jones --- .../selftests/kvm/riscv/get-reg-list.c| 34 +++ 1 file changed, 34 insertions(+) d

[PATCH v3 4/6] KVM: riscv: selftests: Add senvcfg register to get-reg-list test

2023-10-02 Thread Anup Patel
We have a new senvcfg register in the general CSR ONE_REG interface so let us add it to get-reg-list test. Signed-off-by: Anup Patel Reviewed-by: Andrew Jones --- tools/testing/selftests/kvm/riscv/get-reg-list.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/testing/selftests/kvm/

[PATCH v3 3/6] RISC-V: KVM: Allow Zicond extension for Guest/VM

2023-10-02 Thread Anup Patel
We extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable Zicond extension for Guest/VM. Signed-off-by: Anup Patel Reviewed-by: Andrew Jones --- arch/riscv/include/uapi/asm/kvm.h | 1 + arch/riscv/kvm/vcpu_onereg.c | 2 ++ 2 files changed, 3 insertions(

[PATCH v3 2/6] RISC-V: Detect Zicond from ISA string

2023-10-02 Thread Anup Patel
The RISC-V integer conditional (Zicond) operation extension defines standard conditional arithmetic and conditional-select/move operations which are inspired from the XVentanaCondOps extension. In fact, QEMU RISC-V also has support for emulating Zicond extension. Let us detect Zicond extension fro

[PATCH v3 1/6] dt-bindings: riscv: Add Zicond extension entry

2023-10-02 Thread Anup Patel
Add an entry for the Zicond extension to the riscv,isa-extensions property. Signed-off-by: Anup Patel Reviewed-by: Andrew Jones Reviewed-by: Conor Dooley --- Documentation/devicetree/bindings/riscv/extensions.yaml | 6 ++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetr

[PATCH v3 0/6] KVM RISC-V Conditional Operations

2023-10-02 Thread Anup Patel
This series extends KVM RISC-V to allow Guest/VM discover and use conditional operations related ISA extensions (namely XVentanaCondOps and Zicond). To try these patches, use KVMTOOL from riscv_zbx_zicntr_smstateen_condops_v1 branch at: https://github.com/avpatel/kvmtool.git These patches are bas

Re: [PATCH v4 03/36] arm64/gcs: Document the ABI for Guarded Control Stacks

2023-10-02 Thread Edgecombe, Rick P
On Mon, 2023-10-02 at 20:49 +0100, Mark Brown wrote: > On Thu, Sep 28, 2023 at 05:59:25PM +0100, Szabolcs Nagy wrote: > > The 08/23/2023 14:11, Catalin Marinas wrote: > > > > > and there is user code doing raw clone threads (such threads > > > > are > > > > technically not allowed to call into lib

Re: [PATCH v4 03/36] arm64/gcs: Document the ABI for Guarded Control Stacks

2023-10-02 Thread Mark Brown
On Thu, Sep 28, 2023 at 05:59:25PM +0100, Szabolcs Nagy wrote: > The 08/23/2023 14:11, Catalin Marinas wrote: > > > and there is user code doing raw clone threads (such threads are > > > technically not allowed to call into libc) it's not immediately > > > clear to me if having gcs in those thread

Re: [PATCH v2 2/3] userfaultfd: UFFDIO_REMAP uABI

2023-10-02 Thread Lokesh Gidra
On Mon, Oct 2, 2023 at 6:43 PM David Hildenbrand wrote: > > On 02.10.23 17:55, Lokesh Gidra wrote: > > On Mon, Oct 2, 2023 at 4:46 PM Lokesh Gidra wrote: > >> > >> On Mon, Oct 2, 2023 at 4:21 PM Peter Xu wrote: > >>> > >>> On Mon, Oct 02, 2023 at 10:00:03AM +0200, David Hildenbrand wrote: >

Re: [PATCH v2 2/3] userfaultfd: UFFDIO_REMAP uABI

2023-10-02 Thread David Hildenbrand
On 02.10.23 17:55, Lokesh Gidra wrote: On Mon, Oct 2, 2023 at 4:46 PM Lokesh Gidra wrote: On Mon, Oct 2, 2023 at 4:21 PM Peter Xu wrote: On Mon, Oct 02, 2023 at 10:00:03AM +0200, David Hildenbrand wrote: In case we cannot simply remap the page, the fallback sequence (from the cover letter)

Re: [PATCH-cgroup] cgroup/cpuset: Enable invalid to valid local partition transition

2023-10-02 Thread Waiman Long
On 10/2/23 06:06, Pierre Gondois wrote: Hello Waiman, I could test the patch using the for-next branch in your tree. Just a NIT, it seemed that the message indicating the reason the isolated configuration was invalid is not printed anymore: Commands: # mkdir cgroup # mount -t cgroup2 none cgrou

Re: [PATCH v2 2/3] userfaultfd: UFFDIO_REMAP uABI

2023-10-02 Thread David Hildenbrand
On 02.10.23 19:33, David Hildenbrand wrote: On 02.10.23 17:21, Peter Xu wrote: On Mon, Oct 02, 2023 at 10:00:03AM +0200, David Hildenbrand wrote: In case we cannot simply remap the page, the fallback sequence (from the cover letter) would be triggered. 1) UFFDIO_COPY 2) MADV_DONTNEED So we wo

Re: [PATCH v2 2/3] userfaultfd: UFFDIO_REMAP uABI

2023-10-02 Thread David Hildenbrand
On 02.10.23 17:21, Peter Xu wrote: On Mon, Oct 02, 2023 at 10:00:03AM +0200, David Hildenbrand wrote: In case we cannot simply remap the page, the fallback sequence (from the cover letter) would be triggered. 1) UFFDIO_COPY 2) MADV_DONTNEED So we would just handle the operation internally with

Re: [PATCH v2 1/3] userfaultfd: UFFDIO_REMAP: rmap preparation

2023-10-02 Thread David Hildenbrand
On 02.10.23 17:23, Peter Xu wrote: On Mon, Oct 02, 2023 at 04:42:50PM +0200, David Hildenbrand wrote: On 23.09.23 03:31, Suren Baghdasaryan wrote: From: Andrea Arcangeli As far as the rmap code is concerned, UFFDIO_REMAP only alters the page->mapping and page->index. It does it while holding

Re: [PATCH 1/2] kunit: Add param generator macro for zero terminated arrays

2023-10-02 Thread Michal Wajdeczko
On 30.09.2023 10:58, David Gow wrote: > On Wed, 27 Sept 2023 at 06:02, Michal Wajdeczko > wrote: >> >> The existing macro KUNIT_ARRAY_PARAM can produce parameter >> generator function but only when we fully know the definition >> of the array. However, there might be cases where we would like >

Re: [PATCH v2 2/3] userfaultfd: UFFDIO_REMAP uABI

2023-10-02 Thread Lokesh Gidra
On Mon, Oct 2, 2023 at 4:46 PM Lokesh Gidra wrote: > > On Mon, Oct 2, 2023 at 4:21 PM Peter Xu wrote: > > > > On Mon, Oct 02, 2023 at 10:00:03AM +0200, David Hildenbrand wrote: > > > In case we cannot simply remap the page, the fallback sequence (from the > > > cover letter) would be triggered. >

Re: [PATCH v4 0/7] selftests/resctrl: Fixes to failing tests

2023-10-02 Thread Reinette Chatre
On 10/2/2023 4:31 AM, Ilpo Järvinen wrote: > On Mon, 2 Oct 2023, Ilpo Järvinen wrote: > >> Fix four issues with resctrl selftests. >> >> The signal handling fix became necessary after the mount/umount fixes >> and the uninitialized member bug was discovered during the review. >> >> The other tw

Re: [PATCH v2 2/3] userfaultfd: UFFDIO_REMAP uABI

2023-10-02 Thread Lokesh Gidra
On Mon, Oct 2, 2023 at 4:21 PM Peter Xu wrote: > > On Mon, Oct 02, 2023 at 10:00:03AM +0200, David Hildenbrand wrote: > > In case we cannot simply remap the page, the fallback sequence (from the > > cover letter) would be triggered. > > > > 1) UFFDIO_COPY > > 2) MADV_DONTNEED > > > > So we would j

Re: [PATCH v4 1/7] selftests/resctrl: Fix uninitialized .sa_flags

2023-10-02 Thread Reinette Chatre
Hi Ilpo, On 10/2/2023 2:48 AM, Ilpo Järvinen wrote: > signal_handler_unregister() calls sigaction() with uninitializing > sa_flags in the struct sigaction. > > Make sure sa_flags is always initialized in signal_handler_unregister() > by initializing the struct sigaction when declaring it. Also ad

Re: [PATCH 1/7] RISC-V: Detect XVentanaCondOps from ISA string

2023-10-02 Thread Anup Patel
On Mon, Oct 2, 2023 at 11:57 AM Christoph Hellwig wrote: > > On Tue, Sep 19, 2023 at 09:23:37AM +0530, Anup Patel wrote: > > The Veyron-V1 CPU supports custom conditional arithmetic and > > conditional-select/move operations referred to as XVentanaCondOps > > extension. In fact, QEMU RISC-V also h

Re: [PATCH v2 1/3] userfaultfd: UFFDIO_REMAP: rmap preparation

2023-10-02 Thread Peter Xu
On Mon, Oct 02, 2023 at 04:42:50PM +0200, David Hildenbrand wrote: > On 23.09.23 03:31, Suren Baghdasaryan wrote: > > From: Andrea Arcangeli > > > > As far as the rmap code is concerned, UFFDIO_REMAP only alters the > > page->mapping and page->index. It does it while holding the page > > lock. Ho

Re: [PATCH v2 2/3] userfaultfd: UFFDIO_REMAP uABI

2023-10-02 Thread Peter Xu
On Mon, Oct 02, 2023 at 10:00:03AM +0200, David Hildenbrand wrote: > In case we cannot simply remap the page, the fallback sequence (from the > cover letter) would be triggered. > > 1) UFFDIO_COPY > 2) MADV_DONTNEED > > So we would just handle the operation internally without a fallback. Note th

Re: [PATCH v2 0/3] selftests/hid: fix building for older kernels

2023-10-02 Thread Benjamin Tissoires
On Sep 26 2023, Justin Stitt wrote: > Hey all, > > Gentle ping on this patch. Looking to get this patch and [1] slated > for 6.7 wherein we can start getting cleaner kselftests builds. > > I do not think I am able to successfully run the hid/bpf selftests due > to my kernel version being too low

Re: [PATCH v2 1/3] userfaultfd: UFFDIO_REMAP: rmap preparation

2023-10-02 Thread David Hildenbrand
On 23.09.23 03:31, Suren Baghdasaryan wrote: From: Andrea Arcangeli As far as the rmap code is concerned, UFFDIO_REMAP only alters the page->mapping and page->index. It does it while holding the page lock. However folio_referenced() is doing rmap walks without taking the folio lock first, so fo

Re: [PATCH v2] Added missing TARGETS in kselftest top level Makefile

2023-10-02 Thread Shuah Khan
On 10/2/23 05:46, Abhinav wrote: Some tests like dma, ia64, etc. were not present in top level of selftest Makefile, so when someone ran 'make run_tests' they would miss these tests. This patches adds those left out tests. Signed-off-by: Abhinav --- I removed sched, safesetid and filelock from

Re: [PATCH 4/4] kunit: Prepare test plan for parameterized subtests

2023-10-02 Thread Michal Wajdeczko
On 28.09.2023 22:54, Rae Moar wrote: > On Mon, Sep 25, 2023 at 1:58 PM Michal Wajdeczko > wrote: >> >> In case of parameterized tests we are not providing a test plan >> so we can't detect if any result is missing. >> >> Count available params using the same generator as during a test >> execut

Re: [PATCH 3/4] kunit: Fix indentation of parameterized tests messages

2023-10-02 Thread Michal Wajdeczko
On 28.09.2023 22:53, Rae Moar wrote: > On Mon, Sep 25, 2023 at 1:58 PM Michal Wajdeczko > wrote: >> >> When running parametrized test cases, diagnostic messages >> are not properly aligned with the test result lines: >> >> $ ./tools/testing/kunit/kunit.py run --raw_output \ >> --kun

Re: [PATCH 2/4] kunit: Fix indentation level of suite messages

2023-10-02 Thread Michal Wajdeczko
On 28.09.2023 22:52, Rae Moar wrote: > On Mon, Sep 25, 2023 at 1:58 PM Michal Wajdeczko > wrote: >> >> A kunit suite is a top level test from the KTAP point of view but >> all suite diagnostic messages are printed at the subtest level: >> >> $ ./tools/testing/kunit/kunit.py run --raw_output

Re: [PATCH bpf-next 2/2] selftests/bpf: Add pair_redir_to_connected helper

2023-10-02 Thread Daniel Borkmann
On 9/28/23 11:20 AM, Geliang Tang wrote: Extract duplicate code from these four functions unix_redir_to_connected() udp_redir_to_connected() inet_unix_redir_to_connected() unix_inet_redir_to_connected() to create a new helper pair_redir_to_connected(). Create the different socketpair in

Re: [PATCH v4 0/7] selftests/resctrl: Fixes to failing tests

2023-10-02 Thread Ilpo Järvinen
On Mon, 2 Oct 2023, Ilpo Järvinen wrote: > Fix four issues with resctrl selftests. > > The signal handling fix became necessary after the mount/umount fixes > and the uninitialized member bug was discovered during the review. > > The other two came up when I ran resctrl selftests across the serv

[PATCH v2] Added missing TARGETS in kselftest top level Makefile

2023-10-02 Thread Abhinav
Some tests like dma, ia64, etc. were not present in top level of selftest Makefile, so when someone ran 'make run_tests' they would miss these tests. This patches adds those left out tests. Signed-off-by: Abhinav --- I removed sched, safesetid and filelock from the Makefile, because these tests

Re: [PATCH-cgroup] cgroup/cpuset: Enable invalid to valid local partition transition

2023-10-02 Thread Pierre Gondois
Hello Waiman, I could test the patch using the for-next branch in your tree. Just a NIT, it seemed that the message indicating the reason the isolated configuration was invalid is not printed anymore: Commands: # mkdir cgroup # mount -t cgroup2 none cgroup/ # mkdir cgroup/A1 cgroup/B1 # echo "+c

[PATCH v4 7/7] selftests/resctrl: Reduce failures due to outliers in MBA/MBM tests

2023-10-02 Thread Ilpo Järvinen
The initial value of 5% chosen for the maximum allowed percentage difference between resctrl mbm value and IMC mbm value in commit 06bd03a57f8c ("selftests/resctrl: Fix MBA/MBM results reporting format") was "randomly chosen value" (as admitted by the changelog). When running tests in our lab acro

[PATCH v4 6/7] selftests/resctrl: Fix feature checks

2023-10-02 Thread Ilpo Järvinen
The MBA and CMT tests expect support of other features to be able to run. When platform only supports MBA but not MBM, MBA test will fail with: Failed to open total bw file: No such file or directory When platform only supports CMT but not CAT, CMT test will fail with: Failed to open bit mask fil

[PATCH v4 5/7] selftests/resctrl: Refactor feature check to use resource and feature name

2023-10-02 Thread Ilpo Järvinen
Feature check in validate_resctrl_feature_request() takes in the test name string and maps that to what to check per test. Pass resource and feature names to validate_resctrl_feature_request() directly rather than deriving them from the test name inside the function which makes the feature check e

[PATCH v4 4/7] selftests/resctrl: Move _GNU_SOURCE define into Makefile

2023-10-02 Thread Ilpo Järvinen
_GNU_SOURCE is defined in resctrl.h. Defining _GNU_SOURCE has a large impact on what gets defined when including headers either before or after it. This can result in compile failures if .c file decides to include a standard header file before resctrl.h. It is safer to define _GNU_SOURCE in Makefi

[PATCH v4 3/7] selftests/resctrl: Remove duplicate feature check from CMT test

2023-10-02 Thread Ilpo Järvinen
The test runner run_cmt_test() in resctrl_tests.c checks for CMT feature and does not run cmt_resctrl_val() if CMT is not supported. Then cmt_resctrl_val() also check is CMT is supported. Remove the duplicated feature check for CMT from cmt_resctrl_val(). Signed-off-by: Ilpo Järvinen Tested-by:

[PATCH v4 2/7] selftests/resctrl: Extend signal handler coverage to unmount on receiving signal

2023-10-02 Thread Ilpo Järvinen
Unmounting resctrl FS has been moved into the per test functions in resctrl_tests.c by commit caddc0fbe495 ("selftests/resctrl: Move resctrl FS mount/umount to higher level"). In case a signal (SIGINT, SIGTERM, or SIGHUP) is received, the running selftest is aborted by ctrlc_handler() which then un

[PATCH v4 1/7] selftests/resctrl: Fix uninitialized .sa_flags

2023-10-02 Thread Ilpo Järvinen
signal_handler_unregister() calls sigaction() with uninitializing sa_flags in the struct sigaction. Make sure sa_flags is always initialized in signal_handler_unregister() by initializing the struct sigaction when declaring it. Also add the initialization to signal_handler_register() even if there

[PATCH v4 0/7] selftests/resctrl: Fixes to failing tests

2023-10-02 Thread Ilpo Järvinen
Fix four issues with resctrl selftests. The signal handling fix became necessary after the mount/umount fixes and the uninitialized member bug was discovered during the review. The other two came up when I ran resctrl selftests across the server fleet in our lab to validate the upcoming CAT test

Re: [PATCH v3 1/7] selftests/resctrl: Fix uninitialized .sa_flags

2023-10-02 Thread Ilpo Järvinen
On Fri, 29 Sep 2023, Reinette Chatre wrote: > Hi Ilpo, > > On 9/29/2023 4:20 AM, Ilpo Järvinen wrote: > > signal_handler_unregister() calls sigaction() with uninitializing > > sa_flags in the struct sigaction. > > > > Make sure sa_flags is always initialized in signal_handler_unregister() > > by

Re: [PATCH v2] Added missing TARGETS in kselftest top level Makefile

2023-10-02 Thread Greg KH
On Mon, Oct 02, 2023 at 12:57:35PM +0530, Abhinav wrote: > Some tests like dma, ia64, etc. were not present in top level of > selftest Makefile, so when someone ran 'make run_tests' they would miss > these tests. This patches adds those left out tests. > > Signed-off-by: Abhinav > --- > tools/te

Re: [PATCH v2 2/3] userfaultfd: UFFDIO_REMAP uABI

2023-10-02 Thread David Hildenbrand
On 28.09.23 20:34, Peter Xu wrote: On Thu, Sep 28, 2023 at 07:51:18PM +0200, David Hildenbrand wrote: On 28.09.23 19:21, Peter Xu wrote: On Thu, Sep 28, 2023 at 07:05:40PM +0200, David Hildenbrand wrote: As described as reply to v1, without fork() and KSM, the PAE bit should stick around. If t

Re: [PATCH v2 2/3] userfaultfd: UFFDIO_REMAP uABI

2023-10-02 Thread David Hildenbrand
On 28.09.23 21:00, Peter Xu wrote: On Thu, Sep 28, 2023 at 07:15:13PM +0200, David Hildenbrand wrote: There are some interesting questions to ask here: 1) What happens if the old VMA has VM_SOFTDIRTY set but the new one not? You most probably have to mark the PTE softdirty and not make it writa

[PATCH v2] Added missing TARGETS in kselftest top level Makefile

2023-10-02 Thread Abhinav
Some tests like dma, ia64, etc. were not present in top level of selftest Makefile, so when someone ran 'make run_tests' they would miss these tests. This patches adds those left out tests. Signed-off-by: Abhinav --- tools/testing/selftests/Makefile | 7 +++ 1 file changed, 7 insertions(+)