Skip to contentSkip to conversation

lib: fix kernel-bit detection on s390 platform

PATCH New Li Wang 1 participant 1 message Nov 10, 2017 Library code

lore
Share & tools
lore

Li Wang

author
#0 lore raw

PATCH v2 1/2 lib: fix kernel-bit detection on s390 platform

This correction also fix the mmapstress03 issues on the latest kernel:
mmapstress03: errno = 25: really large mmap didn't fail

  mmapstress03    0  TINFO  :  uname.machine=s390x kernel is 32bit
  mmapstress03    1  TFAIL  :  mmapstress03.c:212: Test failed
---
 lib/tst_kernel.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
lib/tst_kernel.c +3 -1
index fd648b1..42d64cb 100644
@@ -34,8 +34,10 @@ int tst_kernel_bits(void)
 	/*
 	 * ARM64 (aarch64) defines 32-bit compatibility modes as
 	 * armv8l and armv8b (little and big endian).
+	 * s390x is 64bit but not contain 64 in the words.
 	 */
-	if (!strcmp(buf.machine, "armv8l") || !strcmp(buf.machine, "armv8b"))
+	if (!strcmp(buf.machine, "armv8l") || !strcmp(buf.machine, "armv8b")
+			|| !strcmp(buf.machine, "s390x"))
 		kernel_bits = 64;
 
 	tst_resm(TINFO, "uname.machine=%s kernel is %ibit",
Signature · 1 line
2.9.3