* [PATCH] KVM: Don't update PPR on any APIC read
@ 2012-07-22 14:41 Avi Kivity
2012-07-30 23:48 ` Marcelo Tosatti
0 siblings, 1 reply; 2+ messages in thread
From: Avi Kivity @ 2012-07-22 14:41 UTC (permalink / raw)
To: Marcelo Tosatti; +Cc: kvm, Gleb Natapov
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).
Signed-off-by: Avi Kivity <avi@redhat.com>
---
arch/x86/kvm/lapic.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index ce87878..a7b8fa2 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -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;
}
--
1.7.11.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] KVM: Don't update PPR on any APIC read
2012-07-22 14:41 [PATCH] KVM: Don't update PPR on any APIC read Avi Kivity
@ 2012-07-30 23:48 ` Marcelo Tosatti
0 siblings, 0 replies; 2+ messages in thread
From: Marcelo Tosatti @ 2012-07-30 23:48 UTC (permalink / raw)
To: Avi Kivity; +Cc: kvm, Gleb Natapov
On Sun, Jul 22, 2012 at 05:41:00PM +0300, Avi Kivity wrote:
> 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).
>
> Signed-off-by: Avi Kivity <avi@redhat.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-07-30 23:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-22 14:41 [PATCH] KVM: Don't update PPR on any APIC read Avi Kivity
2012-07-30 23:48 ` Marcelo Tosatti
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).