Commit 5bae7bc6 authored by Will Deacon's avatar Will Deacon Committed by Marc Zyngier
Browse files

KVM: arm64: Rename PKVM_PAGE_STATE_MASK



Rename PKVM_PAGE_STATE_MASK to PKVM_PAGE_STATE_VMEMMAP_MASK to make it
clear that the mask applies to the page state recorded in the entries
of the 'hyp_vmemmap', rather than page states stored elsewhere (e.g. in
the ptes).

Suggested-by: default avatarAlexandru Elisei <alexandru.elisei@arm.com>
Reviewed-by: default avatarFuad Tabba <tabba@google.com>
Tested-by: default avatarFuad Tabba <tabba@google.com>
Tested-by: default avatarMostafa Saleh <smostafa@google.com>
Signed-off-by: default avatarWill Deacon <will@kernel.org>
Link: https://patch.msgid.link/20260330144841.26181-38-will@kernel.org


Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
parent feae58b6
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ enum pkvm_page_state {
	 */
	PKVM_POISON			= BIT(2),
};
#define PKVM_PAGE_STATE_MASK		(BIT(0) | BIT(1))
#define PKVM_PAGE_STATE_VMEMMAP_MASK	(BIT(0) | BIT(1))

#define PKVM_PAGE_STATE_PROT_MASK	(KVM_PGTABLE_PROT_SW0 | KVM_PGTABLE_PROT_SW1)
static inline enum kvm_pgtable_prot pkvm_mkstate(enum kvm_pgtable_prot prot,
@@ -114,12 +114,12 @@ static inline void set_host_state(struct hyp_page *p, enum pkvm_page_state state

static inline enum pkvm_page_state get_hyp_state(struct hyp_page *p)
{
	return p->__hyp_state_comp ^ PKVM_PAGE_STATE_MASK;
	return p->__hyp_state_comp ^ PKVM_PAGE_STATE_VMEMMAP_MASK;
}

static inline void set_hyp_state(struct hyp_page *p, enum pkvm_page_state state)
{
	p->__hyp_state_comp = state ^ PKVM_PAGE_STATE_MASK;
	p->__hyp_state_comp = state ^ PKVM_PAGE_STATE_VMEMMAP_MASK;
}

/*