Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
	kvm@vger.kernel.org
Cc: Steffen Eiden <seiden@linux.ibm.com>,
	Joey Gouly <joey.gouly@arm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Oliver Upton <oupton@kernel.org>,
	Zenghui Yu <yuzenghui@huawei.com>,
	Fuad Tabba <fuad.tabba@linux.dev>
Subject: [PATCH 0/7] KVM: arm64: Fix cross-CPU vcpu pausing
Date: Thu, 15 Oct 2026 11:05:32 +0100	[thread overview]
Message-ID: <20261015100539.1011760-1-maz@kernel.org> (raw)

This series is a follow-up on what I previously posted at [1], and has
now grown a few more fixes, and inherited an improvement from Oliver.
Some of the fixes have already been merged, so what we have here
serves a slightly different goal.

As we are simplifying (and fixing) a bunch of vgic behaviours, it
becomes necessary to pause one (or all) vcpu(s) and *reliably*
introspect the state of interrupts.

It appears that the current KVM behaviour is remarkably broken:

- OUTSIDE_GUEST_MODE is published too early, before we have resynced
  the state, making it unreliable

- IN_GUEST_MODE is published too late, once we have already placed
  volatile state on the CPU (interrupts, for example), and making the
  in-memory state stale (edge pending bits are a particular sore spot)

- self-generated requests are sometimes posted too late, after we have
  committed to entering the guest, and are therefore delayed

- the pausing mechanism itself is unreliable, as it has no requirement
  to be called whilst holding a global lock, and therefore is able to
  nest, while it is backed by a simple boolean

This series addresses these defects, and builds on top of it to:

- add pausing to a single vcpu in addition to the full VM pausing

- convert LPI disabling and the MOVALL command to vcpu pausing

Patches on top of -rc6, most of them being Cc stable without any
qualification (this has been broken for as long as I can remember).

[1] https://lore.kernel.org/r/20260929093548.3598547-1-maz@kernel.org

Marc Zyngier (6):
  KVM: arm64: nv: Move L2->L1 switch on interrupt early
  KVM: arm64: Move OUTSIDE_GUEST_MODE publication past context being
    saved
  KVM: arm64: Move IN_GUEST_MODE ahead of state being loaded
  KVM: arm64: Turn vcpu->arch.pause into a counter
  KVM: arm64: vgic: Stop the target vcpu when disabling LPIs
  KVM: arm64: vgic-its: Stop the VM when handling MOVALL

Oliver Upton (1):
  KVM: arm64: Add helpers to halt a vCPU

 arch/arm64/include/asm/kvm_host.h  |  9 ++--
 arch/arm64/kvm/arm.c               | 69 ++++++++++++++++++++----------
 arch/arm64/kvm/nested.c            |  8 ++++
 arch/arm64/kvm/vgic/vgic-its.c     | 11 +++++
 arch/arm64/kvm/vgic/vgic-mmio-v3.c | 10 +++++
 arch/arm64/kvm/vgic/vgic.c         |  8 +---
 6 files changed, 81 insertions(+), 34 deletions(-)

-- 
2.47.3


             reply	other threads:[~2026-10-15 10:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-15 10:05 Marc Zyngier [this message]
2026-10-15 10:05 ` [PATCH 1/7] KVM: arm64: nv: Move L2->L1 switch on interrupt early Marc Zyngier
2026-10-15 10:16   ` sashiko-bot
2026-10-15 10:05 ` [PATCH 2/7] KVM: arm64: Move OUTSIDE_GUEST_MODE publication past context being saved Marc Zyngier
2026-10-15 12:57   ` Fuad Tabba
2026-10-15 10:05 ` [PATCH 3/7] KVM: arm64: Move IN_GUEST_MODE ahead of state being loaded Marc Zyngier
2026-10-15 10:05 ` [PATCH 4/7] KVM: arm64: Turn vcpu->arch.pause into a counter Marc Zyngier
2026-10-15 10:05 ` [PATCH 5/7] KVM: arm64: Add helpers to halt a vCPU Marc Zyngier
2026-10-15 12:57   ` Fuad Tabba
2026-10-15 13:13     ` Marc Zyngier
2026-10-15 13:15       ` Fuad Tabba
2026-10-15 10:05 ` [PATCH 6/7] KVM: arm64: vgic: Stop the target vcpu when disabling LPIs Marc Zyngier
2026-10-15 10:05 ` [PATCH 7/7] KVM: arm64: vgic-its: Stop the VM when handling MOVALL Marc Zyngier
2026-10-15 12:57 ` [PATCH 0/7] KVM: arm64: Fix cross-CPU vcpu pausing 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=20261015100539.1011760-1-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=fuad.tabba@linux.dev \
    --cc=joey.gouly@arm.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=oupton@kernel.org \
    --cc=seiden@linux.ibm.com \
    --cc=suzuki.poulose@arm.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox