]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
KVM: arm64: Rename PKVM_PAGE_STATE_MASK
authorWill Deacon <will@kernel.org>
Mon, 30 Mar 2026 14:48:38 +0000 (15:48 +0100)
committerMarc Zyngier <maz@kernel.org>
Mon, 30 Mar 2026 15:58:09 +0000 (16:58 +0100)
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: Alexandru Elisei <alexandru.elisei@arm.com>
Reviewed-by: Fuad Tabba <tabba@google.com>
Tested-by: Fuad Tabba <tabba@google.com>
Tested-by: Mostafa Saleh <smostafa@google.com>
Signed-off-by: Will Deacon <will@kernel.org>
Link: https://patch.msgid.link/20260330144841.26181-38-will@kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/kvm/hyp/include/nvhe/memory.h

index 4cedb720c75d221a53fcc123efd76199f3141cd5..b50712d47f6d6e8019bfd1f88bae57bfb1c5793e 100644 (file)
@@ -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;
 }
 
 /*