mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/2] KVM: arm64: Fixes for the host SMCs that pKVM forwards to firmware
@ 2026-11-17 16:36 Fuad Tabba
  2026-11-17 16:37 ` [PATCH v2 1/2] KVM: arm64: Don't forward the host's SDEI calls " Fuad Tabba
  2026-11-17 16:37 ` [PATCH v2 2/2] KVM: arm64: Don't run a pVM with firmware Spectre-v4 mitigation disabled Fuad Tabba
  0 siblings, 2 replies; 3+ messages in thread
From: Fuad Tabba @ 2026-11-17 16:36 UTC (permalink / raw)
  To: Marc Zyngier, Oliver Upton
  Cc: Joey Gouly, Steffen Eiden, Suzuki K Poulose, Zenghui Yu,
	Catalin Marinas, Will Deacon, Mark Rutland, Vincent Donnefort,
	Ryan Roberts, Fuad Tabba, linux-arm-kernel, kvmarm, linux-kernel

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@linux.dev/

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-17 16:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-17 16:36 [PATCH v2 0/2] KVM: arm64: Fixes for the host SMCs that pKVM forwards to firmware Fuad Tabba
2026-11-17 16:37 ` [PATCH v2 1/2] KVM: arm64: Don't forward the host's SDEI calls " Fuad Tabba
2026-11-17 16:37 ` [PATCH v2 2/2] KVM: arm64: Don't run a pVM with firmware Spectre-v4 mitigation disabled Fuad Tabba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®