KVM: arm64: pkvm: Refcount the pages shared with EL2
authorQuentin Perret <qperret@google.com>
Wed, 15 Dec 2021 16:12:24 +0000 (16:12 +0000)
committerMarc Zyngier <maz@kernel.org>
Thu, 16 Dec 2021 12:58:56 +0000 (12:58 +0000)
commita83e2191b7f1894dd0b4b3816ceb9caf4e0cd7e5
tree6afc533f512b43a468caa968c8c4de71dc8d5eb9
parent3f868e142c0bb052a1c15fd3ceca1391604e2e69
KVM: arm64: pkvm: Refcount the pages shared with EL2

In order to simplify the page tracking infrastructure at EL2 in nVHE
protected mode, move the responsibility of refcounting pages that are
shared multiple times on the host. In order to do so, let's create a
red-black tree tracking all the PFNs that have been shared, along with
a refcount.

Acked-by: Will Deacon <will@kernel.org>
Signed-off-by: Quentin Perret <qperret@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211215161232.1480836-8-qperret@google.com
arch/arm64/kvm/mmu.c