linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] arm64: KVM: vgic-v2: Allow unsafe GICV accesses
@ 2016-08-19 12:38 Marc Zyngier
  2016-08-19 12:38 ` [PATCH 1/5] arm/arm64: KVM: Don't BUG_ON if IT bits are set in ARM mode Marc Zyngier
                   ` (4 more replies)
  0 siblings, 5 replies; 21+ messages in thread
From: Marc Zyngier @ 2016-08-19 12:38 UTC (permalink / raw)
  To: linux-arm-kernel

In a number of cases, KVM cannot give access direct access to the
GICv2 GICV region, either because GICV is not page aligned, or its
size is not a multiple of the page size. This is especially visible
with 16kB/64kB pages and the original GIC-400 layout where each region
is only 4k aligned.

Instead of disabling KVM altogether (which is the current behaviour),
there is some value in trapping each guest GICV access, performing the
access as quickly as possible at EL2, and resuming the guest. This
allows us to keep KVM enabled on this HW.

Implementation wise, this is done with a static key controlling the
workaround being enabled, hence coming at zero cost (well, an extra
nop on the exit hot path) for unaffected platforms. On the affected
HW, I've measured a 10 to 15% overhead for a self-IPI test, which is
pretty bad, but still much better than not having a GIC at all.

Tested on Juno.

Marc Zyngier (5):
  arm/arm64: KVM: Don't BUG_ON if IT bits are set in ARM mode
  arm64: KVM: Allow kvm_skip_instr32 to be shared between kernel and HYP
    code
  arm64: KVM: vgic-v2: Add the GICV emulation infrastructure
  arm64: KVM: vgic-v2: Add GICV access from HYP
  arm64: KVM: vgic-v2: Enable GICV access from HYP if access from guest
    is unsafe

 arch/arm/kvm/emulate.c               |  4 +-
 arch/arm64/include/asm/kvm_emulate.h | 49 +++++++++++++++++++++++++
 arch/arm64/include/asm/kvm_hyp.h     |  1 +
 arch/arm64/kvm/emulate.c             | 47 +-----------------------
 arch/arm64/kvm/hyp/switch.c          | 32 ++++++++++++++++
 include/kvm/arm_vgic.h               |  6 +++
 virt/kvm/arm/hyp/vgic-v2-sr.c        | 46 +++++++++++++++++++++++
 virt/kvm/arm/vgic/vgic-v2.c          | 71 ++++++++++++++++++++++--------------
 8 files changed, 180 insertions(+), 76 deletions(-)

-- 
2.1.4

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2016-09-01 14:55 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-19 12:38 [PATCH 0/5] arm64: KVM: vgic-v2: Allow unsafe GICV accesses Marc Zyngier
2016-08-19 12:38 ` [PATCH 1/5] arm/arm64: KVM: Don't BUG_ON if IT bits are set in ARM mode Marc Zyngier
2016-09-01 11:56   ` Christoffer Dall
2016-09-01 12:21     ` Marc Zyngier
2016-08-19 12:38 ` [PATCH 2/5] arm64: KVM: Allow kvm_skip_instr32 to be shared between kernel and HYP code Marc Zyngier
2016-09-01 12:09   ` Christoffer Dall
2016-09-01 12:23     ` Marc Zyngier
2016-09-01 12:45   ` Peter Maydell
2016-08-19 12:38 ` [PATCH 3/5] arm64: KVM: vgic-v2: Add the GICV emulation infrastructure Marc Zyngier
2016-09-01 12:46   ` Christoffer Dall
2016-09-01 14:28     ` Marc Zyngier
2016-09-01 14:39       ` Peter Maydell
2016-09-01 14:55       ` Christoffer Dall
2016-08-19 12:38 ` [PATCH 4/5] arm64: KVM: vgic-v2: Add GICV access from HYP Marc Zyngier
2016-09-01 13:28   ` Christoffer Dall
2016-08-19 12:38 ` [PATCH 5/5] arm64: KVM: vgic-v2: Enable GICV access from HYP if access from guest is unsafe Marc Zyngier
2016-08-19 12:53   ` Peter Maydell
2016-08-19 13:05     ` Marc Zyngier
2016-08-19 13:31       ` Peter Maydell
2016-08-19 14:54         ` Marc Zyngier
2016-09-01 13:30   ` Christoffer Dall

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).