From: Wei-Lin Chang <weilin.chang@arm.com>
To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
linux-kselftest@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Shuah Khan <shuah@kernel.org>, Marc Zyngier <maz@kernel.org>,
Oliver Upton <oupton@kernel.org>, Joey Gouly <joey.gouly@arm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Zenghui Yu <yuzenghui@huawei.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
Itaru Kitayama <itaru.kitayama@fujitsu.com>,
Wei-Lin Chang <weilin.chang@arm.com>
Subject: [PATCH v3 0/9] KVM: arm64: selftests: Basic nested guest support
Date: Sat, 16 May 2026 19:29:54 +0100 [thread overview]
Message-ID: <20260516183003.799058-1-weilin.chang@arm.com> (raw)
Hi,
This is v3 of adding basic support for running nested guests (L2) in
kselftest. This time a framework for enabling stage-2 in the guest is
added, including the s2_mmu struct, s2 translation control setup, and
a stage-2 page table generator. Similar to L2 vCPU management, all
stage-2 work is done in the guest instead of userspace.
An additional shadow_stage2 test is added which leverages the framework
to run L2 with stage-2 enabled.
* Changes from v2 [1]:
- Update vm_paddr_t to gpa_t, vm_vaddr_t to gva_t.
- Added framework for enabling stage-2 in the guest.
- Added shadow_stage2 test.
Thanks!
[1]: https://lore.kernel.org/kvmarm/20260412142216.3806482-1-weilin.chang@arm.com/
Wei-Lin Chang (9):
KVM: arm64: selftests: Add GPR save/restore functions for NV
KVM: arm64: selftests: Add helpers for guest hypervisors
KVM: arm64: selftests: Add hello_nested basic NV selftest
KVM: arm64: selftests: Enhance hello_nested test
KVM: arm64: selftests: Add shadow_stage2 test
KVM: arm64: selftests: shadow_stage2: Allocate L2 stack from dedicated
pool
KVM: arm64: selftests: shadow_stage2: Check supported stage-2 granule
size
KVM: arm64: selftests: Add infrastructure for using stage-2 in guest
KVM: arm64: selftests: shadow_stage2: Turn on stage-2 translation for
the nested guest
tools/testing/selftests/kvm/Makefile.kvm | 5 +
.../selftests/kvm/arm64/hello_nested.c | 134 +++++++++
.../selftests/kvm/arm64/shadow_stage2.c | 165 +++++++++++
.../selftests/kvm/include/arm64/nested.h | 85 ++++++
tools/testing/selftests/kvm/lib/arm64/entry.S | 137 +++++++++
.../selftests/kvm/lib/arm64/hyp-entry.S | 77 +++++
.../testing/selftests/kvm/lib/arm64/nested.c | 264 ++++++++++++++++++
7 files changed, 867 insertions(+)
create mode 100644 tools/testing/selftests/kvm/arm64/hello_nested.c
create mode 100644 tools/testing/selftests/kvm/arm64/shadow_stage2.c
create mode 100644 tools/testing/selftests/kvm/include/arm64/nested.h
create mode 100644 tools/testing/selftests/kvm/lib/arm64/entry.S
create mode 100644 tools/testing/selftests/kvm/lib/arm64/hyp-entry.S
create mode 100644 tools/testing/selftests/kvm/lib/arm64/nested.c
--
2.43.0
next reply other threads:[~2026-05-16 18:31 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-16 18:29 Wei-Lin Chang [this message]
2026-05-16 18:29 ` [PATCH v3 1/9] KVM: arm64: selftests: Add GPR save/restore functions for NV Wei-Lin Chang
2026-05-16 18:29 ` [PATCH v3 2/9] KVM: arm64: selftests: Add helpers for guest hypervisors Wei-Lin Chang
2026-05-16 18:29 ` [PATCH v3 3/9] KVM: arm64: selftests: Add hello_nested basic NV selftest Wei-Lin Chang
2026-05-16 18:29 ` [PATCH v3 4/9] KVM: arm64: selftests: Enhance hello_nested test Wei-Lin Chang
2026-05-16 18:29 ` [PATCH v3 5/9] KVM: arm64: selftests: Add shadow_stage2 test Wei-Lin Chang
2026-05-16 18:30 ` [PATCH v3 6/9] KVM: arm64: selftests: shadow_stage2: Allocate L2 stack from dedicated pool Wei-Lin Chang
2026-05-16 18:30 ` [PATCH v3 7/9] KVM: arm64: selftests: shadow_stage2: Check supported stage-2 granule size Wei-Lin Chang
2026-05-16 18:30 ` [PATCH v3 8/9] KVM: arm64: selftests: Add infrastructure for using stage-2 in guest Wei-Lin Chang
2026-05-16 18:30 ` [PATCH v3 9/9] KVM: arm64: selftests: shadow_stage2: Turn on stage-2 translation for the nested guest Wei-Lin Chang
2026-05-19 21:31 ` [PATCH v3 0/9] KVM: arm64: selftests: Basic nested guest support Oliver Upton
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=20260516183003.799058-1-weilin.chang@arm.com \
--to=weilin.chang@arm.com \
--cc=catalin.marinas@arm.com \
--cc=itaru.kitayama@fujitsu.com \
--cc=joey.gouly@arm.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=maz@kernel.org \
--cc=oupton@kernel.org \
--cc=pbonzini@redhat.com \
--cc=shuah@kernel.org \
--cc=suzuki.poulose@arm.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