Fix crash on VirtualBox (and probably on some real hardware):

- Do not cover error returned by pmc_core_initialize with the
    result of pmc_uncore_initialize, fail right away.
- Give a user something to report instead failing silently

Reported by:	Alexandr Kovalenko <never@nevermind.kiev.ua>
This commit is contained in:
gonzo 2012-03-27 18:22:14 +00:00
parent 1da5145831
commit edf893b531
2 changed files with 8 additions and 1 deletions

View File

@ -2406,8 +2406,12 @@ pmc_core_initialize(struct pmc_mdep *md, int maxcpu)
PMCDBG(MDP,INI,1,"core-init cputype=%d ncpu=%d ipa-version=%d",
md->pmd_cputype, maxcpu, ipa_version);
if (ipa_version < 1 || ipa_version > 3) /* Unknown PMC architecture. */
if (ipa_version < 1 || ipa_version > 3) {
/* Unknown PMC architecture. */
printf("hwpc_core: unknown PMC architecture: %d\n",
ipa_version);
return (EPROGMISMATCH);
}
core_cputype = md->pmd_cputype;

View File

@ -239,6 +239,9 @@ pmc_intel_initialize(void)
KASSERT(0, ("[intel,%d] Unknown CPU type", __LINE__));
}
if (error)
goto error;
/*
* Init the uncore class.
*/