|
Mark Wielaard |
66d255 |
From a88c168b4dd607bca47d3a1ec08573d3e5fa889b Mon Sep 17 00:00:00 2001
|
|
Mark Wielaard |
66d255 |
From: Florian Weimer <fweimer@redhat.com>
|
|
Mark Wielaard |
66d255 |
Date: Fri, 8 Jan 2021 15:08:50 +0100
|
|
Mark Wielaard |
66d255 |
Subject: [PATCH] ppc64: Mask unrecognized AT_HWCAP2 values
|
|
Mark Wielaard |
66d255 |
|
|
Mark Wielaard |
66d255 |
Also suppress printing a log message for scv instructions in the
|
|
Mark Wielaard |
66d255 |
instruction stream.
|
|
Mark Wielaard |
66d255 |
|
|
Mark Wielaard |
66d255 |
These changes are required for running glibc 2.33 on kernels with scv
|
|
Mark Wielaard |
66d255 |
support under valgrind.
|
|
Mark Wielaard |
66d255 |
---
|
|
Mark Wielaard |
66d255 |
VEX/priv/guest_ppc_toIR.c | 5 +++--
|
|
Mark Wielaard |
66d255 |
coregrind/m_initimg/initimg-linux.c | 6 ++++++
|
|
Mark Wielaard |
66d255 |
2 files changed, 9 insertions(+), 2 deletions(-)
|
|
Mark Wielaard |
66d255 |
|
|
Mark Wielaard |
66d255 |
diff --git a/VEX/priv/guest_ppc_toIR.c b/VEX/priv/guest_ppc_toIR.c
|
|
Mark Wielaard |
66d255 |
index e7b576fa2..99e96a577 100644
|
|
Mark Wielaard |
66d255 |
--- a/VEX/priv/guest_ppc_toIR.c
|
|
Mark Wielaard |
66d255 |
+++ b/VEX/priv/guest_ppc_toIR.c
|
|
Mark Wielaard |
66d255 |
@@ -8739,8 +8739,9 @@
|
|
Mark Wielaard |
66d255 |
{
|
|
Mark Wielaard |
66d255 |
IRType ty = mode64 ? Ity_I64 : Ity_I32;
|
|
Mark Wielaard |
66d255 |
|
|
Mark Wielaard |
66d255 |
- if (theInstr != 0x44000002) {
|
|
Mark Wielaard |
66d255 |
- vex_printf("dis_syslink(ppc)(theInstr)\n");
|
|
Mark Wielaard |
66d255 |
+ if (theInstr != 0x44000002) { // sc
|
|
Mark Wielaard |
66d255 |
+ if (theInstr != 0x44000001) // scv
|
|
Mark Wielaard |
66d255 |
+ vex_printf("dis_syslink(ppc)(theInstr)\n");
|
|
Mark Wielaard |
66d255 |
return False;
|
|
Mark Wielaard |
66d255 |
}
|
|
Mark Wielaard |
66d255 |
|
|
Mark Wielaard |
66d255 |
diff --git a/coregrind/m_initimg/initimg-linux.c b/coregrind/m_initimg/initimg-linux.c
|
|
Mark Wielaard |
66d255 |
index ba84fa6e9..fb68ae00b 100644
|
|
Mark Wielaard |
66d255 |
--- a/coregrind/m_initimg/initimg-linux.c
|
|
Mark Wielaard |
66d255 |
+++ b/coregrind/m_initimg/initimg-linux.c
|
|
Mark Wielaard |
66d255 |
@@ -750,6 +750,7 @@ Addr setup_client_stack( void* init_sp,
|
|
Mark Wielaard |
66d255 |
PPC_FEATURE2_HAS_ISEL 0x08000000
|
|
Mark Wielaard |
66d255 |
PPC_FEATURE2_HAS_TAR 0x04000000
|
|
Mark Wielaard |
66d255 |
PPC_FEATURE2_HAS_VCRYPTO 0x02000000
|
|
Mark Wielaard |
66d255 |
+ PPC_FEATURE2_HAS_IEEE128 0x00400000
|
|
Mark Wielaard |
66d255 |
*/
|
|
Mark Wielaard |
66d255 |
auxv_2_07 = (auxv->u.a_val & 0x80000000ULL) == 0x80000000ULL;
|
|
Mark Wielaard |
66d255 |
hw_caps_2_07 = (vex_archinfo->hwcaps & VEX_HWCAPS_PPC64_ISA2_07)
|
|
Mark Wielaard |
66d255 |
@@ -757,6 +757,11 @@
|
|
Mark Wielaard |
66d255 |
* matches the setting in VEX HWCAPS.
|
|
Mark Wielaard |
66d255 |
*/
|
|
Mark Wielaard |
66d255 |
vg_assert(auxv_2_07 == hw_caps_2_07);
|
|
Mark Wielaard |
66d255 |
+
|
|
Mark Wielaard |
66d255 |
+ /* Mask unrecognized HWCAP bits. Only keep the bits that have
|
|
Mark Wielaard |
66d255 |
+ * been mentioned above.
|
|
Mark Wielaard |
66d255 |
+ */
|
|
Mark Wielaard |
66d255 |
+ auxv->u.a_val &= 0xfec00000ULL;
|
|
Mark Wielaard |
66d255 |
}
|
|
Mark Wielaard |
66d255 |
|
|
Mark Wielaard |
66d255 |
break;
|
|
Mark Wielaard |
66d255 |
--- valgrind-3.16.1/VEX/priv/guest_ppc_toIR.c 2021-01-08 16:43:45.947122866 +0100
|
|
Mark Wielaard |
66d255 |
+++ guest_ppc_toIR.c.new 2021-01-08 16:43:40.238166866 +0100
|