Skip to contentSkip to conversation

perf_counter/x86: Remove masking and unmasking of LVT error register.

PATCH Applied Yong Wang 2 participants 4 messages May 28, 2009 – May 29, 2009 x86

lore
Share & tools
lore

Yong Wang

author
#0 lore raw

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
index 2eeaa99..444bcf2 100644
@@ -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
#1 lore raw
Quoted 24 lines · Yong Wang

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 -2
index 2eeaa99..444bcf2 100644
@@ -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

author
#2 lore raw
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

Applied
#3 lore raw
Quoted 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_event and hw_perf_counter structs and the 'nmi' parameter of perf_counter_overflow and perf_swcounter_event functions, etc. Right?

yes, that too.

Ingo