Date: Fri, 26 Oct 2018 08:52:23 +0000 (UTC) From: Matt Macy <mmacy@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r339771 - stable/11/sys/dev/hwpmc Message-ID: <201810260852.w9Q8qNFc015119@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mmacy Date: Fri Oct 26 08:52:22 2018 New Revision: 339771 URL: https://svnweb.freebsd.org/changeset/base/339771 Log: fix up more issues introduced by failing to have run TB before r339767 Modified: stable/11/sys/dev/hwpmc/hwpmc_amd.c Modified: stable/11/sys/dev/hwpmc/hwpmc_amd.c ============================================================================== --- stable/11/sys/dev/hwpmc/hwpmc_amd.c Fri Oct 26 08:12:28 2018 (r339770) +++ stable/11/sys/dev/hwpmc/hwpmc_amd.c Fri Oct 26 08:52:22 2018 (r339771) @@ -816,11 +816,12 @@ amd_intr(int cpu, struct trapframe *tf) v = pm->pm_sc.pm_reloadcount; config = rdmsr(evsel); + KASSERT((config & ~AMD_PMC_ENABLE) == (pm->pm_md.pm_amd.pm_amd_evsel & ~AMD_PMC_ENABLE), - ("[amd,%d] config mismatch reg=0x%x pm=0x%x", __LINE__, - config, pm->pm_md.pm_amd.pm_amd_evsel)); - + ("[amd,%d] config mismatch reg=0x%jx pm=0x%jx", __LINE__, + (uintmax_t)config, (uintmax_t)pm->pm_md.pm_amd.pm_amd_evsel)); + wrmsr(evsel, config & ~AMD_PMC_ENABLE); wrmsr(perfctr, AMD_RELOAD_COUNT_TO_PERFCTR_VALUE(v)); @@ -1195,9 +1196,12 @@ pmc_amd_finalize(struct pmc_mdep *md) } else if (AMD_cpufamily == 0x17) { classindex = PMC_MDEP_CLASS_INDEX_F17H; pmcclass = PMC_CLASS_F17H; - } else + } else { + classindex = PMC_MDEP_CLASS_INDEX_K8; + pmcclass = PMC_CLASS_K8; (void) printf("pmc:AMD CPU family unknown.\n"); - + } + } KASSERT(md->pmd_classdep[classindex].pcd_class == pmcclass,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201810260852.w9Q8qNFc015119>