All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fuad Tabba <fuad.tabba@linux.dev>
To: Marc Zyngier <maz@kernel.org>, Oliver Upton <oupton@kernel.org>
Cc: Joey Gouly <joey.gouly@arm.com>,
	Steffen Eiden <seiden@linux.ibm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Zenghui Yu <yuzenghui@huawei.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Vincent Donnefort <vdonnefort@google.com>,
	Ryan Roberts <ryan.roberts@arm.com>,
	Fuad Tabba <tabba@google.com>,
	linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: [PATCH v2 0/2] KVM: arm64: Fixes for the host SMCs that pKVM forwards to firmware
Date: Tue, 17 Nov 2026 16:36:59 +0000	[thread overview]
Message-ID: <20261117163702.1678277-1-fuad.tabba@linux.dev> (raw)

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


             reply	other threads:[~2026-11-17 16:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17 16:36 Fuad Tabba [this message]
2026-11-17 16:37 ` [PATCH v2 1/2] KVM: arm64: Don't forward the host's SDEI calls to firmware 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261117163702.1678277-1-fuad.tabba@linux.dev \
    --to=fuad.tabba@linux.dev \
    --cc=catalin.marinas@arm.com \
    --cc=joey.gouly@arm.com \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=maz@kernel.org \
    --cc=oupton@kernel.org \
    --cc=ryan.roberts@arm.com \
    --cc=seiden@linux.ibm.com \
    --cc=suzuki.poulose@arm.com \
    --cc=tabba@google.com \
    --cc=vdonnefort@google.com \
    --cc=will@kernel.org \
    --cc=yuzenghui@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.