diff options
Diffstat (limited to 'arch/powerpc/include')
-rw-r--r-- | arch/powerpc/include/asm/kvm_book3s_64.h | 19 | ||||
-rw-r--r-- | arch/powerpc/include/asm/ppc_asm.h | 2 | ||||
-rw-r--r-- | arch/powerpc/include/asm/processor.h | 2 |
3 files changed, 21 insertions, 2 deletions
diff --git a/arch/powerpc/include/asm/kvm_book3s_64.h b/arch/powerpc/include/asm/kvm_book3s_64.h index fddb72b48ce9..d645428a65a4 100644 --- a/arch/powerpc/include/asm/kvm_book3s_64.h +++ b/arch/powerpc/include/asm/kvm_book3s_64.h | |||
@@ -198,8 +198,10 @@ static inline unsigned long compute_tlbie_rb(unsigned long v, unsigned long r, | |||
198 | return rb; | 198 | return rb; |
199 | } | 199 | } |
200 | 200 | ||
201 | static inline unsigned long hpte_page_size(unsigned long h, unsigned long l) | 201 | static inline unsigned long __hpte_page_size(unsigned long h, unsigned long l, |
202 | bool is_base_size) | ||
202 | { | 203 | { |
204 | |||
203 | int size, a_psize; | 205 | int size, a_psize; |
204 | /* Look at the 8 bit LP value */ | 206 | /* Look at the 8 bit LP value */ |
205 | unsigned int lp = (l >> LP_SHIFT) & ((1 << LP_BITS) - 1); | 207 | unsigned int lp = (l >> LP_SHIFT) & ((1 << LP_BITS) - 1); |
@@ -214,14 +216,27 @@ static inline unsigned long hpte_page_size(unsigned long h, unsigned long l) | |||
214 | continue; | 216 | continue; |
215 | 217 | ||
216 | a_psize = __hpte_actual_psize(lp, size); | 218 | a_psize = __hpte_actual_psize(lp, size); |
217 | if (a_psize != -1) | 219 | if (a_psize != -1) { |
220 | if (is_base_size) | ||
221 | return 1ul << mmu_psize_defs[size].shift; | ||
218 | return 1ul << mmu_psize_defs[a_psize].shift; | 222 | return 1ul << mmu_psize_defs[a_psize].shift; |
223 | } | ||
219 | } | 224 | } |
220 | 225 | ||
221 | } | 226 | } |
222 | return 0; | 227 | return 0; |
223 | } | 228 | } |
224 | 229 | ||
230 | static inline unsigned long hpte_page_size(unsigned long h, unsigned long l) | ||
231 | { | ||
232 | return __hpte_page_size(h, l, 0); | ||
233 | } | ||
234 | |||
235 | static inline unsigned long hpte_base_page_size(unsigned long h, unsigned long l) | ||
236 | { | ||
237 | return __hpte_page_size(h, l, 1); | ||
238 | } | ||
239 | |||
225 | static inline unsigned long hpte_rpn(unsigned long ptel, unsigned long psize) | 240 | static inline unsigned long hpte_rpn(unsigned long ptel, unsigned long psize) |
226 | { | 241 | { |
227 | return ((ptel & HPTE_R_RPN) & ~(psize - 1)) >> PAGE_SHIFT; | 242 | return ((ptel & HPTE_R_RPN) & ~(psize - 1)) >> PAGE_SHIFT; |
diff --git a/arch/powerpc/include/asm/ppc_asm.h b/arch/powerpc/include/asm/ppc_asm.h index 9ea266eae33e..7e4612528546 100644 --- a/arch/powerpc/include/asm/ppc_asm.h +++ b/arch/powerpc/include/asm/ppc_asm.h | |||
@@ -277,6 +277,8 @@ n: | |||
277 | .globl n; \ | 277 | .globl n; \ |
278 | n: | 278 | n: |
279 | 279 | ||
280 | #define _GLOBAL_TOC(name) _GLOBAL(name) | ||
281 | |||
280 | #define _KPROBE(n) \ | 282 | #define _KPROBE(n) \ |
281 | .section ".kprobes.text","a"; \ | 283 | .section ".kprobes.text","a"; \ |
282 | .globl n; \ | 284 | .globl n; \ |
diff --git a/arch/powerpc/include/asm/processor.h b/arch/powerpc/include/asm/processor.h index 6d59072e13a7..dda7ac4c80bd 100644 --- a/arch/powerpc/include/asm/processor.h +++ b/arch/powerpc/include/asm/processor.h | |||
@@ -400,6 +400,8 @@ static inline unsigned long __pack_fe01(unsigned int fpmode) | |||
400 | #define cpu_relax() barrier() | 400 | #define cpu_relax() barrier() |
401 | #endif | 401 | #endif |
402 | 402 | ||
403 | #define cpu_relax_lowlatency() cpu_relax() | ||
404 | |||
403 | /* Check that a certain kernel stack pointer is valid in task_struct p */ | 405 | /* Check that a certain kernel stack pointer is valid in task_struct p */ |
404 | int validate_sp(unsigned long sp, struct task_struct *p, | 406 | int validate_sp(unsigned long sp, struct task_struct *p, |
405 | unsigned long nbytes); | 407 | unsigned long nbytes); |