This series adds an Ultravisor(UV) device letting the userspace send some
Ultravisor calls to the UV. Currently two calls are supported.
Query Ultravisor Information (QUI) and
Receive Attestation Measurement (Attest[ation]).
The UV device is implemented as a miscdevice accepting only IOCTLs.
The IOCTL cmd specifies the UV call and the IOCTL arg the request
and response data depending on the UV call.
The device driver writes the UV response in the ioctl argument data.
The 'uvdevice' does no checks on the request beside faulty userspace
addresses, if sizes are in a sane range before allocating in kernel space,
and other tests that prevent the system from corruption.
Especially, no checks are made, that will be performed by the UV anyway
(E.g. 'invalid command' in case of attestation on unsupported hardware).
These errors are reported back to userspace using the UV return code
field.
The first patch introduces the new device as a module configured to be
compiled directly into the kernel (y) similar to the s390 SCLP and CHSH
miscdevice modules. The second atch introduces Kselftests which verify error
paths of the ioctl.
@Greg
There is now a userspace tool "pvattest" that uses the new device:
https://github.com/ibm-s390-linux/s390-tools/tree/for-2.22
We are currently discussing some nits regarding the processing
of certificates and the user interface and add the tool to
s390-tools/master afterwards.
However, the interface to the kernel is fixed.
The tool (pvattest) will be in s390-tools 2.22 that accompanies
linux 5.18.
You will be most interested in S390-tools/pvattest/src/uvio.{h,c}
and S390-tools/pvattest/src/pvattest.c
v3->v4:
* Dropped the QUI related patches, as we agreed that we do not want
to expose the QUI-UVC to userspace for now.
* Kconfig option was misplaced inside the S390 TAPE group ->fixed
* Some nits fixed:
* dropped the X from S390X in the uvdevice.h guard
* fixes kernel doc style issue in uvdevice.c
v2->v3:
The main change is that QUI is now introduced after Attestation as we
might not want pick it. Also the Kselftest patch is splitted into
Attestation and QUI so that they can be picked without requiring
QUI support of the uvdevice.
* dropped the Kconfig dependency
* reorganized the series:
- Patch 1 now covers the introduction of the uvdevice and Attestation
- Patch 2 adds QUI to uvdevice
- Patch 3/4 add Kselftests for Attestation and QUI
* fixed some nits
* added some comments
v1->v2:
* ioctl returns -ENOIOCTLCMD in case of a invalid ioctl command
* streamlined reserved field test
* default Kconfig is y instead of m
* improved selftest documentation
Steffen Eiden (2):
drivers/s390/char: Add Ultravisor io device
selftests: drivers/s390x: Add uvdevice tests
MAINTAINERS | 3 +
arch/s390/include/asm/uv.h | 23 +-
arch/s390/include/uapi/asm/uvdevice.h | 51 ++++
drivers/s390/char/Kconfig | 10 +
drivers/s390/char/Makefile | 1 +
drivers/s390/char/uvdevice.c | 264 +++++++++++++++++
tools/testing/selftests/Makefile | 1 +
tools/testing/selftests/drivers/.gitignore | 1 +
.../selftests/drivers/s390x/uvdevice/Makefile | 22 ++
.../selftests/drivers/s390x/uvdevice/config | 1 +
.../drivers/s390x/uvdevice/test_uvdevice.c | 276 ++++++++++++++++++
11 files changed, 652 insertions(+), 1 deletion(-)
create mode 100644 arch/s390/include/uapi/asm/uvdevice.h
create mode 100644 drivers/s390/char/uvdevice.c
create mode 100644 tools/testing/selftests/drivers/s390x/uvdevice/Makefile
create mode 100644 tools/testing/selftests/drivers/s390x/uvdevice/config
create mode 100644 tools/testing/selftests/drivers/s390x/uvdevice/test_uvdevice.c
--
2.30.2
Hello,
This series add support for the renameat2 system call RENAME_EXCHANGE flag
(which allows to atomically replace two paths) to the vfat filesystem code.
There are many use cases for this, but we are particularly interested in
making possible for vfat filesystems to be part of OSTree [0] deployments.
Currently OSTree relies on symbolic links to make the deployment updates
an atomic transactional operation. But RENAME_EXCHANGE could be used [1]
to achieve a similar level of robustness when using a vfat filesystem.
Patch #1 is just a preparatory patch to introduce the RENAME_EXCHANGE
support in patch #2 and finally patch #3 adds some kselftests to test it.
This is my first contribution to the fs/* subsystem, so I'm marking this
set as RFC, in case I got anything wrong with the patches. But they work
correctly on my local testing.
[0]: https://github.com/ostreedev/ostree
[1]: https://github.com/ostreedev/ostree/issues/1649
Javier Martinez Canillas (3):
fat: add a vfat_rename2() and make existing .rename callback a helper
fat: add renameat2 RENAME_EXCHANGE flag support
selftests/filesystems: add a vfat RENAME_EXCHANGE test
MAINTAINERS | 1 +
fs/fat/namei_vfat.c | 172 +++++++++++++++++-
tools/testing/selftests/Makefile | 1 +
.../selftests/filesystems/fat/Makefile | 7 +
.../testing/selftests/filesystems/fat/config | 2 +
.../filesystems/fat/rename_exchange.c | 37 ++++
.../filesystems/fat/run_fat_tests.sh | 80 ++++++++
7 files changed, 293 insertions(+), 7 deletions(-)
create mode 100644 tools/testing/selftests/filesystems/fat/Makefile
create mode 100644 tools/testing/selftests/filesystems/fat/config
create mode 100644 tools/testing/selftests/filesystems/fat/rename_exchange.c
create mode 100755 tools/testing/selftests/filesystems/fat/run_fat_tests.sh
--
2.35.1
Spelling mistake (triple letters) in comment.
Detected with the help of Coccinelle.
Signed-off-by: Julia Lawall <Julia.Lawall(a)inria.fr>
---
tools/testing/selftests/vm/protection_keys.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/vm/protection_keys.c b/tools/testing/selftests/vm/protection_keys.c
index 2d0ae88665db..291bc1e07842 100644
--- a/tools/testing/selftests/vm/protection_keys.c
+++ b/tools/testing/selftests/vm/protection_keys.c
@@ -1523,7 +1523,7 @@ void test_implicit_mprotect_exec_only_memory(int *ptr, u16 pkey)
/*
* Reset the shadow, assuming that the above mprotect()
* correctly changed PKRU, but to an unknown value since
- * the actual alllocated pkey is unknown.
+ * the actual allocated pkey is unknown.
*/
shadow_pkey_reg = __read_pkey_reg();
Spelling mistake (triple letters) in comment.
Detected with the help of Coccinelle.
Signed-off-by: Julia Lawall <Julia.Lawall(a)inria.fr>
---
tools/testing/selftests/sync/sync_stress_parallelism.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/sync/sync_stress_parallelism.c b/tools/testing/selftests/sync/sync_stress_parallelism.c
index e6c9be671dfc..6ce56ca204c4 100644
--- a/tools/testing/selftests/sync/sync_stress_parallelism.c
+++ b/tools/testing/selftests/sync/sync_stress_parallelism.c
@@ -87,7 +87,7 @@ int test_stress_two_threads_shared_timeline(void)
/*
* Use a single timeline to synchronize two threads
- * hammmering on the same counter.
+ * hammering on the same counter.
*/
pthread_create(&a, NULL, (void *(*)(void *))
This series contains three fixup patches for vm selftests. They
are independent. Please see the patches.
Patrick Wang (3):
selftests: vm: check numa_available() before operating
"merge_across_nodes" in ksm_tests
selftests: vm: add "test_hmm.sh" to TEST_FILES
selftests: vm: add the "settings" file with timeout variable
tools/testing/selftests/vm/Makefile | 1 +
tools/testing/selftests/vm/ksm_tests.c | 9 ++++++---
tools/testing/selftests/vm/settings | 1 +
3 files changed, 8 insertions(+), 3 deletions(-)
create mode 100644 tools/testing/selftests/vm/settings
--
2.25.1
Add the following new guidelines:
- Add instruction to use lib.mk
- Add instruction about how to use headers from kernel source
- Add instruction to add .gitignore file
- Add instruction about how to add new test in selftests/Makefile
- Add instruction about different build commands to test
Signed-off-by: Muhammad Usama Anjum <usama.anjum(a)collabora.com>
---
Following patch is fixing build of kselftest when separate output
direcotry is specified using kernel's top most Makefile. It should be
accepted first:
https://lore.kernel.org/lkml/20220223191016.1658728-1-usama.anjum@collabora…
---
Documentation/dev-tools/kselftest.rst | 46 ++++++++++++++++++++++++++-
1 file changed, 45 insertions(+), 1 deletion(-)
diff --git a/Documentation/dev-tools/kselftest.rst b/Documentation/dev-tools/kselftest.rst
index a833ecf12fbc1..637f83d1450dc 100644
--- a/Documentation/dev-tools/kselftest.rst
+++ b/Documentation/dev-tools/kselftest.rst
@@ -208,6 +208,13 @@ In general, the rules for selftests are
Contributing new tests (details)
================================
+ * Use lib.mk instead of writing Makefile from sratch. Specify flags and
+ binaries generation flags on need basis before including lib.mk. ::
+
+ CFLAGS = $(KHDR_INCLUDES)
+ TEST_GEN_PROGS := close_range_test
+ include ../lib.mk
+
* Use TEST_GEN_XXX if such binaries or files are generated during
compiling.
@@ -230,13 +237,50 @@ Contributing new tests (details)
* First use the headers inside the kernel source and/or git repo, and then the
system headers. Headers for the kernel release as opposed to headers
installed by the distro on the system should be the primary focus to be able
- to find regressions.
+ to find regressions. Use KHDR_INCLUDES in Makefile to include headers from
+ the kernel source.
* If a test needs specific kernel config options enabled, add a config file in
the test directory to enable them.
e.g: tools/testing/selftests/android/config
+ * Create a .gitignore file inside test directory and add all generated objects
+ in it.
+
+ * Add new test name in TARGETS in selftests/Makefile::
+
+ TARGETS += android
+
+ * All of the following build commands should be successful
+
+ - Same directory build of kselftests::
+
+ make kselftest-all
+ make kselftest-install
+ make kselftest-clean
+ make kselftest-gen_tar
+
+ - Build with absolute output directory path::
+
+ make kselftest-all O=/abs_build_path
+ make kselftest-install O=/abs_build_path
+ make kselftest-clean O=/abs_build_path
+ make kselftest-gen_tar O=/abs_build_path
+
+ - Build with relative output directory path::
+
+ make kselftest-all O=relative_path
+ make kselftest-install O=relative_path
+ make kselftest-clean O=relative_path
+ make kselftest-gen_tar O=relative_path
+
+ - Build from Makefile of selftests directly::
+
+ make -C tools/testing/selftests
+ make -C tools/testing/selftests O=/abs_build_path
+ make -C tools/testing/selftests O=relative_path
+
Test Module
===========
--
2.30.2