From: Vincent Donnefort <vdonnefort@google.com>
To: maz@kernel.org, oliver.upton@linux.dev, joey.gouly@arm.com,
suzuki.poulose@arm.com, yuzenghui@huawei.com,
catalin.marinas@arm.com, will@kernel.org
Cc: qperret@google.com, linux-arm-kernel@lists.infradead.org,
kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org,
kernel-team@android.com,
Vincent Donnefort <vdonnefort@google.com>
Subject: [PATCH v5 00/10] Stage-2 huge mappings for pKVM np-guests
Date: Tue, 20 May 2025 09:51:51 +0100 [thread overview]
Message-ID: <20250520085201.3059786-1-vdonnefort@google.com> (raw)
Hi all,
This series adds support for stage-2 huge mappings (PMD_SIZE) to pKVM
np-guests, that is installing PMD-level mappings in the stage-2,
whenever the stage-1 is backed by either Hugetlbfs or THPs.
The last patch of that series is an optimization for CMOs using a shared
PMD_SIZE fixmap.
Changes since v4 (https://lore.kernel.org/all/20250509131706.2336138-1-vdonnefort@google.com/)
- Make guest CMO functions working with any input (Marc)
- Improve for_each_hyp_page() and fold struct hyp_page declaration
(Marc)
- in mem_protect.c "PMD_SIZE" replaced with kvm_granule_size(KVM_PGTABLE_LAST_LEVEL - 1)
(Marc)
- Remove useless guest pgtable callback force_pte (Marc)
- Fixblock functions fallsback on fixmap on 64KiB pages systems.
(Marc)
Changes since v3 (https://lore.kernel.org/all/20250407082706.1239603-1-vdonnefort@google.com/)
- Rebase on kvmarm/next
Changes since v2 (https://lore.kernel.org/all/20250306110038.3733649-1-vdonnefort@google.com/)
- Fix PUD_SIZE -> PMD_SIZE enforcement (Quentin)
- Rework pkvm_host_share_guest() to remove one hyp_page walk (Quentin)
- Remove one pgtable walk into __check_host_shared_guest() (Quentin)
- Return EBUSY on host_share_guest_count overflow
Changes since v1 (https://lore.kernel.org/all/20250228102530.1229089-1-vdonnefort@google.com/)
- WARN_ON() on !PAGE_ALIGNED size for guest CMOs (Quentin)
- check_range_allowed_memory() before accessing the Vmemmap (Quentin)
Quentin Perret (2):
KVM: arm64: Convert pkvm_mappings to interval tree
KVM: arm64: Add a range to pkvm_mappings
Vincent Donnefort (8):
KVM: arm64: Handle huge mappings for np-guest CMOs
KVM: arm64: Introduce for_each_hyp_page
KVM: arm64: Add a range to __pkvm_host_share_guest()
KVM: arm64: Add a range to __pkvm_host_unshare_guest()
KVM: arm64: Add a range to __pkvm_host_wrprotect_guest()
KVM: arm64: Add a range to __pkvm_host_test_clear_young_guest()
KVM: arm64: Stage-2 huge mappings for np-guests
KVM: arm64: np-guest CMOs with PMD_SIZE fixmap
arch/arm64/include/asm/kvm_pgtable.h | 7 +-
arch/arm64/include/asm/kvm_pkvm.h | 2 +
arch/arm64/kvm/hyp/include/nvhe/mem_protect.h | 8 +-
arch/arm64/kvm/hyp/include/nvhe/memory.h | 16 +-
arch/arm64/kvm/hyp/include/nvhe/mm.h | 4 +-
arch/arm64/kvm/hyp/nvhe/hyp-main.c | 16 +-
arch/arm64/kvm/hyp/nvhe/mem_protect.c | 264 +++++++++++-------
arch/arm64/kvm/hyp/nvhe/mm.c | 97 ++++++-
arch/arm64/kvm/hyp/nvhe/setup.c | 15 +-
arch/arm64/kvm/hyp/pgtable.c | 6 -
arch/arm64/kvm/mmu.c | 6 +-
arch/arm64/kvm/pkvm.c | 129 ++++-----
12 files changed, 365 insertions(+), 205 deletions(-)
base-commit: c4e91ea0cc7e6345a4f7b8167e838d728ca86c30
--
2.49.0.1143.g0be31eac6b-goog
next reply other threads:[~2025-05-20 10:07 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-20 8:51 Vincent Donnefort [this message]
2025-05-20 8:51 ` [PATCH v5 01/10] KVM: arm64: Handle huge mappings for np-guest CMOs Vincent Donnefort
2025-05-20 8:51 ` [PATCH v5 02/10] KVM: arm64: Introduce for_each_hyp_page Vincent Donnefort
2025-05-20 8:51 ` [PATCH v5 03/10] KVM: arm64: Add a range to __pkvm_host_share_guest() Vincent Donnefort
2025-05-20 8:51 ` [PATCH v5 04/10] KVM: arm64: Add a range to __pkvm_host_unshare_guest() Vincent Donnefort
2025-05-20 8:51 ` [PATCH v5 05/10] KVM: arm64: Add a range to __pkvm_host_wrprotect_guest() Vincent Donnefort
2025-05-20 8:51 ` [PATCH v5 06/10] KVM: arm64: Add a range to __pkvm_host_test_clear_young_guest() Vincent Donnefort
2025-05-20 8:51 ` [PATCH v5 07/10] KVM: arm64: Convert pkvm_mappings to interval tree Vincent Donnefort
2025-05-20 8:51 ` [PATCH v5 08/10] KVM: arm64: Add a range to pkvm_mappings Vincent Donnefort
2025-05-20 8:52 ` [PATCH v5 09/10] KVM: arm64: Stage-2 huge mappings for np-guests Vincent Donnefort
2025-05-20 8:52 ` [PATCH v5 10/10] KVM: arm64: np-guest CMOs with PMD_SIZE fixmap Vincent Donnefort
2025-05-21 11:01 ` Marc Zyngier
2025-05-21 11:43 ` Vincent Donnefort
2025-05-21 12:04 ` Marc Zyngier
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=20250520085201.3059786-1-vdonnefort@google.com \
--to=vdonnefort@google.com \
--cc=catalin.marinas@arm.com \
--cc=joey.gouly@arm.com \
--cc=kernel-team@android.com \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maz@kernel.org \
--cc=oliver.upton@linux.dev \
--cc=qperret@google.com \
--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;
as well as URLs for NNTP newsgroup(s).