]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Support SCV_FLAG also on VGP_ppc64be_linux
authorMark Wielaard <mark@klomp.org>
Fri, 28 Apr 2023 11:34:48 +0000 (13:34 +0200)
committerMark Wielaard <mark@klomp.org>
Fri, 28 Apr 2023 13:08:44 +0000 (15:08 +0200)
Running on a kernel that supports the SCV instruction (sets
PPC_FEATURE2_SCV in auxv AT_HWCAPS2) valgrind will assert: valgrind:
m_syswrap/syswrap-main.c:549 (getSyscallArgsFromGuestState): Assertion
'gst->guest_syscall_flag == SC_FLAG' failed.

Removing that assert makes most things work. But also filter out
PPC_FEATURE2_SCV from AT_HWCAPS2 for the client, so it shouldn't try
using the SCV instruction.

https://bugs.kde.org/show_bug.cgi?id=469097

NEWS
coregrind/m_initimg/initimg-linux.c
coregrind/m_syswrap/syswrap-main.c

diff --git a/NEWS b/NEWS
index 22d5d4a1d8ddf46d0050bbdb18c170326ac65aad..118c5e65d0ea6ac23d4693db08f5974ed5aa70cd 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -188,6 +188,7 @@ are not entered into bugzilla tend to get forgotten about or ignored.
 468401  [PATCH] Add a style file for clang-format
 468556  Build failure for vgdb
 468606  build: remove "Valgrind relies on GCC" check/output
+469097  ppc64(be) doesn't support SCV syscall instruction
 n-i-bz  FreeBSD rfork syscall fail with EINVAL or ENOSYS rather than VG_(unimplemented)
 
 To see details of a given bug, visit
index 4da9a8b9760b42f98e6634ea9d83954d9caf1d0b..7a7d453350e9f5a5288096f3788cd066c76b31da 100644 (file)
@@ -852,7 +852,11 @@ Addr setup_client_stack( void*  init_sp,
                               | 0x04000000ULL   /* TAR */
                               | 0x04000000ULL   /* VEC_CRYPTO */
                               | 0x00800000ULL   /* ARCH_3_00 */
+#if defined(VGP_ppc64le_linux)
+   /* Should also be supported on ppc64be,
+      but see https://bugs.kde.org/show_bug.cgi?id=469097  */
                               | 0x00100000ULL   /* PPC_FEATURE2_SCV */
+#endif
                               | 0x00400000ULL   /* HAS_IEEE128 */
                               | 0x00200000ULL   /* PPC_FEATURE2_DARN */
                               | 0x00040000ULL   /* ARCH_3_1 */
index abd8472e925af4dd1e148bcb8dd79ca076db74ce..4f8c0fe1cb8d0fbfe38dbe3ca8d50062ce4614af 100644 (file)
@@ -544,11 +544,6 @@ void getSyscallArgsFromGuestState ( /*OUT*/SyscallArgs*       canonical,
    canonical->arg7  = gst->guest_syscall_flag;
    canonical->arg8  = 0;
 
-#if defined(VGP_ppc64be_linux)
-   /* The sc instruction is currently only supported on LE systems. */
-   vg_assert(gst->guest_syscall_flag == SC_FLAG);
-#endif
-
 #elif defined(VGP_x86_freebsd)
    VexGuestX86State* gst = (VexGuestX86State*)gst_vanilla;
    UWord *stack = (UWord *)gst->guest_ESP;