Mark Wielaard c5d5c8
commit 1ab61656f71e94ce12b68de87f1e28cf3dc0c18c
Mark Wielaard c5d5c8
Author: mjw <mjw@8f6e269a-dfd6-0310-a8e1-e2731360e62c>
Mark Wielaard c5d5c8
Date:   Thu Oct 1 12:31:19 2015 +0000
Mark Wielaard c5d5c8
Mark Wielaard c5d5c8
    Don't advertise RDRAND in cpuid for Core-i7-4910-like avx2 machine.
Mark Wielaard c5d5c8
    
Mark Wielaard c5d5c8
    Bug#353370. In amd64g_dirtyhelper_CPUID_avx2 we set the RDRAND bit
Mark Wielaard c5d5c8
    but we don't implement support for RDRAND. Turn the bit off so programs
Mark Wielaard c5d5c8
    don't try to use RDRAND when running under valgrind.
Mark Wielaard c5d5c8
    
Mark Wielaard c5d5c8
    git-svn-id: svn://svn.valgrind.org/vex/trunk@3197 8f6e269a-dfd6-0310-a8e1-e2731360e62c
Mark Wielaard c5d5c8
Mark Wielaard c5d5c8
diff --git a/VEX/priv/guest_amd64_helpers.c b/VEX/priv/guest_amd64_helpers.c
Mark Wielaard c5d5c8
index e77d753..ab53e15 100644
Mark Wielaard c5d5c8
--- a/VEX/priv/guest_amd64_helpers.c
Mark Wielaard c5d5c8
+++ b/VEX/priv/guest_amd64_helpers.c
Mark Wielaard c5d5c8
@@ -3101,7 +3101,8 @@ void amd64g_dirtyhelper_CPUID_avx2 ( VexGuestAMD64State* st )
Mark Wielaard c5d5c8
          SET_ABCD(0x0000000d, 0x756e6547, 0x6c65746e, 0x49656e69);
Mark Wielaard c5d5c8
          break;
Mark Wielaard c5d5c8
       case 0x00000001:
Mark Wielaard c5d5c8
-         SET_ABCD(0x000306c3, 0x02100800, 0x7ffafbff, 0xbfebfbff);
Mark Wielaard c5d5c8
+         /* Don't advertise RDRAND support, bit 30 in ECX.  */
Mark Wielaard c5d5c8
+         SET_ABCD(0x000306c3, 0x02100800, 0x3ffafbff, 0xbfebfbff);
Mark Wielaard c5d5c8
          break;
Mark Wielaard c5d5c8
       case 0x00000002:
Mark Wielaard c5d5c8
          SET_ABCD(0x76036301, 0x00f0b6ff, 0x00000000, 0x00c10000);