Skip to content

Commit e998334

Browse files
kvaneeshmpe
authored andcommitted
powerpc/mm/radix: Add partition table format & callback
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>
1 parent 11a6f6a commit e998334

File tree

3 files changed

+31
-2
lines changed

3 files changed

+31
-2
lines changed

arch/powerpc/include/asm/book3s/64/mmu.h

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,39 @@ struct mmu_psize_def {
2121
extern struct mmu_psize_def mmu_psize_defs[MMU_PAGE_COUNT];
2222
#endif /* __ASSEMBLY__ */
2323

24-
#ifdef CONFIG_PPC_STD_MMU_64
2524
/* 64-bit classic hash table MMU */
2625
#include <asm/book3s/64/mmu-hash.h>
27-
#endif
2826

2927
#ifndef __ASSEMBLY__
28+
/*
29+
* ISA 3.0 partiton and process table entry format
30+
*/
31+
struct prtb_entry {
32+
__be64 prtb0;
33+
__be64 prtb1;
34+
};
35+
extern struct prtb_entry *process_tb;
36+
37+
struct patb_entry {
38+
__be64 patb0;
39+
__be64 patb1;
40+
};
41+
extern struct patb_entry *partition_tb;
42+
43+
#define PATB_HR (1UL << 63)
44+
#define PATB_GR (1UL << 63)
45+
#define RPDB_MASK 0x0ffffffffffff00fUL
46+
#define RPDB_SHIFT (1UL << 8)
47+
/*
48+
* Limit process table to PAGE_SIZE table. This
49+
* also limit the max pid we can support.
50+
* MAX_USER_CONTEXT * 16 bytes of space.
51+
*/
52+
#define PRTB_SIZE_SHIFT (CONTEXT_BITS + 4)
53+
/*
54+
* Power9 currently only support 64K partition table size.
55+
*/
56+
#define PATB_SIZE_SHIFT 16
3057

3158
typedef unsigned long mm_context_id_t;
3259
struct spinlock;

arch/powerpc/include/asm/machdep.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ struct machdep_calls {
256256
#ifdef CONFIG_ARCH_RANDOM
257257
int (*get_random_seed)(unsigned long *v);
258258
#endif
259+
int (*update_partition_table)(u64);
259260
};
260261

261262
extern void e500_idle(void);

arch/powerpc/include/asm/reg.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,7 @@
587587
#define SPRN_PIR 0x3FF /* Processor Identification Register */
588588
#endif
589589
#define SPRN_TIR 0x1BE /* Thread Identification Register */
590+
#define SPRN_PTCR 0x1D0 /* Partition table control Register */
590591
#define SPRN_PSPB 0x09F /* Problem State Priority Boost reg */
591592
#define SPRN_PTEHI 0x3D5 /* 981 7450 PTE HI word (S/W TLB load) */
592593
#define SPRN_PTELO 0x3D6 /* 982 7450 PTE LO word (S/W TLB load) */

0 commit comments

Comments
 (0)