|
From: <sv...@va...> - 2014-11-11 12:49:28
|
Author: sewardj
Date: Tue Nov 11 12:49:21 2014
New Revision: 2989
Log:
Add a nasty temporary kludge to CPUID that allows 64-bit MacOSX 10.10
(Yosemite) to run, until such time as XSAVE and XRSTOR are implemented.
Detailed in the comments. All other targets should be unaffected.
Modified:
trunk/priv/guest_amd64_toIR.c
Modified: trunk/priv/guest_amd64_toIR.c
==============================================================================
--- trunk/priv/guest_amd64_toIR.c (original)
+++ trunk/priv/guest_amd64_toIR.c Tue Nov 11 12:49:21 2014
@@ -21434,13 +21434,33 @@
void amd64g_dirtyhelper_CPUID ( VexGuestAMD64State* )
declared to mod rax, wr rbx, rcx, rdx
*/
- IRDirty* d = NULL;
- const HChar* fName = NULL;
- void* fAddr = NULL;
+ IRDirty* d = NULL;
+ const HChar* fName = NULL;
+ void* fAddr = NULL;
+
+ /* JRS 2014-11-11: this a really horrible temp kludge to work
+ around the fact that the Yosemite (OSX 10.10)
+ /usr/lib/system/libdyld.dylib expects XSAVE/XRSTOR to be
+ implemented, because amd64g_dirtyhelper_CPUID_avx_and_cx16
+ claims they are supported, but so far they aren't. So cause
+ it to fall back to a simpler CPU. The cleaner approach of
+ setting CPUID(eax=1).OSXSAVE=0 and .XSAVE=0 isn't desirable
+ since it will (per the official Intel guidelines) lead to
+ software concluding that AVX isn't supported.
+
+ This is also a kludge in that putting these ifdefs here checks
+ the build (host) architecture, when really we're checking the
+ guest architecture. */
+ Bool this_is_yosemite = False;
+# if defined(VGP_amd64_darwin) && DARWIN_VERS == DARWIN_10_10
+ this_is_yosemite = True;
+# endif
+
if (haveF2orF3(pfx)) goto decode_failure;
/* This isn't entirely correct, CPUID should depend on the VEX
capabilities, not on the underlying CPU. See bug #324882. */
- if ((archinfo->hwcaps & VEX_HWCAPS_AMD64_SSE3) &&
+ if (!this_is_yosemite &&
+ (archinfo->hwcaps & VEX_HWCAPS_AMD64_SSE3) &&
(archinfo->hwcaps & VEX_HWCAPS_AMD64_CX16) &&
(archinfo->hwcaps & VEX_HWCAPS_AMD64_AVX)) {
fName = "amd64g_dirtyhelper_CPUID_avx_and_cx16";
|