Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'powerpc-6.12-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Pull powerpc updates from Michael Ellerman:

- Reduce alignment constraints on STRICT_KERNEL_RWX and speed-up TLB
misses on 8xx and 603

- Replace kretprobe code with rethook and enable fprobe

- Remove the "fast endian switch" syscall

- Handle DLPAR device tree updates in kernel, allowing the deprecation
of the binary /proc/powerpc/ofdt interface

Thanks to Abhishek Dubey, Alex Shi, Benjamin Gray, Christophe Leroy,
Gaosheng Cui, Gautam Menghani, Geert Uytterhoeven, Haren Myneni, Hari
Bathini, Huang Xiaojia, Jinjie Ruan, Madhavan Srinivasan, Miguel Ojeda,
Mina Almasry, Narayana Murty N, Naveen Rao, Rob Herring (Arm), Scott
Cheloha, Segher Boessenkool, Stephen Rothwell, Thomas Zimmermann, Uwe
Kleine-König, Vaibhav Jain, and Zhang Zekun.

* tag 'powerpc-6.12-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (59 commits)
powerpc/atomic: Use YZ constraints for DS-form instructions
MAINTAINERS: powerpc: Add Maddy
powerpc: Switch back to struct platform_driver::remove()
powerpc/pseries/eeh: Fix pseries_eeh_err_inject
selftests/powerpc: Allow building without static libc
macintosh/via-pmu: register_pmu_pm_ops() can be __init
powerpc: Stop using no_llseek
powerpc/64s: Remove the "fast endian switch" syscall
powerpc/mm/64s: Restrict THP to Radix or HPT w/64K pages
powerpc/mm/64s: Move THP reqs into a separate symbol
powerpc/64s: Make mmu_hash_ops __ro_after_init
powerpc: Replace kretprobe code with rethook on powerpc
powerpc: pseries: Constify struct kobj_type
powerpc: powernv: Constify struct kobj_type
powerpc: Constify struct kobj_type
powerpc/pseries/dlpar: Add device tree nodes for DLPAR IO add
powerpc/pseries/dlpar: Remove device tree node for DLPAR IO remove
powerpc/pseries: Use correct data types from pseries_hp_errorlog struct
powerpc/vdso: Inconditionally use CFUNC macro
powerpc/32: Implement validation of emergency stack
...

+785 -389
+6
CREDITS
··· 378 378 S: Brimson, MN 55602 379 379 S: USA 380 380 381 + N: Arnd Bergmann 382 + D: Maintainer of Cell Broadband Engine Architecture 383 + 381 384 N: Hennus Bergman 382 385 P: 1024/77D50909 76 99 FD 31 91 E1 96 1C 90 BB 22 80 62 F6 BD 63 383 386 D: Author and maintainer of the QIC-02 tape driver ··· 1871 1868 S: K osmidomkum 723 1872 1869 S: 160 00 Praha 6 1873 1870 S: Czech Republic 1871 + 1872 + N: Jeremy Kerr 1873 + D: Maintainer of SPU File System 1874 1874 1875 1875 N: Michael Kerrisk 1876 1876 E: mtk.manpages@gmail.com
+3 -6
MAINTAINERS
··· 5145 5145 F: drivers/media/cec/platform/cec-gpio/ 5146 5146 5147 5147 CELL BROADBAND ENGINE ARCHITECTURE 5148 - M: Arnd Bergmann <arnd@arndb.de> 5149 5148 L: linuxppc-dev@lists.ozlabs.org 5150 - S: Supported 5151 - W: http://www.ibm.com/developerworks/power/cell/ 5149 + S: Orphan 5152 5150 F: arch/powerpc/include/asm/cell*.h 5153 5151 F: arch/powerpc/include/asm/spu*.h 5154 5152 F: arch/powerpc/include/uapi/asm/spu*.h ··· 12993 12995 R: Nicholas Piggin <npiggin@gmail.com> 12994 12996 R: Christophe Leroy <christophe.leroy@csgroup.eu> 12995 12997 R: Naveen N Rao <naveen@kernel.org> 12998 + R: Madhavan Srinivasan <maddy@linux.ibm.com> 12996 12999 L: linuxppc-dev@lists.ozlabs.org 12997 13000 S: Supported 12998 13001 W: https://github.com/linuxppc/wiki/wiki ··· 21671 21672 F: include/trace/events/spmi.h 21672 21673 21673 21674 SPU FILE SYSTEM 21674 - M: Jeremy Kerr <jk@ozlabs.org> 21675 21675 L: linuxppc-dev@lists.ozlabs.org 21676 - S: Supported 21677 - W: http://www.ibm.com/developerworks/power/cell/ 21676 + S: Orphan 21678 21677 F: Documentation/filesystems/spufs/spufs.rst 21679 21678 F: arch/powerpc/platforms/cell/spufs/ 21680 21679
+26 -6
arch/powerpc/Kconfig
··· 269 269 select HAVE_PERF_EVENTS_NMI if PPC64 270 270 select HAVE_PERF_REGS 271 271 select HAVE_PERF_USER_STACK_DUMP 272 + select HAVE_RETHOOK if KPROBES 272 273 select HAVE_REGS_AND_STACK_ACCESS_API 273 274 select HAVE_RELIABLE_STACKTRACE 274 275 select HAVE_RSEQ ··· 855 854 bool "Set custom data alignment" 856 855 depends on ADVANCED_OPTIONS 857 856 depends on STRICT_KERNEL_RWX || DEBUG_PAGEALLOC || KFENCE 858 - depends on PPC_BOOK3S_32 || (PPC_8xx && !PIN_TLB_DATA && !STRICT_KERNEL_RWX) || \ 859 - PPC_85xx 857 + depends on (PPC_8xx && !PIN_TLB_DATA && (!STRICT_KERNEL_RWX || !PIN_TLB_TEXT)) || \ 858 + PPC_BOOK3S_32 || PPC_85xx 860 859 help 861 860 This option allows you to set the kernel data alignment. When 862 861 RAM is mapped by blocks, the alignment needs to fit the size and ··· 872 871 range 20 24 if (STRICT_KERNEL_RWX || DEBUG_PAGEALLOC || KFENCE) && PPC_85xx 873 872 default 22 if STRICT_KERNEL_RWX && PPC_BOOK3S_32 874 873 default 18 if (DEBUG_PAGEALLOC || KFENCE) && PPC_BOOK3S_32 875 - default 23 if STRICT_KERNEL_RWX && PPC_8xx 876 - default 23 if (DEBUG_PAGEALLOC || KFENCE) && PPC_8xx && PIN_TLB_DATA 877 - default 19 if (DEBUG_PAGEALLOC || KFENCE) && PPC_8xx 874 + default 23 if (STRICT_KERNEL_RWX || DEBUG_PAGEALLOC || KFENCE) && PPC_8xx && \ 875 + (PIN_TLB_DATA || PIN_TLB_TEXT) 876 + default 19 if (STRICT_KERNEL_RWX || DEBUG_PAGEALLOC || KFENCE) && PPC_8xx 878 877 default 24 if STRICT_KERNEL_RWX && PPC_85xx 879 878 default PAGE_SHIFT 880 879 help ··· 1275 1274 config TASK_SIZE 1276 1275 hex "Size of user task space" if TASK_SIZE_BOOL 1277 1276 default "0x80000000" if PPC_8xx 1278 - default "0xb0000000" if PPC_BOOK3S_32 1277 + default "0xb0000000" if PPC_BOOK3S_32 && EXECMEM 1279 1278 default "0xc0000000" 1279 + 1280 + config MODULES_SIZE_BOOL 1281 + bool "Set custom size for modules/execmem area" 1282 + depends on EXECMEM && ADVANCED_OPTIONS 1283 + help 1284 + This option allows you to set the size of kernel virtual address 1285 + space dedicated for modules/execmem. 1286 + For the time being it is only for 8xx and book3s/32. Other 1287 + platform share it with vmalloc space. 1288 + 1289 + Say N here unless you know what you are doing. 1290 + 1291 + config MODULES_SIZE 1292 + int "Size of modules/execmem area (In Mbytes)" if MODULES_SIZE_BOOL 1293 + range 1 256 if EXECMEM 1294 + default 64 if EXECMEM && PPC_BOOK3S_32 1295 + default 32 if EXECMEM && PPC_8xx 1296 + default 0 1297 + 1280 1298 endmenu 1281 1299 1282 1300 if PPC64
-6
arch/powerpc/Kconfig.debug
··· 379 379 380 380 If you are unsure, say N. 381 381 382 - config PPC_FAST_ENDIAN_SWITCH 383 - bool "Deprecated fast endian-switch syscall" 384 - depends on DEBUG_KERNEL && PPC_BOOK3S_64 385 - help 386 - If you're unsure what this is, say N. 387 - 388 382 config KASAN_SHADOW_OFFSET 389 383 hex 390 384 depends on KASAN
+1
arch/powerpc/configs/ppc64_defconfig
··· 93 93 CONFIG_KSM=y 94 94 CONFIG_TRANSPARENT_HUGEPAGE=y 95 95 CONFIG_MEM_SOFT_DIRTY=y 96 + CONFIG_DEFERRED_STRUCT_PAGE_INIT=y 96 97 CONFIG_ZONE_DEVICE=y 97 98 CONFIG_NET=y 98 99 CONFIG_PACKET=y
+6 -2
arch/powerpc/include/asm/asm-compat.h
··· 26 26 #define PPC_MIN_STKFRM 112 27 27 28 28 #ifdef __BIG_ENDIAN__ 29 - #define LHZX_BE stringify_in_c(lhzx) 30 29 #define LWZX_BE stringify_in_c(lwzx) 31 30 #define LDX_BE stringify_in_c(ldx) 32 31 #define STWX_BE stringify_in_c(stwx) 33 32 #define STDX_BE stringify_in_c(stdx) 34 33 #else 35 - #define LHZX_BE stringify_in_c(lhbrx) 36 34 #define LWZX_BE stringify_in_c(lwbrx) 37 35 #define LDX_BE stringify_in_c(ldbrx) 38 36 #define STWX_BE stringify_in_c(stwbrx) 39 37 #define STDX_BE stringify_in_c(stdbrx) 38 + #endif 39 + 40 + #ifdef CONFIG_CC_IS_CLANG 41 + #define DS_FORM_CONSTRAINT "Z<>" 42 + #else 43 + #define DS_FORM_CONSTRAINT "YZ<>" 40 44 #endif 41 45 42 46 #else /* 32-bit */
+3 -2
arch/powerpc/include/asm/atomic.h
··· 11 11 #include <asm/cmpxchg.h> 12 12 #include <asm/barrier.h> 13 13 #include <asm/asm-const.h> 14 + #include <asm/asm-compat.h> 14 15 15 16 /* 16 17 * Since *_return_relaxed and {cmp}xchg_relaxed are implemented with ··· 198 197 if (IS_ENABLED(CONFIG_PPC_KERNEL_PREFIXED)) 199 198 __asm__ __volatile__("ld %0,0(%1)" : "=r"(t) : "b"(&v->counter)); 200 199 else 201 - __asm__ __volatile__("ld%U1%X1 %0,%1" : "=r"(t) : "m<>"(v->counter)); 200 + __asm__ __volatile__("ld%U1%X1 %0,%1" : "=r"(t) : DS_FORM_CONSTRAINT (v->counter)); 202 201 203 202 return t; 204 203 } ··· 209 208 if (IS_ENABLED(CONFIG_PPC_KERNEL_PREFIXED)) 210 209 __asm__ __volatile__("std %1,0(%2)" : "=m"(v->counter) : "r"(i), "b"(&v->counter)); 211 210 else 212 - __asm__ __volatile__("std%U0%X0 %1,%0" : "=m<>"(v->counter) : "r"(i)); 211 + __asm__ __volatile__("std%U0%X0 %1,%0" : "=" DS_FORM_CONSTRAINT (v->counter) : "r"(i)); 213 212 } 214 213 215 214 #define ATOMIC64_OP(op, asm_op) \
+2 -1
arch/powerpc/include/asm/book3s/32/pgtable.h
··· 196 196 #endif 197 197 198 198 #define MODULES_END ALIGN_DOWN(PAGE_OFFSET, SZ_256M) 199 - #define MODULES_VADDR (MODULES_END - SZ_256M) 199 + #define MODULES_SIZE (CONFIG_MODULES_SIZE * SZ_1M) 200 + #define MODULES_VADDR (MODULES_END - MODULES_SIZE) 200 201 201 202 #ifndef __ASSEMBLY__ 202 203 #include <linux/sched.h>
+20
arch/powerpc/include/asm/book3s/64/hash-4k.h
··· 75 75 remap_pfn_range((vma), (addr), (pfn), PAGE_SIZE, (prot)) 76 76 77 77 /* 78 + * With 4K page size the real_pte machinery is all nops. 79 + */ 80 + #define __real_pte(e, p, o) ((real_pte_t){(e)}) 81 + #define __rpte_to_pte(r) ((r).pte) 82 + #define __rpte_to_hidx(r,index) (pte_val(__rpte_to_pte(r)) >> H_PAGE_F_GIX_SHIFT) 83 + 84 + #define pte_iterate_hashed_subpages(rpte, psize, va, index, shift) \ 85 + do { \ 86 + index = 0; \ 87 + shift = mmu_psize_defs[psize].shift; \ 88 + 89 + #define pte_iterate_hashed_end() } while(0) 90 + 91 + /* 92 + * We expect this to be called only for user addresses or kernel virtual 93 + * addresses other than the linear mapping. 94 + */ 95 + #define pte_pagesize_index(mm, addr, pte) MMU_PAGE_4K 96 + 97 + /* 78 98 * 4K PTE format is different from 64K PTE format. Saving the hash_slot is just 79 99 * a matter of returning the PTE bits that need to be modified. On 64K PTE, 80 100 * things are a little more involved and hence needs many more parameters to
-26
arch/powerpc/include/asm/book3s/64/pgtable.h
··· 330 330 331 331 #ifndef __ASSEMBLY__ 332 332 333 - /* 334 - * This is the default implementation of various PTE accessors, it's 335 - * used in all cases except Book3S with 64K pages where we have a 336 - * concept of sub-pages 337 - */ 338 - #ifndef __real_pte 339 - 340 - #define __real_pte(e, p, o) ((real_pte_t){(e)}) 341 - #define __rpte_to_pte(r) ((r).pte) 342 - #define __rpte_to_hidx(r,index) (pte_val(__rpte_to_pte(r)) >> H_PAGE_F_GIX_SHIFT) 343 - 344 - #define pte_iterate_hashed_subpages(rpte, psize, va, index, shift) \ 345 - do { \ 346 - index = 0; \ 347 - shift = mmu_psize_defs[psize].shift; \ 348 - 349 - #define pte_iterate_hashed_end() } while(0) 350 - 351 - /* 352 - * We expect this to be called only for user addresses or kernel virtual 353 - * addresses other than the linear mapping. 354 - */ 355 - #define pte_pagesize_index(mm, addr, pte) MMU_PAGE_4K 356 - 357 - #endif /* __real_pte */ 358 - 359 333 static inline unsigned long pte_update(struct mm_struct *mm, unsigned long addr, 360 334 pte_t *ptep, unsigned long clr, 361 335 unsigned long set, int huge)
+37
arch/powerpc/include/asm/code-patching.h
··· 76 76 int raw_patch_instruction(u32 *addr, ppc_inst_t instr); 77 77 int patch_instructions(u32 *addr, u32 *code, size_t len, bool repeat_instr); 78 78 79 + /* 80 + * The data patching functions patch_uint() and patch_ulong(), etc., must be 81 + * called on aligned addresses. 82 + * 83 + * The instruction patching functions patch_instruction() and similar must be 84 + * called on addresses satisfying instruction alignment requirements. 85 + */ 86 + 87 + #ifdef CONFIG_PPC64 88 + 89 + int patch_uint(void *addr, unsigned int val); 90 + int patch_ulong(void *addr, unsigned long val); 91 + 92 + #define patch_u64 patch_ulong 93 + 94 + #else 95 + 96 + static inline int patch_uint(void *addr, unsigned int val) 97 + { 98 + if (!IS_ALIGNED((unsigned long)addr, sizeof(unsigned int))) 99 + return -EINVAL; 100 + 101 + return patch_instruction(addr, ppc_inst(val)); 102 + } 103 + 104 + static inline int patch_ulong(void *addr, unsigned long val) 105 + { 106 + if (!IS_ALIGNED((unsigned long)addr, sizeof(unsigned long))) 107 + return -EINVAL; 108 + 109 + return patch_instruction(addr, ppc_inst(val)); 110 + } 111 + 112 + #endif 113 + 114 + #define patch_u32 patch_uint 115 + 79 116 static inline unsigned long patch_site_addr(s32 *site) 80 117 { 81 118 return (unsigned long)site + *site;
+1
arch/powerpc/include/asm/eeh.h
··· 308 308 int eeh_pe_configure(struct eeh_pe *pe); 309 309 int eeh_pe_inject_err(struct eeh_pe *pe, int type, int func, 310 310 unsigned long addr, unsigned long mask); 311 + int eeh_pe_inject_mmio_error(struct pci_dev *pdev); 311 312 312 313 /** 313 314 * EEH_POSSIBLE_ERROR() -- test for possible MMIO failure.
-3
arch/powerpc/include/asm/mmu_context.h
··· 116 116 } 117 117 #endif 118 118 119 - extern int use_cop(unsigned long acop, struct mm_struct *mm); 120 - extern void drop_cop(unsigned long acop, struct mm_struct *mm); 121 - 122 119 #ifdef CONFIG_PPC_BOOK3S_64 123 120 static inline void inc_mm_active_cpus(struct mm_struct *mm) 124 121 {
+2 -1
arch/powerpc/include/asm/nohash/32/mmu-8xx.h
··· 170 170 171 171 #define mmu_linear_psize MMU_PAGE_8M 172 172 173 - #define MODULES_VADDR (PAGE_OFFSET - SZ_256M) 174 173 #define MODULES_END PAGE_OFFSET 174 + #define MODULES_SIZE (CONFIG_MODULES_SIZE * SZ_1M) 175 + #define MODULES_VADDR (MODULES_END - MODULES_SIZE) 175 176 176 177 #ifndef __ASSEMBLY__ 177 178
+7 -1
arch/powerpc/include/asm/nohash/pgalloc.h
··· 19 19 20 20 static inline pgd_t *pgd_alloc(struct mm_struct *mm) 21 21 { 22 - return kmem_cache_alloc(PGT_CACHE(PGD_INDEX_SIZE), 22 + pgd_t *pgd = kmem_cache_alloc(PGT_CACHE(PGD_INDEX_SIZE), 23 23 pgtable_gfp_flags(mm, GFP_KERNEL)); 24 + 25 + #if defined(CONFIG_PPC_8xx) || defined(CONFIG_PPC_BOOK3S_603) 26 + memcpy(pgd + USER_PTRS_PER_PGD, swapper_pg_dir + USER_PTRS_PER_PGD, 27 + (MAX_PTRS_PER_PGD - USER_PTRS_PER_PGD) * sizeof(pgd_t)); 28 + #endif 29 + return pgd; 24 30 } 25 31 26 32 static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
+1 -1
arch/powerpc/include/asm/percpu.h
··· 23 23 (static_key_enabled(&__percpu_first_chunk_is_paged.key)) 24 24 #else 25 25 #define percpu_first_chunk_is_paged false 26 - #endif /* CONFIG_PPC64 && CONFIG_SMP */ 26 + #endif 27 27 28 28 #include <asm-generic/percpu.h> 29 29
+1
arch/powerpc/include/asm/rtas.h
··· 397 397 #define PSERIES_HP_ELOG_RESOURCE_SLOT 3 398 398 #define PSERIES_HP_ELOG_RESOURCE_PHB 4 399 399 #define PSERIES_HP_ELOG_RESOURCE_PMEM 6 400 + #define PSERIES_HP_ELOG_RESOURCE_DT 7 400 401 401 402 #define PSERIES_HP_ELOG_ACTION_ADD 1 402 403 #define PSERIES_HP_ELOG_ACTION_REMOVE 2
+4
arch/powerpc/include/asm/thread_info.h
··· 226 226 return BAD_STACK; 227 227 } 228 228 229 + #ifdef CONFIG_PPC32 230 + extern void *emergency_ctx[]; 231 + #endif 232 + 229 233 #endif /* !__ASSEMBLY__ */ 230 234 231 235 #endif /* __KERNEL__ */
+1 -6
arch/powerpc/include/asm/uaccess.h
··· 6 6 #include <asm/page.h> 7 7 #include <asm/extable.h> 8 8 #include <asm/kup.h> 9 + #include <asm/asm-compat.h> 9 10 10 11 #ifdef __powerpc64__ 11 12 /* We use TASK_SIZE_USER64 as TASK_SIZE is not constant */ ··· 91 90 : "r" (x), "m<>" (*addr) \ 92 91 : \ 93 92 : label) 94 - #endif 95 - 96 - #ifdef CONFIG_CC_IS_CLANG 97 - #define DS_FORM_CONSTRAINT "Z<>" 98 - #else 99 - #define DS_FORM_CONSTRAINT "YZ<>" 100 93 #endif 101 94 102 95 #ifdef __powerpc64__
+1
arch/powerpc/kernel/Makefile
··· 139 139 obj-$(CONFIG_OPTPROBES) += optprobes.o optprobes_head.o 140 140 obj-$(CONFIG_KPROBES_ON_FTRACE) += kprobes-ftrace.o 141 141 obj-$(CONFIG_UPROBES) += uprobes.o 142 + obj-$(CONFIG_RETHOOK) += rethook.o 142 143 obj-$(CONFIG_PPC_UDBG_16550) += legacy_serial.o udbg_16550.o 143 144 obj-$(CONFIG_SWIOTLB) += dma-swiotlb.o 144 145 obj-$(CONFIG_ARCH_HAS_DMA_SET_MASK) += dma-mask.o
+1 -1
arch/powerpc/kernel/cacheinfo.c
··· 735 735 .show = cache_index_show, 736 736 }; 737 737 738 - static struct kobj_type cache_index_type = { 738 + static const struct kobj_type cache_index_type = { 739 739 .release = cache_index_release, 740 740 .sysfs_ops = &cache_index_ops, 741 741 .default_groups = cache_index_default_groups,
+5 -8
arch/powerpc/kernel/eeh.c
··· 1537 1537 if (!eeh_ops || !eeh_ops->err_inject) 1538 1538 return -ENOENT; 1539 1539 1540 - /* Check on PCI error type */ 1541 - if (type != EEH_ERR_TYPE_32 && type != EEH_ERR_TYPE_64) 1542 - return -EINVAL; 1543 - 1544 1540 /* Check on PCI error function */ 1545 1541 if (func < EEH_ERR_FUNC_MIN || func > EEH_ERR_FUNC_MAX) 1546 1542 return -EINVAL; ··· 1678 1682 1679 1683 static const struct file_operations eeh_force_recover_fops = { 1680 1684 .open = simple_open, 1681 - .llseek = no_llseek, 1682 1685 .write = eeh_force_recover_write, 1683 1686 }; 1684 1687 ··· 1721 1726 1722 1727 static const struct file_operations eeh_dev_check_fops = { 1723 1728 .open = simple_open, 1724 - .llseek = no_llseek, 1725 1729 .write = eeh_dev_check_write, 1726 1730 .read = eeh_debugfs_dev_usage, 1727 1731 }; ··· 1840 1846 1841 1847 static const struct file_operations eeh_dev_break_fops = { 1842 1848 .open = simple_open, 1843 - .llseek = no_llseek, 1844 1849 .write = eeh_dev_break_write, 1845 1850 .read = eeh_debugfs_dev_usage, 1846 1851 }; 1852 + 1853 + int eeh_pe_inject_mmio_error(struct pci_dev *pdev) 1854 + { 1855 + return eeh_debugfs_break_device(pdev); 1856 + } 1847 1857 1848 1858 static ssize_t eeh_dev_can_recover(struct file *filp, 1849 1859 const char __user *user_buf, ··· 1891 1893 1892 1894 static const struct file_operations eeh_dev_can_recover_fops = { 1893 1895 .open = simple_open, 1894 - .llseek = no_llseek, 1895 1896 .write = eeh_dev_can_recover, 1896 1897 .read = eeh_debugfs_dev_usage, 1897 1898 };
-17
arch/powerpc/kernel/exceptions-64s.S
··· 1989 1989 INTERRUPT_TO_KERNEL 1990 1990 #endif 1991 1991 1992 - #ifdef CONFIG_PPC_FAST_ENDIAN_SWITCH 1993 - BEGIN_FTR_SECTION 1994 - cmpdi r0,0x1ebe 1995 - beq- 1f 1996 - END_FTR_SECTION_IFSET(CPU_FTR_REAL_LE) 1997 - #endif 1998 - 1999 1992 /* We reach here with PACA in r13, r13 in r9. */ 2000 1993 mfspr r11,SPRN_SRR0 2001 1994 mfspr r12,SPRN_SRR1 ··· 2008 2015 b system_call_common 2009 2016 #endif 2010 2017 .endif 2011 - 2012 - #ifdef CONFIG_PPC_FAST_ENDIAN_SWITCH 2013 - /* Fast LE/BE switch system call */ 2014 - 1: mfspr r12,SPRN_SRR1 2015 - xori r12,r12,MSR_LE 2016 - mtspr SPRN_SRR1,r12 2017 - mr r13,r9 2018 - RFI_TO_USER /* return to userspace */ 2019 - b . /* prevent speculative execution */ 2020 - #endif 2021 2018 .endm 2022 2019 2023 2020 EXC_REAL_BEGIN(system_call, 0xc00, 0x100)
+43 -35
arch/powerpc/kernel/head_8xx.S
··· 40 40 41 41 #include "head_32.h" 42 42 43 - .macro compare_to_kernel_boundary scratch, addr 44 - #if CONFIG_TASK_SIZE <= 0x80000000 && CONFIG_PAGE_OFFSET >= 0x80000000 45 - /* By simply checking Address >= 0x80000000, we know if its a kernel address */ 46 - not. \scratch, \addr 47 - #else 48 - rlwinm \scratch, \addr, 16, 0xfff8 49 - cmpli cr0, \scratch, PAGE_OFFSET@h 50 - #endif 51 - .endm 52 - 53 43 #define PAGE_SHIFT_512K 19 54 44 #define PAGE_SHIFT_8M 23 55 45 ··· 189 199 mfspr r10, SPRN_SRR0 /* Get effective address of fault */ 190 200 INVALIDATE_ADJACENT_PAGES_CPU15(r10, r11) 191 201 mtspr SPRN_MD_EPN, r10 192 - #ifdef CONFIG_EXECMEM 193 - mfcr r11 194 - compare_to_kernel_boundary r10, r10 195 - #endif 196 202 mfspr r10, SPRN_M_TWB /* Get level 1 table */ 197 - #ifdef CONFIG_EXECMEM 198 - blt+ 3f 199 - rlwinm r10, r10, 0, 20, 31 200 - oris r10, r10, (swapper_pg_dir - PAGE_OFFSET)@ha 201 - 3: 202 - mtcr r11 203 - #endif 204 203 lwz r11, (swapper_pg_dir-PAGE_OFFSET)@l(r10) /* Get level 1 entry */ 205 204 mtspr SPRN_MD_TWC, r11 206 205 mfspr r10, SPRN_MD_TWC ··· 227 248 START_EXCEPTION(INTERRUPT_DATA_TLB_MISS_8xx, DataStoreTLBMiss) 228 249 mtspr SPRN_SPRG_SCRATCH2, r10 229 250 mtspr SPRN_M_TW, r11 230 - mfcr r11 231 251 232 252 /* If we are faulting a kernel address, we have to use the 233 253 * kernel page tables. 234 254 */ 235 255 mfspr r10, SPRN_MD_EPN 236 - compare_to_kernel_boundary r10, r10 237 256 mfspr r10, SPRN_M_TWB /* Get level 1 table */ 238 - blt+ 3f 239 - rlwinm r10, r10, 0, 20, 31 240 - oris r10, r10, (swapper_pg_dir - PAGE_OFFSET)@ha 241 - 3: 242 - mtcr r11 243 257 lwz r11, (swapper_pg_dir-PAGE_OFFSET)@l(r10) /* Get level 1 entry */ 244 258 245 259 mtspr SPRN_MD_TWC, r11 ··· 304 332 cmpwi cr1, r11, RPN_PATTERN 305 333 beq- cr1, FixupDAR /* must be a buggy dcbX, icbi insn. */ 306 334 DARFixed:/* Return from dcbx instruction bug workaround */ 335 + mfspr r11, SPRN_DSISR 336 + rlwinm r11, r11, 0, DSISR_NOHPTE 337 + cmpwi cr1, r11, 0 338 + beq+ cr1, .Ldtlbie 339 + mfspr r11, SPRN_DAR 340 + tlbie r11 341 + rlwinm r11, r11, 16, 0xffff 342 + cmplwi cr1, r11, TASK_SIZE@h 343 + bge- cr1, FixupPGD 344 + .Ldtlbie: 307 345 EXCEPTION_PROLOG_1 308 346 /* 0x300 is DataAccess exception, needed by bad_page_fault() */ 309 347 EXCEPTION_PROLOG_2 INTERRUPT_DATA_STORAGE DataTLBError handle_dar_dsisr=1 310 - lwz r4, _DAR(r11) 311 - lwz r5, _DSISR(r11) 312 - andis. r10,r5,DSISR_NOHPTE@h 313 - beq+ .Ldtlbie 314 - tlbie r4 315 - .Ldtlbie: 316 348 prepare_transfer_to_handler 317 349 bl do_page_fault 318 350 b interrupt_return ··· 370 394 __HEAD 371 395 . = 0x2000 372 396 397 + FixupPGD: 398 + mtspr SPRN_M_TW, r10 399 + mfspr r10, SPRN_DAR 400 + mtspr SPRN_MD_EPN, r10 401 + mfspr r11, SPRN_M_TWB /* Get level 1 table */ 402 + lwz r10, (swapper_pg_dir - PAGE_OFFSET)@l(r11) /* Get the level 1 entry */ 403 + cmpwi cr1, r10, 0 404 + bne cr1, 1f 405 + 406 + rlwinm r10, r11, 0, 20, 31 407 + oris r10, r10, (swapper_pg_dir - PAGE_OFFSET)@ha 408 + lwz r10, (swapper_pg_dir - PAGE_OFFSET)@l(r10) /* Get the level 1 entry */ 409 + cmpwi cr1, r10, 0 410 + beq cr1, 1f 411 + stw r10, (swapper_pg_dir - PAGE_OFFSET)@l(r11) /* Set the level 1 entry */ 412 + mfspr r10, SPRN_M_TW 413 + mtcr r10 414 + mfspr r10, SPRN_SPRG_SCRATCH0 415 + mfspr r11, SPRN_SPRG_SCRATCH1 416 + rfi 417 + 1: 418 + mfspr r10, SPRN_M_TW 419 + b .Ldtlbie 420 + 373 421 /* This is the procedure to calculate the data EA for buggy dcbx,dcbi instructions 374 422 * by decoding the registers used by the dcbx instruction and adding them. 375 423 * DAR is set to the calculated address. ··· 404 404 mfspr r10, SPRN_SRR0 405 405 mtspr SPRN_MD_EPN, r10 406 406 rlwinm r11, r10, 16, 0xfff8 407 - cmpli cr1, r11, PAGE_OFFSET@h 407 + cmpli cr1, r11, TASK_SIZE@h 408 408 mfspr r11, SPRN_M_TWB /* Get level 1 table */ 409 409 blt+ cr1, 3f 410 410 ··· 587 587 lis r0, (MD_TWAM | MD_RSV4I)@h 588 588 mtspr SPRN_MD_CTR, r0 589 589 #endif 590 + #ifndef CONFIG_PIN_TLB_TEXT 591 + li r0, 0 592 + mtspr SPRN_MI_CTR, r0 593 + #endif 590 594 #if !defined(CONFIG_PIN_TLB_DATA) && !defined(CONFIG_PIN_TLB_IMMR) 591 595 lis r0, MD_TWAM@h 592 596 mtspr SPRN_MD_CTR, r0 ··· 687 683 blr 688 684 SYM_FUNC_END(initial_mmu) 689 685 686 + #ifdef CONFIG_PIN_TLB 690 687 _GLOBAL(mmu_pin_tlb) 691 688 lis r9, (1f - PAGE_OFFSET)@h 692 689 ori r9, r9, (1f - PAGE_OFFSET)@l ··· 709 704 mtspr SPRN_MD_CTR, r6 710 705 tlbia 711 706 707 + #ifdef CONFIG_PIN_TLB_TEXT 712 708 LOAD_REG_IMMEDIATE(r5, 28 << 8) 713 709 LOAD_REG_IMMEDIATE(r6, PAGE_OFFSET) 714 710 LOAD_REG_IMMEDIATE(r7, MI_SVALID | MI_PS8MEG | _PMD_ACCESSED) ··· 730 724 bdnzt lt, 2b 731 725 lis r0, MI_RSV4I@h 732 726 mtspr SPRN_MI_CTR, r0 727 + #endif 733 728 734 729 LOAD_REG_IMMEDIATE(r5, 28 << 8 | MD_TWAM) 735 730 #ifdef CONFIG_PIN_TLB_DATA ··· 790 783 mtspr SPRN_SRR1, r10 791 784 mtspr SPRN_SRR0, r11 792 785 rfi 786 + #endif
+66 -80
arch/powerpc/kernel/head_book3s_32.S
··· 411 411 */ 412 412 . = INTERRUPT_INST_TLB_MISS_603 413 413 InstructionTLBMiss: 414 - /* 415 - * r0: userspace flag (later scratch) 416 - * r1: linux style pte ( later becomes ppc hardware pte ) 417 - * r2: ptr to linux-style pte 418 - * r3: fault address 419 - */ 420 414 /* Get PTE (linux-style) and check access */ 421 - mfspr r3,SPRN_IMISS 422 - #ifdef CONFIG_EXECMEM 423 - lis r1, TASK_SIZE@h /* check if kernel address */ 424 - cmplw 0,r1,r3 425 - #endif 415 + mfspr r0,SPRN_IMISS 426 416 mfspr r2, SPRN_SDR1 427 417 li r1,_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_EXEC 428 418 rlwinm r2, r2, 28, 0xfffff000 429 - #ifdef CONFIG_EXECMEM 430 - li r0, 3 431 - bgt- 112f 432 - lis r2, (swapper_pg_dir - PAGE_OFFSET)@ha /* if kernel address, use */ 433 - li r0, 0 434 - addi r2, r2, (swapper_pg_dir - PAGE_OFFSET)@l /* kernel page table */ 435 - #endif 436 - 112: rlwimi r2,r3,12,20,29 /* insert top 10 bits of address */ 419 + rlwimi r2,r0,12,20,29 /* insert top 10 bits of address */ 437 420 lwz r2,0(r2) /* get pmd entry */ 421 + #ifdef CONFIG_EXECMEM 422 + rlwinm r3, r0, 4, 0xf 423 + subi r3, r3, (TASK_SIZE >> 28) & 0xf 424 + #endif 438 425 rlwinm. r2,r2,0,0,19 /* extract address of pte page */ 439 426 beq- InstructionAddressInvalid /* return if no mapping */ 440 - rlwimi r2,r3,22,20,29 /* insert next 10 bits of address */ 427 + rlwimi r2,r0,22,20,29 /* insert next 10 bits of address */ 441 428 lwz r2,0(r2) /* get linux-style pte */ 442 429 andc. r1,r1,r2 /* check access & ~permission */ 443 430 bne- InstructionAddressInvalid /* return if access not permitted */ 444 431 /* Convert linux-style PTE to low word of PPC-style PTE */ 445 432 #ifdef CONFIG_EXECMEM 446 - rlwimi r2, r0, 0, 31, 31 /* userspace ? -> PP lsb */ 433 + rlwimi r2, r3, 1, 31, 31 /* userspace ? -> PP lsb */ 447 434 #endif 448 435 ori r1, r1, 0xe06 /* clear out reserved bits */ 449 436 andc r1, r2, r1 /* PP = user? 1 : 0 */ ··· 438 451 rlwinm r1,r1,0,~_PAGE_COHERENT /* clear M (coherence not required) */ 439 452 END_FTR_SECTION_IFCLR(CPU_FTR_NEED_COHERENT) 440 453 mtspr SPRN_RPA,r1 441 - tlbli r3 454 + tlbli r0 442 455 mfspr r3,SPRN_SRR1 /* Need to restore CR0 */ 443 456 mtcrf 0x80,r3 444 457 rfi ··· 467 480 */ 468 481 . = INTERRUPT_DATA_LOAD_TLB_MISS_603 469 482 DataLoadTLBMiss: 470 - /* 471 - * r0: userspace flag (later scratch) 472 - * r1: linux style pte ( later becomes ppc hardware pte ) 473 - * r2: ptr to linux-style pte 474 - * r3: fault address 475 - */ 476 483 /* Get PTE (linux-style) and check access */ 477 - mfspr r3,SPRN_DMISS 478 - lis r1, TASK_SIZE@h /* check if kernel address */ 479 - cmplw 0,r1,r3 484 + mfspr r0,SPRN_DMISS 480 485 mfspr r2, SPRN_SDR1 481 - li r1, _PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_READ 482 - rlwinm r2, r2, 28, 0xfffff000 483 - li r0, 3 484 - bgt- 112f 485 - lis r2, (swapper_pg_dir - PAGE_OFFSET)@ha /* if kernel address, use */ 486 - li r0, 0 487 - addi r2, r2, (swapper_pg_dir - PAGE_OFFSET)@l /* kernel page table */ 488 - 112: rlwimi r2,r3,12,20,29 /* insert top 10 bits of address */ 489 - lwz r2,0(r2) /* get pmd entry */ 486 + rlwinm r1, r2, 28, 0xfffff000 487 + rlwimi r1,r0,12,20,29 /* insert top 10 bits of address */ 488 + lwz r2,0(r1) /* get pmd entry */ 489 + rlwinm r3, r0, 4, 0xf 490 490 rlwinm. r2,r2,0,0,19 /* extract address of pte page */ 491 - beq- DataAddressInvalid /* return if no mapping */ 492 - rlwimi r2,r3,22,20,29 /* insert next 10 bits of address */ 491 + subi r3, r3, (TASK_SIZE >> 28) & 0xf 492 + beq- 2f /* bail if no mapping */ 493 + 1: rlwimi r2,r0,22,20,29 /* insert next 10 bits of address */ 493 494 lwz r2,0(r2) /* get linux-style pte */ 495 + li r1, _PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_READ 494 496 andc. r1,r1,r2 /* check access & ~permission */ 495 497 bne- DataAddressInvalid /* return if access not permitted */ 496 498 /* Convert linux-style PTE to low word of PPC-style PTE */ 497 499 rlwinm r1,r2,32-9,30,30 /* _PAGE_WRITE -> PP msb */ 498 - rlwimi r2,r0,0,30,31 /* userspace ? -> PP */ 500 + rlwimi r2,r3,2,30,31 /* userspace ? -> PP */ 499 501 rlwimi r1,r2,32-3,24,24 /* _PAGE_WRITE -> _PAGE_DIRTY */ 500 502 xori r1,r1,_PAGE_DIRTY /* clear dirty when not rw */ 501 503 ori r1,r1,0xe04 /* clear out reserved bits */ ··· 494 518 END_FTR_SECTION_IFCLR(CPU_FTR_NEED_COHERENT) 495 519 mtspr SPRN_RPA,r1 496 520 BEGIN_MMU_FTR_SECTION 497 - li r0,1 521 + li r3,1 498 522 mfspr r1,SPRN_SPRG_603_LRU 499 - rlwinm r2,r3,20,27,31 /* Get Address bits 15:19 */ 500 - slw r0,r0,r2 501 - xor r1,r0,r1 502 - srw r0,r1,r2 523 + rlwinm r2,r0,20,27,31 /* Get Address bits 15:19 */ 524 + slw r3,r3,r2 525 + xor r1,r3,r1 526 + srw r3,r1,r2 503 527 mtspr SPRN_SPRG_603_LRU,r1 504 528 mfspr r2,SPRN_SRR1 505 - rlwimi r2,r0,31-14,14,14 529 + rlwimi r2,r3,31-14,14,14 506 530 mtspr SPRN_SRR1,r2 507 531 mtcrf 0x80,r2 508 - tlbld r3 532 + tlbld r0 509 533 rfi 510 534 MMU_FTR_SECTION_ELSE 511 535 mfspr r2,SPRN_SRR1 /* Need to restore CR0 */ 512 536 mtcrf 0x80,r2 513 - tlbld r3 537 + tlbld r0 514 538 rfi 515 539 ALT_MMU_FTR_SECTION_END_IFSET(MMU_FTR_NEED_DTLB_SW_LRU) 540 + 541 + 2: lis r2, (swapper_pg_dir - PAGE_OFFSET)@ha 542 + addi r2, r2, (swapper_pg_dir - PAGE_OFFSET)@l /* kernel page table */ 543 + rlwimi r2,r0,12,20,29 /* insert top 10 bits of address */ 544 + lwz r2,0(r2) /* get pmd entry */ 545 + cmpwi cr0,r2,0 546 + beq- DataAddressInvalid /* return if no mapping */ 547 + stw r2,0(r1) 548 + rlwinm. r2,r2,0,0,19 /* extract address of pte page */ 549 + b 1b 516 550 DataAddressInvalid: 517 551 mfspr r3,SPRN_SRR1 518 552 rlwinm r1,r3,9,6,6 /* Get load/store bit */ ··· 546 560 */ 547 561 . = INTERRUPT_DATA_STORE_TLB_MISS_603 548 562 DataStoreTLBMiss: 549 - /* 550 - * r0: userspace flag (later scratch) 551 - * r1: linux style pte ( later becomes ppc hardware pte ) 552 - * r2: ptr to linux-style pte 553 - * r3: fault address 554 - */ 555 563 /* Get PTE (linux-style) and check access */ 556 - mfspr r3,SPRN_DMISS 557 - lis r1, TASK_SIZE@h /* check if kernel address */ 558 - cmplw 0,r1,r3 564 + mfspr r0,SPRN_DMISS 559 565 mfspr r2, SPRN_SDR1 560 - li r1, _PAGE_RW | _PAGE_DIRTY | _PAGE_PRESENT | _PAGE_ACCESSED 561 - rlwinm r2, r2, 28, 0xfffff000 562 - li r0, 3 563 - bgt- 112f 564 - lis r2, (swapper_pg_dir - PAGE_OFFSET)@ha /* if kernel address, use */ 565 - li r0, 0 566 - addi r2, r2, (swapper_pg_dir - PAGE_OFFSET)@l /* kernel page table */ 567 - 112: rlwimi r2,r3,12,20,29 /* insert top 10 bits of address */ 568 - lwz r2,0(r2) /* get pmd entry */ 566 + rlwinm r1, r2, 28, 0xfffff000 567 + rlwimi r1,r0,12,20,29 /* insert top 10 bits of address */ 568 + lwz r2,0(r1) /* get pmd entry */ 569 + rlwinm r3, r0, 4, 0xf 569 570 rlwinm. r2,r2,0,0,19 /* extract address of pte page */ 570 - beq- DataAddressInvalid /* return if no mapping */ 571 - rlwimi r2,r3,22,20,29 /* insert next 10 bits of address */ 571 + subi r3, r3, (TASK_SIZE >> 28) & 0xf 572 + beq- 2f /* bail if no mapping */ 573 + 1: 574 + rlwimi r2,r0,22,20,29 /* insert next 10 bits of address */ 572 575 lwz r2,0(r2) /* get linux-style pte */ 576 + li r1, _PAGE_RW | _PAGE_DIRTY | _PAGE_PRESENT | _PAGE_ACCESSED 573 577 andc. r1,r1,r2 /* check access & ~permission */ 574 578 bne- DataAddressInvalid /* return if access not permitted */ 575 579 /* Convert linux-style PTE to low word of PPC-style PTE */ 576 - rlwimi r2,r0,0,31,31 /* userspace ? -> PP lsb */ 580 + rlwimi r2,r3,1,31,31 /* userspace ? -> PP lsb */ 577 581 li r1,0xe06 /* clear out reserved bits & PP msb */ 578 582 andc r1,r2,r1 /* PP = user? 1: 0 */ 579 583 BEGIN_FTR_SECTION ··· 573 597 mfspr r2,SPRN_SRR1 /* Need to restore CR0 */ 574 598 mtcrf 0x80,r2 575 599 BEGIN_MMU_FTR_SECTION 576 - li r0,1 600 + li r3,1 577 601 mfspr r1,SPRN_SPRG_603_LRU 578 - rlwinm r2,r3,20,27,31 /* Get Address bits 15:19 */ 579 - slw r0,r0,r2 580 - xor r1,r0,r1 581 - srw r0,r1,r2 602 + rlwinm r2,r0,20,27,31 /* Get Address bits 15:19 */ 603 + slw r3,r3,r2 604 + xor r1,r3,r1 605 + srw r3,r1,r2 582 606 mtspr SPRN_SPRG_603_LRU,r1 583 607 mfspr r2,SPRN_SRR1 584 - rlwimi r2,r0,31-14,14,14 608 + rlwimi r2,r3,31-14,14,14 585 609 mtspr SPRN_SRR1,r2 586 610 mtcrf 0x80,r2 587 - tlbld r3 611 + tlbld r0 588 612 rfi 589 613 MMU_FTR_SECTION_ELSE 590 614 mfspr r2,SPRN_SRR1 /* Need to restore CR0 */ 591 615 mtcrf 0x80,r2 592 - tlbld r3 616 + tlbld r0 593 617 rfi 594 618 ALT_MMU_FTR_SECTION_END_IFSET(MMU_FTR_NEED_DTLB_SW_LRU) 619 + 620 + 2: lis r2, (swapper_pg_dir - PAGE_OFFSET)@ha 621 + addi r2, r2, (swapper_pg_dir - PAGE_OFFSET)@l /* kernel page table */ 622 + rlwimi r2,r0,12,20,29 /* insert top 10 bits of address */ 623 + lwz r2,0(r2) /* get pmd entry */ 624 + cmpwi cr0,r2,0 625 + beq- DataAddressInvalid /* return if no mapping */ 626 + stw r2,0(r1) 627 + rlwinm r2,r2,0,0,19 /* extract address of pte page */ 628 + b 1b 595 629 596 630 #ifndef CONFIG_ALTIVEC 597 631 #define altivec_assist_exception unknown_exception
+1 -64
arch/powerpc/kernel/kprobes.c
··· 228 228 kcb->kprobe_saved_msr = regs->msr; 229 229 } 230 230 231 - void arch_prepare_kretprobe(struct kretprobe_instance *ri, struct pt_regs *regs) 232 - { 233 - ri->ret_addr = (kprobe_opcode_t *)regs->link; 234 - ri->fp = NULL; 235 - 236 - /* Replace the return addr with trampoline addr */ 237 - regs->link = (unsigned long)__kretprobe_trampoline; 238 - } 239 - NOKPROBE_SYMBOL(arch_prepare_kretprobe); 240 - 241 231 static int try_to_emulate(struct kprobe *p, struct pt_regs *regs) 242 232 { 243 233 int ret; ··· 385 395 NOKPROBE_SYMBOL(kprobe_handler); 386 396 387 397 /* 388 - * Function return probe trampoline: 389 - * - init_kprobes() establishes a probepoint here 390 - * - When the probed function returns, this probe 391 - * causes the handlers to fire 392 - */ 393 - asm(".global __kretprobe_trampoline\n" 394 - ".type __kretprobe_trampoline, @function\n" 395 - "__kretprobe_trampoline:\n" 396 - "nop\n" 397 - "blr\n" 398 - ".size __kretprobe_trampoline, .-__kretprobe_trampoline\n"); 399 - 400 - /* 401 - * Called when the probe at kretprobe trampoline is hit 402 - */ 403 - static int trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs) 404 - { 405 - unsigned long orig_ret_address; 406 - 407 - orig_ret_address = __kretprobe_trampoline_handler(regs, NULL); 408 - /* 409 - * We get here through one of two paths: 410 - * 1. by taking a trap -> kprobe_handler() -> here 411 - * 2. by optprobe branch -> optimized_callback() -> opt_pre_handler() -> here 412 - * 413 - * When going back through (1), we need regs->nip to be setup properly 414 - * as it is used to determine the return address from the trap. 415 - * For (2), since nip is not honoured with optprobes, we instead setup 416 - * the link register properly so that the subsequent 'blr' in 417 - * __kretprobe_trampoline jumps back to the right instruction. 418 - * 419 - * For nip, we should set the address to the previous instruction since 420 - * we end up emulating it in kprobe_handler(), which increments the nip 421 - * again. 422 - */ 423 - regs_set_return_ip(regs, orig_ret_address - 4); 424 - regs->link = orig_ret_address; 425 - 426 - return 0; 427 - } 428 - NOKPROBE_SYMBOL(trampoline_probe_handler); 429 - 430 - /* 431 398 * Called after single-stepping. p->addr is the address of the 432 399 * instruction whose first byte has been replaced by the "breakpoint" 433 400 * instruction. To avoid the SMP problems that can occur when we ··· 486 539 } 487 540 NOKPROBE_SYMBOL(kprobe_fault_handler); 488 541 489 - static struct kprobe trampoline_p = { 490 - .addr = (kprobe_opcode_t *) &__kretprobe_trampoline, 491 - .pre_handler = trampoline_probe_handler 492 - }; 493 - 494 - int __init arch_init_kprobes(void) 495 - { 496 - return register_kprobe(&trampoline_p); 497 - } 498 - 499 542 int arch_trampoline_kprobe(struct kprobe *p) 500 543 { 501 - if (p->addr == (kprobe_opcode_t *)&__kretprobe_trampoline) 544 + if (p->addr == (kprobe_opcode_t *)&arch_rethook_trampoline) 502 545 return 1; 503 546 504 547 return 0;
+2 -3
arch/powerpc/kernel/module_64.c
··· 651 651 // func_desc_t is 8 bytes if ABIv2, else 16 bytes 652 652 desc = func_desc(addr); 653 653 for (i = 0; i < sizeof(func_desc_t) / sizeof(u32); i++) { 654 - if (patch_instruction(((u32 *)&entry->funcdata) + i, 655 - ppc_inst(((u32 *)(&desc))[i]))) 654 + if (patch_u32(((u32 *)&entry->funcdata) + i, ((u32 *)&desc)[i])) 656 655 return 0; 657 656 } 658 657 659 - if (patch_instruction(&entry->magic, ppc_inst(STUB_MAGIC))) 658 + if (patch_u32(&entry->magic, STUB_MAGIC)) 660 659 return 0; 661 660 662 661 return 1;
+1 -1
arch/powerpc/kernel/optprobes.c
··· 56 56 * has a 'nop' instruction, which can be emulated. 57 57 * So further checks can be skipped. 58 58 */ 59 - if (p->addr == (kprobe_opcode_t *)&__kretprobe_trampoline) 59 + if (p->addr == (kprobe_opcode_t *)&arch_rethook_trampoline) 60 60 return addr + sizeof(kprobe_opcode_t); 61 61 62 62 /*
+18 -4
arch/powerpc/kernel/process.c
··· 72 72 #define TM_DEBUG(x...) do { } while(0) 73 73 #endif 74 74 75 - extern unsigned long _get_SP(void); 76 - 77 75 #ifdef CONFIG_PPC_TRANSACTIONAL_MEM 78 76 /* 79 77 * Are we running in "Suspend disabled" mode? If so we have to block any ··· 2175 2177 return 0; 2176 2178 } 2177 2179 2180 + #ifdef CONFIG_PPC64 2178 2181 static inline int valid_emergency_stack(unsigned long sp, struct task_struct *p, 2179 2182 unsigned long nbytes) 2180 2183 { 2181 - #ifdef CONFIG_PPC64 2182 2184 unsigned long stack_page; 2183 2185 unsigned long cpu = task_cpu(p); 2184 2186 ··· 2206 2208 if (sp >= stack_page && sp <= stack_page + THREAD_SIZE - nbytes) 2207 2209 return 1; 2208 2210 # endif 2209 - #endif 2210 2211 2211 2212 return 0; 2212 2213 } 2214 + #else 2215 + static inline int valid_emergency_stack(unsigned long sp, struct task_struct *p, 2216 + unsigned long nbytes) 2217 + { 2218 + unsigned long stack_page; 2219 + unsigned long cpu = task_cpu(p); 2220 + 2221 + if (!IS_ENABLED(CONFIG_VMAP_STACK)) 2222 + return 0; 2223 + 2224 + stack_page = (unsigned long)emergency_ctx[cpu] - THREAD_SIZE; 2225 + if (sp >= stack_page && sp <= stack_page + THREAD_SIZE - nbytes) 2226 + return 1; 2227 + 2228 + return 0; 2229 + } 2230 + #endif 2213 2231 2214 2232 /* 2215 2233 * validate the stack frame of a particular minimum size, used for when we are
+73
arch/powerpc/kernel/rethook.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + /* 3 + * PowerPC implementation of rethook. This depends on kprobes. 4 + */ 5 + 6 + #include <linux/kprobes.h> 7 + #include <linux/rethook.h> 8 + 9 + /* 10 + * Function return trampoline: 11 + * - init_kprobes() establishes a probepoint here 12 + * - When the probed function returns, this probe 13 + * causes the handlers to fire 14 + */ 15 + asm(".global arch_rethook_trampoline\n" 16 + ".type arch_rethook_trampoline, @function\n" 17 + "arch_rethook_trampoline:\n" 18 + "nop\n" 19 + "blr\n" 20 + ".size arch_rethook_trampoline, .-arch_rethook_trampoline\n"); 21 + 22 + /* 23 + * Called when the probe at kretprobe trampoline is hit 24 + */ 25 + static int trampoline_rethook_handler(struct kprobe *p, struct pt_regs *regs) 26 + { 27 + return !rethook_trampoline_handler(regs, regs->gpr[1]); 28 + } 29 + NOKPROBE_SYMBOL(trampoline_rethook_handler); 30 + 31 + void arch_rethook_prepare(struct rethook_node *rh, struct pt_regs *regs, bool mcount) 32 + { 33 + rh->ret_addr = regs->link; 34 + rh->frame = regs->gpr[1]; 35 + 36 + /* Replace the return addr with trampoline addr */ 37 + regs->link = (unsigned long)arch_rethook_trampoline; 38 + } 39 + NOKPROBE_SYMBOL(arch_rethook_prepare); 40 + 41 + /* This is called from rethook_trampoline_handler(). */ 42 + void arch_rethook_fixup_return(struct pt_regs *regs, unsigned long orig_ret_address) 43 + { 44 + /* 45 + * We get here through one of two paths: 46 + * 1. by taking a trap -> kprobe_handler() -> here 47 + * 2. by optprobe branch -> optimized_callback() -> opt_pre_handler() -> here 48 + * 49 + * When going back through (1), we need regs->nip to be setup properly 50 + * as it is used to determine the return address from the trap. 51 + * For (2), since nip is not honoured with optprobes, we instead setup 52 + * the link register properly so that the subsequent 'blr' in 53 + * arch_rethook_trampoline jumps back to the right instruction. 54 + * 55 + * For nip, we should set the address to the previous instruction since 56 + * we end up emulating it in kprobe_handler(), which increments the nip 57 + * again. 58 + */ 59 + regs_set_return_ip(regs, orig_ret_address - 4); 60 + regs->link = orig_ret_address; 61 + } 62 + NOKPROBE_SYMBOL(arch_rethook_fixup_return); 63 + 64 + static struct kprobe trampoline_p = { 65 + .addr = (kprobe_opcode_t *) &arch_rethook_trampoline, 66 + .pre_handler = trampoline_rethook_handler 67 + }; 68 + 69 + /* rethook initializer */ 70 + int __init arch_init_kprobes(void) 71 + { 72 + return register_kprobe(&trampoline_p); 73 + }
+1 -1
arch/powerpc/kernel/secvar-sysfs.c
··· 125 125 }; 126 126 __ATTRIBUTE_GROUPS(secvar_attr); 127 127 128 - static struct kobj_type secvar_ktype = { 128 + static const struct kobj_type secvar_ktype = { 129 129 .sysfs_ops = &kobj_sysfs_ops, 130 130 .default_groups = secvar_attr_groups, 131 131 };
+4 -2
arch/powerpc/kernel/stacktrace.c
··· 21 21 #include <asm/processor.h> 22 22 #include <linux/ftrace.h> 23 23 #include <asm/kprobes.h> 24 + #include <linux/rethook.h> 24 25 25 26 #include <asm/paca.h> 26 27 ··· 134 133 * arch-dependent code, they are generic. 135 134 */ 136 135 ip = ftrace_graph_ret_addr(task, &graph_idx, ip, stack); 137 - #ifdef CONFIG_KPROBES 136 + 138 137 /* 139 138 * Mark stacktraces with kretprobed functions on them 140 139 * as unreliable. 141 140 */ 142 - if (ip == (unsigned long)__kretprobe_trampoline) 141 + #ifdef CONFIG_RETHOOK 142 + if (ip == (unsigned long)arch_rethook_trampoline) 143 143 return -EINVAL; 144 144 #endif 145 145
+1 -1
arch/powerpc/kernel/static_call.c
··· 17 17 mutex_lock(&text_mutex); 18 18 19 19 if (func && !is_short) { 20 - err = patch_instruction(tramp + PPC_SCT_DATA, ppc_inst(target)); 20 + err = patch_ulong(tramp + PPC_SCT_DATA, target); 21 21 if (err) 22 22 goto out; 23 23 }
+1 -1
arch/powerpc/kernel/traps.c
··· 121 121 122 122 props = &pmac_backlight->props; 123 123 props->brightness = props->max_brightness; 124 - props->power = FB_BLANK_UNBLANK; 124 + props->power = BACKLIGHT_POWER_ON; 125 125 backlight_update_status(pmac_backlight); 126 126 } 127 127 mutex_unlock(&pmac_backlight_mutex);
-4
arch/powerpc/kernel/vdso/gettimeofday.S
··· 38 38 .else 39 39 addi r4, r5, VDSO_DATA_OFFSET 40 40 .endif 41 - #ifdef __powerpc64__ 42 41 bl CFUNC(DOTSYM(\funct)) 43 - #else 44 - bl \funct 45 - #endif 46 42 PPC_LL r0, PPC_MIN_STKFRM + PPC_LR_STKOFF(r1) 47 43 #ifdef __powerpc64__ 48 44 PPC_LL r2, PPC_MIN_STKFRM + STK_GOT(r1)
+12 -6
arch/powerpc/kvm/book3s_hv.c
··· 1922 1922 1923 1923 r = EMULATE_FAIL; 1924 1924 if (cpu_has_feature(CPU_FTR_ARCH_300)) { 1925 - if (cause == FSCR_MSGP_LG) 1925 + switch (cause) { 1926 + case FSCR_MSGP_LG: 1926 1927 r = kvmppc_emulate_doorbell_instr(vcpu); 1927 - if (cause == FSCR_PM_LG) 1928 + break; 1929 + case FSCR_PM_LG: 1928 1930 r = kvmppc_pmu_unavailable(vcpu); 1929 - if (cause == FSCR_EBB_LG) 1931 + break; 1932 + case FSCR_EBB_LG: 1930 1933 r = kvmppc_ebb_unavailable(vcpu); 1931 - if (cause == FSCR_TM_LG) 1934 + break; 1935 + case FSCR_TM_LG: 1932 1936 r = kvmppc_tm_unavailable(vcpu); 1937 + break; 1938 + default: 1939 + break; 1940 + } 1933 1941 } 1934 1942 if (r == EMULATE_FAIL) { 1935 1943 kvmppc_core_queue_program(vcpu, SRR1_PROGILL | ··· 4057 4049 /* Return to whole-core mode if we split the core earlier */ 4058 4050 if (cmd_bit) { 4059 4051 unsigned long hid0 = mfspr(SPRN_HID0); 4060 - unsigned long loops = 0; 4061 4052 4062 4053 hid0 &= ~HID0_POWER8_DYNLPARDIS; 4063 4054 stat_bit = HID0_POWER8_2LPARMODE | HID0_POWER8_4LPARMODE; ··· 4068 4061 if (!(hid0 & stat_bit)) 4069 4062 break; 4070 4063 cpu_relax(); 4071 - ++loops; 4072 4064 } 4073 4065 split_info.do_nap = 0; 4074 4066 }
+55 -15
arch/powerpc/lib/code-patching.c
··· 20 20 #include <asm/code-patching.h> 21 21 #include <asm/inst.h> 22 22 23 - static int __patch_instruction(u32 *exec_addr, ppc_inst_t instr, u32 *patch_addr) 23 + static int __patch_mem(void *exec_addr, unsigned long val, void *patch_addr, bool is_dword) 24 24 { 25 - if (!ppc_inst_prefixed(instr)) { 26 - u32 val = ppc_inst_val(instr); 25 + if (!IS_ENABLED(CONFIG_PPC64) || likely(!is_dword)) { 26 + /* For big endian correctness: plain address would use the wrong half */ 27 + u32 val32 = val; 27 28 28 - __put_kernel_nofault(patch_addr, &val, u32, failed); 29 + __put_kernel_nofault(patch_addr, &val32, u32, failed); 29 30 } else { 30 - u64 val = ppc_inst_as_ulong(instr); 31 - 32 31 __put_kernel_nofault(patch_addr, &val, u64, failed); 33 32 } 34 33 ··· 43 44 44 45 int raw_patch_instruction(u32 *addr, ppc_inst_t instr) 45 46 { 46 - return __patch_instruction(addr, instr, addr); 47 + if (ppc_inst_prefixed(instr)) 48 + return __patch_mem(addr, ppc_inst_as_ulong(instr), addr, true); 49 + else 50 + return __patch_mem(addr, ppc_inst_val(instr), addr, false); 47 51 } 48 52 49 53 struct patch_context { ··· 278 276 flush_tlb_kernel_range(addr, addr + PAGE_SIZE); 279 277 } 280 278 281 - static int __do_patch_instruction_mm(u32 *addr, ppc_inst_t instr) 279 + static int __do_patch_mem_mm(void *addr, unsigned long val, bool is_dword) 282 280 { 283 281 int err; 284 282 u32 *patch_addr; ··· 307 305 308 306 orig_mm = start_using_temp_mm(patching_mm); 309 307 310 - err = __patch_instruction(addr, instr, patch_addr); 308 + err = __patch_mem(addr, val, patch_addr, is_dword); 311 309 312 310 /* context synchronisation performed by __patch_instruction (isync or exception) */ 313 311 stop_using_temp_mm(patching_mm, orig_mm); ··· 324 322 return err; 325 323 } 326 324 327 - static int __do_patch_instruction(u32 *addr, ppc_inst_t instr) 325 + static int __do_patch_mem(void *addr, unsigned long val, bool is_dword) 328 326 { 329 327 int err; 330 328 u32 *patch_addr; ··· 341 339 if (radix_enabled()) 342 340 asm volatile("ptesync": : :"memory"); 343 341 344 - err = __patch_instruction(addr, instr, patch_addr); 342 + err = __patch_mem(addr, val, patch_addr, is_dword); 345 343 346 344 pte_clear(&init_mm, text_poke_addr, pte); 347 345 flush_tlb_kernel_range(text_poke_addr, text_poke_addr + PAGE_SIZE); ··· 349 347 return err; 350 348 } 351 349 352 - int patch_instruction(u32 *addr, ppc_inst_t instr) 350 + static int patch_mem(void *addr, unsigned long val, bool is_dword) 353 351 { 354 352 int err; 355 353 unsigned long flags; ··· 361 359 */ 362 360 if (!IS_ENABLED(CONFIG_STRICT_KERNEL_RWX) || 363 361 !static_branch_likely(&poking_init_done)) 364 - return raw_patch_instruction(addr, instr); 362 + return __patch_mem(addr, val, addr, is_dword); 365 363 366 364 local_irq_save(flags); 367 365 if (mm_patch_enabled()) 368 - err = __do_patch_instruction_mm(addr, instr); 366 + err = __do_patch_mem_mm(addr, val, is_dword); 369 367 else 370 - err = __do_patch_instruction(addr, instr); 368 + err = __do_patch_mem(addr, val, is_dword); 371 369 local_irq_restore(flags); 372 370 373 371 return err; 374 372 } 373 + 374 + #ifdef CONFIG_PPC64 375 + 376 + int patch_instruction(u32 *addr, ppc_inst_t instr) 377 + { 378 + if (ppc_inst_prefixed(instr)) 379 + return patch_mem(addr, ppc_inst_as_ulong(instr), true); 380 + else 381 + return patch_mem(addr, ppc_inst_val(instr), false); 382 + } 375 383 NOKPROBE_SYMBOL(patch_instruction); 384 + 385 + int patch_uint(void *addr, unsigned int val) 386 + { 387 + if (!IS_ALIGNED((unsigned long)addr, sizeof(unsigned int))) 388 + return -EINVAL; 389 + 390 + return patch_mem(addr, val, false); 391 + } 392 + NOKPROBE_SYMBOL(patch_uint); 393 + 394 + int patch_ulong(void *addr, unsigned long val) 395 + { 396 + if (!IS_ALIGNED((unsigned long)addr, sizeof(unsigned long))) 397 + return -EINVAL; 398 + 399 + return patch_mem(addr, val, true); 400 + } 401 + NOKPROBE_SYMBOL(patch_ulong); 402 + 403 + #else 404 + 405 + int patch_instruction(u32 *addr, ppc_inst_t instr) 406 + { 407 + return patch_mem(addr, ppc_inst_val(instr), false); 408 + } 409 + NOKPROBE_SYMBOL(patch_instruction) 410 + 411 + #endif 376 412 377 413 static int patch_memset64(u64 *addr, u64 val, size_t count) 378 414 {
+41
arch/powerpc/lib/test-code-patching.c
··· 438 438 vfree(buf); 439 439 } 440 440 441 + static void __init test_data_patching(void) 442 + { 443 + void *buf; 444 + u32 *addr32; 445 + 446 + buf = vzalloc(PAGE_SIZE); 447 + check(buf); 448 + if (!buf) 449 + return; 450 + 451 + addr32 = buf + 128; 452 + 453 + addr32[1] = 0xA0A1A2A3; 454 + addr32[2] = 0xB0B1B2B3; 455 + 456 + check(!patch_uint(&addr32[1], 0xC0C1C2C3)); 457 + 458 + check(addr32[0] == 0); 459 + check(addr32[1] == 0xC0C1C2C3); 460 + check(addr32[2] == 0xB0B1B2B3); 461 + check(addr32[3] == 0); 462 + 463 + /* Unaligned patch_ulong() should fail */ 464 + if (IS_ENABLED(CONFIG_PPC64)) 465 + check(patch_ulong(&addr32[1], 0xD0D1D2D3) == -EINVAL); 466 + 467 + check(!patch_ulong(&addr32[2], 0xD0D1D2D3)); 468 + 469 + check(addr32[0] == 0); 470 + check(addr32[1] == 0xC0C1C2C3); 471 + check(*(unsigned long *)(&addr32[2]) == 0xD0D1D2D3); 472 + 473 + if (!IS_ENABLED(CONFIG_PPC64)) 474 + check(addr32[3] == 0); 475 + 476 + check(addr32[4] == 0); 477 + 478 + vfree(buf); 479 + } 480 + 441 481 static int __init test_code_patching(void) 442 482 { 443 483 pr_info("Running code patching self-tests ...\n"); ··· 488 448 test_translate_branch(); 489 449 test_prefixed_patching(); 490 450 test_multi_instruction_patching(); 451 + test_data_patching(); 491 452 492 453 return 0; 493 454 }
+2
arch/powerpc/mm/book3s32/mmu.c
··· 223 223 224 224 update_bats(); 225 225 226 + BUILD_BUG_ON(ALIGN_DOWN(MODULES_VADDR, SZ_256M) < TASK_SIZE); 227 + 226 228 for (i = TASK_SIZE >> 28; i < 16; i++) { 227 229 /* Do not set NX on VM space for modules */ 228 230 if (is_module_segment(i << 28))
+1 -1
arch/powerpc/mm/book3s64/hash_utils.c
··· 125 125 #endif 126 126 static u8 *linear_map_hash_slots; 127 127 static unsigned long linear_map_hash_count; 128 - struct mmu_hash_ops mmu_hash_ops; 128 + struct mmu_hash_ops mmu_hash_ops __ro_after_init; 129 129 EXPORT_SYMBOL(mmu_hash_ops); 130 130 131 131 /*
+14
arch/powerpc/mm/mem.c
··· 410 410 #ifdef CONFIG_EXECMEM 411 411 static struct execmem_info execmem_info __ro_after_init; 412 412 413 + #if defined(CONFIG_PPC_8xx) || defined(CONFIG_PPC_BOOK3S_603) 414 + static void prealloc_execmem_pgtable(void) 415 + { 416 + unsigned long va; 417 + 418 + for (va = ALIGN_DOWN(MODULES_VADDR, PGDIR_SIZE); va < MODULES_END; va += PGDIR_SIZE) 419 + pte_alloc_kernel(pmd_off_k(va), va); 420 + } 421 + #else 422 + static void prealloc_execmem_pgtable(void) { } 423 + #endif 424 + 413 425 struct execmem_info __init *execmem_arch_setup(void) 414 426 { 415 427 pgprot_t kprobes_prot = strict_module_rwx_enabled() ? PAGE_KERNEL_ROX : PAGE_KERNEL_EXEC; ··· 452 440 start = VMALLOC_START; 453 441 end = VMALLOC_END; 454 442 #endif 443 + 444 + prealloc_execmem_pgtable(); 455 445 456 446 execmem_info = (struct execmem_info){ 457 447 .ranges = {
+6 -3
arch/powerpc/mm/nohash/8xx.c
··· 150 150 151 151 mmu_mapin_immr(); 152 152 153 - mmu_mapin_ram_chunk(0, boundary, PAGE_KERNEL_TEXT, true); 153 + mmu_mapin_ram_chunk(0, boundary, PAGE_KERNEL_X, true); 154 154 if (debug_pagealloc_enabled_or_kfence()) { 155 155 top = boundary; 156 156 } else { 157 - mmu_mapin_ram_chunk(boundary, einittext8, PAGE_KERNEL_TEXT, true); 157 + mmu_mapin_ram_chunk(boundary, einittext8, PAGE_KERNEL_X, true); 158 158 mmu_mapin_ram_chunk(einittext8, top, PAGE_KERNEL, true); 159 159 } 160 160 ··· 177 177 if (!debug_pagealloc_enabled_or_kfence()) 178 178 err = mmu_mapin_ram_chunk(boundary, einittext8, PAGE_KERNEL, false); 179 179 180 - mmu_pin_tlb(block_mapped_ram, false); 180 + if (IS_ENABLED(CONFIG_PIN_TLB_TEXT)) 181 + mmu_pin_tlb(block_mapped_ram, false); 181 182 182 183 return err; 183 184 } ··· 207 206 208 207 /* 8xx can only access 32MB at the moment */ 209 208 memblock_set_current_limit(min_t(u64, first_memblock_size, SZ_32M)); 209 + 210 + BUILD_BUG_ON(ALIGN_DOWN(MODULES_VADDR, PGDIR_SIZE) < TASK_SIZE); 210 211 } 211 212 212 213 int pud_clear_huge(pud_t *pud)
+1 -1
arch/powerpc/platforms/44x/ppc476.c
··· 95 95 } 96 96 97 97 static const struct i2c_device_id avr_id[] = { 98 - { "akebono-avr", 0 }, 98 + { "akebono-avr" }, 99 99 { } 100 100 }; 101 101
+1 -1
arch/powerpc/platforms/512x/mpc512x_lpbfifo.c
··· 504 504 505 505 static struct platform_driver mpc512x_lpbfifo_driver = { 506 506 .probe = mpc512x_lpbfifo_probe, 507 - .remove_new = mpc512x_lpbfifo_remove, 507 + .remove = mpc512x_lpbfifo_remove, 508 508 .driver = { 509 509 .name = DRV_NAME, 510 510 .of_match_table = mpc512x_lpbfifo_match,
-1
arch/powerpc/platforms/52xx/mpc52xx_gpt.c
··· 644 644 645 645 static const struct file_operations mpc52xx_wdt_fops = { 646 646 .owner = THIS_MODULE, 647 - .llseek = no_llseek, 648 647 .write = mpc52xx_wdt_write, 649 648 .unlocked_ioctl = mpc52xx_wdt_ioctl, 650 649 .compat_ioctl = compat_ptr_ioctl,
+1 -1
arch/powerpc/platforms/85xx/sgy_cts1000.c
··· 143 143 .of_match_table = gpio_halt_match, 144 144 }, 145 145 .probe = gpio_halt_probe, 146 - .remove_new = gpio_halt_remove, 146 + .remove = gpio_halt_remove, 147 147 }; 148 148 149 149 module_platform_driver(gpio_halt_driver);
+7
arch/powerpc/platforms/8xx/Kconfig
··· 195 195 CONFIG_PIN_TLB_DATA is also selected, it will reduce 196 196 CONFIG_PIN_TLB_DATA to 24 Mbytes. 197 197 198 + config PIN_TLB_TEXT 199 + bool "Pinned TLB for TEXT" 200 + depends on PIN_TLB 201 + default y 202 + help 203 + This pins kernel text with 8M pages. 204 + 198 205 endmenu 199 206 200 207 endmenu
+8 -3
arch/powerpc/platforms/Kconfig.cputype
··· 84 84 bool "Server processors" 85 85 select PPC_FPU 86 86 select PPC_HAVE_PMU_SUPPORT 87 - select HAVE_ARCH_TRANSPARENT_HUGEPAGE 88 - select HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD 89 87 select ARCH_ENABLE_HUGEPAGE_MIGRATION if HUGETLB_PAGE && MIGRATION 90 88 select ARCH_ENABLE_SPLIT_PMD_PTLOCK 91 - select ARCH_ENABLE_THP_MIGRATION if TRANSPARENT_HUGEPAGE 92 89 select ARCH_SUPPORTS_HUGETLBFS 93 90 select ARCH_SUPPORTS_NUMA_BALANCING 94 91 select HAVE_MOVE_PMD ··· 104 107 select ZONE_DMA 105 108 106 109 endchoice 110 + 111 + config PPC_THP 112 + def_bool y 113 + depends on PPC_BOOK3S_64 114 + depends on PPC_RADIX_MMU || (PPC_64S_HASH_MMU && PAGE_SIZE_64KB) 115 + select HAVE_ARCH_TRANSPARENT_HUGEPAGE 116 + select HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD 117 + select ARCH_ENABLE_THP_MIGRATION if TRANSPARENT_HUGEPAGE 107 118 108 119 choice 109 120 prompt "CPU selection"
-17
arch/powerpc/platforms/cell/spufs/file.c
··· 453 453 .release = spufs_cntl_release, 454 454 .read = simple_attr_read, 455 455 .write = simple_attr_write, 456 - .llseek = no_llseek, 457 456 .mmap = spufs_cntl_mmap, 458 457 }; 459 458 ··· 633 634 static const struct file_operations spufs_mbox_fops = { 634 635 .open = spufs_pipe_open, 635 636 .read = spufs_mbox_read, 636 - .llseek = no_llseek, 637 637 }; 638 638 639 639 static ssize_t spufs_mbox_stat_read(struct file *file, char __user *buf, ··· 662 664 static const struct file_operations spufs_mbox_stat_fops = { 663 665 .open = spufs_pipe_open, 664 666 .read = spufs_mbox_stat_read, 665 - .llseek = no_llseek, 666 667 }; 667 668 668 669 /* low-level ibox access function */ ··· 766 769 .open = spufs_pipe_open, 767 770 .read = spufs_ibox_read, 768 771 .poll = spufs_ibox_poll, 769 - .llseek = no_llseek, 770 772 }; 771 773 772 774 static ssize_t spufs_ibox_stat_read(struct file *file, char __user *buf, ··· 793 797 static const struct file_operations spufs_ibox_stat_fops = { 794 798 .open = spufs_pipe_open, 795 799 .read = spufs_ibox_stat_read, 796 - .llseek = no_llseek, 797 800 }; 798 801 799 802 /* low-level mailbox write */ ··· 896 901 .open = spufs_pipe_open, 897 902 .write = spufs_wbox_write, 898 903 .poll = spufs_wbox_poll, 899 - .llseek = no_llseek, 900 904 }; 901 905 902 906 static ssize_t spufs_wbox_stat_read(struct file *file, char __user *buf, ··· 923 929 static const struct file_operations spufs_wbox_stat_fops = { 924 930 .open = spufs_pipe_open, 925 931 .read = spufs_wbox_stat_read, 926 - .llseek = no_llseek, 927 932 }; 928 933 929 934 static int spufs_signal1_open(struct inode *inode, struct file *file) ··· 1049 1056 .read = spufs_signal1_read, 1050 1057 .write = spufs_signal1_write, 1051 1058 .mmap = spufs_signal1_mmap, 1052 - .llseek = no_llseek, 1053 1059 }; 1054 1060 1055 1061 static const struct file_operations spufs_signal1_nosched_fops = { ··· 1056 1064 .release = spufs_signal1_release, 1057 1065 .write = spufs_signal1_write, 1058 1066 .mmap = spufs_signal1_mmap, 1059 - .llseek = no_llseek, 1060 1067 }; 1061 1068 1062 1069 static int spufs_signal2_open(struct inode *inode, struct file *file) ··· 1186 1195 .read = spufs_signal2_read, 1187 1196 .write = spufs_signal2_write, 1188 1197 .mmap = spufs_signal2_mmap, 1189 - .llseek = no_llseek, 1190 1198 }; 1191 1199 1192 1200 static const struct file_operations spufs_signal2_nosched_fops = { ··· 1193 1203 .release = spufs_signal2_release, 1194 1204 .write = spufs_signal2_write, 1195 1205 .mmap = spufs_signal2_mmap, 1196 - .llseek = no_llseek, 1197 1206 }; 1198 1207 1199 1208 /* ··· 1332 1343 .open = spufs_mss_open, 1333 1344 .release = spufs_mss_release, 1334 1345 .mmap = spufs_mss_mmap, 1335 - .llseek = no_llseek, 1336 1346 }; 1337 1347 1338 1348 static vm_fault_t ··· 1389 1401 .open = spufs_psmap_open, 1390 1402 .release = spufs_psmap_release, 1391 1403 .mmap = spufs_psmap_mmap, 1392 - .llseek = no_llseek, 1393 1404 }; 1394 1405 1395 1406 ··· 1719 1732 .flush = spufs_mfc_flush, 1720 1733 .fsync = spufs_mfc_fsync, 1721 1734 .mmap = spufs_mfc_mmap, 1722 - .llseek = no_llseek, 1723 1735 }; 1724 1736 1725 1737 static int spufs_npc_set(void *data, u64 val) ··· 2088 2102 static const struct file_operations spufs_dma_info_fops = { 2089 2103 .open = spufs_info_open, 2090 2104 .read = spufs_dma_info_read, 2091 - .llseek = no_llseek, 2092 2105 }; 2093 2106 2094 2107 static void spufs_get_proxydma_info(struct spu_context *ctx, ··· 2144 2159 static const struct file_operations spufs_proxydma_info_fops = { 2145 2160 .open = spufs_info_open, 2146 2161 .read = spufs_proxydma_info_read, 2147 - .llseek = no_llseek, 2148 2162 }; 2149 2163 2150 2164 static int spufs_show_tid(struct seq_file *s, void *private) ··· 2426 2442 .read = spufs_switch_log_read, 2427 2443 .poll = spufs_switch_log_poll, 2428 2444 .release = spufs_switch_log_release, 2429 - .llseek = no_llseek, 2430 2445 }; 2431 2446 2432 2447 /**
-1
arch/powerpc/platforms/maple/maple.h
··· 7 7 extern int maple_set_rtc_time(struct rtc_time *tm); 8 8 extern void maple_get_rtc_time(struct rtc_time *tm); 9 9 extern time64_t maple_get_boot_time(void); 10 - extern void maple_calibrate_decr(void); 11 10 extern void maple_pci_init(void); 12 11 extern void maple_pci_irq_fixup(struct pci_dev *dev); 13 12 extern int maple_pci_get_legacy_ide_irq(struct pci_dev *dev, int channel);
+1 -1
arch/powerpc/platforms/pasemi/gpio_mdio.c
··· 285 285 static struct platform_driver gpio_mdio_driver = 286 286 { 287 287 .probe = gpio_mdio_probe, 288 - .remove_new = gpio_mdio_remove, 288 + .remove = gpio_mdio_remove, 289 289 .driver = { 290 290 .name = "gpio-mdio-bitbang", 291 291 .of_match_table = gpio_mdio_match,
-1
arch/powerpc/platforms/pasemi/pasemi.h
··· 5 5 extern time64_t pas_get_boot_time(void); 6 6 extern void pas_pci_init(void); 7 7 struct pci_dev; 8 - extern void pas_pci_irq_fixup(struct pci_dev *dev); 9 8 extern void pas_pci_dma_dev_setup(struct pci_dev *dev); 10 9 11 10 void __iomem *__init pasemi_pci_getcfgaddr(struct pci_dev *dev, int offset);
+1 -1
arch/powerpc/platforms/powermac/pfunc_base.c
··· 313 313 /* 314 314 * Install handlers for the hwclock child if any 315 315 */ 316 - for (np = NULL; (np = of_get_next_child(uninorth_node, np)) != NULL;) 316 + for_each_child_of_node(uninorth_node, np) 317 317 if (of_node_name_eq(np, "hw-clock")) { 318 318 unin_hwclock = np; 319 319 break;
+1 -1
arch/powerpc/platforms/powermac/smp.c
··· 827 827 mdelay(1); 828 828 829 829 /* Restore our exception vector */ 830 - patch_instruction(vector, ppc_inst(save_vector)); 830 + patch_uint(vector, save_vector); 831 831 832 832 local_irq_restore(flags); 833 833 if (ppc_md.progress) ppc_md.progress("smp_core99_kick_cpu done", 0x347);
+1 -2
arch/powerpc/platforms/powernv/eeh-powernv.c
··· 99 99 100 100 static const struct file_operations pnv_eeh_ei_fops = { 101 101 .open = simple_open, 102 - .llseek = no_llseek, 103 102 .write = pnv_eeh_ei_write, 104 103 }; 105 104 ··· 859 860 int64_t rc; 860 861 861 862 /* Hot reset to the bus if firmware cannot handle */ 862 - if (!dn || !of_get_property(dn, "ibm,reset-by-firmware", NULL)) 863 + if (!dn || !of_property_present(dn, "ibm,reset-by-firmware")) 863 864 return __pnv_eeh_bridge_reset(pdev, option); 864 865 865 866 pr_debug("%s: FW reset PCI bus %04x:%02x with option %d\n",
+1 -1
arch/powerpc/platforms/powernv/opal-dump.c
··· 210 210 }; 211 211 ATTRIBUTE_GROUPS(dump_default); 212 212 213 - static struct kobj_type dump_ktype = { 213 + static const struct kobj_type dump_ktype = { 214 214 .sysfs_ops = &dump_sysfs_ops, 215 215 .release = &dump_release, 216 216 .default_groups = dump_default_groups,
+1 -1
arch/powerpc/platforms/powernv/opal-elog.c
··· 146 146 }; 147 147 ATTRIBUTE_GROUPS(elog_default); 148 148 149 - static struct kobj_type elog_ktype = { 149 + static const struct kobj_type elog_ktype = { 150 150 .sysfs_ops = &elog_sysfs_ops, 151 151 .release = &elog_release, 152 152 .default_groups = elog_default_groups,
+1 -1
arch/powerpc/platforms/powernv/opal-lpc.c
··· 393 393 for_each_compatible_node(np, NULL, "ibm,power8-lpc") { 394 394 if (!of_device_is_available(np)) 395 395 continue; 396 - if (!of_get_property(np, "primary", NULL)) 396 + if (!of_property_present(np, "primary")) 397 397 continue; 398 398 opal_lpc_chip_id = of_get_ibm_chip_id(np); 399 399 of_node_put(np);
+1 -1
arch/powerpc/platforms/powernv/opal-prd.c
··· 443 443 .of_match_table = opal_prd_match, 444 444 }, 445 445 .probe = opal_prd_probe, 446 - .remove_new = opal_prd_remove, 446 + .remove = opal_prd_remove, 447 447 }; 448 448 449 449 module_platform_driver(opal_prd_driver);
-1
arch/powerpc/platforms/powernv/pci.h
··· 274 274 int where, int size, u32 val); 275 275 extern struct iommu_table *pnv_pci_table_alloc(int nid); 276 276 277 - extern void pnv_pci_init_ioda_hub(struct device_node *np); 278 277 extern void pnv_pci_init_ioda2_phb(struct device_node *np); 279 278 extern void pnv_pci_init_npu2_opencapi_phb(struct device_node *np); 280 279 extern void pnv_pci_reset_secondary_bus(struct pci_dev *dev);
+218 -22
arch/powerpc/platforms/pseries/dlpar.c
··· 23 23 #include <linux/uaccess.h> 24 24 #include <asm/rtas.h> 25 25 #include <asm/rtas-work-area.h> 26 + #include <asm/prom.h> 26 27 27 28 static struct workqueue_struct *pseries_hp_wq; 28 29 ··· 251 250 struct device_node *child; 252 251 int rc; 253 252 254 - child = of_get_next_child(dn, NULL); 255 - while (child) { 253 + for_each_child_of_node(dn, child) 256 254 dlpar_detach_node(child); 257 - child = of_get_next_child(dn, child); 258 - } 259 255 260 256 rc = of_detach_node(dn); 261 257 if (rc) ··· 261 263 of_node_put(dn); 262 264 263 265 return 0; 266 + } 267 + static int dlpar_changeset_attach_cc_nodes(struct of_changeset *ocs, 268 + struct device_node *dn) 269 + { 270 + int rc; 271 + 272 + rc = of_changeset_attach_node(ocs, dn); 273 + 274 + if (!rc && dn->child) 275 + rc = dlpar_changeset_attach_cc_nodes(ocs, dn->child); 276 + if (!rc && dn->sibling) 277 + rc = dlpar_changeset_attach_cc_nodes(ocs, dn->sibling); 278 + 279 + return rc; 264 280 } 265 281 266 282 #define DR_ENTITY_SENSE 9003 ··· 342 330 return 0; 343 331 } 344 332 333 + static struct device_node * 334 + get_device_node_with_drc_index(u32 index) 335 + { 336 + struct device_node *np = NULL; 337 + u32 node_index; 338 + int rc; 339 + 340 + for_each_node_with_property(np, "ibm,my-drc-index") { 341 + rc = of_property_read_u32(np, "ibm,my-drc-index", 342 + &node_index); 343 + if (rc) { 344 + pr_err("%s: %pOF: of_property_read_u32 %s: %d\n", 345 + __func__, np, "ibm,my-drc-index", rc); 346 + of_node_put(np); 347 + return NULL; 348 + } 349 + 350 + if (index == node_index) 351 + break; 352 + } 353 + 354 + return np; 355 + } 356 + 357 + static struct device_node * 358 + get_device_node_with_drc_info(u32 index) 359 + { 360 + struct device_node *np = NULL; 361 + struct of_drc_info drc; 362 + struct property *info; 363 + const __be32 *value; 364 + u32 node_index; 365 + int i, j, count; 366 + 367 + for_each_node_with_property(np, "ibm,drc-info") { 368 + info = of_find_property(np, "ibm,drc-info", NULL); 369 + if (info == NULL) { 370 + /* XXX can this happen? */ 371 + of_node_put(np); 372 + return NULL; 373 + } 374 + value = of_prop_next_u32(info, NULL, &count); 375 + if (value == NULL) 376 + continue; 377 + value++; 378 + for (i = 0; i < count; i++) { 379 + if (of_read_drc_info_cell(&info, &value, &drc)) 380 + break; 381 + if (index > drc.last_drc_index) 382 + continue; 383 + node_index = drc.drc_index_start; 384 + for (j = 0; j < drc.num_sequential_elems; j++) { 385 + if (index == node_index) 386 + return np; 387 + node_index += drc.sequential_inc; 388 + } 389 + } 390 + } 391 + 392 + return NULL; 393 + } 394 + 395 + static int dlpar_hp_dt_add(u32 index) 396 + { 397 + struct device_node *np, *nodes; 398 + struct of_changeset ocs; 399 + int rc; 400 + 401 + /* 402 + * Do not add device node(s) if already exists in the 403 + * device tree. 404 + */ 405 + np = get_device_node_with_drc_index(index); 406 + if (np) { 407 + pr_err("%s: Adding device node for index (%d), but " 408 + "already exists in the device tree\n", 409 + __func__, index); 410 + rc = -EINVAL; 411 + goto out; 412 + } 413 + 414 + np = get_device_node_with_drc_info(index); 415 + 416 + if (!np) 417 + return -EIO; 418 + 419 + /* Next, configure the connector. */ 420 + nodes = dlpar_configure_connector(cpu_to_be32(index), np); 421 + if (!nodes) { 422 + rc = -EIO; 423 + goto out; 424 + } 425 + 426 + /* 427 + * Add the new nodes from dlpar_configure_connector() onto 428 + * the device-tree. 429 + */ 430 + of_changeset_init(&ocs); 431 + rc = dlpar_changeset_attach_cc_nodes(&ocs, nodes); 432 + 433 + if (!rc) 434 + rc = of_changeset_apply(&ocs); 435 + else 436 + dlpar_free_cc_nodes(nodes); 437 + 438 + of_changeset_destroy(&ocs); 439 + 440 + out: 441 + of_node_put(np); 442 + return rc; 443 + } 444 + 445 + static int changeset_detach_node_recursive(struct of_changeset *ocs, 446 + struct device_node *node) 447 + { 448 + struct device_node *child; 449 + int rc; 450 + 451 + for_each_child_of_node(node, child) { 452 + rc = changeset_detach_node_recursive(ocs, child); 453 + if (rc) { 454 + of_node_put(child); 455 + return rc; 456 + } 457 + } 458 + 459 + return of_changeset_detach_node(ocs, node); 460 + } 461 + 462 + static int dlpar_hp_dt_remove(u32 drc_index) 463 + { 464 + struct device_node *np; 465 + struct of_changeset ocs; 466 + u32 index; 467 + int rc = 0; 468 + 469 + /* 470 + * Prune all nodes with a matching index. 471 + */ 472 + of_changeset_init(&ocs); 473 + 474 + for_each_node_with_property(np, "ibm,my-drc-index") { 475 + rc = of_property_read_u32(np, "ibm,my-drc-index", &index); 476 + if (rc) { 477 + pr_err("%s: %pOF: of_property_read_u32 %s: %d\n", 478 + __func__, np, "ibm,my-drc-index", rc); 479 + of_node_put(np); 480 + goto out; 481 + } 482 + 483 + if (index == drc_index) { 484 + rc = changeset_detach_node_recursive(&ocs, np); 485 + if (rc) { 486 + of_node_put(np); 487 + goto out; 488 + } 489 + } 490 + } 491 + 492 + rc = of_changeset_apply(&ocs); 493 + 494 + out: 495 + of_changeset_destroy(&ocs); 496 + return rc; 497 + } 498 + 499 + static int dlpar_hp_dt(struct pseries_hp_errorlog *phpe) 500 + { 501 + u32 drc_index; 502 + int rc; 503 + 504 + if (phpe->id_type != PSERIES_HP_ELOG_ID_DRC_INDEX) 505 + return -EINVAL; 506 + 507 + drc_index = be32_to_cpu(phpe->_drc_u.drc_index); 508 + 509 + lock_device_hotplug(); 510 + 511 + switch (phpe->action) { 512 + case PSERIES_HP_ELOG_ACTION_ADD: 513 + rc = dlpar_hp_dt_add(drc_index); 514 + break; 515 + case PSERIES_HP_ELOG_ACTION_REMOVE: 516 + rc = dlpar_hp_dt_remove(drc_index); 517 + break; 518 + default: 519 + pr_err("Invalid action (%d) specified\n", phpe->action); 520 + rc = -EINVAL; 521 + break; 522 + } 523 + 524 + unlock_device_hotplug(); 525 + 526 + return rc; 527 + } 528 + 345 529 int handle_dlpar_errorlog(struct pseries_hp_errorlog *hp_elog) 346 530 { 347 531 int rc; 348 - 349 - /* pseries error logs are in BE format, convert to cpu type */ 350 - switch (hp_elog->id_type) { 351 - case PSERIES_HP_ELOG_ID_DRC_COUNT: 352 - hp_elog->_drc_u.drc_count = 353 - be32_to_cpu(hp_elog->_drc_u.drc_count); 354 - break; 355 - case PSERIES_HP_ELOG_ID_DRC_INDEX: 356 - hp_elog->_drc_u.drc_index = 357 - be32_to_cpu(hp_elog->_drc_u.drc_index); 358 - break; 359 - case PSERIES_HP_ELOG_ID_DRC_IC: 360 - hp_elog->_drc_u.ic.count = 361 - be32_to_cpu(hp_elog->_drc_u.ic.count); 362 - hp_elog->_drc_u.ic.index = 363 - be32_to_cpu(hp_elog->_drc_u.ic.index); 364 - } 365 532 366 533 switch (hp_elog->resource) { 367 534 case PSERIES_HP_ELOG_RESOURCE_MEM: ··· 551 360 break; 552 361 case PSERIES_HP_ELOG_RESOURCE_PMEM: 553 362 rc = dlpar_hp_pmem(hp_elog); 363 + break; 364 + case PSERIES_HP_ELOG_RESOURCE_DT: 365 + rc = dlpar_hp_dt(hp_elog); 554 366 break; 555 367 556 368 default: ··· 607 413 hp_elog->resource = PSERIES_HP_ELOG_RESOURCE_MEM; 608 414 } else if (sysfs_streq(arg, "cpu")) { 609 415 hp_elog->resource = PSERIES_HP_ELOG_RESOURCE_CPU; 416 + } else if (sysfs_streq(arg, "dt")) { 417 + hp_elog->resource = PSERIES_HP_ELOG_RESOURCE_DT; 610 418 } else { 611 419 pr_err("Invalid resource specified.\n"); 612 420 return -EINVAL; ··· 750 554 static ssize_t dlpar_show(const struct class *class, const struct class_attribute *attr, 751 555 char *buf) 752 556 { 753 - return sprintf(buf, "%s\n", "memory,cpu"); 557 + return sprintf(buf, "%s\n", "memory,cpu,dt"); 754 558 } 755 559 756 560 static CLASS_ATTR_RW(dlpar);
-1
arch/powerpc/platforms/pseries/dtl.c
··· 325 325 .open = dtl_file_open, 326 326 .release = dtl_file_release, 327 327 .read = dtl_file_read, 328 - .llseek = no_llseek, 329 328 }; 330 329 331 330 static struct dentry *dtl_dir;
+38 -1
arch/powerpc/platforms/pseries/eeh_pseries.c
··· 784 784 } 785 785 #endif 786 786 787 + /** 788 + * pseries_eeh_err_inject - Inject specified error to the indicated PE 789 + * @pe: the indicated PE 790 + * @type: error type 791 + * @func: specific error type 792 + * @addr: address 793 + * @mask: address mask 794 + * The routine is called to inject specified error, which is 795 + * determined by @type and @func, to the indicated PE 796 + */ 797 + static int pseries_eeh_err_inject(struct eeh_pe *pe, int type, int func, 798 + unsigned long addr, unsigned long mask) 799 + { 800 + struct eeh_dev *pdev; 801 + 802 + /* Check on PCI error type */ 803 + if (type != EEH_ERR_TYPE_32 && type != EEH_ERR_TYPE_64) 804 + return -EINVAL; 805 + 806 + switch (func) { 807 + case EEH_ERR_FUNC_LD_MEM_ADDR: 808 + case EEH_ERR_FUNC_LD_MEM_DATA: 809 + case EEH_ERR_FUNC_ST_MEM_ADDR: 810 + case EEH_ERR_FUNC_ST_MEM_DATA: 811 + /* injects a MMIO error for all pdev's belonging to PE */ 812 + pci_lock_rescan_remove(); 813 + list_for_each_entry(pdev, &pe->edevs, entry) 814 + eeh_pe_inject_mmio_error(pdev->pdev); 815 + pci_unlock_rescan_remove(); 816 + break; 817 + default: 818 + return -ERANGE; 819 + } 820 + 821 + return 0; 822 + } 823 + 787 824 static struct eeh_ops pseries_eeh_ops = { 788 825 .name = "pseries", 789 826 .probe = pseries_eeh_probe, ··· 829 792 .reset = pseries_eeh_reset, 830 793 .get_log = pseries_eeh_get_log, 831 794 .configure_bridge = pseries_eeh_configure_bridge, 832 - .err_inject = NULL, 795 + .err_inject = pseries_eeh_err_inject, 833 796 .read_config = pseries_eeh_read_config, 834 797 .write_config = pseries_eeh_write_config, 835 798 .next_error = NULL,
+1 -1
arch/powerpc/platforms/pseries/hotplug-cpu.c
··· 757 757 u32 drc_index; 758 758 int rc; 759 759 760 - drc_index = hp_elog->_drc_u.drc_index; 760 + drc_index = be32_to_cpu(hp_elog->_drc_u.drc_index); 761 761 762 762 lock_device_hotplug(); 763 763
+8 -8
arch/powerpc/platforms/pseries/hotplug-memory.c
··· 817 817 case PSERIES_HP_ELOG_ACTION_ADD: 818 818 switch (hp_elog->id_type) { 819 819 case PSERIES_HP_ELOG_ID_DRC_COUNT: 820 - count = hp_elog->_drc_u.drc_count; 820 + count = be32_to_cpu(hp_elog->_drc_u.drc_count); 821 821 rc = dlpar_memory_add_by_count(count); 822 822 break; 823 823 case PSERIES_HP_ELOG_ID_DRC_INDEX: 824 - drc_index = hp_elog->_drc_u.drc_index; 824 + drc_index = be32_to_cpu(hp_elog->_drc_u.drc_index); 825 825 rc = dlpar_memory_add_by_index(drc_index); 826 826 break; 827 827 case PSERIES_HP_ELOG_ID_DRC_IC: 828 - count = hp_elog->_drc_u.ic.count; 829 - drc_index = hp_elog->_drc_u.ic.index; 828 + count = be32_to_cpu(hp_elog->_drc_u.ic.count); 829 + drc_index = be32_to_cpu(hp_elog->_drc_u.ic.index); 830 830 rc = dlpar_memory_add_by_ic(count, drc_index); 831 831 break; 832 832 default: ··· 838 838 case PSERIES_HP_ELOG_ACTION_REMOVE: 839 839 switch (hp_elog->id_type) { 840 840 case PSERIES_HP_ELOG_ID_DRC_COUNT: 841 - count = hp_elog->_drc_u.drc_count; 841 + count = be32_to_cpu(hp_elog->_drc_u.drc_count); 842 842 rc = dlpar_memory_remove_by_count(count); 843 843 break; 844 844 case PSERIES_HP_ELOG_ID_DRC_INDEX: 845 - drc_index = hp_elog->_drc_u.drc_index; 845 + drc_index = be32_to_cpu(hp_elog->_drc_u.drc_index); 846 846 rc = dlpar_memory_remove_by_index(drc_index); 847 847 break; 848 848 case PSERIES_HP_ELOG_ID_DRC_IC: 849 - count = hp_elog->_drc_u.ic.count; 850 - drc_index = hp_elog->_drc_u.ic.index; 849 + count = be32_to_cpu(hp_elog->_drc_u.ic.count); 850 + drc_index = be32_to_cpu(hp_elog->_drc_u.ic.index); 851 851 rc = dlpar_memory_remove_by_ic(count, drc_index); 852 852 break; 853 853 default:
+1 -1
arch/powerpc/platforms/pseries/papr_scm.c
··· 1509 1509 1510 1510 static struct platform_driver papr_scm_driver = { 1511 1511 .probe = papr_scm_probe, 1512 - .remove_new = papr_scm_remove, 1512 + .remove = papr_scm_remove, 1513 1513 .driver = { 1514 1514 .name = "papr_scm", 1515 1515 .of_match_table = papr_scm_match,
+1 -1
arch/powerpc/platforms/pseries/pmem.c
··· 121 121 return -EINVAL; 122 122 } 123 123 124 - drc_index = hp_elog->_drc_u.drc_index; 124 + drc_index = be32_to_cpu(hp_elog->_drc_u.drc_index); 125 125 126 126 lock_device_hotplug(); 127 127
+2 -2
arch/powerpc/platforms/pseries/vas-sysfs.c
··· 162 162 .store = vas_type_store, 163 163 }; 164 164 165 - static struct kobj_type vas_def_attr_type = { 165 + static const struct kobj_type vas_def_attr_type = { 166 166 .release = vas_type_release, 167 167 .sysfs_ops = &vas_sysfs_ops, 168 168 .default_groups = vas_def_capab_groups, 169 169 }; 170 170 171 - static struct kobj_type vas_qos_attr_type = { 171 + static const struct kobj_type vas_qos_attr_type = { 172 172 .release = vas_type_release, 173 173 .sysfs_ops = &vas_sysfs_ops, 174 174 .default_groups = vas_qos_capab_groups,
+1 -1
arch/powerpc/sysdev/fsl_msi.c
··· 603 603 .of_match_table = fsl_of_msi_ids, 604 604 }, 605 605 .probe = fsl_of_msi_probe, 606 - .remove_new = fsl_of_msi_remove, 606 + .remove = fsl_of_msi_remove, 607 607 }; 608 608 609 609 static __init int fsl_of_msi_init(void)
+1 -1
arch/powerpc/sysdev/pmi.c
··· 193 193 194 194 static struct platform_driver pmi_of_platform_driver = { 195 195 .probe = pmi_of_probe, 196 - .remove_new = pmi_of_remove, 196 + .remove = pmi_of_remove, 197 197 .driver = { 198 198 .name = "pmi", 199 199 .of_match_table = pmi_match,
+1 -1
arch/powerpc/xmon/xmon.c
··· 3543 3543 } 3544 3544 } else if (c == '$') { 3545 3545 int i; 3546 - for (i=0; i<63; i++) { 3546 + for (i = 0; i < (KSYM_NAME_LEN - 1); i++) { 3547 3547 c = inchar(); 3548 3548 if (isspace(c) || c == '\0') { 3549 3549 termch = c;
+1 -1
drivers/macintosh/via-pmu-backlight.c
··· 178 178 } 179 179 180 180 bd->props.brightness = level; 181 - bd->props.power = FB_BLANK_UNBLANK; 181 + bd->props.power = BACKLIGHT_POWER_ON; 182 182 backlight_update_status(bd); 183 183 184 184 printk(KERN_INFO "PMU Backlight initialized (%s)\n", name);
+1 -1
drivers/macintosh/via-pmu.c
··· 2334 2334 .valid = pmu_sleep_valid, 2335 2335 }; 2336 2336 2337 - static int register_pmu_pm_ops(void) 2337 + static int __init register_pmu_pm_ops(void) 2338 2338 { 2339 2339 if (pmu_kind == PMU_OHARE_BASED) 2340 2340 powerbook_sleep_init_3400();
+1 -1
tools/testing/selftests/powerpc/benchmarks/Makefile
··· 18 18 19 19 $(OUTPUT)/fork: LDLIBS += -lpthread 20 20 21 - $(OUTPUT)/exec_target: CFLAGS += -static -nostartfiles 21 + $(OUTPUT)/exec_target: CFLAGS += -nostartfiles
+14 -2
tools/testing/selftests/powerpc/benchmarks/exec_target.c
··· 7 7 */ 8 8 9 9 #define _GNU_SOURCE 10 - #include <unistd.h> 11 10 #include <sys/syscall.h> 12 11 13 12 void _start(void) 14 13 { 15 - syscall(SYS_exit, 0); 14 + asm volatile ( 15 + "li %%r0, %[sys_exit];" 16 + "li %%r3, 0;" 17 + "sc;" 18 + : 19 + : [sys_exit] "i" (SYS_exit) 20 + /* 21 + * "sc" will clobber r0, r3-r13, cr0, ctr, xer and memory. 22 + * Even though sys_exit never returns, handle clobber 23 + * registers. 24 + */ 25 + : "r0", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", 26 + "r11", "r12", "r13", "cr0", "ctr", "xer", "memory" 27 + ); 16 28 }