Changes since V2:
- V2: https://lore.kernel.org/lkml/cover.1647360971.git.reinette.chatre@intel.com/
- Rebased against v5.18-rc4, no functional changes.
- Add text in cover letter and first patch to highlight that
the __cpuid_count() macro provided is not a new implementation but
copied from gcc.
Changes since V1:
- V1: https://lore.kernel.org/lkml/cover.1644000145.git.reinette.chatre@intel.com/
- Change solution to not use __cpuid_count() from compiler's
cpuid.h but instead use a local define of __cpuid_count()
provided in kselftest.h to ensure tests continue working
in all supported environments. (Shuah)
- Rewrite cover letter and changelogs to reflect new solution.
A few tests that require running CPUID do so with a private
implementation of a wrapper for CPUID. This duplication of
the CPUID wrapper should be avoided.
Both gcc and clang/LLVM provide wrappers for CPUID but
the wrappers are not available in the minimal required
version of gcc, v3.2, that the selftests need to be used
in. __cpuid_count() was added to gcc in v4.4, which is ok for
kernels after v4.19 when the gcc minimal required version
was changed to v4.6.
Copy gcc's __cpuid_count() to provide a local define of
__cpuid_count() to kselftest.h to ensure that selftests can
still work in environments with older stable kernels (v4.9
and v4.14 that have the minimal required version of gcc of
v3.2). Update tests with private CPUID wrappers to use the
new macro.
Cc: Dave Hansen <dave.hansen(a)linux.intel.com>
Cc: Sandipan Das <sandipan(a)linux.ibm.com>
Cc: Florian Weimer <fweimer(a)redhat.com>
Cc: "Desnes A. Nunes do Rosario" <desnesn(a)linux.vnet.ibm.com>
Cc: Ingo Molnar <mingo(a)kernel.org>
Cc: Thiago Jung Bauermann <bauerman(a)linux.ibm.com>
Cc: Michael Ellerman <mpe(a)ellerman.id.au>
Cc: Michal Suchanek <msuchanek(a)suse.de>
Cc: linux-mm(a)kvack.org
Cc: Chang S. Bae <chang.seok.bae(a)intel.com>
Cc: Borislav Petkov <bp(a)suse.de>
Cc: Thomas Gleixner <tglx(a)linutronix.de>
Cc: Ingo Molnar <mingo(a)redhat.com>
Cc: "H. Peter Anvin" <hpa(a)zytor.com>
Cc: x86(a)kernel.org
Cc: Andy Lutomirski <luto(a)kernel.org>
Reinette Chatre (4):
selftests: Provide local define of __cpuid_count()
selftests/vm/pkeys: Use provided __cpuid_count() macro
selftests/x86/amx: Use provided __cpuid_count() macro
selftests/x86/corrupt_xstate_header: Use provided __cpuid_count()
macro
tools/testing/selftests/kselftest.h | 15 ++++++++++++
tools/testing/selftests/vm/pkey-x86.h | 21 ++--------------
tools/testing/selftests/x86/amx.c | 24 ++++++-------------
.../selftests/x86/corrupt_xstate_header.c | 16 ++-----------
4 files changed, 26 insertions(+), 50 deletions(-)
base-commit: af2d861d4cd2a4da5137f795ee3509e6f944a25b
--
2.25.1
Hi,
this is a revised patch set for RFC I posted some time ago (*).
Since the ZSTD usage became much more popular now, it makes sense to
have the consistent (de)compression support in the kernel, also for
the firmware files. This patch set adds the support for ZSTD-
compressed firmware files as well as the extension of selftests, in
addition to a couple of relevant fixes in selftests.
(*) https://lore.kernel.org/r/20210127154939.13288-1-tiwai@suse.de
Takashi
===
Takashi Iwai (5):
firmware: Add the support for ZSTD-compressed firmware files
selftests: firmware: Use smaller dictionary for XZ compression
selftests: firmware: Fix the request_firmware_into_buf() test for XZ
format
selftests: firmware: Simplify test patterns
selftests: firmware: Add ZSTD compressed file tests
drivers/base/firmware_loader/Kconfig | 24 ++-
drivers/base/firmware_loader/main.c | 76 +++++++-
.../selftests/firmware/fw_filesystem.sh | 170 +++++++++---------
tools/testing/selftests/firmware/fw_lib.sh | 12 +-
4 files changed, 182 insertions(+), 100 deletions(-)
--
2.31.1
Currently if opening /dev/null fails to open then file pointer fp
is null and further access to fp via fprintf will cause a null
pointer dereference. Fix this by returning a negative error value
when a null fp is detected.
Fixes: a2561b12fe39 ("selftests/resctrl: Add built in benchmark")
Signed-off-by: Colin Ian King <colin.i.king(a)gmail.com>
---
tools/testing/selftests/resctrl/fill_buf.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/resctrl/fill_buf.c b/tools/testing/selftests/resctrl/fill_buf.c
index 51e5cf22632f..56ccbeae0638 100644
--- a/tools/testing/selftests/resctrl/fill_buf.c
+++ b/tools/testing/selftests/resctrl/fill_buf.c
@@ -121,8 +121,10 @@ static int fill_cache_read(unsigned char *start_ptr, unsigned char *end_ptr,
/* Consume read result so that reading memory is not optimized out. */
fp = fopen("/dev/null", "w");
- if (!fp)
+ if (!fp) {
perror("Unable to write to /dev/null");
+ return -1;
+ }
fprintf(fp, "Sum: %d ", ret);
fclose(fp);
--
2.35.1
Currently the binderfs test says what failure it encountered
without saying why it may occurred when it fails to mount
binderfs. So, Warn about enabling CONFIG_ANDROID_BINDERFS in the
running kernel.
Signed-off-by: Karthik Alapati <mail(a)karthek.com>
---
tools/testing/selftests/filesystems/binderfs/binderfs_test.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/filesystems/binderfs/binderfs_test.c b/tools/testing/selftests/filesystems/binderfs/binderfs_test.c
index 0315955ff0f4..bc1c407651fc 100644
--- a/tools/testing/selftests/filesystems/binderfs/binderfs_test.c
+++ b/tools/testing/selftests/filesystems/binderfs/binderfs_test.c
@@ -412,7 +412,8 @@ TEST(binderfs_stress)
ret = mount(NULL, binderfs_mntpt, "binder", 0, 0);
ASSERT_EQ(ret, 0) {
- TH_LOG("%s - Failed to mount binderfs", strerror(errno));
+ TH_LOG("%s - Failed to mount binderfs, check if CONFIG_ANDROID_BINDERFS is enabled in the running kernel",
+ strerror(errno));
}
for (int i = 0; i < ARRAY_SIZE(fds); i++) {
--
2.35.2
This patch series adds a memory.reclaim proactive reclaim interface.
The rationale behind the interface and how it works are in the first
patch.
---
Changes in V4:
mm/memcontrol.c:
- Return -EINTR on signal_pending().
- On the final retry, drain percpu lru caches hoping that it might
introduce some evictable pages for reclaim.
- Simplified the retry loop as suggested by Dan Schatzberg.
selftests:
- Always return -errno on failure from cg_write() (whether open() or
write() fail), also update cg_read() and read_text() to return -errno
as well for consistency. Also make sure to correctly check that the
whole buffer was written in cg_write().
- Added a maximum number of retries for the reclaim selftest.
Changes in V3:
- Fix cg_write() (in patch 2) to properly return -1 if open() fails
and not fail if len == errno.
- Remove debug printf() in patch 3.
Changes in V2:
- Add the interface to root as well.
- Added a selftest.
- Documented the interface as a nested-keyed interface, which makes
adding optional arguments in the future easier (see doc updates in the
first patch).
- Modified the commit message to reflect changes and added a timeout
argument as a suggested possible extension
- Return -EAGAIN if the kernel fails to reclaim the full requested
amount.
---
Shakeel Butt (1):
memcg: introduce per-memcg reclaim interface
Yosry Ahmed (3):
selftests: cgroup: return -errno from cg_read()/cg_write() on failure
selftests: cgroup: fix alloc_anon_noexit() instantly freeing memory
selftests: cgroup: add a selftest for memory.reclaim
Documentation/admin-guide/cgroup-v2.rst | 21 +++++
mm/memcontrol.c | 44 +++++++++
tools/testing/selftests/cgroup/cgroup_util.c | 44 ++++-----
.../selftests/cgroup/test_memcontrol.c | 94 ++++++++++++++++++-
4 files changed, 176 insertions(+), 27 deletions(-)
--
2.36.0.rc2.479.g8af0fa9b8e-goog
This series is just a set of minor tweaks and improvements for the MTE
tests that I did while working on the asymmetric mode support for
userspace which seemed like they might be worth keeping even though the
prctl() for asymmetric mode got removed.
v2:
- Rebase onto v5.18-rc3
Mark Brown (4):
kselftest/arm64: Handle more kselftest result codes in MTE helpers
kselftest/arm64: Log unexpected asynchronous MTE faults
kselftest/arm64: Refactor parameter checking in mte_switch_mode()
kselftest/arm64: Add simple test for MTE prctl
tools/testing/selftests/arm64/mte/.gitignore | 1 +
.../testing/selftests/arm64/mte/check_prctl.c | 119 ++++++++++++++++++
.../selftests/arm64/mte/mte_common_util.c | 19 ++-
.../selftests/arm64/mte/mte_common_util.h | 15 ++-
4 files changed, 149 insertions(+), 5 deletions(-)
create mode 100644 tools/testing/selftests/arm64/mte/check_prctl.c
base-commit: b2d229d4ddb17db541098b83524d901257e93845
--
2.30.2
This series has a couple of minor fixes and cleanups for sve-ptrace plus
the addition of a new test which validates that we can write using the
FPSIMD regset and then read matching data back using the SVE regset -
previously we only validated writing SVE and reading FPSIMD data.
v2
- Rebase onto v5.18-rc1
Mark Brown (3):
kselftest/arm64: Fix comment for ptrace_sve_get_fpsimd_data()
kselftest/arm64: Remove assumption that tasks start FPSIMD only
kselftest/arm64: Validate setting via FPSIMD and read via SVE regsets
tools/testing/selftests/arm64/fp/sve-ptrace.c | 164 +++++++++++++++---
1 file changed, 139 insertions(+), 25 deletions(-)
base-commit: 3123109284176b1532874591f7c81f3837bbdc17
--
2.30.2