aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/lppaca.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/include/asm/lppaca.h')
-rw-r--r--arch/powerpc/include/asm/lppaca.h68
1 files changed, 39 insertions, 29 deletions
diff --git a/arch/powerpc/include/asm/lppaca.h b/arch/powerpc/include/asm/lppaca.h
index 9b12f88d4adb..4470d1e34d23 100644
--- a/arch/powerpc/include/asm/lppaca.h
+++ b/arch/powerpc/include/asm/lppaca.h
@@ -48,15 +48,13 @@
48struct lppaca { 48struct lppaca {
49 /* cacheline 1 contains read-only data */ 49 /* cacheline 1 contains read-only data */
50 50
51 u32 desc; /* Eye catcher 0xD397D781 */ 51 __be32 desc; /* Eye catcher 0xD397D781 */
52 u16 size; /* Size of this struct */ 52 __be16 size; /* Size of this struct */
53 u16 reserved1; 53 u8 reserved1[3];
54 u16 reserved2:14; 54 u8 __old_status; /* Old status, including shared proc */
55 u8 shared_proc:1; /* Shared processor indicator */
56 u8 secondary_thread:1; /* Secondary thread indicator */
57 u8 reserved3[14]; 55 u8 reserved3[14];
58 volatile u32 dyn_hw_node_id; /* Dynamic hardware node id */ 56 volatile __be32 dyn_hw_node_id; /* Dynamic hardware node id */
59 volatile u32 dyn_hw_proc_id; /* Dynamic hardware proc id */ 57 volatile __be32 dyn_hw_proc_id; /* Dynamic hardware proc id */
60 u8 reserved4[56]; 58 u8 reserved4[56];
61 volatile u8 vphn_assoc_counts[8]; /* Virtual processor home node */ 59 volatile u8 vphn_assoc_counts[8]; /* Virtual processor home node */
62 /* associativity change counters */ 60 /* associativity change counters */
@@ -73,9 +71,9 @@ struct lppaca {
73 u8 fpregs_in_use; 71 u8 fpregs_in_use;
74 u8 pmcregs_in_use; 72 u8 pmcregs_in_use;
75 u8 reserved8[28]; 73 u8 reserved8[28];
76 u64 wait_state_cycles; /* Wait cycles for this proc */ 74 __be64 wait_state_cycles; /* Wait cycles for this proc */
77 u8 reserved9[28]; 75 u8 reserved9[28];
78 u16 slb_count; /* # of SLBs to maintain */ 76 __be16 slb_count; /* # of SLBs to maintain */
79 u8 idle; /* Indicate OS is idle */ 77 u8 idle; /* Indicate OS is idle */
80 u8 vmxregs_in_use; 78 u8 vmxregs_in_use;
81 79
@@ -89,17 +87,17 @@ struct lppaca {
89 * NOTE: This value will ALWAYS be zero for dedicated processors and 87 * NOTE: This value will ALWAYS be zero for dedicated processors and
90 * will NEVER be zero for shared processors (ie, initialized to a 1). 88 * will NEVER be zero for shared processors (ie, initialized to a 1).
91 */ 89 */
92 volatile u32 yield_count; 90 volatile __be32 yield_count;
93 volatile u32 dispersion_count; /* dispatch changed physical cpu */ 91 volatile __be32 dispersion_count; /* dispatch changed physical cpu */
94 volatile u64 cmo_faults; /* CMO page fault count */ 92 volatile __be64 cmo_faults; /* CMO page fault count */
95 volatile u64 cmo_fault_time; /* CMO page fault time */ 93 volatile __be64 cmo_fault_time; /* CMO page fault time */
96 u8 reserved10[104]; 94 u8 reserved10[104];
97 95
98 /* cacheline 4-5 */ 96 /* cacheline 4-5 */
99 97
100 u32 page_ins; /* CMO Hint - # page ins by OS */ 98 __be32 page_ins; /* CMO Hint - # page ins by OS */
101 u8 reserved11[148]; 99 u8 reserved11[148];
102 volatile u64 dtl_idx; /* Dispatch Trace Log head index */ 100 volatile __be64 dtl_idx; /* Dispatch Trace Log head index */
103 u8 reserved12[96]; 101 u8 reserved12[96];
104} __attribute__((__aligned__(0x400))); 102} __attribute__((__aligned__(0x400)));
105 103
@@ -108,17 +106,29 @@ extern struct lppaca lppaca[];
108#define lppaca_of(cpu) (*paca[cpu].lppaca_ptr) 106#define lppaca_of(cpu) (*paca[cpu].lppaca_ptr)
109 107
110/* 108/*
109 * Old kernels used a reserved bit in the VPA to determine if it was running
110 * in shared processor mode. New kernels look for a non zero yield count
111 * but KVM still needs to set the bit to keep the old stuff happy.
112 */
113#define LPPACA_OLD_SHARED_PROC 2
114
115static inline bool lppaca_shared_proc(struct lppaca *l)
116{
117 return l->yield_count != 0;
118}
119
120/*
111 * SLB shadow buffer structure as defined in the PAPR. The save_area 121 * SLB shadow buffer structure as defined in the PAPR. The save_area
112 * contains adjacent ESID and VSID pairs for each shadowed SLB. The 122 * contains adjacent ESID and VSID pairs for each shadowed SLB. The
113 * ESID is stored in the lower 64bits, then the VSID. 123 * ESID is stored in the lower 64bits, then the VSID.
114 */ 124 */
115struct slb_shadow { 125struct slb_shadow {
116 u32 persistent; /* Number of persistent SLBs */ 126 __be32 persistent; /* Number of persistent SLBs */
117 u32 buffer_length; /* Total shadow buffer length */ 127 __be32 buffer_length; /* Total shadow buffer length */
118 u64 reserved; 128 __be64 reserved;
119 struct { 129 struct {
120 u64 esid; 130 __be64 esid;
121 u64 vsid; 131 __be64 vsid;
122 } save_area[SLB_NUM_BOLTED]; 132 } save_area[SLB_NUM_BOLTED];
123} ____cacheline_aligned; 133} ____cacheline_aligned;
124 134
@@ -130,14 +140,14 @@ extern struct slb_shadow slb_shadow[];
130struct dtl_entry { 140struct dtl_entry {
131 u8 dispatch_reason; 141 u8 dispatch_reason;
132 u8 preempt_reason; 142 u8 preempt_reason;
133 u16 processor_id; 143 __be16 processor_id;
134 u32 enqueue_to_dispatch_time; 144 __be32 enqueue_to_dispatch_time;
135 u32 ready_to_enqueue_time; 145 __be32 ready_to_enqueue_time;
136 u32 waiting_to_ready_time; 146 __be32 waiting_to_ready_time;
137 u64 timebase; 147 __be64 timebase;
138 u64 fault_addr; 148 __be64 fault_addr;
139 u64 srr0; 149 __be64 srr0;
140 u64 srr1; 150 __be64 srr1;
141}; 151};
142 152
143#define DISPATCH_LOG_BYTES 4096 /* bytes per cpu */ 153#define DISPATCH_LOG_BYTES 4096 /* bytes per cpu */