perf_counter/x86: Remove masking and unmasking of LVT error register.
PATCH 1/1 perf_counter/x86: Remove masking and unmasking of LVT error register.
Masking and unmasking of LVT error register become unnecessary as NMI mode will be used all the time.
--- perf_counter.c | 6 ------ 1 file changed, 6 deletions(-)
arch/x86/kernel/cpu/perf_counter.c +0 -6
@@ -865,22 +865,16 @@ void set_perf_counter_pending(void)void perf_counters_lapic_init (int nmi) { -u32 apic_val; -if (!x86_pmu_initialized ())return ;/* * Enable the performance counter vector in the APIC LVT: */ - apic_val =apic_read (APIC_LVTERR ); - -apic_write (APIC_LVTERR , apic_val |APIC_LVT_MASKED );if (nmi)apic_write (APIC_LVTPC ,APIC_DM_NMI );else apic_write (APIC_LVTPC ,LOCAL_PERF_VECTOR ); -apic_write (APIC_LVTERR , apic_val); } static int __kprobes
Quoted 24 lines · Yong Wang
Masking and unmasking of LVT error register become unnecessary as NMI mode will be used all the time.
Signed-off-by Yong Wang <[email protected]>--- perf_counter.c | 6 ------ 1 file changed, 6 deletions(-)arch/x86/kernel/cpu/perf_counter.c +0
-2@@ -865,22 +865,16 @@ void set_perf_counter_pending(void)void perf_counters_lapic_init (int nmi) { -u32 apic_val; -if (!x86_pmu_initialized ())return ;/* * Enable the performance counter vector in the APIC LVT:
arch/x86/kernel/cpu/perf_counter.c void set_perf_counter_pending(void) · line 878
Quoted 10 lines
arch/x86/kernel/cpu/perf_counter.c +0
-4*/ - apic_val =apic_read (APIC_LVTERR ); - -apic_write (APIC_LVTERR , apic_val |APIC_LVT_MASKED );if (nmi)apic_write (APIC_LVTPC ,APIC_DM_NMI );else apic_write (APIC_LVTPC ,LOCAL_PERF_VECTOR ); -apic_write (APIC_LVTERR , apic_val); }
i'd suggest to remove the 'nmi' parameter as well to this function. (and any other dynamic flags that deal with nmi/irq distinctions)
Ingo
Quoted 1 line · Ingo Molnar
i'd suggest to remove the 'nmi' parameter as well to this function.
Thanks for the comment. Just resubmitted a new patch removing the 'nmi' parameter.
Quoted 1 line
(and any other dynamic flags that deal with nmi/irq distinctions)
Just wanna make sure before moving on. You want to remove things like the 'nmi' field in perf_counter_hw_event and hw_perf_counter structs and the 'nmi' parameter of perf_counter_overflow and perf_swcounter_event functions, etc. Right?
Thanks
-Yong
Ingo Molnar
AppliedQuoted 5 lines · Yong Wang
Quoted 1 line · Ingo Molnar
i'd suggest to remove the 'nmi' parameter as well to this function.
Thanks for the comment. Just resubmitted a new patch removing the 'nmi' parameter.
applied, thanks!
Quoted 7 lines
Quoted 2 lines
(and any other dynamic flags that deal with nmi/irq distinctions)
Just wanna make sure before moving on. You want to remove things like the 'nmi' field in
perf_counter_hw_eventandhw_perf_counterstructs and the 'nmi' parameter ofperf_counter_overflowandperf_swcounter_eventfunctions, etc. Right?
yes, that too.
Ingo