Skip to contentSkip to conversation

selftests/powerpc: Add test case for tlbie vs mtpidr ordering issue

PATCH In review Sandipan Das 2 participants 3 messages Oct 17, 2019 – Nov 8, 2019 Stable branch

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 selftests/powerpc: Add test case for tlbie vs mtpidr ordering issue

From: "Aneesh Kumar K.V" <[email protected]>

commit 93cad5f789951eaa27c3392b15294b4e51253944 upstream.

[mpe: Some minor fixes to make it build]
[sandipan: Backported to v5.3]
---
 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
index f1fbc15800c4..ed1565809d2b 100644
@@ -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
#1 lore raw

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
index 9868a5ddd847..f85a0938ab25 100644
@@ -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
maintainer
#2 lore raw
In reply to Sandipan Das
Quoted 11 lines · Sandipan Das

From: "Aneesh Kumar K.V" <[email protected]>

commit 93cad5f789951eaa27c3392b15294b4e51253944 upstream.

[mpe: Some minor fixes to make it build]
[sandipan: Backported to v5.3]
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