arm64: Define PTE_TYPE_HUGEPAGE
PATCH 1/1 arm64: Define PTE_TYPE_HUGEPAGE
PTE_TYPE_HUGEPAGE is referenced by pte_huge, but because nobody uses this macro it doesn't fail yet. KVM will be using this when 32-bit support for huge pages is added so add it.
--- arch/arm64/include/asm/pgtable-hwdef.h | 1 + 1 file changed, 1 insertion(+)
arch/arm64/include/asm/pgtable-hwdef.h +1 -0
@@ -54,6 +54,7 @@#define PTE_TYPE_MASK (_AT(pteval_t, 3) << 0)#define PTE_TYPE_FAULT (_AT(pteval_t, 0) << 0)#define PTE_TYPE_PAGE (_AT(pteval_t, 3) << 0) +#define PTE_TYPE_HUGEPAGE (_AT(pteval_t, 1) << 0)#define PTE_USER (_AT(pteval_t, 1) << 6)/* AP[1] */ #define PTE_RDONLY (_AT(pteval_t, 1) << 7)/* AP[2] */ #define PTE_SHARED (_AT(pteval_t, 3) << 8)/* SH[1:0], inner shareable */
Signature · 1 line
1.8.1.2
PATCH 1/1 arm64: Define PTE_TYPE_HUGEPAGE
Quoted 24 lines · Christoffer Dall
PTE_TYPE_HUGEPAGEis referenced bypte_huge, but because nobody uses this macro it doesn't fail yet. KVM will be using this when 32-bit support for huge pages is added so add it.Signed-off-by Christoffer Dall <[email protected]>--- arch/arm64/include/asm/pgtable-hwdef.h | 1 + 1 file changed, 1 insertion(+)arch/arm64/include/asm/pgtable-hwdef.h +1
-0@@ -54,6 +54,7 @@#define PTE_TYPE_MASK (_AT(pteval_t, 3) << 0)#define PTE_TYPE_FAULT (_AT(pteval_t, 0) << 0)#define PTE_TYPE_PAGE (_AT(pteval_t, 3) << 0) +#define PTE_TYPE_HUGEPAGE (_AT(pteval_t, 1) << 0)#define PTE_USER (_AT(pteval_t, 1) << 6)/* AP[1] */ #define PTE_RDONLY (_AT(pteval_t, 1) << 7)/* AP[2] */ #define PTE_SHARED (_AT(pteval_t, 3) << 8)/* SH[1:0], inner shareable */ Signature · 1 line
1.8.1.2
Hi Christoffer,
We can have PROT_NONE protected huge pages in ARM64 and the descriptors for these will end in 00b. They are faulting descriptors, so any reads or writes by user or kernel space will fault.
I have the following in my huge page patches:
#define pte_huge(pte) (!(pte_val(pte) & PTE_TABLE_BIT))
i.e. check for bit 1 clear.
Please let me know if I've missed a PTE_TYPE_HUGEPAGE somewhere and I'll fix it.
Thanks,
Signature · 1 line
Steve
PATCH 1/1 arm64: Define PTE_TYPE_HUGEPAGE
Quoted 31 lines · Steve Capper
Quoted 24 lines · Christoffer Dall
PTE_TYPE_HUGEPAGEis referenced bypte_huge, but because nobody uses this macro it doesn't fail yet. KVM will be using this when 32-bit support for huge pages is added so add it.Signed-off-by Christoffer Dall <[email protected]>--- arch/arm64/include/asm/pgtable-hwdef.h | 1 + 1 file changed, 1 insertion(+)arch/arm64/include/asm/pgtable-hwdef.h +1
-0@@ -54,6 +54,7 @@#define PTE_TYPE_MASK (_AT(pteval_t, 3) << 0)#define PTE_TYPE_FAULT (_AT(pteval_t, 0) << 0)#define PTE_TYPE_PAGE (_AT(pteval_t, 3) << 0) +#define PTE_TYPE_HUGEPAGE (_AT(pteval_t, 1) << 0)#define PTE_USER (_AT(pteval_t, 1) << 6)/* AP[1] */ #define PTE_RDONLY (_AT(pteval_t, 1) << 7)/* AP[2] */ #define PTE_SHARED (_AT(pteval_t, 3) << 8)/* SH[1:0], inner shareable */ Signature · 1 line
1.8.1.2Hi Christoffer,
We can havePROT_NONEprotected huge pages in ARM64 and the descriptors for these will end in 00b. They are faulting descriptors, so any reads or writes by user or kernel space will fault.
Quoted 8 lines
I have the following in my huge page patches:
#definepte_huge(pte)(!(pte_val(pte) &PTE_TABLE_BIT))i.e. check for bit 1 clear.
Please let me know if I've missed a
PTE_TYPE_HUGEPAGEsomewhere and I'll fix it.
I don't think so, the only place it showed up was for the predicates. I'll just wait until all this is worked out and merged into Catalin's tree (or upstream) and base the patch series on that for the next version.
Thanks,
-Christoffer