KVM: arm64: Change the layout of enum pkvm_page_state
authorQuentin Perret <qperret@google.com>
Wed, 18 Dec 2024 19:40:42 +0000 (19:40 +0000)
committerMarc Zyngier <maz@kernel.org>
Fri, 20 Dec 2024 09:43:59 +0000 (09:43 +0000)
commita1a1f1ff1f28d52deb39aa29b89663de2afefd67
tree81a3d65d21e47055c362dd98142e525b317784c4
parent78d4f34e2115b517bcbfe7ec0d018bbbb6f9b0b8
KVM: arm64: Change the layout of enum pkvm_page_state

The 'concrete' (a.k.a non-meta) page states are currently encoded using
software bits in PTEs. For performance reasons, the abstract
pkvm_page_state enum uses the same bits to encode these states as that
makes conversions from and to PTEs easy.

In order to prepare the ground for moving the 'concrete' state storage
to the hyp vmemmap, re-arrange the enum to use bits 0 and 1 for this
purpose.

No functional changes intended.

Tested-by: Fuad Tabba <tabba@google.com>
Reviewed-by: Fuad Tabba <tabba@google.com>
Signed-off-by: Quentin Perret <qperret@google.com>
Link: https://lore.kernel.org/r/20241218194059.3670226-2-qperret@google.com
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/kvm/hyp/include/nvhe/mem_protect.h