Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 May 2013 16:43:53 +0000 (UTC)
From:      Hiren Panchasara <hiren@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r250373 - stable/9/sys/dev/hwpmc
Message-ID:  <201305081643.r48GhrU6092247@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hiren
Date: Wed May  8 16:43:52 2013
New Revision: 250373
URL: http://svnweb.freebsd.org/changeset/base/250373

Log:
  MFC: 233569
  
  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.
  
  Submitted by:	gonzo
  Reported by:	Alexandr Kovalenko <never@nevermind.kiev.ua>
  Approved by:	sbruno (mentor)

Modified:
  stable/9/sys/dev/hwpmc/hwpmc_core.c
  stable/9/sys/dev/hwpmc/hwpmc_intel.c

Modified: stable/9/sys/dev/hwpmc/hwpmc_core.c
==============================================================================
--- stable/9/sys/dev/hwpmc/hwpmc_core.c	Wed May  8 16:31:11 2013	(r250372)
+++ stable/9/sys/dev/hwpmc/hwpmc_core.c	Wed May  8 16:43:52 2013	(r250373)
@@ -2613,8 +2613,12 @@ pmc_core_initialize(struct pmc_mdep *md,
 	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;
 

Modified: stable/9/sys/dev/hwpmc/hwpmc_intel.c
==============================================================================
--- stable/9/sys/dev/hwpmc/hwpmc_intel.c	Wed May  8 16:31:11 2013	(r250372)
+++ stable/9/sys/dev/hwpmc/hwpmc_intel.c	Wed May  8 16:43:52 2013	(r250373)
@@ -250,6 +250,9 @@ pmc_intel_initialize(void)
 		KASSERT(0, ("[intel,%d] Unknown CPU type", __LINE__));
 	}
 
+	if (error)
+		goto error;
+
 	/*
 	 * Init the uncore class.
 	 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201305081643.r48GhrU6092247>