]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
powerpc/mm/radix: Add partition table format & callback
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Fri, 29 Apr 2016 13:25:42 +0000 (23:25 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Sun, 1 May 2016 08:32:39 +0000 (18:32 +1000)
Add structs and #defines related to the radix MMU partition table
format. We also add a ppc_md callback for updating a partition table
entry.

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/mmu.h
arch/powerpc/include/asm/machdep.h
arch/powerpc/include/asm/reg.h

index aadb0bbc5c71e58e9863e30acccf37aeae907d2d..b86786f2521c53c7884667b3507f4bd679a9c009 100644 (file)
@@ -21,12 +21,39 @@ struct mmu_psize_def {
 extern struct mmu_psize_def mmu_psize_defs[MMU_PAGE_COUNT];
 #endif /* __ASSEMBLY__ */
 
-#ifdef CONFIG_PPC_STD_MMU_64
 /* 64-bit classic hash table MMU */
 #include <asm/book3s/64/mmu-hash.h>
-#endif
 
 #ifndef __ASSEMBLY__
+/*
+ * ISA 3.0 partiton and process table entry format
+ */
+struct prtb_entry {
+       __be64 prtb0;
+       __be64 prtb1;
+};
+extern struct prtb_entry *process_tb;
+
+struct patb_entry {
+       __be64 patb0;
+       __be64 patb1;
+};
+extern struct patb_entry *partition_tb;
+
+#define PATB_HR                (1UL << 63)
+#define PATB_GR                (1UL << 63)
+#define RPDB_MASK      0x0ffffffffffff00fUL
+#define RPDB_SHIFT     (1UL << 8)
+/*
+ * Limit process table to PAGE_SIZE table. This
+ * also limit the max pid we can support.
+ * MAX_USER_CONTEXT * 16 bytes of space.
+ */
+#define PRTB_SIZE_SHIFT        (CONTEXT_BITS + 4)
+/*
+ * Power9 currently only support 64K partition table size.
+ */
+#define PATB_SIZE_SHIFT        16
 
 typedef unsigned long mm_context_id_t;
 struct spinlock;
index fd22442d30a9732eae0489c4e062cfe41628884c..6bdcd0da9e2148565522bd12a4dcece725c9fa70 100644 (file)
@@ -256,6 +256,7 @@ struct machdep_calls {
 #ifdef CONFIG_ARCH_RANDOM
        int (*get_random_seed)(unsigned long *v);
 #endif
+       int (*update_partition_table)(u64);
 };
 
 extern void e500_idle(void);
index cf09c6eb5ee7c7e457c932045426ffe0a23cd1d3..47082bcbf1e502013880394d0f7325b4f9044dc1 100644 (file)
 #define SPRN_PIR       0x3FF   /* Processor Identification Register */
 #endif
 #define SPRN_TIR       0x1BE   /* Thread Identification Register */
+#define SPRN_PTCR      0x1D0   /* Partition table control Register */
 #define SPRN_PSPB      0x09F   /* Problem State Priority Boost reg */
 #define SPRN_PTEHI     0x3D5   /* 981 7450 PTE HI word (S/W TLB load) */
 #define SPRN_PTELO     0x3D6   /* 982 7450 PTE LO word (S/W TLB load) */