Hello,
The aim of this series is to make resctrl_tests run by using
kselftest framework.
- I modify resctrl_test Makefile and kselftest Makefile,
to enable build/run resctrl_tests by using kselftest framework.
Of course, users can also build/run resctrl_tests without
using framework as before.
- I change the default limited time for resctrl_tests to 120 seconds, to
ensure the resctrl_tests finish in limited time on different environments.
- When resctrl file system is not supported by environment or
resctrl_tests is not run as root, return skip code of kselftest framework.
- If resctrl_tests does not finish in limited time, terminate it as
same as executing ctrl+c that kills parent process and child process.
Difference from v3:
- I reodered all patches of this patch series.
- I updated the print message of ksft_exit_skip() to give more information. [PATCH v4 3/6]
- I simplified tools/testing/selftests/resctrl/Makefile to use kselftest's lib.mk. [PATCH v4 4/6]
- I improved README of resctrl_tests. [PATCH v4 5/6]
- I moved license patch to this patch series. [PATCH v4 6/6]
https://lore.kernel.org/lkml/20220216022641.2998318-1-tan.shaopeng@jp.fujit… [PATCH V3]
This patch series is based on v5.16.
Thanks,
Shaopeng Tan (6):
selftests/resctrl: Kill child process before parent process terminates
if SIGTERM is received
selftests/resctrl: Change the default limited time to 120 seconds
selftests/resctrl: Fix resctrl_tests' return code to work with
selftest framework
selftests/resctrl: Make resctrl_tests run using kselftest framework
selftests/resctrl: Update README about using kselftest framework to
build/run resctrl_tests
selftests/resctrl: Add missing SPDX license to Makefile
tools/testing/selftests/Makefile | 1 +
tools/testing/selftests/resctrl/Makefile | 18 +++--------
tools/testing/selftests/resctrl/README | 31 ++++++++++++++++++-
.../testing/selftests/resctrl/resctrl_tests.c | 4 +--
tools/testing/selftests/resctrl/resctrl_val.c | 1 +
tools/testing/selftests/resctrl/settings | 1 +
6 files changed, 39 insertions(+), 17 deletions(-)
create mode 100644 tools/testing/selftests/resctrl/settings
--
2.27.0
GOD BLESS YOU AS YOU REPLY URGENTLY
Hello Dear,
Greetings, I am contacting you regarding an important information i
have for you please reply to confirm your email address and for more
details Thanks
Regards
Mrs Susan Elwood Hara.
The LLVM make variable allows a developer to quickly switch between the
GNU and LLVM tools. However, it does not handle versioned binaries, such
as the ones shipped by Debian, as LLVM=1 just defines the tool variables
with the unversioned binaries.
There was some discussion during the review of the patch that introduces
LLVM=1 around versioned binaries, ultimately coming to the conclusion
that developers can just add the folder that contains the unversioned
binaries to their PATH, as Debian's versioned suffixed binaries are
really just symlinks to the unversioned binaries in /usr/lib/llvm-#/bin:
$ realpath /usr/bin/clang-14
/usr/lib/llvm-14/bin/clang
$ PATH=/usr/lib/llvm-14/bin:$PATH make ... LLVM=1
However, that can be cumbersome to developers who are constantly testing
series with different toolchains and versions. It is simple enough to
support these versioned binaries directly in the Kbuild system by
allowing the developer to specify the version suffix with LLVM=, which
is shorter than the above suggestion:
$ make ... LLVM=-14
It does not change the meaning of LLVM=1 (which will continue to use
unversioned binaries) and it does not add too much additional complexity
to the existing $(LLVM) code, while allowing developers to quickly test
their series with different versions of the whole LLVM suite of tools.
Link: https://lore.kernel.org/r/20200317215515.226917-1-ndesaulniers@google.com/
Link: https://lore.kernel.org/r/20220224151322.072632223@infradead.org/
Suggested-by: Peter Zijlstra <peterz(a)infradead.org>
Reviewed-by: Kees Cook <keescook(a)chromium.org>
Reviewed-by: Nick Desaulniers <ndesaulniers(a)google.com>
Signed-off-by: Nathan Chancellor <nathan(a)kernel.org>
---
RFC -> v1: https://lore.kernel.org/r/Yh%2FegU1LZudfrgVy@dev-arch.thelio-3990X/
* Tidy up commit message slightly.
* Add tags.
* Add links to prior discussions for context.
* Add change to tools/testing/selftests/lib.mk.
I would like for this to go through the Kbuild tree, please ack as
necessary.
Documentation/kbuild/llvm.rst | 7 +++++++
Makefile | 24 ++++++++++++++----------
tools/scripts/Makefile.include | 20 ++++++++++++--------
tools/testing/selftests/lib.mk | 6 +++++-
4 files changed, 38 insertions(+), 19 deletions(-)
diff --git a/Documentation/kbuild/llvm.rst b/Documentation/kbuild/llvm.rst
index d32616891dcf..5805a8473a36 100644
--- a/Documentation/kbuild/llvm.rst
+++ b/Documentation/kbuild/llvm.rst
@@ -60,6 +60,13 @@ They can be enabled individually. The full list of the parameters: ::
OBJCOPY=llvm-objcopy OBJDUMP=llvm-objdump READELF=llvm-readelf \
HOSTCC=clang HOSTCXX=clang++ HOSTAR=llvm-ar HOSTLD=ld.lld
+If your LLVM tools have a suffix and you prefer to test an explicit version rather
+than the unsuffixed executables, use ``LLVM=<suffix>``. For example: ::
+
+ make LLVM=-14
+
+will use ``clang-14``, ``ld.lld-14``, etc.
+
The integrated assembler is enabled by default. You can pass ``LLVM_IAS=0`` to
disable it.
diff --git a/Makefile b/Makefile
index a82095c69fdd..963840c00eae 100644
--- a/Makefile
+++ b/Makefile
@@ -424,8 +424,12 @@ HOST_LFS_LDFLAGS := $(shell getconf LFS_LDFLAGS 2>/dev/null)
HOST_LFS_LIBS := $(shell getconf LFS_LIBS 2>/dev/null)
ifneq ($(LLVM),)
-HOSTCC = clang
-HOSTCXX = clang++
+ifneq ($(LLVM),1)
+LLVM_SFX := $(LLVM)
+endif
+
+HOSTCC = clang$(LLVM_SFX)
+HOSTCXX = clang++$(LLVM_SFX)
else
HOSTCC = gcc
HOSTCXX = g++
@@ -444,14 +448,14 @@ KBUILD_HOSTLDLIBS := $(HOST_LFS_LIBS) $(HOSTLDLIBS)
# Make variables (CC, etc...)
CPP = $(CC) -E
ifneq ($(LLVM),)
-CC = clang
-LD = ld.lld
-AR = llvm-ar
-NM = llvm-nm
-OBJCOPY = llvm-objcopy
-OBJDUMP = llvm-objdump
-READELF = llvm-readelf
-STRIP = llvm-strip
+CC = clang$(LLVM_SFX)
+LD = ld.lld$(LLVM_SFX)
+AR = llvm-ar$(LLVM_SFX)
+NM = llvm-nm$(LLVM_SFX)
+OBJCOPY = llvm-objcopy$(LLVM_SFX)
+OBJDUMP = llvm-objdump$(LLVM_SFX)
+READELF = llvm-readelf$(LLVM_SFX)
+STRIP = llvm-strip$(LLVM_SFX)
else
CC = $(CROSS_COMPILE)gcc
LD = $(CROSS_COMPILE)ld
diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include
index 79d102304470..ab3b2a7dcc94 100644
--- a/tools/scripts/Makefile.include
+++ b/tools/scripts/Makefile.include
@@ -52,11 +52,15 @@ define allow-override
endef
ifneq ($(LLVM),)
-$(call allow-override,CC,clang)
-$(call allow-override,AR,llvm-ar)
-$(call allow-override,LD,ld.lld)
-$(call allow-override,CXX,clang++)
-$(call allow-override,STRIP,llvm-strip)
+ifneq ($(LLVM),1)
+LLVM_SFX := $(LLVM)
+endif
+
+$(call allow-override,CC,clang$(LLVM_SFX))
+$(call allow-override,AR,llvm-ar$(LLVM_SFX))
+$(call allow-override,LD,ld.lld$(LLVM_SFX))
+$(call allow-override,CXX,clang++$(LLVM_SFX))
+$(call allow-override,STRIP,llvm-strip$(LLVM_SFX))
else
# Allow setting various cross-compile vars or setting CROSS_COMPILE as a prefix.
$(call allow-override,CC,$(CROSS_COMPILE)gcc)
@@ -69,9 +73,9 @@ endif
CC_NO_CLANG := $(shell $(CC) -dM -E -x c /dev/null | grep -Fq "__clang__"; echo $$?)
ifneq ($(LLVM),)
-HOSTAR ?= llvm-ar
-HOSTCC ?= clang
-HOSTLD ?= ld.lld
+HOSTAR ?= llvm-ar$(LLVM_SFX)
+HOSTCC ?= clang$(LLVM_SFX)
+HOSTLD ?= ld.lld$(LLVM_SFX)
else
HOSTAR ?= ar
HOSTCC ?= gcc
diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk
index a40add31a2e3..b3ab713537c6 100644
--- a/tools/testing/selftests/lib.mk
+++ b/tools/testing/selftests/lib.mk
@@ -1,7 +1,11 @@
# This mimics the top-level Makefile. We do it explicitly here so that this
# Makefile can operate with or without the kbuild infrastructure.
ifneq ($(LLVM),)
-CC := clang
+ifneq ($(LLVM),1)
+LLVM_SFX := $(LLVM)
+endif
+
+CC := clang$(LLVM_SFX)
else
CC := $(CROSS_COMPILE)gcc
endif
base-commit: 55de8686df7ed2b5237867b130e30c728bbd9db4
--
2.35.1
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 two patches introduce the new device as a module configured to be
compiled directly into the kernel (y) similar to the s390 SCLP and CHSH
miscdevice modules. Patch 3/3 introduces selftests which verify error
paths of the ioctl.
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 (3):
drivers/s390/char: Add Ultravisor io device
drivers/s390/char: Add Ultravisor attestation to uvdevice
selftests: drivers/s390x: Add uvdevice tests
MAINTAINERS | 3 +
arch/s390/include/asm/uv.h | 23 +-
arch/s390/include/uapi/asm/uvdevice.h | 46 +++
drivers/s390/char/Kconfig | 11 +
drivers/s390/char/Makefile | 1 +
drivers/s390/char/uvdevice.c | 308 ++++++++++++++++++
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 | 281 ++++++++++++++++
11 files changed, 697 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.25.1
The things built with USER_CFLAGS don't seem to recognise it as a
compiler option, and print a warning:
clang: warning: argument unused during compilation: '-mno-global-merge' [-Wunused-command-line-argument]
Fixes: 744814d2fa ("um: Allow builds with Clang")
Signed-off-by: David Gow <davidgow(a)google.com>
---
This warning shows up after merging:
https://lore.kernel.org/lkml/20220227184517.504931-6-keescook@chromium.org/
I'm not 100% sure why this is necessary, but it does seem to work. All
the attempts to get rid of -mno-global-merge entirely have been met with
skepticism, but I'm guessing that it's not a problem for just the UML
"user" files, as they shouldn't(?) interact too much with modules.
arch/um/Makefile | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/um/Makefile b/arch/um/Makefile
index f2fe63bfd819..320b09cd513c 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -75,6 +75,10 @@ USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -I%,,$(KBUILD_CFLAGS))) \
-D_FILE_OFFSET_BITS=64 -idirafter $(srctree)/include \
-idirafter $(objtree)/include -D__KERNEL__ -D__UM_HOST__
+ifdef CONFIG_CC_IS_CLANG
+USER_CFLAGS := $(patsubst -mno-global-merge,,$(USER_CFLAGS))
+endif
+
#This will adjust *FLAGS accordingly to the platform.
include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS)
--
2.35.1.616.g0bdcbb4464-goog