Commit 0cd7d721 authored by Quentin Perret's avatar Quentin Perret
Browse files

BACKPORT: FROMGIT: KVM: arm64: Introduce the EL1 pKVM MMU



Introduce a set of helper functions allowing to manipulate the pKVM
guest stage-2 page-tables from EL1 using pKVM's HVC interface.

Each helper has an exact one-to-one correspondance with the traditional
kvm_pgtable_stage2_*() functions from pgtable.c, with a strictly
matching prototype. This will ease plumbing later on in mmu.c.

These callbacks track the gfn->pfn mappings in a simple rb_tree indexed
by IPA in lieu of a page-table. This rb-tree is kept in sync with pKVM's
state and is protected by the mmu_lock like a traditional stage-2
page-table.

BACKPORT: Temporarily hardcoded all sizes/order parameters to PAGE_SIZE
granularity to keep patch as close as possible to upstream. Support for
THP will be implemented in a later patch.

Bug: 357781595
Bug: 235345873
Change-Id: I93187bdee437c6e22d1cd27c14109be5f4f0d89c
Signed-off-by: default avatarQuentin Perret <qperret@google.com>
Tested-by: default avatarFuad Tabba <tabba@google.com>
Reviewed-by: default avatarFuad Tabba <tabba@google.com>
Link: https://lore.kernel.org/r/20241218194059.3670226-18-qperret@google.com


Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
(cherry picked from commit e912efed
 git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm next)
Signed-off-by: default avatarQuentin Perret <qperret@google.com>
parent 874488c3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment