Skip to content

Commit cd4b039

Browse files
Quentin PerretMarc Zyngier
authored andcommitted
KVM: arm64: Use 0b11 for encoding PKVM_NOPAGE
The page ownership state encoded as 0b11 is currently considered reserved for future use, and PKVM_NOPAGE uses bit 2. In order to simplify the relocation of the hyp ownership state into the vmemmap in later patches, let's use the 'reserved' encoding for the PKVM_NOPAGE state. The struct hyp_page layout isn't guaranteed stable at all, so there is no real reason to have 'reserved' encodings. No functional changes intended. Reviewed-by: Marc Zyngier <maz@kernel.org> Signed-off-by: Quentin Perret <qperret@google.com> Link: https://lore.kernel.org/r/20250416152648.2982950-4-qperret@google.com Signed-off-by: Marc Zyngier <maz@kernel.org>
1 parent ba63701 commit cd4b039

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

arch/arm64/kvm/hyp/include/nvhe/memory.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,15 @@ enum pkvm_page_state {
2323
PKVM_PAGE_OWNED = 0ULL,
2424
PKVM_PAGE_SHARED_OWNED = BIT(0),
2525
PKVM_PAGE_SHARED_BORROWED = BIT(1),
26-
__PKVM_PAGE_RESERVED = BIT(0) | BIT(1),
2726

2827
/*
2928
* 'Meta-states' are not stored directly in PTE SW bits for hyp and
3029
* guest states, but inferred from the context (e.g. invalid PTE
3130
* entries). For the host, meta-states are stored directly in the
3231
* struct hyp_page.
3332
*/
34-
PKVM_NOPAGE = BIT(2),
33+
PKVM_NOPAGE = BIT(0) | BIT(1),
3534
};
36-
#define PKVM_PAGE_META_STATES_MASK (~__PKVM_PAGE_RESERVED)
3735

3836
#define PKVM_PAGE_STATE_PROT_MASK (KVM_PGTABLE_PROT_SW0 | KVM_PGTABLE_PROT_SW1)
3937
static inline enum kvm_pgtable_prot pkvm_mkstate(enum kvm_pgtable_prot prot,

0 commit comments

Comments
 (0)