Kselftest update for Linux 6.6-rc1
Subsystems (7)
Shuah Khan
maintainerHi Linus,
Please pull the following Kselftest update for Linux 6.6-rc1.
This Kselftest update for Linux 6.6-rc1 consists of a mix of fixes, enhancements, and new tests. Bulk of the changes enhance and fix rseq and resctrl tests. In addition, user_events, dmabuf-heaps and perf_events are added to default kselftest build and test coverage. A futex test fix, enhance prctl test coverage, and minor fixes are included in this update.
diff is attached.
thanks,
-- Shuah
----------------------------------------------------------------
The following changes since commit 6eaae198076080886b9e7d57f4ae06fa782f90ef:
Linux 6.5-rc3 (2023-07-23 15:24:10 -0700)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest tags/linux-kselftest-next-6.6-rc1
for you to fetch changes up to 9b1db732866bee060b9bca9493e5ebf5e8874c48:
selftests: cachestat: use proper syscall number macro (2023-08-16 11:12:44 -0600)
----------------------------------------------------------------
linux-kselftest-next-6.6-rc1
This Kselftest update for Linux 6.6-rc1 consists of a mix of fixes, enhancements, and new tests. Bulk of the changes enhance and fix rseq and resctrl tests. In addition, user_events, dmabuf-heaps and perf_events are added to default kselftest build and test coverage. A futex test fix, enhance prctl test coverage, and minor fixes are included in this update.
----------------------------------------------------------------
Andre Przywara (2):
selftests: cachestat: properly link in librt
selftests: cachestat: use proper syscall number macro
Hui Min Mina Chou (1):
selftests/filesystems: Add six consecutive 'x' characters to mktemp
Ilpo Järvinen (19):
selftests/resctrl: Add resctrl.h into build deps
selftests/resctrl: Don't leak buffer in fill_cache() selftests/resctrl: Unmount resctrl FS if child fails to run benchmark selftests/resctrl: Close perf value read fd on errors selftests/resctrl: Unmount resctrl FS before starting the first test selftests/resctrl: Move resctrl FS mount/umount to higher level selftests/resctrl: Refactor remount_resctrl(bool mum_resctrlfs) to mount_resctrl() selftests/resctrl: Remove mum_resctrlfs from struct resctrl_val_param selftests/resctrl: Convert span to size_t
selftests/resctrl: Express span internally in bytes selftests/resctrl: Remove duplicated preparation for span arg selftests/resctrl: Remove "malloc_and_init_memory" param from run_fill_buf() selftests/resctrl: Remove unnecessary startptr global from fill_buf selftests/resctrl: Improve parameter consistency in fill_buf selftests/resctrl: Don't pass test name to fill_buf selftests/resctrl: Don't use variable argument list for ->setup() selftests/resctrl: Move CAT/CMT test global vars to function they are used in selftests/resctrl: Pass the real number of tests to show_cache_info() selftests/resctrl: Remove test type checks from cat_val()
Mark Brown (2):
selftests/user_events: Reenable build
selftests: Hook more tests into the build infrastructure
Mathieu Desnoyers (4):
selftests/rseq: Fix CID_ID typo in Makefile selftests/rseq: Implement rseq_unqual_scalar_typeof selftests/rseq: Fix arm64 buggy load-acquire/store-release macros selftests/rseq: Use rseq_unqual_scalar_typeof in macros
Nysal Jan K.A (1):
selftests/futex: Order calls to futex_lock_pi
Osama Muhammad (1):
selftests: prctl: Add new prctl test for PR_SET_NAME
Shuah Khan (2):
selftests:prctl: Fix make clean override warning selftests:prctl: add set-process-name to .gitignore
tools/testing/selftests/Makefile | 4 + tools/testing/selftests/cachestat/Makefile | 2 +- tools/testing/selftests/cachestat/test_cachestat.c | 7 +- .../selftests/filesystems/fat/run_fat_tests.sh | 2 +- .../futex/functional/futex_wait_timeout.c | 7 ++ tools/testing/selftests/prctl/.gitignore | 1 + tools/testing/selftests/prctl/Makefile | 4 +- tools/testing/selftests/prctl/set-process-name.c | 62 +++++++++++++++ tools/testing/selftests/resctrl/Makefile | 2 +- tools/testing/selftests/resctrl/cache.c | 66 ++++++++-------- tools/testing/selftests/resctrl/cat_test.c | 28 ++----- tools/testing/selftests/resctrl/cmt_test.c | 29 ++------ tools/testing/selftests/resctrl/fill_buf.c | 87 ++++++++-------------- tools/testing/selftests/resctrl/mba_test.c | 9 +-- tools/testing/selftests/resctrl/mbm_test.c | 17 ++--- tools/testing/selftests/resctrl/resctrl.h | 17 ++--- tools/testing/selftests/resctrl/resctrl_tests.c | 83 ++++++++++++++------- tools/testing/selftests/resctrl/resctrl_val.c | 7 +- tools/testing/selftests/resctrl/resctrlfs.c | 64 ++++++++-------- tools/testing/selftests/rseq/Makefile | 2 +- tools/testing/selftests/rseq/compiler.h | 26 +++++++ tools/testing/selftests/rseq/rseq-arm.h | 4 +- tools/testing/selftests/rseq/rseq-arm64.h | 58 ++++++++------- tools/testing/selftests/rseq/rseq-mips.h | 4 +- tools/testing/selftests/rseq/rseq-ppc.h | 4 +- tools/testing/selftests/rseq/rseq-riscv.h | 6 +- tools/testing/selftests/rseq/rseq-s390.h | 4 +- tools/testing/selftests/rseq/rseq-x86.h | 4 +- tools/testing/selftests/user_events/Makefile | 8 -- 29 files changed, 328 insertions(+), 290 deletions(-) create mode 100644 tools/testing/selftests/prctl/set-process-name.c
----------------------------------------------------------------
tools/testing/selftests/Makefile +4 -0
@@ -12,6 +12,7 @@ TARGETS += core TARGETS += cpufreq TARGETS += cpu-hotplug TARGETS += damon +TARGETS += dmabuf-heaps TARGETS += drivers/dma-buf TARGETS += drivers/s390x/uvdevice TARGETS += drivers/net/bonding
@@ -56,6 +57,7 @@ TARGETS += net/mptcp TARGETS += net/openvswitch TARGETS += netfilter TARGETS += nsfs +TARGETS += perf_events TARGETS += pidfd TARGETS += pid_namespace TARGETS += powerpc
@@ -88,7 +90,9 @@ endif TARGETS += tmpfs TARGETS += tpm2 TARGETS += tty +TARGETS += uevents TARGETS += user +TARGETS += user_events TARGETS += vDSO TARGETS += mm TARGETS += x86
tools/testing/selftests/cachestat/Makefile +1 -1
@@ -3,6 +3,6 @@ TEST_GEN_PROGS := test_cachestat CFLAGS += $(KHDR_INCLUDES) CFLAGS += -Wall -CFLAGS += -lrt +LDLIBS += -lrt include ../lib.mk
tools/testing/selftests/cachestat/test_cachestat.c +3 -4
@@ -19,7 +19,6 @@ static const char * const dev_files[] = {"/dev/zero" ,"/dev/null" ,"/dev/urandom" , "/proc/version", "/proc" }; -static const int cachestat_nr =451 ;void print_cachestat (struct cachestat *cs) {
@@ -126,7 +125,7 @@ bool test_cachestat(const char *filename, bool write_random, bool create, } } - syscall_ret =syscall (cachestat_nr, fd, &cs_range, &cs,0 ); + syscall_ret =syscall (__NR_cachestat, fd, &cs_range, &cs,0 );ksft_print_msg ("Cachestat call returned %ld\n" , syscall_ret);
@@ -152,7 +151,7 @@ bool test_cachestat(const char *filename, bool write_random, bool create,ksft_print_msg ("fsync fails.\n" ); ret = false; }else { - syscall_ret =syscall (cachestat_nr, fd, &cs_range, &cs,0 ); + syscall_ret =syscall (__NR_cachestat, fd, &cs_range, &cs,0 );ksft_print_msg ("Cachestat call (after fsync) returned %ld\n" , syscall_ret);
@@ -213,7 +212,7 @@ bool test_cachestat_shmem(void) goto close_fd; } - syscall_ret =syscall (cachestat_nr, fd, &cs_range, &cs,0 ); + syscall_ret =syscall (__NR_cachestat, fd, &cs_range, &cs,0 );if (syscall_ret) {ksft_print_msg ("Cachestat returned non-zero.\n" );
tools/testing/selftests/filesystems/fat/run_fat_tests.sh +1 -1
@@ -12,7 +12,7 @@ set -u set -o pipefail BASE_DIR="$(dirname $0)" -TMP_DIR="$(mktemp -d /tmp/fat_tests_tmp.XXXX)" +TMP_DIR="$(mktemp -d /tmp/fat_tests_tmp.XXXXXX)" IMG_PATH="${TMP_DIR}/fat.img" MNT_PATH="${TMP_DIR}/mnt"
tools/testing/selftests/futex/functional/futex_wait_timeout.c +7 -0
@@ -24,6 +24,7 @@static long timeout_ns =100000 ;/* 100us default timeout */ static futex_t futex_pi; +static pthread_barrier_t barrier;void usage (char *prog) {
@@ -48,6 +49,8 @@ void *get_pi_lock(void *arg)if (ret !=0 )error ("futex_lock_pi failed\n" , ret); +pthread_barrier_wait (&barrier); +/* Blocks forever */ ret =futex_wait (&lock,0 ,NULL ,0 );error ("futex_wait failed\n" , ret);
@@ -130,6 +133,7 @@ int main(int argc, char *argv[]) basename(argv[0]));ksft_print_msg ("\tArguments: timeout=%ldns\n" , timeout_ns); +pthread_barrier_init (&barrier,NULL ,2 );pthread_create (&thread,NULL , get_pi_lock,NULL );/* initialize relative timeout */
@@ -163,6 +167,9 @@ int main(int argc, char *argv[]) res =futex_wait_requeue_pi (&f1, f1, &futex_pi, &to,0 );test_timeout (res, &ret,"futex_wait_requeue_pi monotonic" ,ETIMEDOUT ); +/* Wait until the other thread calls futex_lock_pi() */ +pthread_barrier_wait (&barrier); +pthread_barrier_destroy (&barrier);/* * FUTEX_LOCK_PI with CLOCK_REALTIME * Due to historical reasons, FUTEX_LOCK_PI supports only realtime
tools/testing/selftests/prctl/.gitignore +1 -0
@@ -3,3 +3,4 @@ disable-tsc-ctxt-sw-stress-test disable-tsc-on-off-stress-test disable-tsc-test set-anon-vma-name-test +set-process-name
tools/testing/selftests/prctl/Makefile +1 -3
@@ -5,12 +5,10 @@ ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/x86/ -e s/x86_64/x86/) ifeq ($(ARCH),x86) TEST_PROGS := disable-tsc-ctxt-sw-stress-test disable-tsc-on-off-stress-test \ - disable-tsc-test set-anon-vma-name-test + disable-tsc-test set-anon-vma-name-test set-process-name all: $(TEST_PROGS) include ../lib.mk -clean: - rm -fr $(TEST_PROGS) endif endif
tools/testing/selftests/prctl/set-process-name.c new file +62 -0
62 lines not on this page · raw message
tools/testing/selftests/resctrl/Makefile +1 -1
@@ -7,4 +7,4 @@ TEST_GEN_PROGS := resctrl_tests include ../lib.mk -$(OUTPUT)/resctrl_tests: $(wildcard *.c) +$(OUTPUT)/resctrl_tests: $(wildcard *.[ch])
tools/testing/selftests/resctrl/cache.c +31 -35
120 lines not on this page · raw message
tools/testing/selftests/resctrl/cat_test.c +6 -22
@@ -17,27 +17,16 @@#define MAX_DIFF_PERCENT 4#define MAX_DIFF 1000000 -static int count_of_bits; -static char cbm_mask[256 ]; -static unsigned long long_mask; -static unsigned long cache_size; -/* * Change schemata. Write schemata to specified * con_mon grp, mon_grp in resctrl FS. * Run 5 times in order to get average values. */ -static int cat_setup (int num, ...) +static int cat_setup (struct resctrl_val_param *p) { -struct resctrl_val_param *p;char schemata[64 ]; -va_list param;int ret =0 ; -va_start (param, num); - p = va_arg(param, struct resctrl_val_param *); -va_end (param); -/* Run NUM_OF_RUNS times */ if (p->num_of_runs >=NUM_OF_RUNS )return END_OF_TESTS ;
@@ -88,7 +77,7 @@ static int check_results(struct resctrl_val_param *param) no_of_bits =count_bits (param->mask);return show_cache_info (sum_llc_perf_miss, no_of_bits, param->span /64 , -MAX_DIFF ,MAX_DIFF_PERCENT ,NUM_OF_RUNS , +MAX_DIFF ,MAX_DIFF_PERCENT , runs -1 ,get_vendor () ==ARCH_INTEL , false); }
@@ -102,14 +91,12 @@ int cat_perf_miss_val(int cpu_no, int n, char *cache_type) {unsigned long l_mask, l_mask_1;int ret, pipefd[2 ], sibling_cpu_no; +unsigned long cache_size =0 ; +unsigned long long_mask; +char cbm_mask[256 ]; +int count_of_bits;char pipe_message; - cache_size =0 ; - - ret =remount_resctrlfs (true); -if (ret) -return ret; -/* Get default cbm mask for L3/L2 cache */ ret =get_cbm_mask (cache_type, cbm_mask);if (ret)
@@ -144,7 +131,6 @@ int cat_perf_miss_val(int cpu_no, int n, char *cache_type)struct resctrl_val_param param = { .resctrl_val =CAT_STR , .cpu_no = cpu_no, - .mum_resctrlfs = false, .setup = cat_setup, };
@@ -227,8 +213,6 @@ int cat_perf_miss_val(int cpu_no, int n, char *cache_type) out:cat_test_cleanup (); -if (bm_pid) -umount_resctrlfs ();return ret; }
tools/testing/selftests/resctrl/cmt_test.c +7 -22
@@ -16,20 +16,8 @@#define MAX_DIFF 2000000#define MAX_DIFF_PERCENT 15 -static int count_of_bits; -static char cbm_mask[256 ]; -static unsigned long long_mask; -static unsigned long cache_size; - -static int cmt_setup (int num, ...) +static int cmt_setup (struct resctrl_val_param *p) { -struct resctrl_val_param *p; -va_list param; - -va_start (param, num); - p = va_arg(param, struct resctrl_val_param *); -va_end (param); -/* Run NUM_OF_RUNS times */ if (p->num_of_runs >=NUM_OF_RUNS )return END_OF_TESTS ;
@@ -71,7 +59,7 @@ static int check_results(struct resctrl_val_param *param, int no_of_bits)fclose (fp);return show_cache_info (sum_llc_occu_resc, no_of_bits, param->span, -MAX_DIFF ,MAX_DIFF_PERCENT ,NUM_OF_RUNS , +MAX_DIFF ,MAX_DIFF_PERCENT , runs -1 , true, true); }
@@ -82,14 +70,12 @@ void cmt_test_cleanup(void)int cmt_resctrl_val (int cpu_no,int n,char **benchmark_cmd) { +unsigned long cache_size =0 ; +unsigned long long_mask; +char cbm_mask[256 ]; +int count_of_bits;int ret; - cache_size =0 ; - - ret =remount_resctrlfs (true); -if (ret) -return ret; -if (!validate_resctrl_feature_request (CMT_STR ))return -1 ;
@@ -117,7 +103,6 @@ int cmt_resctrl_val(int cpu_no, int n, char **benchmark_cmd) .ctrlgrp = "c1", .mongrp = "m1", .cpu_no = cpu_no, - .mum_resctrlfs = false, .filename = RESULT_FILE_NAME, .mask = ~(long_mask << n) & long_mask, .span = cache_size * n / count_of_bits,
@@ -126,7 +111,7 @@ int cmt_resctrl_val(int cpu_no, int n, char **benchmark_cmd) };if (strcmp (benchmark_cmd[0 ],"fill_buf" ) ==0 ) -sprintf (benchmark_cmd[1 ],"%lu" , param.span); +sprintf (benchmark_cmd[1 ],"%zu" , param.span);remove (RESULT_FILE_NAME );
tools/testing/selftests/resctrl/fill_buf.c +31 -56
185 lines not on this page · raw message
tools/testing/selftests/resctrl/mba_test.c +1 -8
@@ -22,18 +22,12 @@* con_mon grp, mon_grp in resctrl FS. * For each allocation, run 5 times in order to get average values. */ -static int mba_setup (int num, ...) +static int mba_setup (struct resctrl_val_param *p) {static int runs_per_allocation, allocation =100 ; -struct resctrl_val_param *p;char allocation_str[64 ]; -va_list param;int ret; -va_start (param, num); - p = va_arg(param, struct resctrl_val_param *); -va_end (param); -if (runs_per_allocation >=NUM_OF_RUNS ) runs_per_allocation =0 ;
@@ -154,7 +148,6 @@ int mba_schemata_change(int cpu_no, char *bw_report, char **benchmark_cmd) .ctrlgrp = "c1", .mongrp = "m1", .cpu_no = cpu_no, - .mum_resctrlfs = true, .filename = RESULT_FILE_NAME, .bw_report = bw_report, .setup = mba_setup
tools/testing/selftests/resctrl/mbm_test.c +5 -12
@@ -15,7 +15,7 @@#define NUM_OF_RUNS 5static int -show_bw_info (unsigned long *bw_imc,unsigned long *bw_resc,int span) +show_bw_info (unsigned long *bw_imc,unsigned long *bw_resc,size_t span) {unsigned long avg_bw_imc =0 , avg_bw_resc =0 ;unsigned long sum_bw_imc =0 , sum_bw_resc =0 ;
@@ -40,14 +40,14 @@ show_bw_info(unsigned long *bw_imc, unsigned long *bw_resc, int span)ksft_print_msg ("%s Check MBM diff within %d%%\n" , ret ?"Fail:" :"Pass:" ,MAX_DIFF_PERCENT );ksft_print_msg ("avg_diff_per: %d%%\n" , avg_diff_per); -ksft_print_msg ("Span (MB): %d\n" , span); +ksft_print_msg ("Span (MB): %zu\n" , span /MB );ksft_print_msg ("avg_bw_imc: %lu\n" , avg_bw_imc);ksft_print_msg ("avg_bw_resc: %lu\n" , avg_bw_resc);return ret; } -static int check_results (int span) +static int check_results (size_t span) {unsigned long bw_imc[NUM_OF_RUNS ], bw_resc[NUM_OF_RUNS ];char temp[1024 ], *token_array[8 ];
@@ -86,16 +86,10 @@ static int check_results(int span)return ret; } -static int mbm_setup (int num, ...) +static int mbm_setup (struct resctrl_val_param *p) { -struct resctrl_val_param *p; -va_list param;int ret =0 ; -va_start (param, num); - p = va_arg(param, struct resctrl_val_param *); -va_end (param); -/* Run NUM_OF_RUNS times */ if (p->num_of_runs >=NUM_OF_RUNS )return END_OF_TESTS ;
@@ -115,7 +109,7 @@ void mbm_test_cleanup(void)remove (RESULT_FILE_NAME ); } -int mbm_bw_change (int span,int cpu_no,char *bw_report,char **benchmark_cmd) +int mbm_bw_change (size_t span,int cpu_no,char *bw_report,char **benchmark_cmd) {struct resctrl_val_param param = { .resctrl_val =MBM_STR ,
@@ -123,7 +117,6 @@ int mbm_bw_change(int span, int cpu_no, char *bw_report, char **benchmark_cmd) .mongrp = "m1", .span = span, .cpu_no = cpu_no, - .mum_resctrlfs = true, .filename = RESULT_FILE_NAME, .bw_report = bw_report, .setup = mbm_setup
tools/testing/selftests/resctrl/resctrl.h +7 -10
@@ -3,7 +3,6 @@#ifndef RESCTRL_H #define RESCTRL_H #include <stdio.h> -#include <stdarg.h> #include <math.h> #include <errno.h> #include <sched.h>
@@ -43,6 +42,7 @@do { \perror (err_msg); \kill (ppid,SIGKILL ); \ +umount_resctrlfs (); \exit (EXIT_FAILURE ); \ }while (0 )
@@ -53,7 +53,6 @@* @mongrp: Name of the monitor group (mon grp) * @cpu_no: CPU number to which the benchmark would be binded * @span: Memory bytes accessed in each benchmark iteration -* @mum_resctrlfs: Should the resctrl FS be remounted? * @filename: Name of file to which the o/p should be written * @bw_report: Bandwidth report type (reads vs writes) * @setup: Call back function to setup test environment
@@ -63,13 +62,12 @@ struct resctrl_val_param {char ctrlgrp[64 ];char mongrp[64 ];int cpu_no; -unsigned long span; -bool mum_resctrlfs; +size_t span;char filename[64 ];char *bw_report;unsigned long mask;int num_of_runs; -int (*setup)(int num, ...); +int (*setup)(struct resctrl_val_param *param); };#define MBM_STR "mbm"
@@ -84,8 +82,8 @@ extern char llc_occup_path[1024];int get_vendor (void );bool check_resctrlfs_support (void );int filter_dmesg (void ); -int remount_resctrlfs (bool mum_resctrlfs);int get_resource_id (int cpu_no,int *resource_id); +int mount_resctrlfs (void );int umount_resctrlfs (void );int validate_bw_report_request (char *bw_report);bool validate_resctrl_feature_request (const char *resctrl_val);
@@ -98,10 +96,9 @@ int write_bm_pid_to_resctrl(pid_t bm_pid, char *ctrlgrp, char *mongrp, char *resctrl_val);int perf_event_open (struct perf_event_attr *hw_event,pid_t pid,int cpu,int group_fd,unsigned long flags); -int run_fill_buf (unsigned long span,int malloc_and_init_memory,int memflush, -int op,char *resctrl_va); +int run_fill_buf (size_t span,int memflush,int op,bool once);int resctrl_val (char **benchmark_cmd,struct resctrl_val_param *param); -int mbm_bw_change (int span,int cpu_no,char *bw_report,char **benchmark_cmd); +int mbm_bw_change (size_t span,int cpu_no,char *bw_report,char **benchmark_cmd);void tests_cleanup (void );void mbm_test_cleanup (void );int mba_schemata_change (int cpu_no,char *bw_report,char **benchmark_cmd);
@@ -120,7 +117,7 @@ void cmt_test_cleanup(void);int get_core_sibling (int cpu_no);int measure_cache_vals (struct resctrl_val_param *param,int bm_pid);int show_cache_info (unsigned long sum_llc_val,int no_of_bits, -unsigned long cache_span,unsigned long max_diff, +size_t cache_span,unsigned long max_diff,unsigned long max_diff_percent,unsigned long num_of_runs,bool platform,bool cmt);
tools/testing/selftests/resctrl/resctrl_tests.c +57 -26
178 lines not on this page · raw message
tools/testing/selftests/resctrl/resctrl_val.c +1 -6
@@ -648,10 +648,6 @@ int resctrl_val(char **benchmark_cmd, struct resctrl_val_param *param)return ret; } - ret =remount_resctrlfs (param->mum_resctrlfs); -if (ret) -return ret; -/* * If benchmark wasn't successfully started by child, then child should * kill parent, so save parent's pid
@@ -763,7 +759,7 @@ int resctrl_val(char **benchmark_cmd, struct resctrl_val_param *param)/* Test runs until the callback setup() tells the test to stop. */ while (1 ) { - ret = param->setup (1 , param); + ret = param->setup (param);if (ret ==END_OF_TESTS ) { ret =0 ;break ;
@@ -788,7 +784,6 @@ int resctrl_val(char **benchmark_cmd, struct resctrl_val_param *param)signal_handler_unregister (); out:kill (bm_pid,SIGKILL ); -umount_resctrlfs ();return ret; }
tools/testing/selftests/resctrl/resctrlfs.c +31 -33
116 lines not on this page · raw message
tools/testing/selftests/rseq/Makefile +1 -1
@@ -31,7 +31,7 @@ $(OUTPUT)/%: %.c $(TEST_GEN_PROGS_EXTENDED) rseq.h rseq-*.h $(CC) $(CFLAGS) $< $(LDLIBS) -lrseq -o $@ $(OUTPUT)/basic_percpu_ops_mm_cid_test: basic_percpu_ops_test.c $(TEST_GEN_PROGS_EXTENDED) rseq.h rseq-*.h - $(CC) $(CFLAGS) -DBUILDOPT_RSEQ_PERCPU_MM_CID_ID $< $(LDLIBS) -lrseq -o $@ + $(CC) $(CFLAGS) -DBUILDOPT_RSEQ_PERCPU_MM_CID $< $(LDLIBS) -lrseq -o $@ $(OUTPUT)/param_test_benchmark: param_test.c $(TEST_GEN_PROGS_EXTENDED) \ rseq.h rseq-*.h
tools/testing/selftests/rseq/compiler.h +26 -0
@@ -33,4 +33,30 @@#define RSEQ_COMBINE_TOKENS (_tokena, _tokenb) \ RSEQ__COMBINE_TOKENS(_tokena, _tokenb) +#ifdef __cplusplus +#define rseq_unqual_scalar_typeof (x) \ + std::remove_cv<std::remove_reference<decltype(x)>::type>::type +#else +#define rseq_scalar_type_to_expr (type) \ + unsigned type: (unsigned type)0, \ + signed type: (signed type)0 + +/* +* Use C11 _Generic to express unqualified type from expression. This removes +* volatile qualifier from expression type. +*/ +#define rseq_unqual_scalar_typeof (x) \ + __typeof__( \ + _Generic((x), \ + char: (char)0, \ + rseq_scalar_type_to_expr(char), \ + rseq_scalar_type_to_expr(short), \ + rseq_scalar_type_to_expr(int), \ + rseq_scalar_type_to_expr(long), \ + rseq_scalar_type_to_expr(long long), \ + default: (x) \ + ) \ + ) +#endif +#endif /* RSEQ_COMPILER_H_ */
tools/testing/selftests/rseq/rseq-arm.h +2 -2
@@ -66,7 +66,7 @@#define rseq_smp_load_acquire (p) \ __extension__ ({ \ - __typeof(*p) ____p1 = RSEQ_READ_ONCE(*p); \ + rseq_unqual_scalar_typeof(*(p)) ____p1 = RSEQ_READ_ONCE(*(p)); \ rseq_smp_mb(); \ ____p1; \ })
@@ -76,7 +76,7 @@ __extension__ ({ \#define rseq_smp_store_release (p, v) \ do { \ rseq_smp_mb(); \ - RSEQ_WRITE_ONCE(*p, v); \ + RSEQ_WRITE_ONCE(*(p), v); \ } while (0) #define __RSEQ_ASM_DEFINE_TABLE(label, version, flags, start_ip, \
tools/testing/selftests/rseq/rseq-arm64.h +30 -28
89 lines not on this page · raw message
tools/testing/selftests/rseq/rseq-mips.h +2 -2
@@ -45,7 +45,7 @@#define rseq_smp_load_acquire (p) \ __extension__ ({ \ - __typeof(*p) ____p1 = RSEQ_READ_ONCE(*p); \ + rseq_unqual_scalar_typeof(*(p)) ____p1 = RSEQ_READ_ONCE(*(p)); \ rseq_smp_mb(); \ ____p1; \ })
@@ -55,7 +55,7 @@ __extension__ ({ \#define rseq_smp_store_release (p, v) \ do { \ rseq_smp_mb(); \ - RSEQ_WRITE_ONCE(*p, v); \ + RSEQ_WRITE_ONCE(*(p), v); \ } while (0)#if _MIPS_SZLONG ==64
tools/testing/selftests/rseq/rseq-ppc.h +2 -2
@@ -23,7 +23,7 @@#define rseq_smp_load_acquire (p) \ __extension__ ({ \ - __typeof(*p) ____p1 = RSEQ_READ_ONCE(*p); \ + rseq_unqual_scalar_typeof(*(p)) ____p1 = RSEQ_READ_ONCE(*(p)); \ rseq_smp_lwsync(); \ ____p1; \ })
@@ -33,7 +33,7 @@ __extension__ ({ \#define rseq_smp_store_release (p, v) \ do { \ rseq_smp_lwsync(); \ - RSEQ_WRITE_ONCE(*p, v); \ + RSEQ_WRITE_ONCE(*(p), v); \ } while (0)/*
tools/testing/selftests/rseq/rseq-riscv.h +3 -3
@@ -36,8 +36,8 @@#define rseq_smp_load_acquire (p) \ __extension__ ({ \ - __typeof(*(p)) ____p1 = RSEQ_READ_ONCE(*(p)); \ - RISCV_FENCE(r, rw) \ + rseq_unqual_scalar_typeof(*(p)) ____p1 = RSEQ_READ_ONCE(*(p)); \ + RISCV_FENCE(r, rw); \ ____p1; \ })
@@ -46,7 +46,7 @@ __extension__ ({ \#define rseq_smp_store_release (p, v) \ do { \ RISCV_FENCE(rw, w); \ - RSEQ_WRITE_ONCE(*(p), v); \ + RSEQ_WRITE_ONCE(*(p), v); \ } while (0) #define __RSEQ_ASM_DEFINE_TABLE(label, version, flags, start_ip, \
tools/testing/selftests/rseq/rseq-s390.h +2 -2
@@ -15,7 +15,7 @@#define rseq_smp_load_acquire (p) \ __extension__ ({ \ - __typeof(*p) ____p1 = RSEQ_READ_ONCE(*p); \ + rseq_unqual_scalar_typeof(*(p)) ____p1 = RSEQ_READ_ONCE(*(p)); \ rseq_barrier(); \ ____p1; \ })
@@ -25,7 +25,7 @@ __extension__ ({ \#define rseq_smp_store_release (p, v) \ do { \ rseq_barrier(); \ - RSEQ_WRITE_ONCE(*p, v); \ + RSEQ_WRITE_ONCE(*(p), v); \ } while (0)#ifdef __s390x__
tools/testing/selftests/rseq/rseq-x86.h +2 -2
@@ -42,7 +42,7 @@#define rseq_smp_load_acquire (p) \ __extension__ ({ \ - __typeof(*p) ____p1 = RSEQ_READ_ONCE(*p); \ + rseq_unqual_scalar_typeof(*(p)) ____p1 = RSEQ_READ_ONCE(*(p)); \ rseq_barrier(); \ ____p1; \ })
@@ -52,7 +52,7 @@ __extension__ ({ \#define rseq_smp_store_release (p, v) \ do { \ rseq_barrier(); \ - RSEQ_WRITE_ONCE(*p, v); \ + RSEQ_WRITE_ONCE(*(p), v); \ } while (0) #define __RSEQ_ASM_DEFINE_TABLE(label, version, flags, \
tools/testing/selftests/user_events/Makefile +0 -8
@@ -2,14 +2,6 @@ CFLAGS += -Wl,-no-as-needed -Wall $(KHDR_INCLUDES) LDLIBS += -lrt -lpthread -lm -# Note: -# This test depends on <linux/user_events.h> exported in uapi -# The following commit removed user_events.h out of uapi: -# commit 5cfff569cab8bf544bab62c911c5d6efd5af5e05 -# tracing: Move user_events.h temporarily out of include/uapi -# This test will not compile until user_events.h is added -# back to uapi. - TEST_GEN_PROGS = ftrace_test dyn_test perf_test abi_test TEST_FILES := settings
The pull request you sent on Mon, 28 Aug 2023 09:18:10 -0600:
The pull request you sent on Mon, 28 Aug 2023 09:18:10 -0600:
Quoted 1 line
git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftesttags/linux-kselftest-next-6.6-rc1
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/5a31cc7297072a7266a910ca5266b640d27803b4
Thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/prtracker.html