OSDN Git Service

KVM: arm64: Add stand-alone page-table walker infrastructure
authorWill Deacon <will@kernel.org>
Fri, 11 Sep 2020 13:25:10 +0000 (14:25 +0100)
committerMarc Zyngier <maz@kernel.org>
Fri, 11 Sep 2020 14:51:12 +0000 (15:51 +0100)
commitb1e57de62cfb4d05f45ab848bb893fbcff9557d3
tree3312cbccfd660fbca6efee770471958bf390ff01
parent9af3e08baa7c20ee69b7fc18e720e08a091493b9
KVM: arm64: Add stand-alone page-table walker infrastructure

The KVM page-table code is intricately tied into the kernel page-table
code and re-uses the pte/pmd/pud/p4d/pgd macros directly in an attempt
to reduce code duplication. Unfortunately, the reality is that there is
an awful lot of code required to make this work, and at the end of the
day you're limited to creating page-tables with the same configuration
as the host kernel. Furthermore, lifting the page-table code to run
directly at EL2 on a non-VHE system (as we plan to to do in future
patches) is practically impossible due to the number of dependencies it
has on the core kernel.

Introduce a framework for walking Armv8 page-tables configured
independently from the host kernel.

Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Gavin Shan <gshan@redhat.com>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Quentin Perret <qperret@google.com>
Link: https://lore.kernel.org/r/20200911132529.19844-3-will@kernel.org
arch/arm64/include/asm/kvm_pgtable.h [new file with mode: 0644]
arch/arm64/kvm/hyp/Makefile
arch/arm64/kvm/hyp/pgtable.c [new file with mode: 0644]