Skip to content

KVM: arm64: Add LR overflow infrastructure (the dregs, the bad and the ugly)

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. v3 Latest5 patches 22 repliesApplied
  2. v11 patch 1 replySuperseded

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/5KVM: arm64: GICv3: Don't advertise ICH_HCR_EL2.En==1 when no vgic is configuredarch/arm64/kvm/vgic/vgic-v3.c+3 -03 replies
2/5KVM: arm64: GICv3: Completely disable trapping on vcpu exitarch/arm64/kvm/hyp/vgic-v3-sr.c+1 -11 reply
3/5KVM: arm64: GICv3: nv: Resync LRs/VMCR/HCR early for better MI emulationarch/arm64/include/asm/kvm_hyp.h arch/arm64/kvm/hyp/vgic-v3-sr.c arch/arm64/kvm/vgic/vgic-v3-nested.c +2 more+46 -333 replies
4/5KVM: arm64: GICv3: Remove vgic_hcr workaround handling leftoversarch/arm64/kvm/vgic/vgic-v3-nested.c+1 -21 reply
5/5KVM: arm64: GICv3: Force exit to sync ICH_HCR_EL2.Enarch/arm64/kvm/hyp/vgic-v3-sr.c arch/arm64/kvm/vgic/vgic-v3-nested.c+11 -25 replies

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchMark BrownFuad Tabba
SeriesT-b T-b
1/5T-b R-b
2/5R-b
3/5R-b
4/5R-b
5/5R-b

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

Read the v3 thread

Cover letter [PATCH v3 0/5] KVM: arm64: Add LR overflow infrastructure (the dregs, the bad and the ugly)

This is a follow-up to the original series [1] (and fixes [2][3]) with a bunch of bug-fixes and improvements. At least one patch has already been posted, but I thought I might repost it as part of a series, since I accumulated more stuff:

- The first patch addresses Mark's observation that the no-vgic-v3 test has been broken once more. At some point, we'll have to retire that functionality, because even if we keep fixing the SR handling, nobody tests the actual interrupt state exposure to userspace, which I'm pretty sure has badly been broken for at least 5 years.

- The second one addresses a report from Fuad that on QEMU, ICH_HCR_EL2.TDIR traps ICC_DIR_EL1 on top of ICV_DIR_EL1, leading to the host exploding on deactivating an interrupt. This behaviour is allowed by the spec, so make sure we clear all trap bits

- Running vgic_irq in an L1 guest (the test being an L2) results in a MI storm on the host, as the state synchronisation is done at the wrong place, much like it was on the non-NV path before it was reworked. Apply the same methods to the NV code, and enjoy much better MI emulation, now tested all the way into an L3.

- Nuke a small leftover from previous rework.

- Force a read-back of ICH_MISR_EL2 when disabling the vgic, so that the trap prevents too many spurious MIs in an L1 guest, as the write to ICH_HCR_EL2 does exactly nothing on its own when running under FEAT_NV2.

Oliver: this is starting to be a large series of fixes on top of the existing series, plus the two patches you have already added. I'd be happy to respin a full v4 with the fixes squashed into their original patches. On the other hand, if you want to see the history in its full glory, that also works for me.

[1] https://msgid.link/[email protected]
[2] https://msgid.link/[email protected]
[3] https://lore.kernel.org/kvmarm/[email protected]

Marc Zyngier (5):
KVM: arm64: GICv3: Don't advertise ICH_HCR_EL2.En==1 when no vgic is
configured
KVM: arm64: GICv3: Completely disable trapping on vcpu exit
KVM: arm64: GICv3: nv: Resync LRs/VMCR/HCR early for better MI
emulation
KVM: arm64: GICv3: Remove vgic_hcr workaround handling leftovers
KVM: arm64: GICv3: Force exit to sync ICH_HCR_EL2.En

 arch/arm64/include/asm/kvm_hyp.h     |  1 +
 arch/arm64/kvm/hyp/vgic-v3-sr.c      | 11 +++-
 arch/arm64/kvm/vgic/vgic-v3-nested.c | 78 ++++++++++++++++------------
 arch/arm64/kvm/vgic/vgic-v3.c        |  3 ++
 arch/arm64/kvm/vgic/vgic.c           |  6 ++-
 arch/arm64/kvm/vgic/vgic.h           |  1 +
 6 files changed, 62 insertions(+), 38 deletions(-)
Signature · 1 line
2.47.3