Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Functions | Variables
mmu-hash64.h File Reference
#include <asm/asm-compat.h>
#include <asm/page.h>
#include <asm/pgtable-ppc64.h>

Go to the source code of this file.

Data Structures

struct  hash_pte
struct  mmu_psize_def
struct  mm_context_t


#define STE_ESID_V   0x80
#define STE_ESID_KS   0x20
#define STE_ESID_KP   0x10
#define STE_ESID_N   0x08
#define STE_VSID_SHIFT   12
#define STAB0_PAGE   0x8
#define STAB0_OFFSET   (STAB0_PAGE << 12)
#define SLB_NUM_BOLTED   3
#define SLB_MIN_SIZE   32
#define SLB_ESID_V   ASM_CONST(0x0000000008000000) /* valid */
#define SLB_VSID_SHIFT   12
#define SLB_VSID_SHIFT_1T   24
#define SLB_VSID_B   ASM_CONST(0xc000000000000000)
#define SLB_VSID_B_256M   ASM_CONST(0x0000000000000000)
#define SLB_VSID_B_1T   ASM_CONST(0x4000000000000000)
#define SLB_VSID_KS   ASM_CONST(0x0000000000000800)
#define SLB_VSID_KP   ASM_CONST(0x0000000000000400)
#define SLB_VSID_N   ASM_CONST(0x0000000000000200) /* no-execute */
#define SLB_VSID_L   ASM_CONST(0x0000000000000100)
#define SLB_VSID_C   ASM_CONST(0x0000000000000080) /* class */
#define SLB_VSID_LP   ASM_CONST(0x0000000000000030)
#define SLB_VSID_LP_00   ASM_CONST(0x0000000000000000)
#define SLB_VSID_LP_01   ASM_CONST(0x0000000000000010)
#define SLB_VSID_LP_10   ASM_CONST(0x0000000000000020)
#define SLB_VSID_LP_11   ASM_CONST(0x0000000000000030)
#define SLBIE_C   (0x08000000)
#define SLBIE_SSIZE_SHIFT   25
#define HPTES_PER_GROUP   8
#define HPTE_V_SSIZE_SHIFT   62
#define HPTE_V_AVPN_SHIFT   7
#define HPTE_V_AVPN   ASM_CONST(0x3fffffffffffff80)
#define HPTE_V_AVPN_VAL(x)   (((x) & HPTE_V_AVPN) >> HPTE_V_AVPN_SHIFT)
#define HPTE_V_COMPARE(x, y)   (!(((x) ^ (y)) & 0xffffffffffffff80UL))
#define HPTE_V_BOLTED   ASM_CONST(0x0000000000000010)
#define HPTE_V_LOCK   ASM_CONST(0x0000000000000008)
#define HPTE_V_LARGE   ASM_CONST(0x0000000000000004)
#define HPTE_V_SECONDARY   ASM_CONST(0x0000000000000002)
#define HPTE_V_VALID   ASM_CONST(0x0000000000000001)
#define HPTE_R_PP0   ASM_CONST(0x8000000000000000)
#define HPTE_R_TS   ASM_CONST(0x4000000000000000)
#define HPTE_R_KEY_HI   ASM_CONST(0x3000000000000000)
#define HPTE_R_RPN_SHIFT   12
#define HPTE_R_RPN   ASM_CONST(0x0ffffffffffff000)
#define HPTE_R_PP   ASM_CONST(0x0000000000000003)
#define HPTE_R_N   ASM_CONST(0x0000000000000004)
#define HPTE_R_G   ASM_CONST(0x0000000000000008)
#define HPTE_R_M   ASM_CONST(0x0000000000000010)
#define HPTE_R_I   ASM_CONST(0x0000000000000020)
#define HPTE_R_W   ASM_CONST(0x0000000000000040)
#define HPTE_R_WIMG   ASM_CONST(0x0000000000000078)
#define HPTE_R_C   ASM_CONST(0x0000000000000080)
#define HPTE_R_R   ASM_CONST(0x0000000000000100)
#define HPTE_R_KEY_LO   ASM_CONST(0x0000000000000e00)
#define HPTE_V_1TB_SEG   ASM_CONST(0x4000000000000000)
#define HPTE_V_VRMA_MASK   ASM_CONST(0x4001ffffff000000)
#define PP_RWXX   0 /* Supervisor read/write, User none */
#define PP_RWRX   1 /* Supervisor read/write, User read */
#define PP_RWRW   2 /* Supervisor read/write, User read/write */
#define PP_RXRX   3 /* Supervisor read, User read */
#define PP_RXXX   (HPTE_R_PP0 | 2) /* Supervisor read, user none */
#define MMU_SEGSIZE_256M   0
#define MMU_SEGSIZE_1T   1
#define VPN_SHIFT   12
#define VSID_MULTIPLIER_256M   ASM_CONST(12538073) /* 24-bit prime */
#define VSID_BITS_256M   38
#define VSID_MODULUS_256M   ((1UL<<VSID_BITS_256M)-1)
#define VSID_MULTIPLIER_1T   ASM_CONST(12538073) /* 24-bit prime */
#define VSID_BITS_1T   26
#define VSID_MODULUS_1T   ((1UL<<VSID_BITS_1T)-1)
#define CONTEXT_BITS   19
#define USER_ESID_BITS   18
#define USER_ESID_BITS_1T   6
#define ASM_VSID_SCRAMBLE(rt, rx, size)
#define vsid_scramble(protovsid, size)


typedef unsigned long mm_context_id_t


int __hash_page_4K (unsigned long ea, unsigned long access, unsigned long vsid, pte_t *ptep, unsigned long trap, unsigned int local, int ssize, int subpage_prot)
int __hash_page_64K (unsigned long ea, unsigned long access, unsigned long vsid, pte_t *ptep, unsigned long trap, unsigned int local, int ssize)
unsigned int hash_page_do_lazy_icache (unsigned int pp, pte_t pte, int trap)
int hash_page (unsigned long ea, unsigned long access, unsigned long trap)
int __hash_page_huge (unsigned long ea, unsigned long access, unsigned long vsid, pte_t *ptep, unsigned long trap, int local, int ssize, unsigned int shift, unsigned int mmu_psize)
void hash_failure_debug (unsigned long ea, unsigned long access, unsigned long vsid, unsigned long trap, int ssize, int psize, unsigned long pte)
int htab_bolt_mapping (unsigned long vstart, unsigned long vend, unsigned long pstart, unsigned long prot, int psize, int ssize)
void add_gpage (u64 addr, u64 page_size, unsigned long number_of_pages)
void demote_segment_4k (struct mm_struct *mm, unsigned long addr)
void hpte_init_native (void)
void hpte_init_lpar (void)
void hpte_init_beat (void)
void hpte_init_beat_v3 (void)
void stabs_alloc (void)
void slb_initialize (void)
void slb_flush_and_rebolt (void)
void stab_initialize (unsigned long stab)
void slb_vmalloc_update (void)
void slb_set_size (u16 size)


char initial_stab []
struct hash_ptehtab_address
unsigned long htab_size_bytes
unsigned long htab_hash_mask
struct mmu_psize_def mmu_psize_defs [MMU_PAGE_COUNT]
int mmu_linear_psize
int mmu_virtual_psize
int mmu_vmalloc_psize
int mmu_vmemmap_psize
int mmu_io_psize
int mmu_kernel_ssize
int mmu_highuser_ssize
u16 mmu_slb_size
unsigned long tce_alloc_start
unsigned long tce_alloc_end
int mmu_ci_restrictions

Macro Definition Documentation

#define ASM_VSID_SCRAMBLE (   rt,
lis rx,VSID_MULTIPLIER_##size@h; \
ori rx,rx,VSID_MULTIPLIER_##size@l; \
mulld rt,rt,rx; /* rt = rt * MULTIPLIER */ \
srdi rx,rt,VSID_BITS_##size; \
clrldi rt,rt,(64-VSID_BITS_##size); \
add rt,rt,rx; /* add high and low bits */ \
/* Now, r3 == VSID (mod 2^36-1), and lies between 0 and \
* 2^36-1+2^28-1. That in particular means that if r3 >= \
* 2^36-1, then r3+1 has the 2^36 bit set. So, if r3+1 has \
* the bit clear, r3 already has the answer we want, if it \
* doesn't, the answer is the low 36 bits of r3+1. So in all \
* cases the answer is the low 36 bits of (r3 + ((r3+1) >> 36))*/\
addi rx,rt,1; \
srdi rx,rx,VSID_BITS_##size; /* extract 2^VSID_BITS bit */ \
add rt,rt,rx

Definition at line 406 of file mmu-hash64.h.

#define CONTEXT_BITS   19

Definition at line 386 of file mmu-hash64.h.

#define HPTE_R_C   ASM_CONST(0x0000000000000080)

Definition at line 110 of file mmu-hash64.h.

#define HPTE_R_G   ASM_CONST(0x0000000000000008)

Definition at line 105 of file mmu-hash64.h.

#define HPTE_R_I   ASM_CONST(0x0000000000000020)

Definition at line 107 of file mmu-hash64.h.

#define HPTE_R_KEY_HI   ASM_CONST(0x3000000000000000)

Definition at line 100 of file mmu-hash64.h.

#define HPTE_R_KEY_LO   ASM_CONST(0x0000000000000e00)

Definition at line 112 of file mmu-hash64.h.

#define HPTE_R_M   ASM_CONST(0x0000000000000010)

Definition at line 106 of file mmu-hash64.h.

#define HPTE_R_N   ASM_CONST(0x0000000000000004)

Definition at line 104 of file mmu-hash64.h.

#define HPTE_R_PP   ASM_CONST(0x0000000000000003)

Definition at line 103 of file mmu-hash64.h.

#define HPTE_R_PP0   ASM_CONST(0x8000000000000000)

Definition at line 98 of file mmu-hash64.h.

#define HPTE_R_R   ASM_CONST(0x0000000000000100)

Definition at line 111 of file mmu-hash64.h.

#define HPTE_R_RPN   ASM_CONST(0x0ffffffffffff000)

Definition at line 102 of file mmu-hash64.h.

#define HPTE_R_RPN_SHIFT   12

Definition at line 101 of file mmu-hash64.h.

#define HPTE_R_TS   ASM_CONST(0x4000000000000000)

Definition at line 99 of file mmu-hash64.h.

#define HPTE_R_W   ASM_CONST(0x0000000000000040)

Definition at line 108 of file mmu-hash64.h.

#define HPTE_R_WIMG   ASM_CONST(0x0000000000000078)

Definition at line 109 of file mmu-hash64.h.

#define HPTE_V_1TB_SEG   ASM_CONST(0x4000000000000000)

Definition at line 114 of file mmu-hash64.h.

#define HPTE_V_AVPN   ASM_CONST(0x3fffffffffffff80)

Definition at line 89 of file mmu-hash64.h.

#define HPTE_V_AVPN_SHIFT   7

Definition at line 88 of file mmu-hash64.h.

#define HPTE_V_AVPN_VAL (   x)    (((x) & HPTE_V_AVPN) >> HPTE_V_AVPN_SHIFT)

Definition at line 90 of file mmu-hash64.h.

#define HPTE_V_BOLTED   ASM_CONST(0x0000000000000010)

Definition at line 92 of file mmu-hash64.h.

#define HPTE_V_COMPARE (   x,
)    (!(((x) ^ (y)) & 0xffffffffffffff80UL))

Definition at line 91 of file mmu-hash64.h.

#define HPTE_V_LARGE   ASM_CONST(0x0000000000000004)

Definition at line 94 of file mmu-hash64.h.

#define HPTE_V_LOCK   ASM_CONST(0x0000000000000008)

Definition at line 93 of file mmu-hash64.h.

#define HPTE_V_SECONDARY   ASM_CONST(0x0000000000000002)

Definition at line 95 of file mmu-hash64.h.

#define HPTE_V_SSIZE_SHIFT   62

Definition at line 87 of file mmu-hash64.h.

#define HPTE_V_VALID   ASM_CONST(0x0000000000000001)

Definition at line 96 of file mmu-hash64.h.

#define HPTE_V_VRMA_MASK   ASM_CONST(0x4001ffffff000000)

Definition at line 115 of file mmu-hash64.h.

#define HPTES_PER_GROUP   8

Definition at line 85 of file mmu-hash64.h.

#define MMU_SEGSIZE_1T   1

Definition at line 162 of file mmu-hash64.h.

#define MMU_SEGSIZE_256M   0

Definition at line 161 of file mmu-hash64.h.

#define PP_RWRW   2 /* Supervisor read/write, User read/write */

Definition at line 120 of file mmu-hash64.h.

#define PP_RWRX   1 /* Supervisor read/write, User read */

Definition at line 119 of file mmu-hash64.h.

#define PP_RWXX   0 /* Supervisor read/write, User none */

Definition at line 118 of file mmu-hash64.h.

#define PP_RXRX   3 /* Supervisor read, User read */

Definition at line 121 of file mmu-hash64.h.

#define PP_RXXX   (HPTE_R_PP0 | 2) /* Supervisor read, user none */

Definition at line 122 of file mmu-hash64.h.


Definition at line 50 of file mmu-hash64.h.

#define SLB_ESID_V   ASM_CONST(0x0000000008000000) /* valid */

Definition at line 54 of file mmu-hash64.h.

#define SLB_MIN_SIZE   32

Definition at line 51 of file mmu-hash64.h.

#define SLB_NUM_BOLTED   3

Definition at line 49 of file mmu-hash64.h.

#define SLB_VSID_B   ASM_CONST(0xc000000000000000)

Definition at line 60 of file mmu-hash64.h.

#define SLB_VSID_B_1T   ASM_CONST(0x4000000000000000)

Definition at line 62 of file mmu-hash64.h.

#define SLB_VSID_B_256M   ASM_CONST(0x0000000000000000)

Definition at line 61 of file mmu-hash64.h.

#define SLB_VSID_C   ASM_CONST(0x0000000000000080) /* class */

Definition at line 67 of file mmu-hash64.h.


Definition at line 75 of file mmu-hash64.h.

#define SLB_VSID_KP   ASM_CONST(0x0000000000000400)

Definition at line 64 of file mmu-hash64.h.

#define SLB_VSID_KS   ASM_CONST(0x0000000000000800)

Definition at line 63 of file mmu-hash64.h.

#define SLB_VSID_L   ASM_CONST(0x0000000000000100)

Definition at line 66 of file mmu-hash64.h.


Definition at line 73 of file mmu-hash64.h.

#define SLB_VSID_LP   ASM_CONST(0x0000000000000030)

Definition at line 68 of file mmu-hash64.h.

#define SLB_VSID_LP_00   ASM_CONST(0x0000000000000000)

Definition at line 69 of file mmu-hash64.h.

#define SLB_VSID_LP_01   ASM_CONST(0x0000000000000010)

Definition at line 70 of file mmu-hash64.h.

#define SLB_VSID_LP_10   ASM_CONST(0x0000000000000020)

Definition at line 71 of file mmu-hash64.h.

#define SLB_VSID_LP_11   ASM_CONST(0x0000000000000030)

Definition at line 72 of file mmu-hash64.h.

#define SLB_VSID_N   ASM_CONST(0x0000000000000200) /* no-execute */

Definition at line 65 of file mmu-hash64.h.

#define SLB_VSID_SHIFT   12

Definition at line 57 of file mmu-hash64.h.

#define SLB_VSID_SHIFT_1T   24

Definition at line 58 of file mmu-hash64.h.


Definition at line 59 of file mmu-hash64.h.


Definition at line 76 of file mmu-hash64.h.

#define SLBIE_C   (0x08000000)

Definition at line 78 of file mmu-hash64.h.

#define SLBIE_SSIZE_SHIFT   25

Definition at line 79 of file mmu-hash64.h.


Definition at line 420 of file mmu-hash64.h.

#define STAB0_OFFSET   (STAB0_PAGE << 12)

Definition at line 38 of file mmu-hash64.h.

#define STAB0_PAGE   0x8

Definition at line 37 of file mmu-hash64.h.


Definition at line 39 of file mmu-hash64.h.

#define STE_ESID_KP   0x10

Definition at line 31 of file mmu-hash64.h.

#define STE_ESID_KS   0x20

Definition at line 30 of file mmu-hash64.h.

#define STE_ESID_N   0x08

Definition at line 32 of file mmu-hash64.h.

#define STE_ESID_V   0x80

Definition at line 29 of file mmu-hash64.h.

#define STE_VSID_SHIFT   12

Definition at line 34 of file mmu-hash64.h.

#define USER_ESID_BITS   18

Definition at line 387 of file mmu-hash64.h.

#define USER_ESID_BITS_1T   6

Definition at line 388 of file mmu-hash64.h.


Definition at line 390 of file mmu-hash64.h.

#define VPN_SHIFT   12

Definition at line 172 of file mmu-hash64.h.

#define VSID_BITS_1T   26

Definition at line 383 of file mmu-hash64.h.

#define VSID_BITS_256M   38

Definition at line 379 of file mmu-hash64.h.

#define VSID_MODULUS_1T   ((1UL<<VSID_BITS_1T)-1)

Definition at line 384 of file mmu-hash64.h.

#define VSID_MODULUS_256M   ((1UL<<VSID_BITS_256M)-1)

Definition at line 380 of file mmu-hash64.h.

#define VSID_MULTIPLIER_1T   ASM_CONST(12538073) /* 24-bit prime */

Definition at line 382 of file mmu-hash64.h.

#define VSID_MULTIPLIER_256M   ASM_CONST(12538073) /* 24-bit prime */

Definition at line 378 of file mmu-hash64.h.

#define vsid_scramble (   protovsid,
({ \
unsigned long x; \
x = (protovsid) * VSID_MULTIPLIER_##size; \
x = (x >> VSID_BITS_##size) + (x & VSID_MODULUS_##size); \
(x + ((x+1) >> VSID_BITS_##size)) & VSID_MODULUS_##size; \

Definition at line 492 of file mmu-hash64.h.

Typedef Documentation

typedef unsigned long mm_context_id_t

Definition at line 456 of file mmu-hash64.h.

Function Documentation

int __hash_page_4K ( unsigned long  ea,
unsigned long  access,
unsigned long  vsid,
pte_t ptep,
unsigned long  trap,
unsigned int  local,
int  ssize,
int  subpage_prot 
int __hash_page_64K ( unsigned long  ea,
unsigned long  access,
unsigned long  vsid,
pte_t ptep,
unsigned long  trap,
unsigned int  local,
int  ssize 
int __hash_page_huge ( unsigned long  ea,
unsigned long  access,
unsigned long  vsid,
pte_t ptep,
unsigned long  trap,
int  local,
int  ssize,
unsigned int  shift,
unsigned int  mmu_psize 

Definition at line 17 of file hugetlbpage-hash64.c.

void add_gpage ( u64  addr,
u64  page_size,
unsigned long  number_of_pages 

Definition at line 343 of file hugetlbpage.c.

void demote_segment_4k ( struct mm_struct mm,
unsigned long  addr 
void hash_failure_debug ( unsigned long  ea,
unsigned long  access,
unsigned long  vsid,
unsigned long  trap,
int  ssize,
int  psize,
unsigned long  pte 

Definition at line 892 of file hash_utils_64.c.

int hash_page ( unsigned long  ea,
unsigned long  access,
unsigned long  trap 

Definition at line 910 of file hash_utils_64.c.

unsigned int hash_page_do_lazy_icache ( unsigned int  pp,
pte_t  pte,
int  trap 

Definition at line 783 of file hash_utils_64.c.

void hpte_init_beat ( void  )

Definition at line 304 of file beat_htab.c.

void hpte_init_beat_v3 ( void  )

Definition at line 424 of file beat_htab.c.

void hpte_init_lpar ( void  )

Definition at line 439 of file lpar.c.

void hpte_init_native ( void  )

Definition at line 572 of file hash_native_64.c.

int htab_bolt_mapping ( unsigned long  vstart,
unsigned long  vend,
unsigned long  pstart,
unsigned long  prot,
int  psize,
int  ssize 

Definition at line 174 of file hash_utils_64.c.

void slb_flush_and_rebolt ( void  )

Definition at line 134 of file slb.c.

void slb_initialize ( void  )

Definition at line 267 of file slb.c.

void slb_set_size ( u16  size)

Definition at line 256 of file slb.c.

void slb_vmalloc_update ( void  )

Definition at line 149 of file slb.c.

void stab_initialize ( unsigned long  stab)

Definition at line 271 of file stab.c.

void stabs_alloc ( void  )

Definition at line 239 of file stab.c.

Variable Documentation

struct hash_pte* htab_address

Definition at line 94 of file hash_utils_64.c.

unsigned long htab_hash_mask

Definition at line 96 of file hash_utils_64.c.

unsigned long htab_size_bytes

Definition at line 95 of file hash_utils_64.c.

char initial_stab[]
int mmu_ci_restrictions
int mmu_highuser_ssize

Definition at line 106 of file hash_utils_64.c.

int mmu_io_psize

Definition at line 104 of file hash_utils_64.c.

int mmu_kernel_ssize

Definition at line 105 of file hash_utils_64.c.

int mmu_linear_psize

Definition at line 98 of file hash_utils_64.c.

struct mmu_psize_def mmu_psize_defs[MMU_PAGE_COUNT]

Definition at line 92 of file hash_utils_64.c.

u16 mmu_slb_size

Definition at line 107 of file hash_utils_64.c.

int mmu_virtual_psize

Definition at line 99 of file hash_utils_64.c.

int mmu_vmalloc_psize

Definition at line 100 of file hash_utils_64.c.

int mmu_vmemmap_psize
unsigned long tce_alloc_end
unsigned long tce_alloc_start