Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177939621
D61368.1795606577.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D61368.1795606577.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
@@ -840,7 +840,10 @@
config = pm->pm_md.pm_amd.pm_amd_evsel & ~AMD_PMC_UMC_ENABLE;
} else {
- KASSERT(!AMD_PMC_IS_STOPPED(pd->pm_evsel),
+ /* NMI stops must set pps_stalled. */
+ KASSERT(!AMD_PMC_IS_STOPPED(pd->pm_evsel) ||
+ (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm)) &&
+ pm->pm_pcpu_state[cpu].pps_stalled != 0),
("[amd,%d] PMC%d, CPU%d \"%s\" already stopped",
__LINE__, ri, cpu, pd->pm_descr.pd_name));
@@ -854,12 +857,16 @@
* panic or messages based on kernel configuration
*/
- /* Wait for the count to be reset */
- for (i = 0; i < OVERFLOW_WAIT_COUNT; i++) {
- if (rdmsr(pd->pm_perfctr) & (1 << (pd->pm_descr.pd_width - 1)))
- break;
+ /* Wait for NMI reload. The top bit clears on overflow. */
+ if (pd->pm_subclass == PMC_AMD_SUB_CLASS_CORE &&
+ PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm))) {
+ for (i = 0; i < OVERFLOW_WAIT_COUNT; i++) {
+ if ((rdmsr(pd->pm_perfctr) &
+ (1ULL << (pd->pm_descr.pd_width - 1))) != 0)
+ break;
- DELAY(1);
+ DELAY(1);
+ }
}
return (0);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 25, 11:36 AM (15 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41651930
Default Alt Text
D61368.1795606577.diff (1 KB)
Attached To
Mode
D61368: hwpmc_amd: fix stop and overflow waits
Attached
Detach File
Event Timeline