Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F149017852
D41278.1789370979.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D41278.1789370979.diff
View Options
diff --git a/sys/dev/hwpmc/hwpmc_amd.c b/sys/dev/hwpmc/hwpmc_amd.c
--- a/sys/dev/hwpmc/hwpmc_amd.c
+++ b/sys/dev/hwpmc/hwpmc_amd.c
@@ -755,7 +755,6 @@
{
struct amd_cpu *pac;
struct pmc_cpu *pc;
- uint32_t evsel;
int first_ri, i;
KASSERT(cpu >= 0 && cpu < pmc_cpu_max(),
@@ -763,15 +762,6 @@
PMCDBG1(MDP, INI, 1, "amd-cleanup cpu=%d", cpu);
- /*
- * First, turn off all PMCs on this CPU.
- */
- for (i = 0; i < 4; i++) { /* XXX this loop is now not needed */
- evsel = rdmsr(AMD_PMC_EVSEL_0 + i);
- evsel &= ~AMD_PMC_ENABLE;
- wrmsr(AMD_PMC_EVSEL_0 + i, evsel);
- }
-
/*
* Next, free up allocated space.
*/
@@ -780,14 +770,19 @@
amd_pcpu[cpu] = NULL;
-#ifdef HWPMC_DEBUG
+ /* Verify PMC state assumptions for this CPU. */
for (i = 0; i < AMD_NPMCS; i++) {
KASSERT(pac->pc_amdpmcs[i].phw_pmc == NULL,
("[amd,%d] CPU%d/PMC%d in use", __LINE__, cpu, i));
- KASSERT(AMD_PMC_IS_STOPPED(AMD_PMC_EVSEL_0 + i),
+
+ if (i >= 6 && i < 12 && !has_cache_pmcs)
+ continue;
+ if (i >= 12 && i < 16 && !has_fabric_pmcs)
+ continue;
+
+ KASSERT(AMD_PMC_IS_STOPPED(amd_pmcdesc[i].pm_evsel),
("[amd,%d] CPU%d/PMC%d not stopped", __LINE__, cpu, i));
}
-#endif
pc = pmc_pcpu[cpu];
KASSERT(pc != NULL, ("[amd,%d] NULL per-cpu state", __LINE__));
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Sep 14, 7:29 AM (21 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29623167
Default Alt Text
D41278.1789370979.diff (1 KB)
Attached To
Mode
D41278: hwpmc_amd: improve assertions in amd_pcpu_fini()
Attached
Detach File
Event Timeline
Log In to Comment