As documented in issue C215 in the known issues list for DDI0487I.a [1] Arm
will be making a retroactive change to SVE to remove the possibility of
selecting non power of two vector lengths. This has no impact on existing
physical implementations but most virtual implementations have implemented
the full range of permissible vector lengths. Given how demanding fp-stress
is for these implementations update to only attempt to enumerate the power
of two vector lengths, reducing the load created on existing virtual
implementations and only exercising the functionality that will be seen in
physical implementations.
[1] https://developer.arm.com/documentation/102105/ia-00/
Signed-off-by: Mark Brown <broonie(a)kernel.org>
---
tools/testing/selftests/arm64/fp/fp-stress.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/arm64/fp/fp-stress.c b/tools/testing/selftests/arm64/fp/fp-stress.c
index f8b2f41aac36..2b95f9451b1b 100644
--- a/tools/testing/selftests/arm64/fp/fp-stress.c
+++ b/tools/testing/selftests/arm64/fp/fp-stress.c
@@ -377,7 +377,7 @@ static void probe_vls(int vls[], int *vl_count, int set_vl)
*vl_count = 0;
- for (vq = SVE_VQ_MAX; vq > 0; --vq) {
+ for (vq = SVE_VQ_MAX; vq > 0; vq /= 2) {
vl = prctl(set_vl, vq * 16);
if (vl == -1)
ksft_exit_fail_msg("SET_VL failed: %s (%d)\n",
@@ -385,6 +385,9 @@ static void probe_vls(int vls[], int *vl_count, int set_vl)
vl &= PR_SVE_VL_LEN_MASK;
+ if (*vl_count && (vl == vls[*vl_count - 1]))
+ break;
+
vq = sve_vq_from_vl(vl);
vls[*vl_count] = vl;
---
base-commit: 1b929c02afd37871d5afb9d498426f83432e71c2
change-id: 20221220-arm64-fp-stress-pow2-b81ee6471492
Best regards,
--
Mark Brown <broonie(a)kernel.org>
The first patch here is a fix which should ideally be sent as such,
currently the program will hang on architecturally valid systems which
implement SME but not 128 bit vector lengths. The remaining patches
are general enhancements, including coverage for the SME ABI on SME only
systems.
To: Catalin Marinas <catalin.marinas(a)arm.com>
To: Will Deacon <will(a)kernel.org>
To: Shuah Khan <shuah(a)kernel.org>
Cc: Shuah Khan <skhan(a)linuxfoundation.org>
Cc: linux-arm-kernel(a)lists.infradead.org
Cc: linux-kselftest(a)vger.kernel.org
Cc: linux-kernel(a)vger.kernel.org
Signed-off-by: Mark Brown <broonie(a)kernel.org>
---
Mark Brown (4):
kselftest/arm64: Fix syscall-abi for systems without 128 bit SME
kselftest/arm64: Only enumerate VLs once in syscall-abi
kselftest/arm64: Verify SME only ABI in syscall-abi
kselftest/arm64: Only enumerate power of two VLs in syscall-abi
.../testing/selftests/arm64/abi/syscall-abi-asm.S | 14 ++-
tools/testing/selftests/arm64/abi/syscall-abi.c | 133 +++++++++++++--------
2 files changed, 89 insertions(+), 58 deletions(-)
---
base-commit: 1b929c02afd37871d5afb9d498426f83432e71c2
change-id: 20221223-arm64-syscall-abi-sme-only-c3bb2c0f81e5
Best regards,
--
Mark Brown <broonie(a)kernel.org>
While looking at the BTI selftest results on a non-BTI system I noticed
that not only are we printing invalid test numbers in that case, we're
skipping running the tests entirely even though there's a well defined
ABI we could be verifying and the code already knows what the results
should be.
The first patch here is a fix to the reporting of test numbers when
skipping, the second one just removes the skipping entirely in favour of
a runtime check for what the result of a BTI binary should be.
To: Catalin Marinas <catalin.marinas(a)arm.com>
To: Will Deacon <will(a)kernel.org>
To: Shuah Khan <shuah(a)kernel.org>
Cc: linux-arm-kernel(a)lists.infradead.org
Cc: linux-kselftest(a)vger.kernel.org
Cc: linux-kernel(a)vger.kernel.org
Signed-off-by: Mark Brown <broonie(a)kernel.org>
---
Mark Brown (2):
kselftest/arm64: Fix test numbering when skipping tests
kselftest/arm64: Run BTI selftests on systems without BTI
tools/testing/selftests/arm64/bti/test.c | 25 ++++++++++---------------
1 file changed, 10 insertions(+), 15 deletions(-)
---
base-commit: b7bfaa761d760e72a969d116517eaa12e404c262
change-id: 20230110-arm64-bti-selftest-skip-9fdf5e94fb62
Best regards,
--
Mark Brown <broonie(a)kernel.org>
User space can use the MEM_OP ioctl to make storage key checked reads
and writes to the guest, however, it has no way of performing atomic,
key checked, accesses to the guest.
Extend the MEM_OP ioctl in order to allow for this, by adding a cmpxchg
mode. For now, support this mode for absolute accesses only.
This mode can be use, for example, to set the device-state-change
indicator and the adapter-local-summary indicator atomically.
Also contains some fixes/changes for the memop selftest independent of
the cmpxchg changes.
v4 -> v5
* refuse cmpxchg if not write (thanks Thomas)
* minor doc changes (thanks Claudio)
* picked up R-b's (thanks Thomas & Claudio)
* memop selftest fixes
* rebased
v3 -> v4
* no functional change intended
* rework documentation a bit
* name extension cap cmpxchg bit
* picked up R-b (thanks Thomas)
* various changes (rename variable, comments, ...) see range-diff below
v2 -> v3
* rebase onto the wip/cmpxchg_user_key branch in the s390 kernel repo
* use __uint128_t instead of unsigned __int128
* put moving of testlist into main into separate patch
* pick up R-b's (thanks Nico)
v1 -> v2
* get rid of xrk instruction for cmpxchg byte and short implementation
* pass old parameter via pointer instead of in mem_op struct
* indicate failure of cmpxchg due to wrong old value by special return
code
* picked up R-b's (thanks Thomas)
Janis Schoetterl-Glausch (10):
KVM: s390: Extend MEM_OP ioctl by storage key checked cmpxchg
Documentation: KVM: s390: Describe KVM_S390_MEMOP_F_CMPXCHG
KVM: s390: selftest: memop: Pass mop_desc via pointer
KVM: s390: selftest: memop: Replace macros by functions
KVM: s390: selftest: memop: Move testlist into main
KVM: s390: selftest: memop: Add cmpxchg tests
KVM: s390: selftest: memop: Add bad address test
KVM: s390: selftest: memop: Fix typo
KVM: s390: selftest: memop: Fix wrong address being used in test
KVM: s390: selftest: memop: Fix integer literal
Documentation/virt/kvm/api.rst | 20 +-
include/uapi/linux/kvm.h | 7 +
arch/s390/kvm/gaccess.h | 3 +
arch/s390/kvm/gaccess.c | 102 ++++
arch/s390/kvm/kvm-s390.c | 41 +-
tools/testing/selftests/kvm/s390x/memop.c | 675 +++++++++++++++++-----
6 files changed, 696 insertions(+), 152 deletions(-)
Range-diff against v4:
1: 75a20d2e27f2 ! 1: 6adc166ee141 KVM: s390: Extend MEM_OP ioctl by storage key checked cmpxchg
@@ arch/s390/kvm/kvm-s390.c: static int kvm_s390_vm_mem_op(struct kvm *kvm, struct
+ */
+ if (mop->size > sizeof(new))
+ return -EINVAL;
++ if (mop->op != KVM_S390_MEMOP_ABSOLUTE_WRITE)
++ return -EINVAL;
+ if (copy_from_user(&new.raw[off_in_quad], uaddr, mop->size))
+ return -EFAULT;
+ if (copy_from_user(&old.raw[off_in_quad], old_addr, mop->size))
2: 5c5ad96a4c81 ! 2: fce9a063ab70 Documentation: KVM: s390: Describe KVM_S390_MEMOP_F_CMPXCHG
@@ Commit message
checked) cmpxchg operations on guest memory.
Signed-off-by: Janis Schoetterl-Glausch <scgl(a)linux.ibm.com>
+ Reviewed-by: Claudio Imbrenda <imbrenda(a)linux.ibm.com>
## Documentation/virt/kvm/api.rst ##
@@ Documentation/virt/kvm/api.rst: The fields in each entry are defined as follows:
@@ Documentation/virt/kvm/api.rst: The fields in each entry are defined as follows:
:Returns: = 0 on success,
< 0 on generic error (e.g. -EFAULT or -ENOMEM),
- > 0 if an exception occurred while walking the page tables
-+ 16 bit program exception code if the access causes such an exception
-+ other code > 0xffff with special meaning
++ 16 bit program exception code if the access causes such an exception,
++ other code > 0xffff with special meaning.
Read or write data from/to the VM's memory.
The KVM_CAP_S390_MEM_OP_EXTENSION capability specifies what functionality is
3: 9cbcb313d91d = 3: 94c1165ae24a KVM: s390: selftest: memop: Pass mop_desc via pointer
4: 21d98b9deaae ! 4: 027c87eee0ac KVM: s390: selftest: memop: Replace macros by functions
@@ Commit message
need the exta flexibility.
Signed-off-by: Janis Schoetterl-Glausch <scgl(a)linux.ibm.com>
+ Reviewed-by: Thomas Huth <thuth(a)redhat.com>
## tools/testing/selftests/kvm/s390x/memop.c ##
@@ tools/testing/selftests/kvm/s390x/memop.c: struct mop_desc {
5: 866fcd7fbc97 ! 5: 16ac410ecc0f KVM: s390: selftest: memop: Move testlist into main
@@ tools/testing/selftests/kvm/s390x/memop.c: static void test_errors(void)
{
int extension_cap, idx;
-+ setbuf(stdout, NULL); /* Tell stdout not to buffer its content */
TEST_REQUIRE(kvm_has_cap(KVM_CAP_S390_MEM_OP));
+ extension_cap = kvm_check_cap(KVM_CAP_S390_MEM_OP_EXTENSION);
-- setbuf(stdout, NULL); /* Tell stdout not to buffer its content */
+- ksft_print_header();
+ struct testdef {
+ const char *name;
+ void (*test)(void);
@@ tools/testing/selftests/kvm/s390x/memop.c: static void test_errors(void)
+ },
+ };
- ksft_print_header();
--
++ ksft_print_header();
ksft_set_plan(ARRAY_SIZE(testlist));
- extension_cap = kvm_check_cap(KVM_CAP_S390_MEM_OP_EXTENSION);
@@ tools/testing/selftests/kvm/s390x/memop.c: static void test_errors(void)
- ksft_test_result_skip("%s - extension level %d not supported\n",
- testlist[idx].name,
- testlist[idx].extension);
-+ ksft_test_result_skip("%s - requirements not met (kernel has extension cap %#x\n)",
++ ksft_test_result_skip("%s - requirements not met (kernel has extension cap %#x)\n",
+ testlist[idx].name, extension_cap);
}
}
6: c3e473677786 ! 6: 214281b6eb96 KVM: s390: selftest: memop: Add cmpxchg tests
@@ tools/testing/selftests/kvm/s390x/memop.c: static void test_errors(void)
+ rv = ERR_MOP(t.vm, ABSOLUTE, WRITE, mem1, i, GADDR((void *)~0xfffUL),
+ CMPXCHG_OLD(&old));
+ TEST_ASSERT(rv > 0, "ioctl allows bad guest address for cmpxchg");
++ rv = ERR_MOP(t.vm, ABSOLUTE, READ, mem1, i, GADDR_V(mem1),
++ CMPXCHG_OLD(&old));
++ TEST_ASSERT(rv == -1 && errno == EINVAL,
++ "ioctl allows read cmpxchg call");
+ }
+ for (i = 2; i <= 16; i *= 2) {
+ rv = ERR_MOP(t.vm, ABSOLUTE, WRITE, mem1, i, GADDR_V(mem1 + 1),
7: 90288760656e = 7: 2d6776733e64 KVM: s390: selftest: memop: Add bad address test
8: e3d4b9b2ba61 = 8: 8c49eafd2881 KVM: s390: selftest: memop: Fix typo
9: 13fedd6e3d9e = 9: 0af907110b34 KVM: s390: selftest: memop: Fix wrong address being used in test
-: ------------ > 10: 886c80b2bdce KVM: s390: selftest: memop: Fix integer literal
--
2.34.1
When use tools/testing/selftests/kselftest_install.sh to make the
kselftest-list.txt under tools/testing/selftests/kselftest_install.
Then use tools/testing/selftests/kselftest_install/run_kselftest.sh to
run all the kselftests in kselftest-list.txt, it will be blocked by
case "filesystems/fat: run_fat_tests.sh" with "Warning: file run_fat_tests.sh
is not executable", so grant executable permission to run_fat_tests.sh to
fix this issue.
Fixes: dd7c9be330d8 ("selftests/filesystems: add a vfat RENAME_EXCHANGE test")
Signed-off-by: Pengfei Xu <pengfei.xu(a)intel.com>
---
tools/testing/selftests/filesystems/fat/run_fat_tests.sh | 0
1 file changed, 0 insertions(+), 0 deletions(-)
mode change 100644 => 100755 tools/testing/selftests/filesystems/fat/run_fat_tests.sh
diff --git a/tools/testing/selftests/filesystems/fat/run_fat_tests.sh b/tools/testing/selftests/filesystems/fat/run_fat_tests.sh
old mode 100644
new mode 100755
--
2.31.1
We are missing a ) when we attempt to complain about not having enough
configuration for clang, resulting in the rather inscrutable error:
../lib.mk:23: *** unterminated call to function 'error': missing ')'. Stop.
Add the required ) so we print the message we were trying to print.
Signed-off-by: Mark Brown <broonie(a)kernel.org>
---
tools/testing/selftests/lib.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk
index 291144c284fb..f7900e75d230 100644
--- a/tools/testing/selftests/lib.mk
+++ b/tools/testing/selftests/lib.mk
@@ -20,7 +20,7 @@ CLANG_TARGET_FLAGS := $(CLANG_TARGET_FLAGS_$(ARCH))
ifeq ($(CROSS_COMPILE),)
ifeq ($(CLANG_TARGET_FLAGS),)
-$(error Specify CROSS_COMPILE or add '--target=' option to lib.mk
+$(error Specify CROSS_COMPILE or add '--target=' option to lib.mk)
else
CLANG_FLAGS += --target=$(CLANG_TARGET_FLAGS)
endif # CLANG_TARGET_FLAGS
---
base-commit: b7bfaa761d760e72a969d116517eaa12e404c262
change-id: 20230111-kselftest-lib-clang-fix-8936ba376ea1
Best regards,
--
Mark Brown <broonie(a)kernel.org>
LKFT CI found that with the latest mainline kernel (6.1) on
some QEMU emulators and FVP, the following tests will take
longer than the kselftest framework default timeout (45 seconds) to
run and thus got terminated with TIMEOUT error:
* fp-stress - took about 11m30s
* sve-ptrace - took about 8m50s
* check_gcr_el1_cswitch - took about 6m
* check_user_mem - took about 3m
* syscall-abi - took about 5m
Current test timeouts:
not ok 29 selftests: arm64: sve-ptrace # TIMEOUT 45 seconds
not ok 36 selftests: arm64: check_gcr_el1_cswitch # TIMEOUT 45 seconds
not ok 41 selftests: arm64: check_user_mem # TIMEOUT 45 seconds
not ok 46 selftests: arm64: syscall-abi # TIMEOUT 45 seconds
Signed-off-by: Naresh Kamboju <naresh.kamboju(a)linaro.org>
---
tools/testing/selftests/arm64/settings | 1 +
1 file changed, 1 insertion(+)
create mode 100644 tools/testing/selftests/arm64/settings
diff --git a/tools/testing/selftests/arm64/settings b/tools/testing/selftests/arm64/settings
new file mode 100644
index 000000000000..8959a5dd8ace
--- /dev/null
+++ b/tools/testing/selftests/arm64/settings
@@ -0,0 +1 @@
+timeout=900
\ No newline at end of file
--
2.30.2
Hi all,
I was wondering whether I am already obnoxious with three or four bug reports in
two days and you might find it easier to hire an assassin to silence me
than to fix them :)
But the saner approach prevailed and I thought of the advantage of pulling
through with 6.2-rc2 selftests on all my available hardware.
Please find included the lshw output, config and dmesg log.
The kernel is essentially vanilla mainline torvalds tree kernel with
CONFIG_KMEMLEAK=y and MG-LRU enabled (somewhat maybe brave, but I believe unrelated).
https://domac.alu.unizg.hr/~mtodorov/linux/selftests/net-namespace-20230106…https://domac.alu.unizg.hr/~mtodorov/linux/selftests/net-namespace-20230106…
[root@pc-mtodorov linux_torvalds]# tools/testing/selftests/net/l2_tos_ttl_inherit.sh
┌────────┬───────┬───────┬──────────────┬──────────────┬───────┬────────┐
├────────┼───────┼───────┼──────────────┼──────────────┼───────┼────────┤
│ Type │ outer | inner │ tos │ ttl │ vlan │ result │
├────────┼───────┼───────┼──────────────┼──────────────┼───────┼────────┤
│ gre │ 4 │ 4 │ inherit 0xc4 │ inherit 116 │ false │Cannot create namespace file "/var/run/netns/testing": File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists
Of course, I should have tried to fix these myself, but I am not quite an expert
in namespaces.
BTW, Florian asked for a bash -x output, so I am providing one to save one roundtrip:
https://domac.alu.unizg.hr/~mtodorov/linux/selftests/net-namespace-20230106…
Kind regards,
Mirsad
--
Mirsad Goran Todorovac
Sistem inženjer
Grafički fakultet | Akademija likovnih umjetnosti
Sveučilište u Zagrebu
--
System engineer
Faculty of Graphic Arts | Academy of Fine Arts
University of Zagreb, Republic of Croatia
The European Union
Hi,
So this is the fix for the bug that actually prevented me to integrate
HID-BPF in v6.2.
While testing the code base with LLVM, I realized that clang was smarter
than I expected it to be, and it sometimes inlined a function or not
depending on the branch. This lead to segfaults because my current code
in linux-next is messing up the bpf programs refcounts assuming that I
had enough observability over the kernel.
So I came back to the drawing board and realized that what I was missing
was exactly a bpf_link, to represent the attachment of a bpf program to
a HID device. This is the bulk of the series, in patch 6/9.
The other patches are cleanups, tests, and also the addition of the
vmtests.sh script I run locally, largely inspired by the one in the bpf
selftests dir. This allows very fast development of HID-BPF, assuming we
have tests that cover the bugs :)
Cheers,
Benjamin
Benjamin Tissoires (9):
selftests: hid: add vmtest.sh
selftests: hid: allow to compile hid_bpf with LLVM
selftests: hid: attach/detach 2 bpf programs, not just one
selftests: hid: ensure the program is correctly pinned
selftests: hid: prepare tests for HID_BPF API change
HID: bpf: rework how programs are attached and stored in the kernel
selftests: hid: enforce new attach API
HID: bpf: clean up entrypoint
HID: bpf: reorder BPF registration
Documentation/hid/hid-bpf.rst | 12 +-
drivers/hid/bpf/entrypoints/entrypoints.bpf.c | 9 -
.../hid/bpf/entrypoints/entrypoints.lskel.h | 188 ++++--------
drivers/hid/bpf/hid_bpf_dispatch.c | 28 +-
drivers/hid/bpf/hid_bpf_dispatch.h | 3 -
drivers/hid/bpf/hid_bpf_jmp_table.c | 116 +++----
include/linux/hid_bpf.h | 7 +
tools/testing/selftests/hid/.gitignore | 1 +
tools/testing/selftests/hid/Makefile | 10 +-
tools/testing/selftests/hid/config.common | 241 +++++++++++++++
tools/testing/selftests/hid/config.x86_64 | 4 +
tools/testing/selftests/hid/hid_bpf.c | 32 +-
tools/testing/selftests/hid/progs/hid.c | 13 +
tools/testing/selftests/hid/vmtest.sh | 284 ++++++++++++++++++
14 files changed, 724 insertions(+), 224 deletions(-)
create mode 100644 tools/testing/selftests/hid/config.common
create mode 100644 tools/testing/selftests/hid/config.x86_64
create mode 100755 tools/testing/selftests/hid/vmtest.sh
--
2.38.1