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 branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc

Pull powerpc fixes and cleanups from Ben Herrenschmidt:
"Here are a handful or two of powerpc fixes and simple/trivial
cleanups. A bunch of them fix ftrace with the new ABI v2 in Little
Endian, the rest is a scattering of fairly simple things"

* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
powerpc: Don't skip ePAPR spin-table CPUs
powerpc/module: Fix TOC symbol CRC
powerpc/powernv: Remove OPAL v1 takeover
powerpc/kmemleak: Do not scan the DART table
selftests/powerpc: Use the test harness for the TM DSCR test
powerpc/cell: cbe_thermal.c: Cleaning up a variable is of the wrong type
powerpc/kprobes: Fix jprobes on ABI v2 (LE)
powerpc/ftrace: Use pr_fmt() to namespace error messages
powerpc/ftrace: Fix nop of modules on 64bit LE (ABIv2)
powerpc/ftrace: Fix inverted check of create_branch()
powerpc/ftrace: Fix typo in mask of opcode
powerpc: Add ppc_global_function_entry()
powerpc/macintosh/smu.c: Fix closing brace followed by if
powerpc: Remove __arch_swab*
powerpc: Remove ancient DEBUG_SIG code
powerpc/kerenl: Enable EEH for IO accessors

+93 -501
-1
arch/powerpc/Kconfig.debug
··· 303 303 This correspond to which /dev/hvcN you want to use for early 304 304 debug. 305 305 306 - On OPAL v1 (takeover) this should always be 0 307 306 On OPAL v2, this will be 0 for network console and 1 or 2 for 308 307 the machine built-in serial ports. 309 308
+11
arch/powerpc/include/asm/code-patching.h
··· 88 88 #endif 89 89 } 90 90 91 + static inline unsigned long ppc_global_function_entry(void *func) 92 + { 93 + #if defined(CONFIG_PPC64) && defined(_CALL_ELF) && _CALL_ELF == 2 94 + /* PPC64 ABIv2 the global entry point is at the address */ 95 + return (unsigned long)func; 96 + #else 97 + /* All other cases there is no change vs ppc_function_entry() */ 98 + return ppc_function_entry(func); 99 + #endif 100 + } 101 + 91 102 #endif /* _ASM_POWERPC_CODE_PATCHING_H */
-29
arch/powerpc/include/asm/opal.h
··· 12 12 #ifndef __OPAL_H 13 13 #define __OPAL_H 14 14 15 - /****** Takeover interface ********/ 16 - 17 - /* PAPR H-Call used to querty the HAL existence and/or instanciate 18 - * it from within pHyp (tech preview only). 19 - * 20 - * This is exclusively used in prom_init.c 21 - */ 22 - 23 15 #ifndef __ASSEMBLY__ 24 - 25 - struct opal_takeover_args { 26 - u64 k_image; /* r4 */ 27 - u64 k_size; /* r5 */ 28 - u64 k_entry; /* r6 */ 29 - u64 k_entry2; /* r7 */ 30 - u64 hal_addr; /* r8 */ 31 - u64 rd_image; /* r9 */ 32 - u64 rd_size; /* r10 */ 33 - u64 rd_loc; /* r11 */ 34 - }; 35 - 36 16 /* 37 17 * SG entry 38 18 * ··· 34 54 35 55 /* We calculate number of sg entries based on PAGE_SIZE */ 36 56 #define SG_ENTRIES_PER_NODE ((PAGE_SIZE - 16) / sizeof(struct opal_sg_entry)) 37 - 38 - extern long opal_query_takeover(u64 *hal_size, u64 *hal_align); 39 - 40 - extern long opal_do_takeover(struct opal_takeover_args *args); 41 - 42 - struct rtas_args; 43 - extern int opal_enter_rtas(struct rtas_args *args, 44 - unsigned long data, 45 - unsigned long entry); 46 57 47 58 #endif /* __ASSEMBLY__ */ 48 59
-43
arch/powerpc/include/asm/swab.h
··· 9 9 10 10 #include <uapi/asm/swab.h> 11 11 12 - #ifdef __GNUC__ 13 - #ifndef __powerpc64__ 14 - #endif /* __powerpc64__ */ 15 - 16 12 static __inline__ __u16 ld_le16(const volatile __u16 *addr) 17 13 { 18 14 __u16 val; ··· 16 20 __asm__ __volatile__ ("lhbrx %0,0,%1" : "=r" (val) : "r" (addr), "m" (*addr)); 17 21 return val; 18 22 } 19 - #define __arch_swab16p ld_le16 20 23 21 24 static __inline__ void st_le16(volatile __u16 *addr, const __u16 val) 22 25 { 23 26 __asm__ __volatile__ ("sthbrx %1,0,%2" : "=m" (*addr) : "r" (val), "r" (addr)); 24 27 } 25 - 26 - static inline void __arch_swab16s(__u16 *addr) 27 - { 28 - st_le16(addr, *addr); 29 - } 30 - #define __arch_swab16s __arch_swab16s 31 28 32 29 static __inline__ __u32 ld_le32(const volatile __u32 *addr) 33 30 { ··· 29 40 __asm__ __volatile__ ("lwbrx %0,0,%1" : "=r" (val) : "r" (addr), "m" (*addr)); 30 41 return val; 31 42 } 32 - #define __arch_swab32p ld_le32 33 43 34 44 static __inline__ void st_le32(volatile __u32 *addr, const __u32 val) 35 45 { 36 46 __asm__ __volatile__ ("stwbrx %1,0,%2" : "=m" (*addr) : "r" (val), "r" (addr)); 37 47 } 38 48 39 - static inline void __arch_swab32s(__u32 *addr) 40 - { 41 - st_le32(addr, *addr); 42 - } 43 - #define __arch_swab32s __arch_swab32s 44 - 45 - static inline __attribute_const__ __u16 __arch_swab16(__u16 value) 46 - { 47 - __u16 result; 48 - 49 - __asm__("rlwimi %0,%1,8,16,23" 50 - : "=r" (result) 51 - : "r" (value), "0" (value >> 8)); 52 - return result; 53 - } 54 - #define __arch_swab16 __arch_swab16 55 - 56 - static inline __attribute_const__ __u32 __arch_swab32(__u32 value) 57 - { 58 - __u32 result; 59 - 60 - __asm__("rlwimi %0,%1,24,16,23\n\t" 61 - "rlwimi %0,%1,8,8,15\n\t" 62 - "rlwimi %0,%1,24,0,7" 63 - : "=r" (result) 64 - : "r" (value), "0" (value >> 24)); 65 - return result; 66 - } 67 - #define __arch_swab32 __arch_swab32 68 - 69 - #endif /* __GNUC__ */ 70 49 #endif /* _ASM_POWERPC_SWAB_H */
+25 -27
arch/powerpc/kernel/ftrace.c
··· 10 10 * 11 11 */ 12 12 13 + #define pr_fmt(fmt) "ftrace-powerpc: " fmt 14 + 13 15 #include <linux/spinlock.h> 14 16 #include <linux/hardirq.h> 15 17 #include <linux/uaccess.h> ··· 107 105 struct dyn_ftrace *rec, unsigned long addr) 108 106 { 109 107 unsigned int op; 110 - unsigned long ptr; 108 + unsigned long entry, ptr; 111 109 unsigned long ip = rec->ip; 112 110 void *tramp; 113 111 ··· 117 115 118 116 /* Make sure that that this is still a 24bit jump */ 119 117 if (!is_bl_op(op)) { 120 - printk(KERN_ERR "Not expected bl: opcode is %x\n", op); 118 + pr_err("Not expected bl: opcode is %x\n", op); 121 119 return -EINVAL; 122 120 } 123 121 ··· 127 125 pr_devel("ip:%lx jumps to %p", ip, tramp); 128 126 129 127 if (!is_module_trampoline(tramp)) { 130 - printk(KERN_ERR "Not a trampoline\n"); 128 + pr_err("Not a trampoline\n"); 131 129 return -EINVAL; 132 130 } 133 131 134 132 if (module_trampoline_target(mod, tramp, &ptr)) { 135 - printk(KERN_ERR "Failed to get trampoline target\n"); 133 + pr_err("Failed to get trampoline target\n"); 136 134 return -EFAULT; 137 135 } 138 136 139 137 pr_devel("trampoline target %lx", ptr); 140 138 139 + entry = ppc_global_function_entry((void *)addr); 141 140 /* This should match what was called */ 142 - if (ptr != ppc_function_entry((void *)addr)) { 143 - printk(KERN_ERR "addr %lx does not match expected %lx\n", 144 - ptr, ppc_function_entry((void *)addr)); 141 + if (ptr != entry) { 142 + pr_err("addr %lx does not match expected %lx\n", ptr, entry); 145 143 return -EINVAL; 146 144 } 147 145 ··· 181 179 182 180 /* Make sure that that this is still a 24bit jump */ 183 181 if (!is_bl_op(op)) { 184 - printk(KERN_ERR "Not expected bl: opcode is %x\n", op); 182 + pr_err("Not expected bl: opcode is %x\n", op); 185 183 return -EINVAL; 186 184 } 187 185 ··· 200 198 201 199 /* Find where the trampoline jumps to */ 202 200 if (probe_kernel_read(jmp, (void *)tramp, sizeof(jmp))) { 203 - printk(KERN_ERR "Failed to read %lx\n", tramp); 201 + pr_err("Failed to read %lx\n", tramp); 204 202 return -EFAULT; 205 203 } 206 204 ··· 211 209 ((jmp[1] & 0xffff0000) != 0x398c0000) || 212 210 (jmp[2] != 0x7d8903a6) || 213 211 (jmp[3] != 0x4e800420)) { 214 - printk(KERN_ERR "Not a trampoline\n"); 212 + pr_err("Not a trampoline\n"); 215 213 return -EINVAL; 216 214 } 217 215 ··· 223 221 pr_devel(" %lx ", tramp); 224 222 225 223 if (tramp != addr) { 226 - printk(KERN_ERR 227 - "Trampoline location %08lx does not match addr\n", 224 + pr_err("Trampoline location %08lx does not match addr\n", 228 225 tramp); 229 226 return -EINVAL; 230 227 } ··· 264 263 */ 265 264 if (!rec->arch.mod) { 266 265 if (!mod) { 267 - printk(KERN_ERR "No module loaded addr=%lx\n", 268 - addr); 266 + pr_err("No module loaded addr=%lx\n", addr); 269 267 return -EFAULT; 270 268 } 271 269 rec->arch.mod = mod; 272 270 } else if (mod) { 273 271 if (mod != rec->arch.mod) { 274 - printk(KERN_ERR 275 - "Record mod %p not equal to passed in mod %p\n", 272 + pr_err("Record mod %p not equal to passed in mod %p\n", 276 273 rec->arch.mod, mod); 277 274 return -EINVAL; 278 275 } ··· 306 307 * The load offset is different depending on the ABI. For simplicity 307 308 * just mask it out when doing the compare. 308 309 */ 309 - if ((op[0] != 0x48000008) || ((op[1] & 0xffff00000) != 0xe8410000)) { 310 - printk(KERN_ERR "Unexpected call sequence: %x %x\n", 311 - op[0], op[1]); 310 + if ((op[0] != 0x48000008) || ((op[1] & 0xffff0000) != 0xe8410000)) { 311 + pr_err("Unexpected call sequence: %x %x\n", op[0], op[1]); 312 312 return -EINVAL; 313 313 } 314 314 315 315 /* If we never set up a trampoline to ftrace_caller, then bail */ 316 316 if (!rec->arch.mod->arch.tramp) { 317 - printk(KERN_ERR "No ftrace trampoline\n"); 317 + pr_err("No ftrace trampoline\n"); 318 318 return -EINVAL; 319 319 } 320 320 321 321 /* Ensure branch is within 24 bits */ 322 - if (create_branch(ip, rec->arch.mod->arch.tramp, BRANCH_SET_LINK)) { 323 - printk(KERN_ERR "Branch out of range"); 322 + if (!create_branch(ip, rec->arch.mod->arch.tramp, BRANCH_SET_LINK)) { 323 + pr_err("Branch out of range\n"); 324 324 return -EINVAL; 325 325 } 326 326 327 327 if (patch_branch(ip, rec->arch.mod->arch.tramp, BRANCH_SET_LINK)) { 328 - printk(KERN_ERR "REL24 out of range!\n"); 328 + pr_err("REL24 out of range!\n"); 329 329 return -EINVAL; 330 330 } 331 331 ··· 343 345 344 346 /* It should be pointing to a nop */ 345 347 if (op != PPC_INST_NOP) { 346 - printk(KERN_ERR "Expected NOP but have %x\n", op); 348 + pr_err("Expected NOP but have %x\n", op); 347 349 return -EINVAL; 348 350 } 349 351 350 352 /* If we never set up a trampoline to ftrace_caller, then bail */ 351 353 if (!rec->arch.mod->arch.tramp) { 352 - printk(KERN_ERR "No ftrace trampoline\n"); 354 + pr_err("No ftrace trampoline\n"); 353 355 return -EINVAL; 354 356 } 355 357 ··· 357 359 op = create_branch((unsigned int *)ip, 358 360 rec->arch.mod->arch.tramp, BRANCH_SET_LINK); 359 361 if (!op) { 360 - printk(KERN_ERR "REL24 out of range!\n"); 362 + pr_err("REL24 out of range!\n"); 361 363 return -EINVAL; 362 364 } 363 365 ··· 395 397 * already have a module defined. 396 398 */ 397 399 if (!rec->arch.mod) { 398 - printk(KERN_ERR "No module loaded\n"); 400 + pr_err("No module loaded\n"); 399 401 return -EINVAL; 400 402 } 401 403
+10 -10
arch/powerpc/kernel/iomap.c
··· 23 23 } 24 24 unsigned int ioread16be(void __iomem *addr) 25 25 { 26 - return in_be16(addr); 26 + return readw_be(addr); 27 27 } 28 28 unsigned int ioread32(void __iomem *addr) 29 29 { ··· 31 31 } 32 32 unsigned int ioread32be(void __iomem *addr) 33 33 { 34 - return in_be32(addr); 34 + return readl_be(addr); 35 35 } 36 36 EXPORT_SYMBOL(ioread8); 37 37 EXPORT_SYMBOL(ioread16); ··· 49 49 } 50 50 void iowrite16be(u16 val, void __iomem *addr) 51 51 { 52 - out_be16(addr, val); 52 + writew_be(val, addr); 53 53 } 54 54 void iowrite32(u32 val, void __iomem *addr) 55 55 { ··· 57 57 } 58 58 void iowrite32be(u32 val, void __iomem *addr) 59 59 { 60 - out_be32(addr, val); 60 + writel_be(val, addr); 61 61 } 62 62 EXPORT_SYMBOL(iowrite8); 63 63 EXPORT_SYMBOL(iowrite16); ··· 75 75 */ 76 76 void ioread8_rep(void __iomem *addr, void *dst, unsigned long count) 77 77 { 78 - _insb((u8 __iomem *) addr, dst, count); 78 + readsb(addr, dst, count); 79 79 } 80 80 void ioread16_rep(void __iomem *addr, void *dst, unsigned long count) 81 81 { 82 - _insw_ns((u16 __iomem *) addr, dst, count); 82 + readsw(addr, dst, count); 83 83 } 84 84 void ioread32_rep(void __iomem *addr, void *dst, unsigned long count) 85 85 { 86 - _insl_ns((u32 __iomem *) addr, dst, count); 86 + readsl(addr, dst, count); 87 87 } 88 88 EXPORT_SYMBOL(ioread8_rep); 89 89 EXPORT_SYMBOL(ioread16_rep); ··· 91 91 92 92 void iowrite8_rep(void __iomem *addr, const void *src, unsigned long count) 93 93 { 94 - _outsb((u8 __iomem *) addr, src, count); 94 + writesb(addr, src, count); 95 95 } 96 96 void iowrite16_rep(void __iomem *addr, const void *src, unsigned long count) 97 97 { 98 - _outsw_ns((u16 __iomem *) addr, src, count); 98 + writesw(addr, src, count); 99 99 } 100 100 void iowrite32_rep(void __iomem *addr, const void *src, unsigned long count) 101 101 { 102 - _outsl_ns((u32 __iomem *) addr, src, count); 102 + writesl(addr, src, count); 103 103 } 104 104 EXPORT_SYMBOL(iowrite8_rep); 105 105 EXPORT_SYMBOL(iowrite16_rep);
+6 -3
arch/powerpc/kernel/kprobes.c
··· 32 32 #include <linux/module.h> 33 33 #include <linux/kdebug.h> 34 34 #include <linux/slab.h> 35 + #include <asm/code-patching.h> 35 36 #include <asm/cacheflush.h> 36 37 #include <asm/sstep.h> 37 38 #include <asm/uaccess.h> ··· 492 491 return ret; 493 492 } 494 493 495 - #ifdef CONFIG_PPC64 496 494 unsigned long arch_deref_entry_point(void *entry) 497 495 { 498 - return ((func_descr_t *)entry)->entry; 496 + return ppc_global_function_entry(entry); 499 497 } 500 - #endif 501 498 502 499 int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs) 503 500 { ··· 507 508 /* setup return addr to the jprobe handler routine */ 508 509 regs->nip = arch_deref_entry_point(jp->entry); 509 510 #ifdef CONFIG_PPC64 511 + #if defined(_CALL_ELF) && _CALL_ELF == 2 512 + regs->gpr[12] = (unsigned long)jp->entry; 513 + #else 510 514 regs->gpr[2] = (unsigned long)(((func_descr_t *)jp->entry)->toc); 515 + #endif 511 516 #endif 512 517 513 518 return 1;
+10 -1
arch/powerpc/kernel/module_64.c
··· 315 315 struct modversion_info *end; 316 316 317 317 for (end = (void *)vers + size; vers < end; vers++) 318 - if (vers->name[0] == '.') 318 + if (vers->name[0] == '.') { 319 319 memmove(vers->name, vers->name+1, strlen(vers->name)); 320 + #ifdef ARCH_RELOCATES_KCRCTAB 321 + /* The TOC symbol has no CRC computed. To avoid CRC 322 + * check failing, we must force it to the expected 323 + * value (see CRC check in module.c). 324 + */ 325 + if (!strcmp(vers->name, "TOC.")) 326 + vers->crc = -(unsigned long)reloc_start; 327 + #endif 328 + } 320 329 } 321 330 322 331 /* Undefined symbols which refer to .funcname, hack to funcname (or .TOC.) */
-7
arch/powerpc/kernel/prom.c
··· 662 662 of_scan_flat_dt(early_init_dt_scan_fw_dump, NULL); 663 663 #endif 664 664 665 - /* Pre-initialize the cmd_line with the content of boot_commmand_line, 666 - * which will be empty except when the content of the variable has 667 - * been overriden by a bootloading mechanism. This happens typically 668 - * with HAL takeover 669 - */ 670 - strlcpy(cmd_line, boot_command_line, COMMAND_LINE_SIZE); 671 - 672 665 /* Retrieve various informations from the /chosen node of the 673 666 * device-tree, including the platform type, initrd location and 674 667 * size, TCE reserve, and more ...
-211
arch/powerpc/kernel/prom_init.c
··· 1268 1268 static u64 __initdata prom_opal_entry; 1269 1269 #endif 1270 1270 1271 - #ifdef __BIG_ENDIAN__ 1272 - /* XXX Don't change this structure without updating opal-takeover.S */ 1273 - static struct opal_secondary_data { 1274 - s64 ack; /* 0 */ 1275 - u64 go; /* 8 */ 1276 - struct opal_takeover_args args; /* 16 */ 1277 - } opal_secondary_data; 1278 - 1279 - static u64 __initdata prom_opal_align; 1280 - static u64 __initdata prom_opal_size; 1281 - static int __initdata prom_rtas_start_cpu; 1282 - static u64 __initdata prom_rtas_data; 1283 - static u64 __initdata prom_rtas_entry; 1284 - 1285 - extern char opal_secondary_entry; 1286 - 1287 - static void __init prom_query_opal(void) 1288 - { 1289 - long rc; 1290 - 1291 - /* We must not query for OPAL presence on a machine that 1292 - * supports TNK takeover (970 blades), as this uses the same 1293 - * h-call with different arguments and will crash 1294 - */ 1295 - if (PHANDLE_VALID(call_prom("finddevice", 1, 1, 1296 - ADDR("/tnk-memory-map")))) { 1297 - prom_printf("TNK takeover detected, skipping OPAL check\n"); 1298 - return; 1299 - } 1300 - 1301 - prom_printf("Querying for OPAL presence... "); 1302 - 1303 - rc = opal_query_takeover(&prom_opal_size, 1304 - &prom_opal_align); 1305 - prom_debug("(rc = %ld) ", rc); 1306 - if (rc != 0) { 1307 - prom_printf("not there.\n"); 1308 - return; 1309 - } 1310 - of_platform = PLATFORM_OPAL; 1311 - prom_printf(" there !\n"); 1312 - prom_debug(" opal_size = 0x%lx\n", prom_opal_size); 1313 - prom_debug(" opal_align = 0x%lx\n", prom_opal_align); 1314 - if (prom_opal_align < 0x10000) 1315 - prom_opal_align = 0x10000; 1316 - } 1317 - 1318 - static int __init prom_rtas_call(int token, int nargs, int nret, 1319 - int *outputs, ...) 1320 - { 1321 - struct rtas_args rtas_args; 1322 - va_list list; 1323 - int i; 1324 - 1325 - rtas_args.token = token; 1326 - rtas_args.nargs = nargs; 1327 - rtas_args.nret = nret; 1328 - rtas_args.rets = (rtas_arg_t *)&(rtas_args.args[nargs]); 1329 - va_start(list, outputs); 1330 - for (i = 0; i < nargs; ++i) 1331 - rtas_args.args[i] = va_arg(list, rtas_arg_t); 1332 - va_end(list); 1333 - 1334 - for (i = 0; i < nret; ++i) 1335 - rtas_args.rets[i] = 0; 1336 - 1337 - opal_enter_rtas(&rtas_args, prom_rtas_data, 1338 - prom_rtas_entry); 1339 - 1340 - if (nret > 1 && outputs != NULL) 1341 - for (i = 0; i < nret-1; ++i) 1342 - outputs[i] = rtas_args.rets[i+1]; 1343 - return (nret > 0)? rtas_args.rets[0]: 0; 1344 - } 1345 - 1346 - static void __init prom_opal_hold_cpus(void) 1347 - { 1348 - int i, cnt, cpu, rc; 1349 - long j; 1350 - phandle node; 1351 - char type[64]; 1352 - u32 servers[8]; 1353 - void *entry = (unsigned long *)&opal_secondary_entry; 1354 - struct opal_secondary_data *data = &opal_secondary_data; 1355 - 1356 - prom_debug("prom_opal_hold_cpus: start...\n"); 1357 - prom_debug(" - entry = 0x%x\n", entry); 1358 - prom_debug(" - data = 0x%x\n", data); 1359 - 1360 - data->ack = -1; 1361 - data->go = 0; 1362 - 1363 - /* look for cpus */ 1364 - for (node = 0; prom_next_node(&node); ) { 1365 - type[0] = 0; 1366 - prom_getprop(node, "device_type", type, sizeof(type)); 1367 - if (strcmp(type, "cpu") != 0) 1368 - continue; 1369 - 1370 - /* Skip non-configured cpus. */ 1371 - if (prom_getprop(node, "status", type, sizeof(type)) > 0) 1372 - if (strcmp(type, "okay") != 0) 1373 - continue; 1374 - 1375 - cnt = prom_getprop(node, "ibm,ppc-interrupt-server#s", servers, 1376 - sizeof(servers)); 1377 - if (cnt == PROM_ERROR) 1378 - break; 1379 - cnt >>= 2; 1380 - for (i = 0; i < cnt; i++) { 1381 - cpu = servers[i]; 1382 - prom_debug("CPU %d ... ", cpu); 1383 - if (cpu == prom.cpu) { 1384 - prom_debug("booted !\n"); 1385 - continue; 1386 - } 1387 - prom_debug("starting ... "); 1388 - 1389 - /* Init the acknowledge var which will be reset by 1390 - * the secondary cpu when it awakens from its OF 1391 - * spinloop. 1392 - */ 1393 - data->ack = -1; 1394 - rc = prom_rtas_call(prom_rtas_start_cpu, 3, 1, 1395 - NULL, cpu, entry, data); 1396 - prom_debug("rtas rc=%d ...", rc); 1397 - 1398 - for (j = 0; j < 100000000 && data->ack == -1; j++) { 1399 - HMT_low(); 1400 - mb(); 1401 - } 1402 - HMT_medium(); 1403 - if (data->ack != -1) 1404 - prom_debug("done, PIR=0x%x\n", data->ack); 1405 - else 1406 - prom_debug("timeout !\n"); 1407 - } 1408 - } 1409 - prom_debug("prom_opal_hold_cpus: end...\n"); 1410 - } 1411 - 1412 - static void __init prom_opal_takeover(void) 1413 - { 1414 - struct opal_secondary_data *data = &opal_secondary_data; 1415 - struct opal_takeover_args *args = &data->args; 1416 - u64 align = prom_opal_align; 1417 - u64 top_addr, opal_addr; 1418 - 1419 - args->k_image = (u64)_stext; 1420 - args->k_size = _end - _stext; 1421 - args->k_entry = 0; 1422 - args->k_entry2 = 0x60; 1423 - 1424 - top_addr = _ALIGN_UP(args->k_size, align); 1425 - 1426 - if (prom_initrd_start != 0) { 1427 - args->rd_image = prom_initrd_start; 1428 - args->rd_size = prom_initrd_end - args->rd_image; 1429 - args->rd_loc = top_addr; 1430 - top_addr = _ALIGN_UP(args->rd_loc + args->rd_size, align); 1431 - } 1432 - 1433 - /* Pickup an address for the HAL. We want to go really high 1434 - * up to avoid problem with future kexecs. On the other hand 1435 - * we don't want to be all over the TCEs on P5IOC2 machines 1436 - * which are going to be up there too. We assume the machine 1437 - * has plenty of memory, and we ask for the HAL for now to 1438 - * be just below the 1G point, or above the initrd 1439 - */ 1440 - opal_addr = _ALIGN_DOWN(0x40000000 - prom_opal_size, align); 1441 - if (opal_addr < top_addr) 1442 - opal_addr = top_addr; 1443 - args->hal_addr = opal_addr; 1444 - 1445 - /* Copy the command line to the kernel image */ 1446 - strlcpy(boot_command_line, prom_cmd_line, 1447 - COMMAND_LINE_SIZE); 1448 - 1449 - prom_debug(" k_image = 0x%lx\n", args->k_image); 1450 - prom_debug(" k_size = 0x%lx\n", args->k_size); 1451 - prom_debug(" k_entry = 0x%lx\n", args->k_entry); 1452 - prom_debug(" k_entry2 = 0x%lx\n", args->k_entry2); 1453 - prom_debug(" hal_addr = 0x%lx\n", args->hal_addr); 1454 - prom_debug(" rd_image = 0x%lx\n", args->rd_image); 1455 - prom_debug(" rd_size = 0x%lx\n", args->rd_size); 1456 - prom_debug(" rd_loc = 0x%lx\n", args->rd_loc); 1457 - prom_printf("Performing OPAL takeover,this can take a few minutes..\n"); 1458 - prom_close_stdin(); 1459 - mb(); 1460 - data->go = 1; 1461 - for (;;) 1462 - opal_do_takeover(args); 1463 - } 1464 - #endif /* __BIG_ENDIAN__ */ 1465 - 1466 1271 /* 1467 1272 * Allocate room for and instantiate OPAL 1468 1273 */ ··· 1402 1597 &val, sizeof(val)) != PROM_ERROR) 1403 1598 rtas_has_query_cpu_stopped = true; 1404 1599 1405 - #if defined(CONFIG_PPC_POWERNV) && defined(__BIG_ENDIAN__) 1406 - /* PowerVN takeover hack */ 1407 - prom_rtas_data = base; 1408 - prom_rtas_entry = entry; 1409 - prom_getprop(rtas_node, "start-cpu", &prom_rtas_start_cpu, 4); 1410 - #endif 1411 1600 prom_debug("rtas base = 0x%x\n", base); 1412 1601 prom_debug("rtas entry = 0x%x\n", entry); 1413 1602 prom_debug("rtas size = 0x%x\n", (long)size); ··· 2826 3027 prom_instantiate_rtas(); 2827 3028 2828 3029 #ifdef CONFIG_PPC_POWERNV 2829 - #ifdef __BIG_ENDIAN__ 2830 - /* Detect HAL and try instanciating it & doing takeover */ 2831 - if (of_platform == PLATFORM_PSERIES_LPAR) { 2832 - prom_query_opal(); 2833 - if (of_platform == PLATFORM_OPAL) { 2834 - prom_opal_hold_cpus(); 2835 - prom_opal_takeover(); 2836 - } 2837 - } else 2838 - #endif /* __BIG_ENDIAN__ */ 2839 3030 if (of_platform == PLATFORM_OPAL) 2840 3031 prom_instantiate_opal(); 2841 3032 #endif /* CONFIG_PPC_POWERNV */
+1 -3
arch/powerpc/kernel/prom_init_check.sh
··· 21 21 __secondary_hold_acknowledge __secondary_hold_spinloop __start 22 22 strcmp strcpy strlcpy strlen strncmp strstr logo_linux_clut224 23 23 reloc_got2 kernstart_addr memstart_addr linux_banner _stext 24 - opal_query_takeover opal_do_takeover opal_enter_rtas opal_secondary_entry 25 - boot_command_line __prom_init_toc_start __prom_init_toc_end 26 - btext_setup_display TOC." 24 + __prom_init_toc_start __prom_init_toc_end btext_setup_display TOC." 27 25 28 26 NM="$1" 29 27 OBJ="$2"
+9 -1
arch/powerpc/kernel/setup-common.c
··· 469 469 } 470 470 471 471 for (j = 0; j < nthreads && cpu < nr_cpu_ids; j++) { 472 + bool avail; 473 + 472 474 DBG(" thread %d -> cpu %d (hard id %d)\n", 473 475 j, cpu, be32_to_cpu(intserv[j])); 474 - set_cpu_present(cpu, of_device_is_available(dn)); 476 + 477 + avail = of_device_is_available(dn); 478 + if (!avail) 479 + avail = !of_property_match_string(dn, 480 + "enable-method", "spin-table"); 481 + 482 + set_cpu_present(cpu, avail); 475 483 set_hard_smp_processor_id(cpu, be32_to_cpu(intserv[j])); 476 484 set_cpu_possible(cpu, true); 477 485 cpu++;
-9
arch/powerpc/kernel/signal_32.c
··· 54 54 55 55 #include "signal.h" 56 56 57 - #undef DEBUG_SIG 58 57 59 58 #ifdef CONFIG_PPC64 60 59 #define sys_rt_sigreturn compat_sys_rt_sigreturn ··· 1062 1063 return 1; 1063 1064 1064 1065 badframe: 1065 - #ifdef DEBUG_SIG 1066 - printk("badframe in handle_rt_signal, regs=%p frame=%p newsp=%lx\n", 1067 - regs, frame, newsp); 1068 - #endif 1069 1066 if (show_unhandled_signals) 1070 1067 printk_ratelimited(KERN_INFO 1071 1068 "%s[%d]: bad frame in handle_rt_signal32: " ··· 1479 1484 return 1; 1480 1485 1481 1486 badframe: 1482 - #ifdef DEBUG_SIG 1483 - printk("badframe in handle_signal, regs=%p frame=%p newsp=%lx\n", 1484 - regs, frame, newsp); 1485 - #endif 1486 1487 if (show_unhandled_signals) 1487 1488 printk_ratelimited(KERN_INFO 1488 1489 "%s[%d]: bad frame in handle_signal32: "
-9
arch/powerpc/kernel/signal_64.c
··· 38 38 39 39 #include "signal.h" 40 40 41 - #define DEBUG_SIG 0 42 41 43 42 #define GP_REGS_SIZE min(sizeof(elf_gregset_t), sizeof(struct pt_regs)) 44 43 #define FP_REGS_SIZE sizeof(elf_fpregset_t) ··· 699 700 return 0; 700 701 701 702 badframe: 702 - #if DEBUG_SIG 703 - printk("badframe in sys_rt_sigreturn, regs=%p uc=%p &uc->uc_mcontext=%p\n", 704 - regs, uc, &uc->uc_mcontext); 705 - #endif 706 703 if (show_unhandled_signals) 707 704 printk_ratelimited(regs->msr & MSR_64BIT ? fmt64 : fmt32, 708 705 current->comm, current->pid, "rt_sigreturn", ··· 804 809 return 1; 805 810 806 811 badframe: 807 - #if DEBUG_SIG 808 - printk("badframe in setup_rt_frame, regs=%p frame=%p newsp=%lx\n", 809 - regs, frame, newsp); 810 - #endif 811 812 if (show_unhandled_signals) 812 813 printk_ratelimited(regs->msr & MSR_64BIT ? fmt64 : fmt32, 813 814 current->comm, current->pid, "setup_rt_frame",
+1 -1
arch/powerpc/platforms/cell/cbe_thermal.c
··· 125 125 static ssize_t store_throttle(struct cbe_pmd_regs __iomem *pmd_regs, const char *buf, size_t size, int pos) 126 126 { 127 127 u64 reg_value; 128 - int temp; 128 + unsigned int temp; 129 129 u64 new_value; 130 130 int ret; 131 131
+1 -1
arch/powerpc/platforms/powernv/Makefile
··· 1 - obj-y += setup.o opal-takeover.o opal-wrappers.o opal.o opal-async.o 1 + obj-y += setup.o opal-wrappers.o opal.o opal-async.o 2 2 obj-y += opal-rtc.o opal-nvram.o opal-lpc.o opal-flash.o 3 3 obj-y += rng.o opal-elog.o opal-dump.o opal-sysparam.o opal-sensor.o 4 4 obj-y += opal-msglog.o
-140
arch/powerpc/platforms/powernv/opal-takeover.S
··· 1 - /* 2 - * PowerNV OPAL takeover assembly code, for use by prom_init.c 3 - * 4 - * Copyright 2011 IBM Corp. 5 - * 6 - * This program is free software; you can redistribute it and/or 7 - * modify it under the terms of the GNU General Public License 8 - * as published by the Free Software Foundation; either version 9 - * 2 of the License, or (at your option) any later version. 10 - */ 11 - 12 - #include <asm/ppc_asm.h> 13 - #include <asm/hvcall.h> 14 - #include <asm/asm-offsets.h> 15 - #include <asm/opal.h> 16 - 17 - #define H_HAL_TAKEOVER 0x5124 18 - #define H_HAL_TAKEOVER_QUERY_MAGIC -1 19 - 20 - .text 21 - _GLOBAL(opal_query_takeover) 22 - mfcr r0 23 - stw r0,8(r1) 24 - stdu r1,-STACKFRAMESIZE(r1) 25 - std r3,STK_PARAM(R3)(r1) 26 - std r4,STK_PARAM(R4)(r1) 27 - li r3,H_HAL_TAKEOVER 28 - li r4,H_HAL_TAKEOVER_QUERY_MAGIC 29 - HVSC 30 - addi r1,r1,STACKFRAMESIZE 31 - ld r10,STK_PARAM(R3)(r1) 32 - std r4,0(r10) 33 - ld r10,STK_PARAM(R4)(r1) 34 - std r5,0(r10) 35 - lwz r0,8(r1) 36 - mtcrf 0xff,r0 37 - blr 38 - 39 - _GLOBAL(opal_do_takeover) 40 - mfcr r0 41 - stw r0,8(r1) 42 - mflr r0 43 - std r0,16(r1) 44 - bl __opal_do_takeover 45 - ld r0,16(r1) 46 - mtlr r0 47 - lwz r0,8(r1) 48 - mtcrf 0xff,r0 49 - blr 50 - 51 - __opal_do_takeover: 52 - ld r4,0(r3) 53 - ld r5,0x8(r3) 54 - ld r6,0x10(r3) 55 - ld r7,0x18(r3) 56 - ld r8,0x20(r3) 57 - ld r9,0x28(r3) 58 - ld r10,0x30(r3) 59 - ld r11,0x38(r3) 60 - li r3,H_HAL_TAKEOVER 61 - HVSC 62 - blr 63 - 64 - .globl opal_secondary_entry 65 - opal_secondary_entry: 66 - mr r31,r3 67 - mfmsr r11 68 - li r12,(MSR_SF | MSR_ISF)@highest 69 - sldi r12,r12,48 70 - or r11,r11,r12 71 - mtmsrd r11 72 - isync 73 - mfspr r4,SPRN_PIR 74 - std r4,0(r3) 75 - 1: HMT_LOW 76 - ld r4,8(r3) 77 - cmpli cr0,r4,0 78 - beq 1b 79 - HMT_MEDIUM 80 - 1: addi r3,r31,16 81 - bl __opal_do_takeover 82 - b 1b 83 - 84 - _GLOBAL(opal_enter_rtas) 85 - mflr r0 86 - std r0,16(r1) 87 - stdu r1,-PROM_FRAME_SIZE(r1) /* Save SP and create stack space */ 88 - 89 - /* Because PROM is running in 32b mode, it clobbers the high order half 90 - * of all registers that it saves. We therefore save those registers 91 - * PROM might touch to the stack. (r0, r3-r13 are caller saved) 92 - */ 93 - SAVE_GPR(2, r1) 94 - SAVE_GPR(13, r1) 95 - SAVE_8GPRS(14, r1) 96 - SAVE_10GPRS(22, r1) 97 - mfcr r10 98 - mfmsr r11 99 - std r10,_CCR(r1) 100 - std r11,_MSR(r1) 101 - 102 - /* Get the PROM entrypoint */ 103 - mtlr r5 104 - 105 - /* Switch MSR to 32 bits mode 106 - */ 107 - li r12,1 108 - rldicr r12,r12,MSR_SF_LG,(63-MSR_SF_LG) 109 - andc r11,r11,r12 110 - li r12,1 111 - rldicr r12,r12,MSR_ISF_LG,(63-MSR_ISF_LG) 112 - andc r11,r11,r12 113 - mtmsrd r11 114 - isync 115 - 116 - /* Enter RTAS here... */ 117 - blrl 118 - 119 - /* Just make sure that r1 top 32 bits didn't get 120 - * corrupt by OF 121 - */ 122 - rldicl r1,r1,0,32 123 - 124 - /* Restore the MSR (back to 64 bits) */ 125 - ld r0,_MSR(r1) 126 - MTMSRD(r0) 127 - isync 128 - 129 - /* Restore other registers */ 130 - REST_GPR(2, r1) 131 - REST_GPR(13, r1) 132 - REST_8GPRS(14, r1) 133 - REST_10GPRS(22, r1) 134 - ld r4,_CCR(r1) 135 - mtcr r4 136 - 137 - addi r1,r1,PROM_FRAME_SIZE 138 - ld r0,16(r1) 139 - mtlr r0 140 - blr
+5
arch/powerpc/sysdev/dart_iommu.c
··· 476 476 */ 477 477 dart_tablebase = (unsigned long) 478 478 __va(memblock_alloc_base(1UL<<24, 1UL<<24, 0x80000000L)); 479 + /* 480 + * The DART space is later unmapped from the kernel linear mapping and 481 + * accessing dart_tablebase during kmemleak scanning will fault. 482 + */ 483 + kmemleak_no_scan((void *)dart_tablebase); 479 484 480 485 printk(KERN_INFO "DART table allocated at: %lx\n", dart_tablebase); 481 486 }
+2 -1
drivers/macintosh/smu.c
··· 1257 1257 if (pp->busy && pp->cmd.status != 1) 1258 1258 mask |= POLLIN; 1259 1259 spin_unlock_irqrestore(&pp->lock, flags); 1260 - } if (pp->mode == smu_file_events) { 1260 + } 1261 + if (pp->mode == smu_file_events) { 1261 1262 /* Not yet implemented */ 1262 1263 } 1263 1264 return mask;
+1 -1
tools/testing/selftests/powerpc/tm/Makefile
··· 2 2 3 3 all: $(PROGS) 4 4 5 - $(PROGS): 5 + $(PROGS): ../harness.c 6 6 7 7 run_tests: all 8 8 @-for PROG in $(PROGS); do \
+11 -3
tools/testing/selftests/powerpc/tm/tm-resched-dscr.c
··· 28 28 #include <assert.h> 29 29 #include <asm/tm.h> 30 30 31 + #include "utils.h" 32 + 31 33 #define TBEGIN ".long 0x7C00051D ;" 32 34 #define TEND ".long 0x7C00055D ;" 33 35 #define TCHECK ".long 0x7C00059C ;" ··· 38 36 #define SPRN_TEXASR 0x82 39 37 #define SPRN_DSCR 0x03 40 38 41 - int main(void) { 39 + int test_body(void) 40 + { 42 41 uint64_t rv, dscr1 = 1, dscr2, texasr; 43 42 44 43 printf("Check DSCR TM context switch: "); ··· 84 81 } 85 82 if (dscr2 != dscr1) { 86 83 printf(" FAIL\n"); 87 - exit(EXIT_FAILURE); 84 + return 1; 88 85 } else { 89 86 printf(" OK\n"); 90 - exit(EXIT_SUCCESS); 87 + return 0; 91 88 } 92 89 } 90 + } 91 + 92 + int main(void) 93 + { 94 + return test_harness(test_body, "tm_resched_dscr"); 93 95 }