fc35c71aea
* 0183-syscall-do-not-use-uninitialized-parts-of-struct-ptr.patch: New file. * 0184-startup_tcb-add-a-comment.patch: Likewise. * 0185-tests-add-another-test-of-restart_syscall-decoding.patch: Likewise. * 0186-tests-workaround-net-yy-inet-for-new-kernels.patch: Likewise. * 0187-tests-avoid-linkat-secontext_mismatch-failures-on-se.patch: Likewise. * 0188-linux-s390-get_scno.c-use-NT_S390_SYSTEM_CALL-if-gpr.patch: Likewise. * 0191-prctl-improve-PR_SVE_-SG-ET_VL-decoding.patch: Likewise. * 0192-tests-prctl-sve-fix-prctl-PR_SVE_GET_VL-return-expec.patch: Likewise. * strace.spec (Patch183, Patch184, Patch185, Patch186, Patch187, Patch188, Patch191, Patch192): New patches. (%prep): Apply them. (%changelog): Add a record. Resolves: RHEL-8570 Signed-off-by: Eugene Syromiatnikov <esyr@redhat.com>
131 lines
3.6 KiB
Diff
131 lines
3.6 KiB
Diff
From 3ed268876dd5b65263449f9aeb18a1cc2604c707 Mon Sep 17 00:00:00 2001
|
|
From: Eugene Syromyatnikov <evgsyr@gmail.com>
|
|
Date: Tue, 25 Apr 2023 18:11:21 +0200
|
|
Subject: [PATCH] tests/prctl-sve: fix prctl(PR_SVE_GET_VL) return expected
|
|
value printing
|
|
|
|
* tests/prctl-sve.c: Print the expected return value string based
|
|
on the value returned, similarly to the way it is done
|
|
in tests/prctl-sme.c:print_sme_vl_arg().
|
|
|
|
Fixes: v5.13~8 "tests: improve test coverage of prctl syscall decoder"
|
|
Closes: https://github.com/strace/strace/issues/251
|
|
---
|
|
tests/prctl-sve.c | 24 ++++++++++++++++++++----
|
|
1 file changed, 20 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/tests/prctl-sve.c b/tests/prctl-sve.c
|
|
index 4cef149cfec6..216ebfc3f92c 100644
|
|
--- a/tests/prctl-sve.c
|
|
+++ b/tests/prctl-sve.c
|
|
@@ -43,12 +43,28 @@ main(void)
|
|
(unsigned long) 0xff, sprintrc(rc));
|
|
|
|
rc = syscall(__NR_prctl, PR_SVE_GET_VL);
|
|
- printf("prctl(PR_SVE_GET_VL) = %s", sprintrc(rc));
|
|
+ printf("prctl(PR_SVE_GET_VL) = ");
|
|
if (rc >= 0) {
|
|
- printf(" (PR_SVE_SET_VL_ONEXEC|PR_SVE_VL_INHERIT|%#lx)",
|
|
- (unsigned long) 0xff);
|
|
+ printf("%#lx", rc);
|
|
+ if (rc > 0xffff) {
|
|
+ printf(" (");
|
|
+ if (rc & PR_SVE_SET_VL_ONEXEC)
|
|
+ printf("PR_SVE_SET_VL_ONEXEC");
|
|
+ if (rc & PR_SVE_VL_INHERIT) {
|
|
+ printf("%sPR_SVE_VL_INHERIT",
|
|
+ rc & PR_SVE_SET_VL_ONEXEC ? "|" : "");
|
|
+ }
|
|
+ if (rc & ~0x6ffffU) {
|
|
+ printf("%s%#lx",
|
|
+ rc & 0x60000 ? "|" : "", rc & ~0x6ffffU);
|
|
+ }
|
|
+ printf("|%#lx)\n", rc & 0xffffU);
|
|
+ } else {
|
|
+ puts("");
|
|
+ }
|
|
+ } else {
|
|
+ puts(sprintrc(rc));
|
|
}
|
|
- puts("");
|
|
|
|
puts("+++ exited with 0 +++");
|
|
return 0;
|
|
diff --git a/tests-m32/prctl-sve.c b/tests-m32/prctl-sve.c
|
|
index 4cef149cfec6..216ebfc3f92c 100644
|
|
--- a/tests-m32/prctl-sve.c
|
|
+++ b/tests-m32/prctl-sve.c
|
|
@@ -43,12 +43,28 @@ main(void)
|
|
(unsigned long) 0xff, sprintrc(rc));
|
|
|
|
rc = syscall(__NR_prctl, PR_SVE_GET_VL);
|
|
- printf("prctl(PR_SVE_GET_VL) = %s", sprintrc(rc));
|
|
+ printf("prctl(PR_SVE_GET_VL) = ");
|
|
if (rc >= 0) {
|
|
- printf(" (PR_SVE_SET_VL_ONEXEC|PR_SVE_VL_INHERIT|%#lx)",
|
|
- (unsigned long) 0xff);
|
|
+ printf("%#lx", rc);
|
|
+ if (rc > 0xffff) {
|
|
+ printf(" (");
|
|
+ if (rc & PR_SVE_SET_VL_ONEXEC)
|
|
+ printf("PR_SVE_SET_VL_ONEXEC");
|
|
+ if (rc & PR_SVE_VL_INHERIT) {
|
|
+ printf("%sPR_SVE_VL_INHERIT",
|
|
+ rc & PR_SVE_SET_VL_ONEXEC ? "|" : "");
|
|
+ }
|
|
+ if (rc & ~0x6ffffU) {
|
|
+ printf("%s%#lx",
|
|
+ rc & 0x60000 ? "|" : "", rc & ~0x6ffffU);
|
|
+ }
|
|
+ printf("|%#lx)\n", rc & 0xffffU);
|
|
+ } else {
|
|
+ puts("");
|
|
+ }
|
|
+ } else {
|
|
+ puts(sprintrc(rc));
|
|
}
|
|
- puts("");
|
|
|
|
puts("+++ exited with 0 +++");
|
|
return 0;
|
|
diff --git a/tests-mx32/prctl-sve.c b/tests-mx32/prctl-sve.c
|
|
index 4cef149cfec6..216ebfc3f92c 100644
|
|
--- a/tests-mx32/prctl-sve.c
|
|
+++ b/tests-mx32/prctl-sve.c
|
|
@@ -43,12 +43,28 @@ main(void)
|
|
(unsigned long) 0xff, sprintrc(rc));
|
|
|
|
rc = syscall(__NR_prctl, PR_SVE_GET_VL);
|
|
- printf("prctl(PR_SVE_GET_VL) = %s", sprintrc(rc));
|
|
+ printf("prctl(PR_SVE_GET_VL) = ");
|
|
if (rc >= 0) {
|
|
- printf(" (PR_SVE_SET_VL_ONEXEC|PR_SVE_VL_INHERIT|%#lx)",
|
|
- (unsigned long) 0xff);
|
|
+ printf("%#lx", rc);
|
|
+ if (rc > 0xffff) {
|
|
+ printf(" (");
|
|
+ if (rc & PR_SVE_SET_VL_ONEXEC)
|
|
+ printf("PR_SVE_SET_VL_ONEXEC");
|
|
+ if (rc & PR_SVE_VL_INHERIT) {
|
|
+ printf("%sPR_SVE_VL_INHERIT",
|
|
+ rc & PR_SVE_SET_VL_ONEXEC ? "|" : "");
|
|
+ }
|
|
+ if (rc & ~0x6ffffU) {
|
|
+ printf("%s%#lx",
|
|
+ rc & 0x60000 ? "|" : "", rc & ~0x6ffffU);
|
|
+ }
|
|
+ printf("|%#lx)\n", rc & 0xffffU);
|
|
+ } else {
|
|
+ puts("");
|
|
+ }
|
|
+ } else {
|
|
+ puts(sprintrc(rc));
|
|
}
|
|
- puts("");
|
|
|
|
puts("+++ exited with 0 +++");
|
|
return 0;
|
|
--
|
|
2.28.0
|
|
|