Re: [PATCH v4 3/5] selftests/mm: call uffd_test_ctx_clear at the end of the test

2023-11-02 Thread Axel Rasmussen
On Mon, Oct 30, 2023 at 1:14 PM Peter Xu wrote: > > On Fri, Oct 27, 2023 at 05:38:13PM -0700, Suren Baghdasaryan wrote: > > uffd_test_ctx_clear() is being called from uffd_test_ctx_init() to unmap > > areas used in the previous test run. This approach is problematic because > > while unmapping are

Re: [PATCH 0/3] selftests/nolibc: various build improvements

2023-11-02 Thread Thomas Weißschuh
On 2023-11-02 09:50:38+0100, Willy Tarreau wrote: > On Tue, Oct 31, 2023 at 09:36:57PM +0100, Thomas Weißschuh wrote: > > With the out-of-tree builds it's possible do incremental tests fairly fast: > > > > time ./run-tests.sh > > i386: 162 test(s): 162 passed, 0 skipped, 0 failed =>

Re: [PATCH 06/24] selftests/resctrl: Exclude shareable bits from schemata in CAT test

2023-11-02 Thread Reinette Chatre
Hi Ilpo, On 10/24/2023 2:26 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 16/24] selftests/resctrl: Rewrite Cache Allocation Technology (CAT) test

2023-11-02 Thread Reinette Chatre
Hi Ilpo, On 10/24/2023 2:26 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 08/24] selftests/resctrl: Split show_cache_info() to test specific and generic parts

2023-11-02 Thread Reinette Chatre
Hi Ilpo, On 10/24/2023 2:26 AM, Ilpo Järvinen wrote: > show_cache_info() calculates results and provides generic cache > information. This makes it hard to alter pass/fail conditions. > > Separate the test specific checks into CAT and CMT test files and > leave only the generic information part i

Re: [PATCH 24/24] selftests/resctrl: Ignore failures from L2 CAT test with <= 2 bits

2023-11-02 Thread Reinette Chatre
Hi Ilpo, On 10/24/2023 2:26 AM, Ilpo Järvinen wrote: > L2 CAT test with low number of bits tends to occasionally fail because > of what seems random variation. The margin is quite small to begin with > for <= 2 bits in CBM. At times, the result can even become negative. > While it would be possibl

Re: [PATCH 23/24] selftests/resctrl: Add L2 CAT test

2023-11-02 Thread Reinette Chatre
Hi Ilpo, On 10/24/2023 2:26 AM, Ilpo Järvinen wrote: > CAT selftests only cover L3 but some newer CPUs come also with L2 CAT > support. No need to use "new" language. L2 CAT has been available for a long time ... since Apollo Lake. Which systems actually support it is a different topic. This is a

Re: [PATCH 18/24] selftests/resctrl: Introduce generalized test framework

2023-11-02 Thread Reinette Chatre
Hi Ilpo, On 10/24/2023 2:26 AM, Ilpo Järvinen wrote: ... > diff --git a/tools/testing/selftests/resctrl/resctrl.h > b/tools/testing/selftests/resctrl/resctrl.h > index ec6efd36f60a..e017adf1390d 100644 > --- a/tools/testing/selftests/resctrl/resctrl.h > +++ b/tools/testing/selftests/resctrl/resct

Re: [PATCH 05/24] selftests/resctrl: Create cache_size() helper

2023-11-02 Thread Reinette Chatre
Hi Ilpo, On 10/24/2023 2:26 AM, Ilpo Järvinen wrote: > CAT and CMT tests calculate the span size from the n-bits cache > allocation on their own. > > Add cache_size() helper which calculates size of the cache portion for > the given number of bits and use it to replace the existing span > calcula

Re: [PATCH 01/24] selftests/resctrl: Split fill_buf to allow tests finer-grained control

2023-11-02 Thread Reinette Chatre
Hi Ilpo, On 10/24/2023 2:26 AM, Ilpo Järvinen wrote: > MBM, MBA and CMT test cases use run_fill_buf() to loop indefinitely > around the buffer. CAT test case is different and doesn't want to loop > around the buffer continuously. Please do not that the changelog starts by describing issue with ru

Re: [PATCH 03/24] selftests/resctrl: Refactor get_cbm_mask()

2023-11-02 Thread Reinette Chatre
Hi Ilpo, On 10/24/2023 2:26 AM, Ilpo Järvinen wrote: ... > @@ -229,6 +228,31 @@ int get_cbm_mask(char *cache_type, char *cbm_mask) > return 0; > } > > +/* > + * get_cbm_mask - Get cbm bit mask I know you just copied code here but please keep an eye out for acronyms to be written in cap

Re: [PATCH 17/24] selftests/resctrl: Create struct for input parameter

2023-11-02 Thread Reinette Chatre
Hi Ilpo, On 10/24/2023 2:26 AM, Ilpo Järvinen wrote: ... > diff --git a/tools/testing/selftests/resctrl/mba_test.c > b/tools/testing/selftests/resctrl/mba_test.c > index d3bf4368341e..5157a3f74fee 100644 > --- a/tools/testing/selftests/resctrl/mba_test.c > +++ b/tools/testing/selftests/resctrl/

[RFC PATCH v1 0/8] KVM: seftests: Support guest user mode execution and running

2023-11-02 Thread Zeng Guang
This patch series give a proposal to support guest VM running in user mode and in canonical linear address organization as well. First design to parition the 64-bit canonical linear address space into two half parts belonging to user-mode and supervisor-mode respectively, similar as the organizati

Re: [PATCH 10/24] selftests/resctrl: Remove nested calls in perf event handling

2023-11-02 Thread Reinette Chatre
Hi Ilpo, On 10/24/2023 2:26 AM, Ilpo Järvinen wrote: > Perf event handling has functions that are the sole caller of another > perf event handling related function: > - reset_enable_llc_perf() calls perf_event_open_llc_miss() > - reset_enable_llc_perf() calls ioctl_perf_event_ioc_reset_enable(

Re: [PATCH 09/24] selftests/resctrl: Remove unnecessary __u64 -> unsigned long conversion

2023-11-02 Thread Reinette Chatre
Hi Ilpo, On 10/24/2023 2:26 AM, Ilpo Järvinen wrote: > Perf counters are __u64 but the code converts them to unsigned long > before printing them out. > > Remove unnecessary type conversion and the potential loss of meaningful > bits due to different sizes of types. This motivation is not clear

Re: [PATCH 07/24] selftests/resctrl: Split measure_cache_vals() function

2023-11-02 Thread Reinette Chatre
Hi Ilpo, On 10/24/2023 2:26 AM, Ilpo Järvinen wrote: > The measure_cache_vals() function does a different thing depending on No need to say "function" when using "()". The above can just be: "measure_cache_vals() does a different ..." > the test case that called it: > - For CAT, it measures LL

Re: [PATCH v3 3/3] kselftest: Add new test for detecting unprobed Devicetree devices

2023-11-02 Thread Mark Brown
On Thu, Nov 02, 2023 at 07:15:58PM +0530, Naresh Kamboju wrote: > On Thu, 2 Nov 2023 at 17:41, Aishwarya TCV wrote: > > https://storage.kernelci.org/mainline/master/v6.6-9152-gdeefd5024f07/arm64/defconfig%2Bkselftest/gcc-10/logs/kselftest.log ... > May be due to, A loop of symlinks that are poi

[RFC PATCH v1 1/8] KVM: selftests: x86: Fix bug in addr_arch_gva2gpa()

2023-11-02 Thread Zeng Guang
Fix the approach to get page map from gva to gpa. If gva maps a 4-KByte page, current implementation of addr_arch_gva2gpa() will obtain wrong page size and cannot derive correct offset from the guest virtual address. Meanwhile using HUGEPAGE_MASK(x) to calculate the offset within page (1G/2M/4K)

[RFC PATCH v1 7/8] KVM: selftests: x86: Support vcpu run in user mode

2023-11-02 Thread Zeng Guang
Introduce vcpu_setup_user_mode() to support vcpu run in user mode. Signed-off-by: Zeng Guang --- .../selftests/kvm/include/x86_64/processor.h | 1 + .../selftests/kvm/lib/x86_64/processor.c | 19 +++ 2 files changed, 20 insertions(+) diff --git a/tools/testing/selftests/k

[RFC PATCH v1 6/8] KVM: selftests: x86: Allow user to access user-mode address and I/O address space

2023-11-02 Thread Zeng Guang
Configure the U/S bit in paging-structure entries according to operation mode and delimit user has user-mode access only to user-mode address space. Similarly set I/O privilege level as ring 3 in EFLAGS register to allow user to access the I/O address space. Signed-off-by: Zeng Guang --- .../se

[RFC PATCH v1 2/8] KVM: selftests: x86: Support guest running on canonical linear-address organization

2023-11-02 Thread Zeng Guang
Setup execution environment running on 64-bit linear addresses for user and supervisor mode. Define the linear address based on 48-bit canonical format in which bits 63:47 of the address are identical. All addresses to system data structure are shifted to supervisor-mode address space. Extend pag

[RFC PATCH v1 5/8] KVM: selftests: x86: Prepare setup for user mode support

2023-11-02 Thread Zeng Guang
Extend the page size of stack memory that can be shared for user mode. And configure the canonical linear address of the stack point(RSP0) for privilege level 0 in TSS segment which processor will use to switch task, e.g. from user mode back to supervisor mode triggered by interrupt. Refactor KVM

[RFC PATCH v1 4/8] KVM : selftests : Adapt selftest cases to kernel canonical linear address

2023-11-02 Thread Zeng Guang
Adapt RIP to kernel canonical linear address in test cases set_memory_region_test/debug_regs/userspace_msr_exit_test. No functional change intended. Signed-off-by: Zeng Guang --- .../testing/selftests/kvm/set_memory_region_test.c | 13 ++--- tools/testing/selftests/kvm/x86_64/debug_reg

[RFC PATCH v1 8/8] KVM: selftests: x86: Add KVM forced emulation prefix capability

2023-11-02 Thread Zeng Guang
Introduce KVM selftest exception fixup using forced emulation prefix to emulate instruction unconditionally when kvm.force_emulation_prefix is enabled. Signed-off-by: Zeng Guang --- .../selftests/kvm/include/x86_64/processor.h | 20 +++ 1 file changed, 20 insertions(+) diff --g

[RFC PATCH v1 3/8] KVM: selftests: Add virt_arch_ucall_prealloc() arch specific implementation

2023-11-02 Thread Zeng Guang
Add virt_arch_ucall_prealloc() which allows to preprocess the memory allocated to ucall_pool as per arch specific requirement. For X86 platform, it needs to adjust the address to corresponding address space based on the operation mode, i.e. user or supervisor mode, at runtime. There is no change

Re: [PATCH bpf] selftests/bpf: Fix broken build where char is unsigned

2023-11-02 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to bpf/bpf.git (master) by Alexei Starovoitov : On Thu, 2 Nov 2023 11:35:37 +0100 you wrote: > From: Björn Töpel > > There are architectures where char is not signed. If so, the following > error is triggered: > > | xdp_hw_metadata.c:435:42: error: result of co

Re: [PATCH v3 3/3] kselftest: Add new test for detecting unprobed Devicetree devices

2023-11-02 Thread Naresh Kamboju
Hi Aishwarya, On Thu, 2 Nov 2023 at 17:41, Aishwarya TCV wrote: > > > > On 28/08/2023 22:13, Nícolas F. R. A. Prado wrote: > > Introduce a new kselftest to detect devices that were declared in the > > Devicetree, and are expected to be probed by a driver, but weren't. > > > > The test uses two li

Re: [PATCH v2 0/6] IOMMUFD: Deliver IO page faults to user space

2023-11-02 Thread Jason Gunthorpe
On Thu, Oct 26, 2023 at 10:49:24AM +0800, Lu Baolu wrote: > Hi folks, > > This series implements the functionality of delivering IO page faults to > user space through the IOMMUFD framework for nested translation. Nested > translation is a hardware feature that supports two-stage translation > tab

Re: [PATCH v2 2/2] selftests/mm: Add a new test for madv and hugetlb

2023-11-02 Thread Ryan Roberts
On 02/11/2023 12:24, Ryan Roberts wrote: > Hi Breno, > > > On 05/10/2023 17:39, Breno Leitao wrote: >> Create a selftest that exercises the race between page faults and >> madvise(MADV_DONTNEED) in the same huge page. Do it by running two >> threads that touches the huge page and madvise(MADV_DON

Re: [PATCH v2 2/2] selftests/mm: Add a new test for madv and hugetlb

2023-11-02 Thread Ryan Roberts
Hi Breno, On 05/10/2023 17:39, Breno Leitao wrote: > Create a selftest that exercises the race between page faults and > madvise(MADV_DONTNEED) in the same huge page. Do it by running two > threads that touches the huge page and madvise(MADV_DONTNEED) at the same > time. > > In case of a SIGBUS

Re: [PATCH v3 3/3] kselftest: Add new test for detecting unprobed Devicetree devices

2023-11-02 Thread Aishwarya TCV
On 28/08/2023 22:13, Nícolas F. R. A. Prado wrote: > Introduce a new kselftest to detect devices that were declared in the > Devicetree, and are expected to be probed by a driver, but weren't. > > The test uses two lists: a list of compatibles that can match a > Devicetree device to a driver, a

Re: [PATCH v33 6/6] selftests: mm: add pagemap ioctl tests

2023-11-02 Thread Ryan Roberts
On 02/11/2023 11:49, Muhammad Usama Anjum wrote: > On 11/2/23 4:45 PM, Ryan Roberts wrote: >> On 21/08/2023 15:15, Muhammad Usama Anjum wrote: >> >> [...] >> >>> + >>> + >>> +int init_uffd(void) >>> +{ >>> + struct uffdio_api uffdio_api; >>> + >>> + uffd = syscall(__NR_userfaultfd, O_CLOEXEC |

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

2023-11-02 Thread Yong-Xuan Wang
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 insertions(+) diff --git a/tools/testing/selftests/kvm/riscv/get-reg-list.c b/tools/t

Re: [PATCH v33 6/6] selftests: mm: add pagemap ioctl tests

2023-11-02 Thread Muhammad Usama Anjum
On 11/2/23 4:45 PM, Ryan Roberts wrote: > On 21/08/2023 15:15, Muhammad Usama Anjum wrote: > > [...] > >> + >> + >> +int init_uffd(void) >> +{ >> +struct uffdio_api uffdio_api; >> + >> +uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK | >> UFFD_USER_MODE_ONLY); >> +if (uffd ==

Re: [PATCH v33 6/6] selftests: mm: add pagemap ioctl tests

2023-11-02 Thread Ryan Roberts
On 21/08/2023 15:15, Muhammad Usama Anjum wrote: [...] > + > + > +int init_uffd(void) > +{ > + struct uffdio_api uffdio_api; > + > + uffd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK | > UFFD_USER_MODE_ONLY); > + if (uffd == -1) > + ksft_exit_fail_msg("uffd syscall

Re: [PATCH bpf] selftests/bpf: Fix broken build where char is unsigned

2023-11-02 Thread Anders Roxell
rrect by changing the char to int. > > Fixes: bb6a5fde ("selftests/bpf: Add options and frags to > xdp_hw_metadata") > Signed-off-by: Björn Töpel Thank you for the patch. I saw the same failure when I built selftests/bpf for arm64. With this patch ontop of today

Re: [PATCH bpf] selftests/bpf: Fix broken build where char is unsigned

2023-11-02 Thread Larysa Zaremba
On Thu, Nov 02, 2023 at 11:35:37AM +0100, Björn Töpel wrote: > From: Björn Töpel > > There are architectures where char is not signed. If so, the following > error is triggered: > > | xdp_hw_metadata.c:435:42: error: result of comparison of constant -1 \ > | with expression of type 'char'

[PATCH bpf] selftests/bpf: Fix broken build where char is unsigned

2023-11-02 Thread Björn Töpel
From: Björn Töpel There are architectures where char is not signed. If so, the following error is triggered: | xdp_hw_metadata.c:435:42: error: result of comparison of constant -1 \ | with expression of type 'char' is always true \ | [-Werror,-Wtautological-constant-out-of-range-compar

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

2023-11-02 Thread Yuan, Perry
[AMD Official Use Only - General] Hi meng Li, > -Original Message- > From: Meng, Li (Jassmine) > Sent: Monday, October 30, 2023 2:34 PM > To: Rafael J . Wysocki ; Huang, Ray > > Cc: linux...@vger.kernel.org; linux-ker...@vger.kernel.org; x...@kernel.org; > linux-a...@vger.kernel.org; S

Re: [PATCH 0/3] selftests/nolibc: various build improvements

2023-11-02 Thread Willy Tarreau
On Tue, Oct 31, 2023 at 09:36:57PM +0100, Thomas Weißschuh wrote: > With the out-of-tree builds it's possible do incremental tests fairly fast: > > time ./run-tests.sh > i386: 162 test(s): 162 passed, 0 skipped, 0 failed => status: > success > x86_64:162 test(s): 162 passed,

Re: [PATCH 1/3] selftests/nolibc: use EFI -bios for LoongArch qemu

2023-11-02 Thread Willy Tarreau
On Tue, Oct 31, 2023 at 09:36:58PM +0100, Thomas Weißschuh wrote: > qemu for LoongArch does not work properly with direct kernel boot. > The kernel will panic during initialization and hang without any output. > > When booting in EFI mode everything work correctly. > > While users most likely don

[PATCH] kselftests: add per_test_log support

2023-11-02 Thread Hangbin Liu
By default, all the test output will be printed to stdout or output.log if -s supplied. The kselftest/runner.sh also supports per test log if the variable per_test_logging is set. So add new option -p to set this veriable. Note the -p option is conflict with -s option. Signed-off-by: Hangbin Liu