selftests/powerpc: Add test case for tlbie vs mtpidr ordering issue
PATCH 1/2 selftests/powerpc: Add test case for tlbie vs mtpidr ordering issue
From: "Aneesh Kumar K.V" <[email protected]>
commit 93cad5f789951eaa27c3392b15294b4e51253944 upstream.
--- tools/testing/selftests/powerpc/mm/Makefile | 2 + .../testing/selftests/powerpc/mm/tlbie_test.c | 734 ++++++++++++++++++ 2 files changed, 736 insertions(+) create mode 100644 tools/testing/selftests/powerpc/mm/tlbie_test.c
tools/testing/selftests/powerpc/mm/Makefile +2 -0
@@ -4,6 +4,7 @@ noarg: TEST_GEN_PROGS := hugetlb_vs_thp_test subpage_prot prot_sao segv_errors wild_bctr \ large_vm_fork_separation +TEST_GEN_PROGS_EXTENDED := tlbie_test TEST_GEN_FILES := tempfile top_srcdir = ../../../../..
@@ -19,3 +20,4 @@ $(OUTPUT)/large_vm_fork_separation: CFLAGS += -m64 $(OUTPUT)/tempfile: dd if=/dev/zero of=$@ bs=64k count=1 +$(OUTPUT)/tlbie_test: LDLIBS += -lpthread
tools/testing/selftests/powerpc/mm/tlbie_test.c new file +734 -0
734 lines not on this page · raw message
Signature · 1 line
2.21.0
PATCH 2/2 selftests/powerpc: Fix compile error on tlbie_test due to newer gcc
From: "Desnes A. Nunes do Rosario" <[email protected]>
commit 5b216ea1c40cf06eead15054c70e238c9bd4729e upstream.
Newer versions of GCC (>= 9) demand that the size of the string to be copied must be explicitly smaller than the size of the destination. Thus, the NULL char has to be taken into account on strncpy.
This will avoid the following compiling error:
tlbie_test.c: In function 'main':
tlbie_test.c:639:4: error: 'strncpy' specified bound 100 equals destination size
strncpy(logdir, optarg, LOGDIR_NAME_SIZE);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~cc1: all warnings being treated as errors
--- tools/testing/selftests/powerpc/mm/tlbie_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/powerpc/mm/tlbie_test.c +1 -1
@@ -636,7 +636,7 @@ int main(int argc, char *argv[]) nrthreads =strtoul (optarg,NULL ,10 );break ;case 'l' : -strncpy (logdir, optarg,LOGDIR_NAME_SIZE ); +strncpy (logdir, optarg,LOGDIR_NAME_SIZE -1 );break ;case 't' : run_time =strtoul (optarg,NULL ,10 );
Signature · 1 line
2.21.0
Greg KH
maintainerQuoted 11 lines · Sandipan Das
From: "Aneesh Kumar K.V" <[email protected]>
commit
93cad5f789951eaa27c3392b15294b4e51253944upstream.Cc [email protected] # v5.3Signed-off-by Aneesh Kumar K.V <[email protected]>[mpe: Some minor fixes to make it build]Signed-off-by Michael Ellerman <[email protected]>[sandipan: Backported to v5.3]Signed-off-by Sandipan Das <[email protected]>
Quoted 5 lines
--- tools/testing/selftests/powerpc/mm/Makefile | 2 + .../testing/selftests/powerpc/mm/tlbie_test.c | 734 ++++++++++++++++++ 2 files changed, 736 insertions(+) create mode 100644 tools/testing/selftests/powerpc/mm/tlbie_test.c
Both queued up, thanks.
greg k-h