Skip to content

KVM: arm64: Assorted vgic-v3 fixes

Marc Zyngier kvm kvmarm linux-arm-kernel 2 versions – Applied

Status from this message: Applied to next, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest5 patches 2 repliesApplied
  2. v15 patches 7 repliesSuperseded

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/5KVM: arm64: Force ID_AA64PFR0_EL1.GIC=1 when exposing a virtual GICv3arch/arm64/kvm/sys_regs.c+5 -00 replies
2/5KVM: arm64: vgic-v3: Work around GICv3 locally generated SErrorsarch/arm64/kvm/vgic/vgic-v3.c+8 -00 replies
3/5KVM: arm64: vgic-v3: Reduce common group trapping to ICV_DIR_EL1 when possiblearch/arm64/include/asm/sysreg.h arch/arm64/kvm/vgic/vgic-v3.c+14 -41 reply
4/5KVM: arm64: vgic-v3: Don't advertise ICC_CTLR_EL1.SEISarch/arm64/kvm/hyp/vgic-v3-sr.c+0 -20 replies
5/5KVM: arm64: vgic-v3: Align emulated cpuif LPI state machine with the pseudocodearch/arm64/kvm/hyp/vgic-v3-sr.c+8 -120 replies

Reviews trailers per patch

4 of 5 patches have a Reviewed-by or Acked-by.

PatchAlexandru EliseiJoey Gouly
1/5R-b
2/5R-b T-b
3/5R-b
4/5R-b
5/5

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/5] KVM: arm64: Assorted vgic-v3 fixes

Here's a bunch of vgic-v3 fixes I have been sitting on for some time. None of them are critical, though some are rather entertaining.

The first one is a leftover from the initial Apple-M1 enablement, which doesn't advertise the GIC support via ID_AA64PFR0_EL1 (which is expected, as it only has half a GIC...). We address it by forcefully advertising the feature if the guest has a GICv3.

The second patch is really fun, and shows how things can go wrong when they are badly specified. The gist of it is that on systems that advertise ICH_VTR_EL2.SEIS, we need to fallback to the full GICv3 cpuif emulation. The third patch is an good optimisation on the previous one, and the fourth a direct consequence of the whole thing.

The last patch are more of a harmless oddity: virtual LPIs happen to have an active state buried into the pseudocode (and only there). Fun! Nothing goes wrong with that, but we need to align the emulation to match the pseudocode.

All of this is only targeting 5.16, and I don't plan to backport any of it.

* From v1 [1]:

- Dropped the patch that tried to optimise what to do with an active LPI. There is unfortunately a bad corner case in the pseudocode that prevents it. Oh well.

- Added an extra patch to help in the case where ICH_HCR_EL2.TDS is supported, and that we can use that instead of ICH_HCR_EL2.TC to trap only ICC_DIR_EL1. Given the performance improvement, it was too hard to ignore it.

[1] https://lore.kernel.org/r/[email protected]

Marc Zyngier (5):
KVM: arm64: Force ID_AA64PFR0_EL1.GIC=1 when exposing a virtual GICv3
KVM: arm64: vgic-v3: Work around GICv3 locally generated SErrors
KVM: arm64: vgic-v3: Reduce common group trapping to ICV_DIR_EL1 when
possible
KVM: arm64: vgic-v3: Don't advertise ICC_CTLR_EL1.SEIS
KVM: arm64: vgic-v3: Align emulated cpuif LPI state machine with the
pseudocode

 arch/arm64/include/asm/sysreg.h |  3 +++
 arch/arm64/kvm/hyp/vgic-v3-sr.c | 22 ++++++++--------------
 arch/arm64/kvm/sys_regs.c       |  5 +++++
 arch/arm64/kvm/vgic/vgic-v3.c   | 21 ++++++++++++++++++---
 4 files changed, 34 insertions(+), 17 deletions(-)
Signature · 1 line
2.30.2