[PATCH 1/2] KVM: arm64: Use appropriate mmu pointer in stage2 page table init.
Marc Zyngier
maz at kernel.org
Thu Nov 25 05:49:59 PST 2021
[+ Quentin]
Hi Ganapatro,
On Mon, 22 Nov 2021 09:58:02 +0000,
Ganapatrao Kulkarni <gankulkarni at os.amperecomputing.com> wrote:
>
> The kvm_pgtable_stage2_init/kvm_pgtable_stage2_init_flags function
> assume arch->mmu is same across all stage 2 mmu and initializes
> the pgt(page table) using arch->mmu.
> Using armc->mmu is not appropriate when nested virtualization is enabled
> since there are multiple stage 2 mmu tables are initialized to manage
> Guest-Hypervisor as well as Nested VM for the same vCPU.
>
> Add a mmu argument to kvm_pgtable_stage2_init that can be used during
> initialization. This patch is a preparatory patch for the
> nested virtualization series and no functional changes.
Thanks for having had a look, and for the analysis. This is obviously
a result of a hasty conversion to the 'new' page table code, and a
total oversight on my part.
I'm however not particularly thrilled with the approach you have taken
though, as carrying both the kvm->arch pointer *and* the mmu pointer
seems totally redundant (the mmu structure already has a backpointer
to kvm->arch or its pkvm equivalent). All we need is to rework the
initialisation for this pointer to be correct at the point of where we
follow it first.
I've pushed out my own version of this[1]. Please have a look.
Thanks,
M.
[1] https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git/commit/?h=kvm-arm64/nv-5.16-WIP&id=21790a24d88c3ed37989533709dad3d40905f5c3
--
Without deviation from the norm, progress is not possible.
More information about the linux-arm-kernel
mailing list