powerpc/mm/keys: Move pte bits to correct headers
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Wed, 7 Mar 2018 13:36:44 +0000 (19:06 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 30 Mar 2018 13:10:36 +0000 (00:10 +1100)
Memory keys are supported only with hash translation mode. Instead of
using #ifdef in generic code move the key related pte bits to
respective headers

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/book3s/64/hash-4k.h
arch/powerpc/include/asm/book3s/64/hash-64k.h
arch/powerpc/include/asm/book3s/64/pgtable.h

index 67c5475311ee6e03b29486f8518dc74758263224..4cbec8195f85fcf7a2576aff1b7223c08c3bdb1f 100644 (file)
 #define H_PAGE_COMBO   0x0
 #define H_PTE_FRAG_NR  0
 #define H_PTE_FRAG_SIZE_SHIFT  0
+
+/* memory key bits, only 8 keys supported */
+#define H_PTE_PKEY_BIT0        0
+#define H_PTE_PKEY_BIT1        0
+#define H_PTE_PKEY_BIT2        _RPAGE_RSV3
+#define H_PTE_PKEY_BIT3        _RPAGE_RSV4
+#define H_PTE_PKEY_BIT4        _RPAGE_RSV5
+
 /*
  * On all 4K setups, remap_4k_pfn() equates to remap_pfn_range()
  */
index 3bcf269f8f55470097ac56680685321bf13e62ba..fcca6de62f3adcb3a2560cbb39e23f1f996aeb9f 100644 (file)
 #define H_PAGE_BUSY    _RPAGE_RPN44     /* software: PTE & hash are busy */
 #define H_PAGE_HASHPTE _RPAGE_RPN43    /* PTE has associated HPTE */
 
+/* memory key bits. */
+#define H_PTE_PKEY_BIT0        _RPAGE_RSV1
+#define H_PTE_PKEY_BIT1        _RPAGE_RSV2
+#define H_PTE_PKEY_BIT2        _RPAGE_RSV3
+#define H_PTE_PKEY_BIT3        _RPAGE_RSV4
+#define H_PTE_PKEY_BIT4        _RPAGE_RSV5
+
 /*
  * We need to differentiate between explicit huge page and THP huge
  * page, since THP huge page also need to track real subpage details
index a6b9f1d746002cd3479686603c76322d52676db9..47b5ffc8715d9c02e342c31459f201d66c7de399 100644 (file)
 /* Max physical address bit as per radix table */
 #define _RPAGE_PA_MAX          57
 
-#ifdef CONFIG_PPC_MEM_KEYS
-#ifdef CONFIG_PPC_64K_PAGES
-#define H_PTE_PKEY_BIT0        _RPAGE_RSV1
-#define H_PTE_PKEY_BIT1        _RPAGE_RSV2
-#else /* CONFIG_PPC_64K_PAGES */
-#define H_PTE_PKEY_BIT0        0 /* _RPAGE_RSV1 is not available */
-#define H_PTE_PKEY_BIT1        0 /* _RPAGE_RSV2 is not available */
-#endif /* CONFIG_PPC_64K_PAGES */
-#define H_PTE_PKEY_BIT2        _RPAGE_RSV3
-#define H_PTE_PKEY_BIT3        _RPAGE_RSV4
-#define H_PTE_PKEY_BIT4        _RPAGE_RSV5
-#else /*  CONFIG_PPC_MEM_KEYS */
-#define H_PTE_PKEY_BIT0        0
-#define H_PTE_PKEY_BIT1        0
-#define H_PTE_PKEY_BIT2        0
-#define H_PTE_PKEY_BIT3        0
-#define H_PTE_PKEY_BIT4        0
-#endif /*  CONFIG_PPC_MEM_KEYS */
-
 /*
  * Max physical address bit we will use for now.
  *