ANDROID: KVM: arm64: Fix PKVM_PAGE_RESTRICTED_PROT conflict

Currently, PKVM_PAGE_RESTRICTED_PROT == __PKVM_PAGE_RESERVED + 2, i.e.
BIT(55) | BIT(56) | BIT(1). IOW, It is not possible to distinguish
RESTRICTED from ownership.

Make PKVM_PAGE_RESTRICTED_PROT the second bit of pkvm_page_state so it
can be combined with the ownership status.

Bug: 244543039
Bug: 244373730
Change-Id: Iee9b84d4f07fca323b35e2d7da54f3657ae2cff9
Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
(cherry picked from commit 39176c9df0)
This commit is contained in:
Vincent Donnefort
2023-01-26 09:48:24 +00:00
parent e72d262632
commit 756818ff77

View File

@@ -30,8 +30,8 @@ enum pkvm_page_state {
KVM_PGTABLE_PROT_SW1,
/* Meta-states which aren't encoded directly in the PTE's SW bits */
PKVM_NOPAGE,
PKVM_PAGE_RESTRICTED_PROT,
PKVM_NOPAGE = BIT(0),
PKVM_PAGE_RESTRICTED_PROT = BIT(1),
};
#define PKVM_PAGE_STATE_PROT_MASK (KVM_PGTABLE_PROT_SW0 | KVM_PGTABLE_PROT_SW1)