diff --git a/valgrind-3.13.0-arm64-hwcap.patch b/valgrind-3.13.0-arm64-hwcap.patch index 8f2a070..676b647 100644 --- a/valgrind-3.13.0-arm64-hwcap.patch +++ b/valgrind-3.13.0-arm64-hwcap.patch @@ -1,17 +1,79 @@ +commit 6bb6c8a65a341a67bd059ec6e1c805813eb17264 +Author: Mark Wielaard +Date: Tue Jun 19 18:00:45 2018 +0200 + + Mask AT_HWCAPS on arm64 to those instructions VEX implements. + + This patch makes sure that the process running under valgrind only sees + the AES, PMULL, SHA1, SHA2, CRC32, FP, and ASIMD features in auxv AT_HWCAPS. + + https://bugs.kde.org/show_bug.cgi?id=381556 + diff --git a/coregrind/m_initimg/initimg-linux.c b/coregrind/m_initimg/initimg-linux.c -index 30e1f85..387beae 100644 +index 30e1f85..61cc458 100644 --- a/coregrind/m_initimg/initimg-linux.c +++ b/coregrind/m_initimg/initimg-linux.c -@@ -703,6 +703,12 @@ Addr setup_client_stack( void* init_sp, +@@ -703,6 +703,19 @@ Addr setup_client_stack( void* init_sp, (and anything above) are not supported by Valgrind. */ auxv->u.a_val &= VKI_HWCAP_S390_TE - 1; } +# elif defined(VGP_arm64_linux) + { -+ /* Linux 4.11 started pupulating this for arm64, but we -+ currently don't support any. */ -+ auxv->u.a_val = 0; ++ /* Limit the AT_HWCAP to just those features we explicitly ++ support in VEX. */ ++#define ARM64_SUPPORTED_HWCAP (VKI_HWCAP_AES \ ++ | VKI_HWCAP_PMULL \ ++ | VKI_HWCAP_SHA1 \ ++ | VKI_HWCAP_SHA2 \ ++ | VKI_HWCAP_CRC32 \ ++ | VKI_HWCAP_FP \ ++ | VKI_HWCAP_ASIMD) ++ auxv->u.a_val &= ARM64_SUPPORTED_HWCAP; + } # endif break; # if defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux) +diff --git a/include/vki/vki-arm64-linux.h b/include/vki/vki-arm64-linux.h +index af6b435..54b0428 100644 +--- a/include/vki/vki-arm64-linux.h ++++ b/include/vki/vki-arm64-linux.h +@@ -692,6 +692,39 @@ struct vki_shminfo64 { + #define VKI_TIOCSSERIAL 0x541F + + //---------------------------------------------------------------------- ++// From linux-4.17/include/uapi/asm-generic/ioctls.h ++//---------------------------------------------------------------------- ++ ++#define VKI_HWCAP_FP (1 << 0) ++#define VKI_HWCAP_ASIMD (1 << 1) ++#define VKI_HWCAP_EVTSTRM (1 << 2) ++#define VKI_HWCAP_AES (1 << 3) ++#define VKI_HWCAP_PMULL (1 << 4) ++#define VKI_HWCAP_SHA1 (1 << 5) ++#define VKI_HWCAP_SHA2 (1 << 6) ++#define VKI_HWCAP_CRC32 (1 << 7) ++#define VKI_HWCAP_ATOMICS (1 << 8) ++#define VKI_HWCAP_FPHP (1 << 9) ++#define VKI_HWCAP_ASIMDHP (1 << 10) ++#define VKI_HWCAP_CPUID (1 << 11) ++#define VKI_HWCAP_ASIMDRDM (1 << 12) ++#define VKI_HWCAP_JSCVT (1 << 13) ++#define VKI_HWCAP_FCMA (1 << 14) ++#define VKI_HWCAP_LRCPC (1 << 15) ++#define VKI_HWCAP_DCPOP (1 << 16) ++#define VKI_HWCAP_SHA3 (1 << 17) ++#define VKI_HWCAP_SM3 (1 << 18) ++#define VKI_HWCAP_SM4 (1 << 19) ++#define VKI_HWCAP_ASIMDDP (1 << 20) ++#define VKI_HWCAP_SHA512 (1 << 21) ++#define VKI_HWCAP_SVE (1 << 22) ++#define VKI_HWCAP_ASIMDFHM (1 << 23) ++#define VKI_HWCAP_DIT (1 << 24) ++#define VKI_HWCAP_USCAT (1 << 25) ++#define VKI_HWCAP_ILRCPC (1 << 26) ++#define VKI_HWCAP_FLAGM (1 << 27) ++ ++//---------------------------------------------------------------------- + // And that's it! + //---------------------------------------------------------------------- + diff --git a/valgrind.spec b/valgrind.spec index afeb669..28f9280 100644 --- a/valgrind.spec +++ b/valgrind.spec @@ -3,7 +3,7 @@ Summary: Tool for finding memory management bugs in programs Name: %{?scl_prefix}valgrind Version: 3.13.0 -Release: 18%{?dist} +Release: 19%{?dist} Epoch: 1 License: GPLv2+ URL: http://www.valgrind.org/ @@ -546,6 +546,9 @@ echo ===============END TESTING=============== %endif %changelog +* Thu Apr 12 2018 Mark Wielaard - 3.13.0-19 +- Improved valgrind-3.13.0-arm64-hwcap.patch + * Thu Apr 12 2018 Mark Wielaard - 3.13.0-18 - Add valgrind-3.13.0-build-id-phdrs.patch (#1566639)