[PATCH v2 0/2] KVM: arm64: Fixes for the host SMCs that pKVM forwards to firmware

From: Fuad Tabba

Date: Tue Nov 17 2026 - 11:37:24 EST


Hi folks,

Changes since v1 [1]:
- New patch 1, which stops forwarding the host's SDEI calls.
- Don't run a protected vCPU on a CPU where the firmware Spectre-v4
mitigation is disabled, instead of re-enabling it from EL2. (Marc)
- Track the host's ARCH_WORKAROUND_2 calls with a kvm_host_data flag
instead of a new per-CPU variable. (Marc)
- Handle the calls in default_host_smc_handler(). (Marc)

Two fixes for the host SMCs that EL2 forwards in protected mode, which
reach firmware as calls from EL2.

The first stops forwarding the host's SDEI calls. With TF-A, the host
could otherwise register an event handler that runs at EL2.

The second is the v1 fix, redone as Marc suggested. It tracks the
firmware Spectre-v4 mitigation state from the host's ARCH_WORKAROUND_2
calls, and relies on the first patch because firmware restores that
state when an SDEI event completes.

Tested on QEMU with TF-A v2.15 and test-only host changes. When SDEI is
built into TF-A, the host's SDEI calls succeed without the first patch
and get NOT_SUPPORTED with it. With TF-A patched to advertise the
dynamic Spectre-v4 workaround on the Cortex-A57 that QEMU models, a
protected vCPU runs with the mitigation disabled, and the second patch
stops it from running.

Based on Linux 7.4-rc2 (7475ea8b58616; also applies to Linux 7.4-rc3
aebb727447640).

Cheers,
/fuad

[1] https://lore.kernel.org/all/20261113081934.1715497-1-fuad.tabba@xxxxxxxxx/

Fuad Tabba (2):
KVM: arm64: Don't forward the host's SDEI calls to firmware
KVM: arm64: Don't run a pVM with firmware Spectre-v4 mitigation
disabled

arch/arm64/include/asm/kvm_host.h | 1 +
arch/arm64/kvm/hyp/nvhe/hyp-main.c | 30 ++++++++++++++++++++++++++++--
2 files changed, 29 insertions(+), 2 deletions(-)


base-commit: 7475ea8b58616b33c04afb976cf0fbaad9dd63fb
--
2.47.3