diff options
author | Avi Kivity <avi@redhat.com> | 2012-07-22 18:41:00 +0400 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2012-07-31 03:47:32 +0400 |
commit | 4a4541a40e1fe145c72c4b959fac524a5600d9fb (patch) | |
tree | 2d9aa84f2cfa1156603d10002b3d21c9b507f70e /arch/x86/kvm/lapic.c | |
parent | ade38c311a0ad8c32e902fe1d0ae74d0d44bc71e (diff) | |
download | linux-4a4541a40e1fe145c72c4b959fac524a5600d9fb.tar.xz |
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).
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm/lapic.c')
-rw-r--r-- | arch/x86/kvm/lapic.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c index fff7173f6a71..ad7fff7ad13c 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; } |