Skip to contentSkip to conversation

KVM: Don't update PPR on any APIC read

PATCH Applied Avi Kivity 2 participants 2 messages Jul 22, 2012 – Jul 30, 2012

Subsystems (3)
lore
Share & tools
lore

Avi Kivity

author
#0 lore raw

PATCH 1/1 KVM: Don't update PPR on any APIC read

The current code will update the PPR on almost any APIC read; however that's only required if we read the PPR.

kvm_update_ppr() shows up in some profiles, albeit with a low usage (~1%). This should reduce it further (it will still be called during interrupt processing).

---
 arch/x86/kvm/lapic.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
arch/x86/kvm/lapic.c +4 -2
index ce87878..a7b8fa2 100644
@@ -696,12 +696,14 @@ static u32 __apic_read(struct kvm_lapic *apic, unsigned int offset)
 
 		val = apic_get_tmcct(apic);
 		break;
-
+	case APIC_PROCPRI:
+		apic_update_ppr(apic);
+		val = apic_get_reg(apic, offset);
+		break;
 	case APIC_TASKPRI:
 		report_tpr_access(apic, false);
 		/* fall thru */
 	default:
-		apic_update_ppr(apic);
 		val = apic_get_reg(apic, offset);
 		break;
 	}
Signature · 1 line
1.7.11.2
#1 lore raw
Quoted 8 lines · Avi Kivity

The current code will update the PPR on almost any APIC read; however that's only required if we read the PPR.

kvm_update_ppr() shows up in some profiles, albeit with a low usage (~1%). This should reduce it further (it will still be called during interrupt processing).

Applied, thanks.