Skip to contentSkip to conversation

x86: Unmask LVTPC on interrupt

PATCH Applied [email protected] 2 participants 2 messages May 3, 2019 – May 20, 2019 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: Unmask LVTPC on interrupt

From: Nadav Amit <[email protected]>

According to the SDM: "When a performance monitoring counters interrupt is generated, the mask bit for its associated LVT entry is set."

Unmask LVTPC on each interrupt by reprogramming it. As the old value is known, no need for read-modify-write is needed.

---
 x86/pmu.c | 1 +
 1 file changed, 1 insertion(+)
x86/pmu.c +1 -0
index f7b3010..6658fe9 100644
@@ -184,6 +184,7 @@ static void start_event(pmu_counter_t *evt)
 	    wrmsr(MSR_CORE_PERF_FIXED_CTR_CTRL, ctrl);
     }
     global_enable(evt);
+    apic_write(APIC_LVTPC, PC_VECTOR);
 }
 
 static void stop_event(pmu_counter_t *evt)
Signature · 1 line
2.17.1
maintainer Applied
#1 lore raw
Quoted 19 lines · On 02/05/19 19:41, [email protected] wrote:

From: Nadav Amit <[email protected]>

According to the SDM: "When a performance monitoring counters interrupt is generated, the mask bit for its associated LVT entry is set."

Unmask LVTPC on each interrupt by reprogramming it. As the old value is known, no need for read-modify-write is needed.

---
 x86/pmu.c | 1 +
 1 file changed, 1 insertion(+)
x86/pmu.c +0 -0
index f7b3010..6658fe9 100644

x86/pmu.c static void start_event(pmu_counter_t *evt) · line 190

Quoted 7 lines
x86/pmu.c +1 -0
@@ -184,6 +184,7 @@ static void start_event(pmu_counter_t *evt)
 	    wrmsr(MSR_CORE_PERF_FIXED_CTR_CTRL, ctrl);
     }
     global_enable(evt);
+    apic_write(APIC_LVTPC, PC_VECTOR);
 }
 
 static void stop_event(pmu_counter_t *evt)

Queued, thanks.

Paolo