Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F146681501
D55607.id172989.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
860 B
Referenced Files
None
Subscribers
None
D55607.id172989.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
@@ -655,7 +655,24 @@
KASSERT(ri >= 0 && ri < amd_npmcs,
("[amd,%d] ri %d out of range", __LINE__, ri));
- *msr = amd_pmcdesc[ri].pm_perfctr - AMD_PMC_PERFCTR_0;
+ switch (amd_pmcdesc[ri].pm_subclass) {
+ case PMC_AMD_SUB_CLASS_CORE:
+ if (amd_pmcdesc[ri].pm_perfctr >= AMD_PMC_CORE_BASE)
+ *msr = (amd_pmcdesc[ri].pm_perfctr -
+ AMD_PMC_CORE_BASE) / 2;
+ else
+ *msr = amd_pmcdesc[ri].pm_perfctr -
+ AMD_PMC_PERFCTR_0;
+ break;
+ case PMC_AMD_SUB_CLASS_L3_CACHE:
+ *msr = (amd_pmcdesc[ri].pm_perfctr - AMD_PMC_L3_BASE) / 2;
+ break;
+ case PMC_AMD_SUB_CLASS_DATA_FABRIC:
+ *msr = (amd_pmcdesc[ri].pm_perfctr - AMD_PMC_DF_BASE) / 2;
+ break;
+ default:
+ return (EINVAL);
+ }
return (0);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Mar 5, 4:35 PM (21 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29177229
Default Alt Text
D55607.id172989.diff (860 B)
Attached To
Mode
D55607: hwpmc_amd: fix amd_get_msr() MSR offset for newer counter bases
Attached
Detach File
Event Timeline
Log In to Comment