From: Fuad Tabba <fuad.tabba@linux.dev>
To: Marc Zyngier <maz@kernel.org>, Oliver Upton <oupton@kernel.org>
Cc: "Will Deacon" <will@kernel.org>,
"Catalin Marinas" <catalin.marinas@arm.com>,
"Joey Gouly" <joey.gouly@arm.com>,
"Mark Rutland" <mark.rutland@arm.com>,
"Suzuki K Poulose" <suzuki.poulose@arm.com>,
"Raghavendra Rao Ananta" <rananta@google.com>,
"Sascha Bischoff" <Sascha.Bischoff@arm.com>,
"Thomas Gleixner" <tglx@kernel.org>,
"Sebastian Ene" <sebastianene@google.com>,
"Bartłomiej Grzesik" <bgrzesik@google.com>,
"Mostafa Saleh" <smostafa@google.com>,
"Vincent Donnefort" <vdonnefort@google.com>,
"Vladimir Murzin" <vladimir.murzin@arm.com>,
"Zenghui Yu" <yuzenghui@huawei.com>,
"Zenghui Yu" <zenghui.yu@linux.dev>,
"Steffen Eiden" <seiden@linux.ibm.com>,
"Radu Rendec" <radu@rendec.net>, "Fuad Tabba" <tabba@google.com>,
kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: [PATCH v4 00/13] KVM: ITS hardening for pKVM
Date: Wed, 18 Nov 2026 15:18:51 +0000 [thread overview]
Message-ID: <20261118151904.4099560-1-fuad.tabba@linux.dev> (raw)
Hi folks,
Changes since v3 [1]:
- The hypervisor never gives an ITT back to the host (patch 11).
- The limit on devices per ITS now counts every DeviceID mapped since
boot (patch 11).
- A host read of an ITS register now aborts, unless the driver reads
that register (patch 9).
- Rebased on 7.4-rc3.
- Various cleanups and wording fixes.
The ITS writes to the memory that its command queue and tables point
to, and the host programs both, so a host that controls the ITS can
write to hypervisor and protected-VM memory. With this series the
hypervisor owns the command queue, the tables and the ITTs, traps every
host access to the ITS control frame, and checks each command before
forwarding it to the ITS. The cover letter for v3 [1] describes the
design in more detail.
This series covers the ITS. The redistributors will follow in a series
of their own.
Jinjie's series [2] lets the collection table have two levels, which
this series doesn't handle. Once it's merged, I'll send patches that
make the hypervisor handle that table the way it handles the device
table.
Tested on QEMU with a program that writes forged commands, table
entries and register values to the ITS through /dev/mem from the host's
userspace. Also tested on FVP, where the ITS uses physical redistributor
addresses (GITS_TYPER.PTA). There, every secondary CPU was hotplugged
after the takeover, so that the driver maps each returning CPU's
collection through the hypervisor with a MAPC that carries a physical
address.
The series is structured as follows:
01: MMIO donation.
02: Taking host-registered MMIO regions at finalisation.
03-06: Driver preparation: GICv4 off, page-aligned ITTs, computing
the wait target under the ITS lock, the shared command
accessors.
07: Deprivileging the host under stop_machine().
08-09: The takeover: the driver's entry points, then the hypervisor
trapping the control frame, taking the command queue and
emulating GITS_CTLR and GITS_CBASER.
10-11: The tables and GITS_BASER<n>, then the ITTs.
12: Rejecting commands whose IDs are out of range.
13: Documentation.
Based on Linux 7.4-rc3 (aebb727447640).
Cheers,
/fuad
[1] https://lore.kernel.org/all/20261102130133.3684226-1-fuad.tabba@linux.dev/
[2] https://lore.kernel.org/all/20261117123116.591621-1-ruanjinjie@huawei.com/
Bartłomiej Grzesik (2):
irqchip/gic-v3: Disable GICv4 features in pKVM
irqchip/gic-v3-its: Page-align ITT allocations in pKVM
Fuad Tabba (7):
irqchip/gic-v3-its: Compute the wait target under the ITS lock
KVM: arm64: Share the ITS command field accessors with the hypervisor
KVM: arm64: Deprivilege the host under stop_machine()
KVM: arm64: Take the ITS tables and restrict GITS_BASER<n>
KVM: arm64: Take the ITT of every device the host maps
KVM: arm64: Reject ITS commands whose IDs are out of range
Documentation: KVM: arm64: Describe the ITS hardening
Mostafa Saleh (1):
KVM: arm64: Donate MMIO to the hypervisor
Sebastian Ene (3):
KVM: arm64: Take host-registered MMIO regions at pKVM finalisation
irqchip/gic-v3-its: Add the pKVM takeover entry points
KVM: arm64: Emulate the ITS command queue
.../admin-guide/kernel-parameters.txt | 8 +-
Documentation/virt/kvm/arm/pkvm.rst | 34 +
arch/arm64/include/asm/kvm_asm.h | 2 +
arch/arm64/include/asm/kvm_hcall.h | 2 +
arch/arm64/include/asm/kvm_pgtable.h | 2 +
arch/arm64/include/asm/kvm_pkvm.h | 16 +
arch/arm64/kvm/arm.c | 4 +
arch/arm64/kvm/hyp/include/nvhe/its_emulate.h | 16 +
arch/arm64/kvm/hyp/include/nvhe/mem_protect.h | 5 +
arch/arm64/kvm/hyp/nvhe/Makefile | 3 +-
arch/arm64/kvm/hyp/nvhe/hyp-main.c | 8 +
arch/arm64/kvm/hyp/nvhe/its_emulate.c | 765 ++++++++++++++++++
arch/arm64/kvm/hyp/nvhe/mem_protect.c | 130 ++-
arch/arm64/kvm/hyp/nvhe/setup.c | 22 +
arch/arm64/kvm/hyp/pgtable.c | 8 +-
arch/arm64/kvm/pkvm.c | 105 ++-
arch/arm64/kvm/vgic/vgic-its.c | 15 -
drivers/irqchip/irq-gic-common.h | 13 +
drivers/irqchip/irq-gic-v3-its.c | 301 ++++++-
drivers/irqchip/irq-gic-v3.c | 8 +
include/linux/irqchip/arm-gic-v3.h | 65 ++
21 files changed, 1475 insertions(+), 57 deletions(-)
create mode 100644 arch/arm64/kvm/hyp/include/nvhe/its_emulate.h
create mode 100644 arch/arm64/kvm/hyp/nvhe/its_emulate.c
base-commit: aebb7274476403040d582c61478df8f4a7bf9cd3
--
2.47.3
next reply other threads:[~2026-11-18 15:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 15:18 Fuad Tabba [this message]
2026-11-18 15:18 ` [PATCH v4 01/13] KVM: arm64: Donate MMIO to the hypervisor Fuad Tabba
2026-11-18 15:18 ` [PATCH v4 02/13] KVM: arm64: Take host-registered MMIO regions at pKVM finalisation Fuad Tabba
2026-11-18 15:18 ` [PATCH v4 03/13] irqchip/gic-v3: Disable GICv4 features in pKVM Fuad Tabba
2026-11-18 15:18 ` [PATCH v4 04/13] irqchip/gic-v3-its: Page-align ITT allocations " Fuad Tabba
2026-11-18 15:18 ` [PATCH v4 05/13] irqchip/gic-v3-its: Compute the wait target under the ITS lock Fuad Tabba
2026-11-18 15:18 ` [PATCH v4 06/13] KVM: arm64: Share the ITS command field accessors with the hypervisor Fuad Tabba
2026-11-18 15:18 ` [PATCH v4 07/13] KVM: arm64: Deprivilege the host under stop_machine() Fuad Tabba
2026-11-18 15:18 ` [PATCH v4 08/13] irqchip/gic-v3-its: Add the pKVM takeover entry points Fuad Tabba
2026-11-18 15:19 ` [PATCH v4 09/13] KVM: arm64: Emulate the ITS command queue 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=20261118151904.4099560-1-fuad.tabba@linux.dev \
--to=fuad.tabba@linux.dev \
--cc=Sascha.Bischoff@arm.com \
--cc=bgrzesik@google.com \
--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=radu@rendec.net \
--cc=rananta@google.com \
--cc=sebastianene@google.com \
--cc=seiden@linux.ibm.com \
--cc=smostafa@google.com \
--cc=suzuki.poulose@arm.com \
--cc=tabba@google.com \
--cc=tglx@kernel.org \
--cc=vdonnefort@google.com \
--cc=vladimir.murzin@arm.com \
--cc=will@kernel.org \
--cc=yuzenghui@huawei.com \
--cc=zenghui.yu@linux.dev \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox