|
From: <sv...@va...> - 2012-04-22 03:50:27
|
florian 2012-04-22 04:50:20 +0100 (Sun, 22 Apr 2012)
New Revision: 12534
Log:
Be lenient if the machine model could not be determined. Assume it's
a new machine as opposed to a too old machine.
Patch by Christian Borntraeger (bor...@de...) with additional
commentary. Fixes 298394.
Modified files:
trunk/coregrind/m_machine.c
Modified: trunk/coregrind/m_machine.c (+9 -7)
===================================================================
--- trunk/coregrind/m_machine.c 2012-04-22 03:58:49 +01:00 (rev 12533)
+++ trunk/coregrind/m_machine.c 2012-04-22 04:50:20 +01:00 (rev 12534)
@@ -467,7 +467,8 @@
processor 0: version = FF, identification = 0117C9, machine = 2064
- and return the machine model or VEX_S390X_MODEL_INVALID on error. */
+ and return the machine model. If the machine model could not be determined
+ or it is an unknown model, return VEX_S390X_MODEL_UNKNOWN. */
static UInt VG_(get_machine_model)(void)
{
@@ -494,7 +495,7 @@
/* Slurp contents of /proc/cpuinfo into FILE_BUF */
fd = VG_(open)( "/proc/cpuinfo", 0, VKI_S_IRUSR );
- if ( sr_isError(fd) ) return VEX_S390X_MODEL_INVALID;
+ if ( sr_isError(fd) ) return VEX_S390X_MODEL_UNKNOWN;
fh = sr_Res(fd);
@@ -527,7 +528,7 @@
VG_(close)(fh);
/* Parse file */
- model = VEX_S390X_MODEL_INVALID;
+ model = VEX_S390X_MODEL_UNKNOWN;
for (p = file_buf; *p; ++p) {
/* Beginning of line */
if (VG_(strncmp)( p, "processor", sizeof "processor" - 1 ) != 0) continue;
@@ -560,9 +561,8 @@
VG_(free)( file_buf );
VG_(debugLog)(1, "machine", "model = %s\n",
- model == VEX_S390X_MODEL_INVALID ? "UNKNOWN"
+ model == VEX_S390X_MODEL_UNKNOWN ? "UNKNOWN"
: model_map[model].name);
-
return model;
}
@@ -1084,12 +1084,14 @@
model = VG_(get_machine_model)();
+ /* If the model is "unknown" don't treat this as an error. Assume
+ this is a brand-new machine model for which we don't have the
+ identification yet. Keeping fingers crossed. */
+
VG_(debugLog)(1, "machine", "machine %d LDISP %d EIMM %d GIE %d DFP %d "
"FGX %d STFLE %d ETF2 %d\n", model, have_LDISP, have_EIMM,
have_GIE, have_DFP, have_FGX, have_STFLE, have_ETF2);
- if (model == VEX_S390X_MODEL_INVALID) return False;
-
vai.hwcaps = model;
if (have_LDISP) {
/* Use long displacement only on machines >= z990. For all other machines
|