kselftest next update for Linux 6.20-rc1
Shuah Khan
maintainerHi Linus,
Please pull the kselftest next update for Linux 6.20-rc1.
resctrl test:
- fixes a devision by zero error on Hygon
- fixes non-contiguous CBM check for Hygon
- defines CPU vendor IDs as bits to match usage
- adds CPU vendor detection for Hygon
- coredeump test: changes to use __builtin_trap() instead of a null pointer
- anon_inode: replaces null pointers with empty arrays
- kublk: includes message in _Static_assert for C11 compatibility
- run_kselftest.sh: adds --skip argument option
- pidfd: fixes typo in comment
Note:
There is a conflict between the following commits found during linux-next merge and Mark fixed it up
tools/testing/selftests/ublk/kublk.h
between commit:
584709ad5ce35 ("selftests: ublk: replace assert() with ublk_assert()")
from the block tree and commit:
3e6ad272bb8b3 ("kselftest/kublk: include message in _Static_assert for C11 compatibility")
from the kselftest tree.
diff is attached.
thanks,
-- Shuah
----------------------------------------------------------------
The following changes since commit 8f0b4cce4481fb22653697cced8d0d04027cb1e8:
Linux 6.19-rc1 (2025-12-14 16:05:07 +1200)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest tags/linux_kselftest-next-6.20-rc1
for you to fetch changes up to 6d6ad32e22f028c525d5df471c5522616e645a6b:
selftests/pidfd: fix typo in comment (2026-01-21 10:56:25 -0700)
----------------------------------------------------------------
linux_kselftest-next-6.20-rc1
resctrl test:
- fixes a devision by zero error on Hygon
- fixes non-contiguous CBM check for Hygon
- defines CPU vendor IDs as bits to match usage
- adds CPU vendor detection for Hygon
- coredeump test: changes to use __builtin_trap() instead of a null pointer
- anon_inode: replaces null pointers with empty arrays
- kublk: includes message in _Static_assert for C11 compatibility
- run_kselftest.sh: adds --skip argument option
- pidfd: fixes typo in comment
----------------------------------------------------------------
Clint George (3):
kselftest/coredump: use __builtin_trap() instead of null pointer kselftest/anon_inode: replace null pointers with empty arrays kselftest/kublk: include message in _Static_assert for C11 compatibility
Ricardo B. Marlière (1):
selftests/run_kselftest.sh: Add --skip argument option
Xiaochen Shen (4):
selftests/resctrl: Fix a division by zero error on Hygon selftests/resctrl: Define CPU vendor IDs as bits to match usage selftests/resctrl: Add CPU vendor detection for Hygon selftests/resctrl: Fix non-contiguous CBM check for Hygon
Ziyu Chen (1):
selftests/pidfd: fix typo in comment
.../selftests/coredump/coredump_test_helpers.c | 2 +- .../selftests/filesystems/anon_inode_test.c | 5 +++- tools/testing/selftests/pidfd/pidfd_info_test.c | 2 +- tools/testing/selftests/resctrl/cat_test.c | 6 +++-- tools/testing/selftests/resctrl/resctrl.h | 8 ++++--- tools/testing/selftests/resctrl/resctrl_tests.c | 28 +++++++++++++++------- tools/testing/selftests/resctrl/resctrlfs.c | 10 ++++++++ tools/testing/selftests/run_kselftest.sh | 11 +++++++++ tools/testing/selftests/ublk/kublk.h | 2 +- 9 files changed, 57 insertions(+), 17 deletions(-)
----------------------------------------------------------------
tools/testing/selftests/coredump/coredump_test_helpers.c +1 -1
@@ -56,7 +56,7 @@ void crashing_child(void)pthread_create (&thread,NULL , do_nothing,NULL );/* crash on purpose */ - i = *(int *)NULL ; +__builtin_trap (); }int create_detached_tmpfs (void )
tools/testing/selftests/filesystems/anon_inode_test.c +4 -1
@@ -42,7 +42,10 @@ TEST(anon_inode_no_exec) fd_context =sys_fsopen ("tmpfs" ,0 );ASSERT_GE (fd_context,0 ); -ASSERT_LT (execveat (fd_context,"" ,NULL ,NULL ,AT_EMPTY_PATH ),0 ); +char *const empty_argv[] = {NULL }; +char *const empty_envp[] = {NULL }; + +ASSERT_LT (execveat (fd_context,"" , empty_argv, empty_envp,AT_EMPTY_PATH ),0 );ASSERT_EQ (errno,EACCES );EXPECT_EQ (close (fd_context),0 );
tools/testing/selftests/pidfd/pidfd_info_test.c +1 -1
@@ -229,7 +229,7 @@ static void *pidfd_info_pause_thread(void *arg)close (ipc_socket); -/* Sleep untill we're killed. */ +/* Sleep until we're killed. */ pause ();return NULL ; }
tools/testing/selftests/resctrl/cat_test.c +4 -2
@@ -290,8 +290,10 @@ static int cat_run_test(const struct resctrl_test *test, const struct user_paramstatic bool arch_supports_noncont_cat (const struct resctrl_test *test) { -/* AMD always supports non-contiguous CBM. */ -if (get_vendor () ==ARCH_AMD ) +unsigned int vendor_id =get_vendor (); + +/* AMD and Hygon always support non-contiguous CBM. */ +if (vendor_id ==ARCH_AMD || vendor_id ==ARCH_HYGON )return true;#if defined(__i386__) || defined(__x86_64__)/* arch */
tools/testing/selftests/resctrl/resctrl.h +5 -3
@@ -23,6 +23,7 @@#include <asm/unistd.h> #include <linux/perf_event.h> #include <linux/compiler.h> +#include <linux/bits.h> #include "kselftest.h" #define MB (1024 * 1024)
@@ -36,8 +37,9 @@* Define as bits because they're used for vendor_specific bitmask in * the struct resctrl_test. */ -#define ARCH_INTEL 1 -#define ARCH_AMD 2 +#define ARCH_INTEL BIT(0) +#define ARCH_AMD BIT(1) +#define ARCH_HYGON BIT(2)#define END_OF_TESTS 1
@@ -163,7 +165,7 @@ extern int snc_unreliable;extern char llc_occup_path[1024 ];int snc_nodes_per_l3_cache (void ); -int get_vendor (void ); +unsigned int get_vendor (void );bool check_resctrlfs_support (void );int filter_dmesg (void );int get_domain_id (const char *resource,int cpu_no,int *domain_id);
tools/testing/selftests/resctrl/resctrl_tests.c +20 -8
@@ -23,16 +23,24 @@ static struct resctrl_test *resctrl_tests[] = { &l2_noncont_cat_test, }; -static int detect_vendor (void ) +static unsigned int detect_vendor (void ) { -FILE *inf =fopen ("/proc/cpuinfo" ,"r" ); -int vendor_id =0 ; +static unsigned int vendor_id; +static bool initialized;char *s =NULL ; +FILE *inf;char *res; -if (!inf) +if (initialized)return vendor_id; + inf =fopen ("/proc/cpuinfo" ,"r" ); +if (!inf) { + vendor_id =0 ; + initialized = true; +return vendor_id; + } + res =fgrep (inf,"vendor_id" );if (res)
@@ -42,18 +50,22 @@ static int detect_vendor(void) vendor_id =ARCH_INTEL ; else if (s && !strcmp(s, ": AuthenticAMD\n")) vendor_id =ARCH_AMD ; + else if (s && !strcmp(s, ": HygonGenuine\n")) + vendor_id =ARCH_HYGON ;fclose (inf);free (res); + + initialized = true;return vendor_id; } -int get_vendor (void ) +unsigned int get_vendor (void ) { -static int vendor =-1 ; +unsigned int vendor; + + vendor =detect_vendor (); -if (vendor ==-1 ) - vendor =detect_vendor ();if (vendor ==0 )ksft_print_msg ("Can not get vendor info...\n" );
tools/testing/selftests/resctrl/resctrlfs.c +10 -0
@@ -243,6 +243,16 @@ int snc_nodes_per_l3_cache(void) } snc_mode = cache_cpus / node_cpus; +/* +* On some platforms (e.g. Hygon), +* cache_cpus < node_cpus, the calculated snc_mode is 0. +* +* Set snc_mode = 1 to indicate that SNC mode is not +* supported on the platform. +*/ +if (!snc_mode) + snc_mode =1 ; +if (snc_mode >1 )ksft_print_msg ("SNC-%d mode discovered.\n" , snc_mode); }
tools/testing/selftests/run_kselftest.sh +11 -0
@@ -30,6 +30,7 @@ Usage: $0 [OPTIONS] -s | --summary Print summary with detailed log in output.log (conflict with -p) -p | --per-test-log Print test log in /tmp with each test name (conflict with -s) -t | --test COLLECTION:TEST Run TEST from COLLECTION + -S | --skip COLLECTION:TEST Skip TEST from COLLECTION -c | --collection COLLECTION Run all tests from COLLECTION -l | --list List the available collection:test entries -d | --dry-run Don't actually run any tests
@@ -43,6 +44,7 @@ EOF COLLECTIONS="" TESTS="" +SKIP="" dryrun="" kselftest_override_timeout="" ERROR_ON_FAIL=true
@@ -58,6 +60,9 @@ while true; do -t | --test) TESTS="$TESTS $2" shift 2 ;; + -S | --skip) + SKIP="$SKIP $2" + shift 2 ;; -c | --collection) COLLECTIONS="$COLLECTIONS $2" shift 2 ;;
@@ -109,6 +114,12 @@ if [ -n "$TESTS" ]; then done available="$(echo "$valid" | sed -e 's/ /\n/g')" fi +# Remove tests to be skipped from available list +if [ -n "$SKIP" ]; then + for skipped in $SKIP ; do + available="$(echo "$available" | grep -v "^${skipped}$")" + done +fi kselftest_failures_file="$(mktemp --tmpdir kselftest-failures-XXXXXX)" export kselftest_failures_file
tools/testing/selftests/ublk/kublk.h +1 -1
@@ -217,7 +217,7 @@ static inline __u64 build_user_data(unsigned tag, unsigned op, unsigned tgt_data, unsigned q_id, unsigned is_target_io) {/* we only have 7 bits to encode q_id */ - _Static_assert(UBLK_MAX_QUEUES_SHIFT <= 7); + _Static_assert(UBLK_MAX_QUEUES_SHIFT <= 7, "UBLK_MAX_QUEUES_SHIFT must be <= 7");assert (!(tag >>16 ) && !(op >>8 ) && !(tgt_data >>16 ) && !(q_id >>7 )); return tag | (op << 16) | (tgt_data << 24) |
The pull request you sent on Sun, 1 Feb 2026 05:30:18 -0700:
The pull request you sent on Sun, 1 Feb 2026 05:30:18 -0700:
Quoted 1 line
git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftesttags/linux_kselftest-next-6.20-rc1
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/5c40222af1689d89966c4b60e79852d6bc13416a
Thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/prtracker.html