From c385d80abd8fd0f1aa1d514e046da96dc2011175 Mon Sep 17 00:00:00 2001 From: Laurynas Biveinis Date: Wed, 30 Jan 2019 10:16:55 +0200 Subject: Fix PS-5388 (Enable hardware CRC32 under Valgrind) Valgrind started supporting CRC32 instruction starting with version 3.6.1, released in 2011. Thus remove the fallback to software implementation in case running under Valgrind. --- storage/innobase/ut/ut0crc32.cc | 19 ------------------- storage/xtradb/ut/ut0crc32.cc | 19 ------------------- 2 files changed, 38 deletions(-) diff --git a/storage/innobase/ut/ut0crc32.cc b/storage/innobase/ut/ut0crc32.cc index cdf036e9d50..4d2d311ff48 100644 --- a/storage/innobase/ut/ut0crc32.cc +++ b/storage/innobase/ut/ut0crc32.cc @@ -316,26 +316,7 @@ ut_crc32_init() ut_cpuid(vend, &model, &family, &stepping, &features_ecx, &features_edx); - /* Valgrind does not understand the CRC32 instructions: - - vex amd64->IR: unhandled instruction bytes: 0xF2 0x48 0xF 0x38 0xF0 0xA - valgrind: Unrecognised instruction at address 0xad3db5. - Your program just tried to execute an instruction that Valgrind - did not recognise. There are two possible reasons for this. - 1. Your program has a bug and erroneously jumped to a non-code - location. If you are running Memcheck and you just saw a - warning about a bad jump, it's probably your program's fault. - 2. The instruction is legitimate but Valgrind doesn't handle it, - i.e. it's Valgrind's fault. If you think this is the case or - you are not sure, please let us know and we'll try to fix it. - Either way, Valgrind will now raise a SIGILL signal which will - probably kill your program. - - */ -#ifndef UNIV_DEBUG_VALGRIND ut_crc32_sse2_enabled = (features_ecx >> 20) & 1; -#endif /* UNIV_DEBUG_VALGRIND */ - #endif /* defined(__GNUC__) && defined(__x86_64__) */ #if defined(__linux__) && defined(__powerpc__) && defined(AT_HWCAP2) \ diff --git a/storage/xtradb/ut/ut0crc32.cc b/storage/xtradb/ut/ut0crc32.cc index f8e93ee7581..4ace913726d 100644 --- a/storage/xtradb/ut/ut0crc32.cc +++ b/storage/xtradb/ut/ut0crc32.cc @@ -316,26 +316,7 @@ ut_crc32_init() ut_cpuid(vend, &model, &family, &stepping, &features_ecx, &features_edx); - /* Valgrind does not understand the CRC32 instructions: - - vex amd64->IR: unhandled instruction bytes: 0xF2 0x48 0xF 0x38 0xF0 0xA - valgrind: Unrecognised instruction at address 0xad3db5. - Your program just tried to execute an instruction that Valgrind - did not recognise. There are two possible reasons for this. - 1. Your program has a bug and erroneously jumped to a non-code - location. If you are running Memcheck and you just saw a - warning about a bad jump, it's probably your program's fault. - 2. The instruction is legitimate but Valgrind doesn't handle it, - i.e. it's Valgrind's fault. If you think this is the case or - you are not sure, please let us know and we'll try to fix it. - Either way, Valgrind will now raise a SIGILL signal which will - probably kill your program. - - */ -#ifndef UNIV_DEBUG_VALGRIND ut_crc32_sse2_enabled = (features_ecx >> 20) & 1; -#endif /* UNIV_DEBUG_VALGRIND */ - #endif /* defined(__GNUC__) && defined(__x86_64__) */ #if defined(__linux__) && defined(__powerpc__) && defined(AT_HWCAP2) \ -- cgit v1.2.1