Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177480534
D61449.1794529246.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
702 B
Referenced Files
None
Subscribers
None
D61449.1794529246.diff
View Options
diff --git a/sys/dev/hwpmc/hwpmc_mod.c b/sys/dev/hwpmc/hwpmc_mod.c
--- a/sys/dev/hwpmc/hwpmc_mod.c
+++ b/sys/dev/hwpmc/hwpmc_mod.c
@@ -2892,8 +2892,14 @@
*/
pm->pm_state = PMC_STATE_DELETED;
- /* Wait for the PMCs runcount to come to zero. */
- pmc_wait_for_pmc_idle(pm);
+ pmc_save_cpu_binding(&pb); /* quiesce_cpus() unbinds us */
+ do {
+ /* Wait for the PMCs runcount to come to zero. */
+ pmc_wait_for_pmc_idle(pm);
+ /* Let every CPU leave any switch-in/out using pm. */
+ quiesce_all_cpus("pmcrel", PDROP);
+ } while (counter_u64_fetch(pm->pm_runcount) != 0);
+ pmc_restore_cpu_binding(&pb);
/*
* At this point the PMC is off all CPUs and cannot be freshly
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 13, 12:20 AM (1 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41686044
Default Alt Text
D61449.1794529246.diff (702 B)
Attached To
Mode
D61449: hwpmc: Fix use-after-free races between PMC release and context switches
Attached
Detach File
Event Timeline