From: Fuad Tabba <fuad.tabba@linux.dev>
To: Marc Zyngier <maz@kernel.org>, Oliver Upton <oupton@kernel.org>
Cc: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, 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>,
Raghavendra Rao Ananta <rananta@google.com>,
Vincent Donnefort <vdonnefort@google.com>,
Fuad Tabba <tabba@google.com>
Subject: [PATCH v2 0/2] KVM: arm64: Stop stage-2 teardown scaling with the IPA size
Date: Wed, 4 Nov 2026 12:44:49 +0000 [thread overview]
Message-ID: <20261104124451.2148724-1-fuad.tabba@linux.dev> (raw)
Hi folks,
Changes since v1 [1]:
- Run all teardown from stage2_destroy_range() (Oliver, Suzuki)
- Dropped the Fixes tags (Marc)
- Dropped the patch moving the teardown into kvm_vm_s2_ops
- Use gfn_to_gpa() for a mapping's address. (Vincent)
Two patches that make stage-2 teardown take time proportional to what
is mapped, rather than to the size of the IPA space as it has since
4ddfab5436b6.
Under QEMU TCG ('-cpu max', 16K pages with LPA2), destroying even an
empty VM takes about 7 seconds in pKVM. Without pKVM it takes about 19
seconds if the VM requests a 52-bit IPA (crosvm requests the host's
limit). With the series, both take well under a second. I tested only
under QEMU, since I don't have hardware with LPA2.
The first has the page-table walk return where it stopped, so that the
teardown steps over an invalid entry larger than a block-sized chunk in
one go. The second has pKVM return where its next mapping starts.
pKVM gives every VM the host's IPA limit. My series honoring
KVM_VM_TYPE_ARM_IPA_SIZE in pKVM [2] doesn't change that for crosvm,
which requests the limit.
Based on Linux 7.4-rc1 (6628e7d4c6b25).
Cheers,
/fuad
[1] https://lore.kernel.org/all/20261103084742.1302597-1-fuad.tabba@linux.dev/
[2] https://lore.kernel.org/all/20260917091826.2639205-1-fuad.tabba@linux.dev/
Fuad Tabba (2):
KVM: arm64: Resume stage-2 teardown where the walk stopped
KVM: arm64: Resume a pKVM stage-2 teardown at the next mapping
arch/arm64/include/asm/kvm_pgtable.h | 8 ++++++--
arch/arm64/include/asm/kvm_pkvm.h | 4 ++--
arch/arm64/kvm/hyp/pgtable.c | 15 ++++++++++++---
arch/arm64/kvm/mmu.c | 4 ++--
arch/arm64/kvm/pkvm.c | 12 +++++++++---
5 files changed, 31 insertions(+), 12 deletions(-)
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
--
2.47.3
next reply other threads:[~2026-11-04 12:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-04 12:44 Fuad Tabba [this message]
2026-11-04 12:44 ` [PATCH v2 1/2] KVM: arm64: Resume stage-2 teardown where the walk stopped Fuad Tabba
2026-11-04 18:30 ` Oliver Upton
2026-11-04 12:44 ` [PATCH v2 2/2] KVM: arm64: Resume a pKVM stage-2 teardown at the next mapping 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=20261104124451.2148724-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=rananta@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox