File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -2066,16 +2066,23 @@ static int intel_pmu_handle_irq(struct pt_regs *regs)
2066
2066
int bit , loops ;
2067
2067
u64 status ;
2068
2068
int handled ;
2069
+ int pmu_enabled ;
2069
2070
2070
2071
cpuc = this_cpu_ptr (& cpu_hw_events );
2071
2072
2073
+ /*
2074
+ * Save the PMU state.
2075
+ * It needs to be restored when leaving the handler.
2076
+ */
2077
+ pmu_enabled = cpuc -> enabled ;
2072
2078
/*
2073
2079
* No known reason to not always do late ACK,
2074
2080
* but just in case do it opt-in.
2075
2081
*/
2076
2082
if (!x86_pmu .late_ack )
2077
2083
apic_write (APIC_LVTPC , APIC_DM_NMI );
2078
2084
intel_bts_disable_local ();
2085
+ cpuc -> enabled = 0 ;
2079
2086
__intel_pmu_disable_all ();
2080
2087
handled = intel_pmu_drain_bts_buffer ();
2081
2088
handled += intel_bts_interrupt ();
@@ -2173,7 +2180,8 @@ static int intel_pmu_handle_irq(struct pt_regs *regs)
2173
2180
2174
2181
done :
2175
2182
/* Only restore PMU state when it's active. See x86_pmu_disable(). */
2176
- if (cpuc -> enabled )
2183
+ cpuc -> enabled = pmu_enabled ;
2184
+ if (pmu_enabled )
2177
2185
__intel_pmu_enable_all (0 , true);
2178
2186
intel_bts_enable_local ();
2179
2187
You can’t perform that action at this time.
0 commit comments