From owner-svn-src-stable-11@freebsd.org Fri Oct 26 08:52:23 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9AD3010DC387; Fri, 26 Oct 2018 08:52:23 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5177C6D253; Fri, 26 Oct 2018 08:52:23 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 32AC51EADC; Fri, 26 Oct 2018 08:52:23 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9Q8qNfu015120; Fri, 26 Oct 2018 08:52:23 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9Q8qNFc015119; Fri, 26 Oct 2018 08:52:23 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201810260852.w9Q8qNFc015119@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 26 Oct 2018 08:52:23 +0000 (UTC) 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 X-SVN-Group: stable-11 X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: stable/11/sys/dev/hwpmc X-SVN-Commit-Revision: 339771 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Oct 2018 08:52:23 -0000 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,