kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoffer Dall <cdall@linaro.org>
To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org
Cc: Marc Zyngier <marc.zyngier@arm.com>,
	Andre Przywara <andre.przywara@arm.com>,
	Christoffer Dall <cdall@linaro.org>,
	kvm@vger.kernel.org
Subject: [PATCH v2 00/10] KVM: arm/arm64: vgic: Improvements and optimizations
Date: Tue, 21 Mar 2017 22:10:49 +0100	[thread overview]
Message-ID: <20170321211059.8719-1-cdall@linaro.org> (raw)

We can improve the performance of our VGIC implementation a bit and
clean up a lot of the implementation while we're at it.

At first, patch 1 may seem excessive for a single register, the VMCR,
but while it adds complexity it does move logic out of the critical path
and into the vcpu_load/put hooks, which are executed much more rarely.
It also provides an infrastructure to move more things into the
vgic_load/put functions later one.

Avoiding the need to take a spinlock in the common case where there are
no virtual interrupts in flight are actually measurable and well worth
the effort.

The implementation cleanups boil down to maintaining a single count of
the used LRs instead of an additional bitmap, avoiding the need to deal
with the MISR and EISR fields, and doing an early init of the VGIC to
avoid a number of vgic_initialized() checks.

Tested on Mustang and TC2, and Thunder-X.

Changelogs are in the patches.

Patches also available on:
git://git.kernel.org/pub/scm/linux/kernel/git/cdall/linux.git gic-optimize-v2

Thanks,
-Christoffer

Christoffer Dall (9):
  KVM: arm/arm64: vgic: Defer touching GICH_VMCR to vcpu_load/put
  KVM: arm/arm64: vgic: Get rid of live_lrs
  KVM: arm/arm64: vgic: Only set underflow when actually out of LRs
  KVM: arm/arm64: vgic: Get rid of unnecessary process_maintenance
    operation
  KVM: arm/arm64: vgic: Get rid of unnecessary save_maint_int_state
  KVM: arm/arm64: vgic: Get rid of MISR and EISR fields
  KVM: arm/arm64: vgic: Implement early VGIC init functionality
  KVM: arm/arm64: vgic: Don't check vgic_initialized in sync/flush
  KVM: arm/arm64: vgic: Improve sync_hwstate performance

Shih-Wei Li (1):
  KVM: arm/arm64: vgic: Avoid flushing vgic state when there's no
    pending IRQ

 arch/arm/include/asm/kvm_asm.h   |   3 ++
 arch/arm/kvm/arm.c               |  11 ++--
 arch/arm64/include/asm/kvm_asm.h |   2 +
 include/kvm/arm_vgic.h           |   9 ++--
 virt/kvm/arm/hyp/vgic-v2-sr.c    |  78 +++-------------------------
 virt/kvm/arm/hyp/vgic-v3-sr.c    |  79 +++++++---------------------
 virt/kvm/arm/vgic/vgic-init.c    | 108 ++++++++++++++++++++++++---------------
 virt/kvm/arm/vgic/vgic-v2.c      |  90 ++++++++++++++------------------
 virt/kvm/arm/vgic/vgic-v3.c      |  80 ++++++++++++++---------------
 virt/kvm/arm/vgic/vgic.c         |  60 ++++++++++++++++------
 virt/kvm/arm/vgic/vgic.h         |   8 ++-
 11 files changed, 234 insertions(+), 294 deletions(-)

-- 
2.9.0

             reply	other threads:[~2017-03-21 21:10 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-21 21:10 Christoffer Dall [this message]
2017-03-21 21:10 ` [PATCH v2 01/10] KVM: arm/arm64: vgic: Defer touching GICH_VMCR to vcpu_load/put Christoffer Dall
2017-03-27 10:49   ` Marc Zyngier
2017-03-21 21:10 ` [PATCH v2 02/10] KVM: arm/arm64: vgic: Avoid flushing vgic state when there's no pending IRQ Christoffer Dall
2017-03-27 10:52   ` Marc Zyngier
2017-03-21 21:10 ` [PATCH v2 03/10] KVM: arm/arm64: vgic: Get rid of live_lrs Christoffer Dall
2017-03-21 21:10 ` [PATCH v2 04/10] KVM: arm/arm64: vgic: Only set underflow when actually out of LRs Christoffer Dall
2017-03-27 10:59   ` Marc Zyngier
2017-03-21 21:10 ` [PATCH v2 05/10] KVM: arm/arm64: vgic: Get rid of unnecessary process_maintenance operation Christoffer Dall
2017-03-27 11:03   ` Marc Zyngier
2017-03-21 21:10 ` [PATCH v2 06/10] KVM: arm/arm64: vgic: Get rid of unnecessary save_maint_int_state Christoffer Dall
2017-03-21 21:10 ` [PATCH v2 07/10] KVM: arm/arm64: vgic: Get rid of MISR and EISR fields Christoffer Dall
2017-03-21 21:10 ` [PATCH v2 08/10] KVM: arm/arm64: vgic: Implement early VGIC init functionality Christoffer Dall
2017-03-21 21:10 ` [PATCH v2 09/10] KVM: arm/arm64: vgic: Don't check vgic_initialized in sync/flush Christoffer Dall
2017-03-21 21:10 ` [PATCH v2 10/10] KVM: arm/arm64: vgic: Improve sync_hwstate performance Christoffer Dall
2017-03-27 11:04   ` Marc Zyngier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170321211059.8719-1-cdall@linaro.org \
    --to=cdall@linaro.org \
    --cc=andre.przywara@arm.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=marc.zyngier@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).