[PATCH 0/7] KVM: arm64: pKVM host hypercall and GICv5 CPU interface fixes

From: Fuad Tabba

Date: Tue Sep 15 2026 - 08:54:47 EST


Hi folks,

This series consolidates three postings, which it supersedes:
- The stage-2 MMU pointer hypercall rejection [1]: patch 2, reworked
to move the hypercalls out of the always-available band instead of
guarding each handler, and covering __kvm_flush_vm_context() too
(Marc). __kvm_flush_cpu_context() stays in the set, which the
sketch on the thread left out.
- The GICv5 CPU interface series [2]: its hypercall patch reworked
the same way, as patch 1, and its other three as patches 3, 6 and
7, with 3's comment and 7's message trimmed and 6 unchanged.
Sascha's Reviewed-by on the reworked patch isn't carried, the code
having changed.
- The __kvm_adjust_pc() host pointer fixes [3]: patches 4 and 5,
with Vincent's and Joey's nits taken and their Reviewed-by
collected. (thanks!)

Under pKVM, EL2 still trusts the host at the hypercall boundary in a
few places: hypercalls the host has no use for in protected mode stay
callable, the __kvm_adjust_pc() hypercall it does use takes a host
vCPU nothing pins or validates, and the vgic model EL2 copies out of
the host's struct kvm goes unchecked.

Patches 1 and 2 move the GICv5 CPU interface save/restore and the
stage-2 flushes into the band the dispatcher rejects once pKVM has
finalised. Patch 3 validates the vgic model EL2 copies from the host.
Patches 4 and 5 fix two host pointers dereferenced unvalidated on the
__kvm_adjust_pc() path, the vCPU's VM and the vCPU itself: either
panics the hypervisor if unmapped, and the VM read leaks a bit of hyp
memory through PSR_TCO on MTE hardware. Both carry Cc: stable. The
pKVM core series [4] carries the same two fixes as its patches 2 and
3, in the form posted before Vincent's nits, so that it applies as
is. Patches 6 and 7 are the rest of [2]: the EL1 side of the GICv5
access on nVHE, and a comment fix.

Patch 2 carries no Fixes: tag, no in-tree host path reaching those
hypercalls under pKVM; patch 1 keeps the one it was posted with.

The GICv5 residency and VDPEND hypercalls queued for 7.4 carry the
per-handler check the superseded GICv5 patch used, and can move the
same way.

Superseded postings:
- 20260914174521.832575-1-fuad.tabba@xxxxxxxxx
- 20260817103228.1203140-1-fuad.tabba@xxxxxxxxx (and its v1,
20260806100256.371164-1-fuad.tabba@xxxxxxxxx)
- 20260915070418.3209779-1-fuad.tabba@xxxxxxxxx (and its v1,
20260914065136.3418404-1-fuad.tabba@xxxxxxxxx)

Based on v7.3-rc3 (fd73f4a665989). On kvmarm/next, patches 1 and 2
conflict with the new GICv5 hypercall IDs and patch 5 with the typed
hypercall handlers.

Cheers,
/fuad

[1] https://lore.kernel.org/all/20260914174521.832575-1-fuad.tabba@xxxxxxxxx/
[2] https://lore.kernel.org/all/20260817103228.1203140-1-fuad.tabba@xxxxxxxxx/
[3] https://lore.kernel.org/all/20260915070418.3209779-1-fuad.tabba@xxxxxxxxx/
[4] https://lore.kernel.org/all/20260914113338.159227-1-fuad.tabba@xxxxxxxxx/

Fuad Tabba (7):
KVM: arm64: Reject the GICv5 CPU interface hypercalls under pKVM
KVM: arm64: Reject the stage-2 flush hypercalls under pKVM
KVM: arm64: Validate the host-provided vgic model in pKVM
KVM: arm64: Validate the host vCPU's VM before reading it under pKVM
KVM: arm64: Pin the host vCPU before adjusting its PC under pKVM
KVM: arm64: vgic: Do not access the GICv5 CPU interface from EL1
KVM: arm64: Fix stale VGICv3 comments in the nVHE world switch

arch/arm64/include/asm/kvm_asm.h | 16 ++++----
arch/arm64/kvm/hyp/exception.c | 5 ++-
arch/arm64/kvm/hyp/include/hyp/adjust_pc.h | 28 +++++++++++++
arch/arm64/kvm/hyp/include/nvhe/pkvm.h | 2 +
arch/arm64/kvm/hyp/nvhe/hyp-main.c | 36 +++++++++++++----
arch/arm64/kvm/hyp/nvhe/pkvm.c | 47 +++++++++++++++++++++-
arch/arm64/kvm/hyp/nvhe/switch.c | 4 +-
arch/arm64/kvm/vgic/vgic.c | 12 ++++--
8 files changed, 125 insertions(+), 25 deletions(-)


base-commit: fd73f4a6659897191fa0d40695fe370925dd3780
--
2.39.5