Skip to content

KVM: arm64: Work around firmware wongly advertising GICv2 compatibility

Marc Zyngier kvmarm linux-arm-kernel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 4 repliesIn review
  2. v12 patches 5 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2KVM: arm64: Rename __vgic_v3_get_ich_vtr_el2() to __vgic_v3_get_gic_config()arch/arm64/include/asm/kvm_asm.h arch/arm64/kvm/hyp/nvhe/hyp-main.c arch/arm64/kvm/hyp/vgic-v3-sr.c +1 more+14 -70 replies
2/2KVM: arm64: Workaround firmware wrongly advertising GICv2-on-v3 compatibilityarch/arm64/kvm/hyp/vgic-v3-sr.c arch/arm64/kvm/vgic/vgic-v3.c+39 -44 replies

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by.

PatchShameer Kolothum
1/2
2/2T-b

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/2] KVM: arm64: Work around firmware wongly advertising GICv2 compatibility

It appears that there is firmware out there that advertises GICv2 compatibility on GICv3, despite the CPUs not being able to actually do it. That's a bummer, and at best creates unexpected behaviours for the users. At worse, it will crash the machine. Awesome!

In order to mitigate this issue, try and validate whether we can actually flip the CPU into supporting MMIO accesses instead of system registers. If we can't, ignore the compatibility information and shout. It's not completely foolproof, but it should cover the existing broken platforms...

The workaround is much more invasive than Shameer's initial proposal, as I wanted to keep it localised to KVM instead of spreading the horror at every level (after all, only KVM is concerned with v2 compatibility).

Tested on a deliberately misconfigured FVP (DT advertising the MMIO regions with cluster*.gicv3.cpuintf-mmap-access-level=2).

* From v1:
- Fixed silly thinko when computing the configuration state

Marc Zyngier (2):
KVM: arm64: Rename __vgic_v3_get_ich_vtr_el2() to

    __vgic_v3_get_gic_config()

KVM: arm64: Workaround firmware wrongly advertising GICv2-on-v3
compatibility

 arch/arm64/include/asm/kvm_asm.h   |  4 +--
 arch/arm64/kvm/hyp/nvhe/hyp-main.c |  6 ++---
 arch/arm64/kvm/hyp/vgic-v3-sr.c    | 40 ++++++++++++++++++++++++++++--
 arch/arm64/kvm/vgic/vgic-v3.c      | 12 ++++++---
 4 files changed, 52 insertions(+), 10 deletions(-)
Signature · 6 lines
2.29.2

_______________________________________________
kvmarm mailing list
[email protected]
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm