[PATCH v2 0/6] KVM: arm64: Make ICH_VTR_EL2 accesses an inlined literal

Marc Zyngier maz at kernel.org
Tue Jul 21 10:07:48 PDT 2026


I'm reposting this early as there were so many issues to the original
posting that I decided to deviate from my own rules... Bite me.

This is the second version of this series I initially sent as [1],
which aims at removing the large number of traps that ICH_VTR_EL2
generates in NV environments, leading to pointless overheads.

By moving from a sysreg access to a patched constant, running an L3
workload with a a healthy amount of IO results in a 5% reduction of
wall-clock time from a baseline without this series.

* From v1 [1]:

  - Move the "broken SEIS" detection to an erratum, something it
    should always have been, so that vgic_broken_seis() doesn't have
    to use non-noinstr function calls (sashiko)

  - Drop WARN_ON() in the patch function (sashiko)

  - Switch from this_cpu_has_cap() to cpus_have_cap() (shashiko)

  - Reorganise the patches so that some of the code movements are less
    surprising to our favourite Artificial Idiot

  - Simplify __vgic_v3_get_config() to only return the MMIO attribute
    as a boolean, dropping all form of GICv5 support which made little
    sense

[1] https://lore.kernel.org/r/20260720132220.2143486-1-maz@kernel.org

Marc Zyngier (6):
  KVM: arm64: vgic-v3: Make vtr_to_* helpers use architectural field
    symbols
  KVM: arm64: Move GICv3 broken SEIS implementation detection to a CPU
    errrata
  KVM: arm64: Add a helper providing an inlined literal value for
    ICH_VTR_EL2
  KVM: arm64: Convert most ICH_VTR_EL2 accesses to inlined literal value
  KVM: arm64: vgic-v3: Simplify initial GICv3 configuration sampling
  KVM: arm64: vgic-v3: Kill kvm_vgic_global_state.ich_vtr_el2

 arch/arm64/include/asm/kvm_asm.h |  2 +-
 arch/arm64/kernel/cpu_errata.c   | 17 +++++-
 arch/arm64/kernel/image-vars.h   |  1 +
 arch/arm64/kvm/hyp/vgic-v3-sr.c  | 43 +++++----------
 arch/arm64/kvm/nested.c          |  3 +-
 arch/arm64/kvm/vgic-sys-reg-v3.c |  8 +--
 arch/arm64/kvm/vgic/vgic-v3.c    | 93 +++++++++++++++++++++-----------
 arch/arm64/kvm/vgic/vgic-v5.c    |  5 +-
 arch/arm64/kvm/vgic/vgic.h       | 19 ++++++-
 arch/arm64/tools/cpucaps         |  1 +
 include/kvm/arm_vgic.h           |  2 -
 11 files changed, 118 insertions(+), 76 deletions(-)

-- 
2.47.3




More information about the linux-arm-kernel mailing list