diff options
Diffstat (limited to 'arch/ppc64/kernel')
26 files changed, 229 insertions, 64 deletions
diff --git a/arch/ppc64/kernel/HvLpEvent.c b/arch/ppc64/kernel/HvLpEvent.c index 9802beefa217..f8f19637f73f 100644 --- a/arch/ppc64/kernel/HvLpEvent.c +++ b/arch/ppc64/kernel/HvLpEvent.c | |||
@@ -45,7 +45,7 @@ int HvLpEvent_unregisterHandler( HvLpEvent_Type eventType ) | |||
45 | /* We now sleep until all other CPUs have scheduled. This ensures that | 45 | /* We now sleep until all other CPUs have scheduled. This ensures that |
46 | * the deletion is seen by all other CPUs, and that the deleted handler | 46 | * the deletion is seen by all other CPUs, and that the deleted handler |
47 | * isn't still running on another CPU when we return. */ | 47 | * isn't still running on another CPU when we return. */ |
48 | synchronize_kernel(); | 48 | synchronize_rcu(); |
49 | } | 49 | } |
50 | } | 50 | } |
51 | return rc; | 51 | return rc; |
diff --git a/arch/ppc64/kernel/misc.S b/arch/ppc64/kernel/misc.S index 90b41f48d21c..b944717c1dbd 100644 --- a/arch/ppc64/kernel/misc.S +++ b/arch/ppc64/kernel/misc.S | |||
@@ -32,7 +32,7 @@ | |||
32 | .text | 32 | .text |
33 | 33 | ||
34 | /* | 34 | /* |
35 | * Returns (address we're running at) - (address we were linked at) | 35 | * Returns (address we were linked at) - (address we are running at) |
36 | * for use before the text and data are mapped to KERNELBASE. | 36 | * for use before the text and data are mapped to KERNELBASE. |
37 | */ | 37 | */ |
38 | 38 | ||
diff --git a/arch/ppc64/kernel/nvram.c b/arch/ppc64/kernel/nvram.c index b9069c2d1933..4e71781a4414 100644 --- a/arch/ppc64/kernel/nvram.c +++ b/arch/ppc64/kernel/nvram.c | |||
@@ -339,9 +339,9 @@ static int nvram_remove_os_partition(void) | |||
339 | static int nvram_create_os_partition(void) | 339 | static int nvram_create_os_partition(void) |
340 | { | 340 | { |
341 | struct list_head * p; | 341 | struct list_head * p; |
342 | struct nvram_partition * part; | 342 | struct nvram_partition *part = NULL; |
343 | struct nvram_partition * new_part = NULL; | 343 | struct nvram_partition *new_part = NULL; |
344 | struct nvram_partition * free_part = NULL; | 344 | struct nvram_partition *free_part = NULL; |
345 | int seq_init[2] = { 0, 0 }; | 345 | int seq_init[2] = { 0, 0 }; |
346 | loff_t tmp_index; | 346 | loff_t tmp_index; |
347 | long size = 0; | 347 | long size = 0; |
@@ -364,13 +364,11 @@ static int nvram_create_os_partition(void) | |||
364 | free_part = part; | 364 | free_part = part; |
365 | } | 365 | } |
366 | } | 366 | } |
367 | if (!size) { | 367 | if (!size) |
368 | return -ENOSPC; | 368 | return -ENOSPC; |
369 | } | ||
370 | 369 | ||
371 | /* Create our OS partition */ | 370 | /* Create our OS partition */ |
372 | new_part = (struct nvram_partition *) | 371 | new_part = kmalloc(sizeof(*new_part), GFP_KERNEL); |
373 | kmalloc(sizeof(struct nvram_partition), GFP_KERNEL); | ||
374 | if (!new_part) { | 372 | if (!new_part) { |
375 | printk(KERN_ERR "nvram_create_os_partition: kmalloc failed\n"); | 373 | printk(KERN_ERR "nvram_create_os_partition: kmalloc failed\n"); |
376 | return -ENOMEM; | 374 | return -ENOMEM; |
@@ -379,7 +377,7 @@ static int nvram_create_os_partition(void) | |||
379 | new_part->index = free_part->index; | 377 | new_part->index = free_part->index; |
380 | new_part->header.signature = NVRAM_SIG_OS; | 378 | new_part->header.signature = NVRAM_SIG_OS; |
381 | new_part->header.length = size; | 379 | new_part->header.length = size; |
382 | sprintf(new_part->header.name, "ppc64,linux"); | 380 | strcpy(new_part->header.name, "ppc64,linux"); |
383 | new_part->header.checksum = nvram_checksum(&new_part->header); | 381 | new_part->header.checksum = nvram_checksum(&new_part->header); |
384 | 382 | ||
385 | rc = nvram_write_header(new_part); | 383 | rc = nvram_write_header(new_part); |
@@ -394,7 +392,8 @@ static int nvram_create_os_partition(void) | |||
394 | tmp_index = new_part->index + NVRAM_HEADER_LEN; | 392 | tmp_index = new_part->index + NVRAM_HEADER_LEN; |
395 | rc = ppc_md.nvram_write((char *)&seq_init, sizeof(seq_init), &tmp_index); | 393 | rc = ppc_md.nvram_write((char *)&seq_init, sizeof(seq_init), &tmp_index); |
396 | if (rc <= 0) { | 394 | if (rc <= 0) { |
397 | printk(KERN_ERR "nvram_create_os_partition: nvram_write failed (%d)\n", rc); | 395 | printk(KERN_ERR "nvram_create_os_partition: nvram_write " |
396 | "failed (%d)\n", rc); | ||
398 | return rc; | 397 | return rc; |
399 | } | 398 | } |
400 | 399 | ||
diff --git a/arch/ppc64/kernel/pSeries_hvCall.S b/arch/ppc64/kernel/pSeries_hvCall.S index 0715d3038019..176e8da76466 100644 --- a/arch/ppc64/kernel/pSeries_hvCall.S +++ b/arch/ppc64/kernel/pSeries_hvCall.S | |||
@@ -28,6 +28,8 @@ | |||
28 | unsigned long *out3); R10 | 28 | unsigned long *out3); R10 |
29 | */ | 29 | */ |
30 | _GLOBAL(plpar_hcall) | 30 | _GLOBAL(plpar_hcall) |
31 | HMT_MEDIUM | ||
32 | |||
31 | mfcr r0 | 33 | mfcr r0 |
32 | 34 | ||
33 | std r8,STK_PARM(r8)(r1) /* Save out ptrs */ | 35 | std r8,STK_PARM(r8)(r1) /* Save out ptrs */ |
@@ -53,6 +55,8 @@ _GLOBAL(plpar_hcall) | |||
53 | 55 | ||
54 | /* Simple interface with no output values (other than status) */ | 56 | /* Simple interface with no output values (other than status) */ |
55 | _GLOBAL(plpar_hcall_norets) | 57 | _GLOBAL(plpar_hcall_norets) |
58 | HMT_MEDIUM | ||
59 | |||
56 | mfcr r0 | 60 | mfcr r0 |
57 | stw r0,8(r1) | 61 | stw r0,8(r1) |
58 | 62 | ||
@@ -75,6 +79,8 @@ _GLOBAL(plpar_hcall_norets) | |||
75 | unsigned long *out1); 120(R1) | 79 | unsigned long *out1); 120(R1) |
76 | */ | 80 | */ |
77 | _GLOBAL(plpar_hcall_8arg_2ret) | 81 | _GLOBAL(plpar_hcall_8arg_2ret) |
82 | HMT_MEDIUM | ||
83 | |||
78 | mfcr r0 | 84 | mfcr r0 |
79 | ld r11,STK_PARM(r11)(r1) /* put arg8 in R11 */ | 85 | ld r11,STK_PARM(r11)(r1) /* put arg8 in R11 */ |
80 | stw r0,8(r1) | 86 | stw r0,8(r1) |
@@ -99,6 +105,8 @@ _GLOBAL(plpar_hcall_8arg_2ret) | |||
99 | unsigned long *out4); 112(R1) | 105 | unsigned long *out4); 112(R1) |
100 | */ | 106 | */ |
101 | _GLOBAL(plpar_hcall_4out) | 107 | _GLOBAL(plpar_hcall_4out) |
108 | HMT_MEDIUM | ||
109 | |||
102 | mfcr r0 | 110 | mfcr r0 |
103 | stw r0,8(r1) | 111 | stw r0,8(r1) |
104 | 112 | ||
diff --git a/arch/ppc64/kernel/pSeries_smp.c b/arch/ppc64/kernel/pSeries_smp.c index c60d8cb2b84d..fbad349ec58c 100644 --- a/arch/ppc64/kernel/pSeries_smp.c +++ b/arch/ppc64/kernel/pSeries_smp.c | |||
@@ -326,13 +326,6 @@ static void __devinit smp_xics_setup_cpu(int cpu) | |||
326 | 326 | ||
327 | cpu_clear(cpu, of_spin_map); | 327 | cpu_clear(cpu, of_spin_map); |
328 | 328 | ||
329 | /* | ||
330 | * Put the calling processor into the GIQ. This is really only | ||
331 | * necessary from a secondary thread as the OF start-cpu interface | ||
332 | * performs this function for us on primary threads. | ||
333 | */ | ||
334 | rtas_set_indicator(GLOBAL_INTERRUPT_QUEUE, | ||
335 | (1UL << interrupt_server_size) - 1 - default_distrib_server, 1); | ||
336 | } | 329 | } |
337 | 330 | ||
338 | static DEFINE_SPINLOCK(timebase_lock); | 331 | static DEFINE_SPINLOCK(timebase_lock); |
diff --git a/arch/ppc64/kernel/pci.c b/arch/ppc64/kernel/pci.c index be3cc387c1ec..d786d4b6af0b 100644 --- a/arch/ppc64/kernel/pci.c +++ b/arch/ppc64/kernel/pci.c | |||
@@ -438,7 +438,7 @@ pgprot_t pci_phys_mem_access_prot(struct file *file, | |||
438 | int i; | 438 | int i; |
439 | 439 | ||
440 | if (page_is_ram(offset >> PAGE_SHIFT)) | 440 | if (page_is_ram(offset >> PAGE_SHIFT)) |
441 | return prot; | 441 | return __pgprot(prot); |
442 | 442 | ||
443 | prot |= _PAGE_NO_CACHE | _PAGE_GUARDED; | 443 | prot |= _PAGE_NO_CACHE | _PAGE_GUARDED; |
444 | 444 | ||
diff --git a/arch/ppc64/kernel/prom.c b/arch/ppc64/kernel/prom.c index 45a4ad08fbc2..eb6538b58008 100644 --- a/arch/ppc64/kernel/prom.c +++ b/arch/ppc64/kernel/prom.c | |||
@@ -321,6 +321,10 @@ static int __devinit finish_node_interrupts(struct device_node *np, | |||
321 | char *name = get_property(ic->parent, "name", NULL); | 321 | char *name = get_property(ic->parent, "name", NULL); |
322 | if (name && !strcmp(name, "u3")) | 322 | if (name && !strcmp(name, "u3")) |
323 | np->intrs[intrcount].line += 128; | 323 | np->intrs[intrcount].line += 128; |
324 | else if (!(name && !strcmp(name, "mac-io"))) | ||
325 | /* ignore other cascaded controllers, such as | ||
326 | the k2-sata-root */ | ||
327 | break; | ||
324 | } | 328 | } |
325 | np->intrs[intrcount].sense = 1; | 329 | np->intrs[intrcount].sense = 1; |
326 | if (n > 1) | 330 | if (n > 1) |
@@ -830,7 +834,7 @@ void __init unflatten_device_tree(void) | |||
830 | { | 834 | { |
831 | unsigned long start, mem, size; | 835 | unsigned long start, mem, size; |
832 | struct device_node **allnextp = &allnodes; | 836 | struct device_node **allnextp = &allnodes; |
833 | char *p; | 837 | char *p = NULL; |
834 | int l = 0; | 838 | int l = 0; |
835 | 839 | ||
836 | DBG(" -> unflatten_device_tree()\n"); | 840 | DBG(" -> unflatten_device_tree()\n"); |
diff --git a/arch/ppc64/kernel/prom_init.c b/arch/ppc64/kernel/prom_init.c index 8dffa9ae2623..35ec42de962e 100644 --- a/arch/ppc64/kernel/prom_init.c +++ b/arch/ppc64/kernel/prom_init.c | |||
@@ -493,6 +493,113 @@ static void __init early_cmdline_parse(void) | |||
493 | } | 493 | } |
494 | 494 | ||
495 | /* | 495 | /* |
496 | * To tell the firmware what our capabilities are, we have to pass | ||
497 | * it a fake 32-bit ELF header containing a couple of PT_NOTE sections | ||
498 | * that contain structures that contain the actual values. | ||
499 | */ | ||
500 | static struct fake_elf { | ||
501 | Elf32_Ehdr elfhdr; | ||
502 | Elf32_Phdr phdr[2]; | ||
503 | struct chrpnote { | ||
504 | u32 namesz; | ||
505 | u32 descsz; | ||
506 | u32 type; | ||
507 | char name[8]; /* "PowerPC" */ | ||
508 | struct chrpdesc { | ||
509 | u32 real_mode; | ||
510 | u32 real_base; | ||
511 | u32 real_size; | ||
512 | u32 virt_base; | ||
513 | u32 virt_size; | ||
514 | u32 load_base; | ||
515 | } chrpdesc; | ||
516 | } chrpnote; | ||
517 | struct rpanote { | ||
518 | u32 namesz; | ||
519 | u32 descsz; | ||
520 | u32 type; | ||
521 | char name[24]; /* "IBM,RPA-Client-Config" */ | ||
522 | struct rpadesc { | ||
523 | u32 lpar_affinity; | ||
524 | u32 min_rmo_size; | ||
525 | u32 min_rmo_percent; | ||
526 | u32 max_pft_size; | ||
527 | u32 splpar; | ||
528 | u32 min_load; | ||
529 | u32 new_mem_def; | ||
530 | u32 ignore_me; | ||
531 | } rpadesc; | ||
532 | } rpanote; | ||
533 | } fake_elf = { | ||
534 | .elfhdr = { | ||
535 | .e_ident = { 0x7f, 'E', 'L', 'F', | ||
536 | ELFCLASS32, ELFDATA2MSB, EV_CURRENT }, | ||
537 | .e_type = ET_EXEC, /* yeah right */ | ||
538 | .e_machine = EM_PPC, | ||
539 | .e_version = EV_CURRENT, | ||
540 | .e_phoff = offsetof(struct fake_elf, phdr), | ||
541 | .e_phentsize = sizeof(Elf32_Phdr), | ||
542 | .e_phnum = 2 | ||
543 | }, | ||
544 | .phdr = { | ||
545 | [0] = { | ||
546 | .p_type = PT_NOTE, | ||
547 | .p_offset = offsetof(struct fake_elf, chrpnote), | ||
548 | .p_filesz = sizeof(struct chrpnote) | ||
549 | }, [1] = { | ||
550 | .p_type = PT_NOTE, | ||
551 | .p_offset = offsetof(struct fake_elf, rpanote), | ||
552 | .p_filesz = sizeof(struct rpanote) | ||
553 | } | ||
554 | }, | ||
555 | .chrpnote = { | ||
556 | .namesz = sizeof("PowerPC"), | ||
557 | .descsz = sizeof(struct chrpdesc), | ||
558 | .type = 0x1275, | ||
559 | .name = "PowerPC", | ||
560 | .chrpdesc = { | ||
561 | .real_mode = ~0U, /* ~0 means "don't care" */ | ||
562 | .real_base = ~0U, | ||
563 | .real_size = ~0U, | ||
564 | .virt_base = ~0U, | ||
565 | .virt_size = ~0U, | ||
566 | .load_base = ~0U | ||
567 | }, | ||
568 | }, | ||
569 | .rpanote = { | ||
570 | .namesz = sizeof("IBM,RPA-Client-Config"), | ||
571 | .descsz = sizeof(struct rpadesc), | ||
572 | .type = 0x12759999, | ||
573 | .name = "IBM,RPA-Client-Config", | ||
574 | .rpadesc = { | ||
575 | .lpar_affinity = 0, | ||
576 | .min_rmo_size = 64, /* in megabytes */ | ||
577 | .min_rmo_percent = 0, | ||
578 | .max_pft_size = 48, /* 2^48 bytes max PFT size */ | ||
579 | .splpar = 1, | ||
580 | .min_load = ~0U, | ||
581 | .new_mem_def = 0 | ||
582 | } | ||
583 | } | ||
584 | }; | ||
585 | |||
586 | static void __init prom_send_capabilities(void) | ||
587 | { | ||
588 | unsigned long offset = reloc_offset(); | ||
589 | ihandle elfloader; | ||
590 | int ret; | ||
591 | |||
592 | elfloader = call_prom("open", 1, 1, ADDR("/packages/elf-loader")); | ||
593 | if (elfloader == 0) { | ||
594 | prom_printf("couldn't open /packages/elf-loader\n"); | ||
595 | return; | ||
596 | } | ||
597 | ret = call_prom("call-method", 3, 1, ADDR("process-elf-header"), | ||
598 | elfloader, ADDR(&fake_elf)); | ||
599 | call_prom("close", 1, 0, elfloader); | ||
600 | } | ||
601 | |||
602 | /* | ||
496 | * Memory allocation strategy... our layout is normally: | 603 | * Memory allocation strategy... our layout is normally: |
497 | * | 604 | * |
498 | * at 14Mb or more we vmlinux, then a gap and initrd. In some rare cases, initrd | 605 | * at 14Mb or more we vmlinux, then a gap and initrd. In some rare cases, initrd |
@@ -1448,6 +1555,12 @@ static void __init scan_dt_build_strings(phandle node, unsigned long *mem_start, | |||
1448 | } | 1555 | } |
1449 | } | 1556 | } |
1450 | 1557 | ||
1558 | /* | ||
1559 | * The Open Firmware 1275 specification states properties must be 31 bytes or | ||
1560 | * less, however not all firmwares obey this. Make it 64 bytes to be safe. | ||
1561 | */ | ||
1562 | #define MAX_PROPERTY_NAME 64 | ||
1563 | |||
1451 | static void __init scan_dt_build_struct(phandle node, unsigned long *mem_start, | 1564 | static void __init scan_dt_build_struct(phandle node, unsigned long *mem_start, |
1452 | unsigned long *mem_end) | 1565 | unsigned long *mem_end) |
1453 | { | 1566 | { |
@@ -1457,7 +1570,7 @@ static void __init scan_dt_build_struct(phandle node, unsigned long *mem_start, | |||
1457 | unsigned long soff; | 1570 | unsigned long soff; |
1458 | unsigned char *valp; | 1571 | unsigned char *valp; |
1459 | unsigned long offset = reloc_offset(); | 1572 | unsigned long offset = reloc_offset(); |
1460 | char pname[32]; | 1573 | char pname[MAX_PROPERTY_NAME]; |
1461 | char *path; | 1574 | char *path; |
1462 | 1575 | ||
1463 | path = RELOC(prom_scratch); | 1576 | path = RELOC(prom_scratch); |
diff --git a/arch/ppc64/kernel/ptrace.c b/arch/ppc64/kernel/ptrace.c index 354a287c67eb..9f8c6087ae56 100644 --- a/arch/ppc64/kernel/ptrace.c +++ b/arch/ppc64/kernel/ptrace.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/security.h> | 28 | #include <linux/security.h> |
29 | #include <linux/audit.h> | 29 | #include <linux/audit.h> |
30 | #include <linux/seccomp.h> | 30 | #include <linux/seccomp.h> |
31 | #include <linux/signal.h> | ||
31 | 32 | ||
32 | #include <asm/uaccess.h> | 33 | #include <asm/uaccess.h> |
33 | #include <asm/page.h> | 34 | #include <asm/page.h> |
@@ -162,7 +163,7 @@ int sys_ptrace(long request, long pid, long addr, long data) | |||
162 | case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */ | 163 | case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */ |
163 | case PTRACE_CONT: { /* restart after signal. */ | 164 | case PTRACE_CONT: { /* restart after signal. */ |
164 | ret = -EIO; | 165 | ret = -EIO; |
165 | if ((unsigned long) data > _NSIG) | 166 | if (!valid_signal(data)) |
166 | break; | 167 | break; |
167 | if (request == PTRACE_SYSCALL) | 168 | if (request == PTRACE_SYSCALL) |
168 | set_tsk_thread_flag(child, TIF_SYSCALL_TRACE); | 169 | set_tsk_thread_flag(child, TIF_SYSCALL_TRACE); |
@@ -194,7 +195,7 @@ int sys_ptrace(long request, long pid, long addr, long data) | |||
194 | 195 | ||
195 | case PTRACE_SINGLESTEP: { /* set the trap flag. */ | 196 | case PTRACE_SINGLESTEP: { /* set the trap flag. */ |
196 | ret = -EIO; | 197 | ret = -EIO; |
197 | if ((unsigned long) data > _NSIG) | 198 | if (!valid_signal(data)) |
198 | break; | 199 | break; |
199 | clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); | 200 | clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); |
200 | set_single_step(child); | 201 | set_single_step(child); |
@@ -304,14 +305,17 @@ static void do_syscall_trace(void) | |||
304 | 305 | ||
305 | void do_syscall_trace_enter(struct pt_regs *regs) | 306 | void do_syscall_trace_enter(struct pt_regs *regs) |
306 | { | 307 | { |
308 | if (test_thread_flag(TIF_SYSCALL_TRACE) | ||
309 | && (current->ptrace & PT_PTRACED)) | ||
310 | do_syscall_trace(); | ||
311 | |||
307 | if (unlikely(current->audit_context)) | 312 | if (unlikely(current->audit_context)) |
308 | audit_syscall_entry(current, regs->gpr[0], | 313 | audit_syscall_entry(current, |
314 | test_thread_flag(TIF_32BIT)?AUDIT_ARCH_PPC:AUDIT_ARCH_PPC64, | ||
315 | regs->gpr[0], | ||
309 | regs->gpr[3], regs->gpr[4], | 316 | regs->gpr[3], regs->gpr[4], |
310 | regs->gpr[5], regs->gpr[6]); | 317 | regs->gpr[5], regs->gpr[6]); |
311 | 318 | ||
312 | if (test_thread_flag(TIF_SYSCALL_TRACE) | ||
313 | && (current->ptrace & PT_PTRACED)) | ||
314 | do_syscall_trace(); | ||
315 | } | 319 | } |
316 | 320 | ||
317 | void do_syscall_trace_leave(struct pt_regs *regs) | 321 | void do_syscall_trace_leave(struct pt_regs *regs) |
@@ -319,7 +323,9 @@ void do_syscall_trace_leave(struct pt_regs *regs) | |||
319 | secure_computing(regs->gpr[0]); | 323 | secure_computing(regs->gpr[0]); |
320 | 324 | ||
321 | if (unlikely(current->audit_context)) | 325 | if (unlikely(current->audit_context)) |
322 | audit_syscall_exit(current, regs->result); | 326 | audit_syscall_exit(current, |
327 | (regs->ccr&0x1000)?AUDITSC_FAILURE:AUDITSC_SUCCESS, | ||
328 | regs->result); | ||
323 | 329 | ||
324 | if ((test_thread_flag(TIF_SYSCALL_TRACE) | 330 | if ((test_thread_flag(TIF_SYSCALL_TRACE) |
325 | || test_thread_flag(TIF_SINGLESTEP)) | 331 | || test_thread_flag(TIF_SINGLESTEP)) |
diff --git a/arch/ppc64/kernel/ptrace32.c b/arch/ppc64/kernel/ptrace32.c index ee81b1b776cc..16436426c7e2 100644 --- a/arch/ppc64/kernel/ptrace32.c +++ b/arch/ppc64/kernel/ptrace32.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/ptrace.h> | 26 | #include <linux/ptrace.h> |
27 | #include <linux/user.h> | 27 | #include <linux/user.h> |
28 | #include <linux/security.h> | 28 | #include <linux/security.h> |
29 | #include <linux/signal.h> | ||
29 | 30 | ||
30 | #include <asm/uaccess.h> | 31 | #include <asm/uaccess.h> |
31 | #include <asm/page.h> | 32 | #include <asm/page.h> |
@@ -293,7 +294,7 @@ int sys32_ptrace(long request, long pid, unsigned long addr, unsigned long data) | |||
293 | case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */ | 294 | case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */ |
294 | case PTRACE_CONT: { /* restart after signal. */ | 295 | case PTRACE_CONT: { /* restart after signal. */ |
295 | ret = -EIO; | 296 | ret = -EIO; |
296 | if ((unsigned long) data > _NSIG) | 297 | if (!valid_signal(data)) |
297 | break; | 298 | break; |
298 | if (request == PTRACE_SYSCALL) | 299 | if (request == PTRACE_SYSCALL) |
299 | set_tsk_thread_flag(child, TIF_SYSCALL_TRACE); | 300 | set_tsk_thread_flag(child, TIF_SYSCALL_TRACE); |
@@ -325,7 +326,7 @@ int sys32_ptrace(long request, long pid, unsigned long addr, unsigned long data) | |||
325 | 326 | ||
326 | case PTRACE_SINGLESTEP: { /* set the trap flag. */ | 327 | case PTRACE_SINGLESTEP: { /* set the trap flag. */ |
327 | ret = -EIO; | 328 | ret = -EIO; |
328 | if ((unsigned long) data > _NSIG) | 329 | if (!valid_signal(data)) |
329 | break; | 330 | break; |
330 | clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); | 331 | clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); |
331 | set_single_step(child); | 332 | set_single_step(child); |
diff --git a/arch/ppc64/kernel/rtas_flash.c b/arch/ppc64/kernel/rtas_flash.c index 3213837282ca..923e2e201a70 100644 --- a/arch/ppc64/kernel/rtas_flash.c +++ b/arch/ppc64/kernel/rtas_flash.c | |||
@@ -218,7 +218,7 @@ static void get_flash_status_msg(int status, char *buf) | |||
218 | } | 218 | } |
219 | 219 | ||
220 | /* Reading the proc file will show status (not the firmware contents) */ | 220 | /* Reading the proc file will show status (not the firmware contents) */ |
221 | static ssize_t rtas_flash_read(struct file *file, char *buf, | 221 | static ssize_t rtas_flash_read(struct file *file, char __user *buf, |
222 | size_t count, loff_t *ppos) | 222 | size_t count, loff_t *ppos) |
223 | { | 223 | { |
224 | struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); | 224 | struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); |
@@ -256,7 +256,7 @@ static ssize_t rtas_flash_read(struct file *file, char *buf, | |||
256 | * count is. If the system is low on memory it will be just as well | 256 | * count is. If the system is low on memory it will be just as well |
257 | * that we fail.... | 257 | * that we fail.... |
258 | */ | 258 | */ |
259 | static ssize_t rtas_flash_write(struct file *file, const char *buffer, | 259 | static ssize_t rtas_flash_write(struct file *file, const char __user *buffer, |
260 | size_t count, loff_t *off) | 260 | size_t count, loff_t *off) |
261 | { | 261 | { |
262 | struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); | 262 | struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); |
@@ -356,7 +356,7 @@ static void manage_flash(struct rtas_manage_flash_t *args_buf) | |||
356 | args_buf->status = rc; | 356 | args_buf->status = rc; |
357 | } | 357 | } |
358 | 358 | ||
359 | static ssize_t manage_flash_read(struct file *file, char *buf, | 359 | static ssize_t manage_flash_read(struct file *file, char __user *buf, |
360 | size_t count, loff_t *ppos) | 360 | size_t count, loff_t *ppos) |
361 | { | 361 | { |
362 | struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); | 362 | struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); |
@@ -386,7 +386,7 @@ static ssize_t manage_flash_read(struct file *file, char *buf, | |||
386 | return msglen; | 386 | return msglen; |
387 | } | 387 | } |
388 | 388 | ||
389 | static ssize_t manage_flash_write(struct file *file, const char *buf, | 389 | static ssize_t manage_flash_write(struct file *file, const char __user *buf, |
390 | size_t count, loff_t *off) | 390 | size_t count, loff_t *off) |
391 | { | 391 | { |
392 | struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); | 392 | struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); |
@@ -466,7 +466,7 @@ static int get_validate_flash_msg(struct rtas_validate_flash_t *args_buf, | |||
466 | return n; | 466 | return n; |
467 | } | 467 | } |
468 | 468 | ||
469 | static ssize_t validate_flash_read(struct file *file, char *buf, | 469 | static ssize_t validate_flash_read(struct file *file, char __user *buf, |
470 | size_t count, loff_t *ppos) | 470 | size_t count, loff_t *ppos) |
471 | { | 471 | { |
472 | struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); | 472 | struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); |
@@ -494,7 +494,7 @@ static ssize_t validate_flash_read(struct file *file, char *buf, | |||
494 | return msglen; | 494 | return msglen; |
495 | } | 495 | } |
496 | 496 | ||
497 | static ssize_t validate_flash_write(struct file *file, const char *buf, | 497 | static ssize_t validate_flash_write(struct file *file, const char __user *buf, |
498 | size_t count, loff_t *off) | 498 | size_t count, loff_t *off) |
499 | { | 499 | { |
500 | struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); | 500 | struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); |
diff --git a/arch/ppc64/kernel/scanlog.c b/arch/ppc64/kernel/scanlog.c index 189b81a41987..4d70736619c7 100644 --- a/arch/ppc64/kernel/scanlog.c +++ b/arch/ppc64/kernel/scanlog.c | |||
@@ -43,7 +43,7 @@ static int scanlog_debug; | |||
43 | static unsigned int ibm_scan_log_dump; /* RTAS token */ | 43 | static unsigned int ibm_scan_log_dump; /* RTAS token */ |
44 | static struct proc_dir_entry *proc_ppc64_scan_log_dump; /* The proc file */ | 44 | static struct proc_dir_entry *proc_ppc64_scan_log_dump; /* The proc file */ |
45 | 45 | ||
46 | static ssize_t scanlog_read(struct file *file, char *buf, | 46 | static ssize_t scanlog_read(struct file *file, char __user *buf, |
47 | size_t count, loff_t *ppos) | 47 | size_t count, loff_t *ppos) |
48 | { | 48 | { |
49 | struct inode * inode = file->f_dentry->d_inode; | 49 | struct inode * inode = file->f_dentry->d_inode; |
@@ -129,7 +129,7 @@ static ssize_t scanlog_read(struct file *file, char *buf, | |||
129 | /*NOTREACHED*/ | 129 | /*NOTREACHED*/ |
130 | } | 130 | } |
131 | 131 | ||
132 | static ssize_t scanlog_write(struct file * file, const char * buf, | 132 | static ssize_t scanlog_write(struct file * file, const char __user * buf, |
133 | size_t count, loff_t *ppos) | 133 | size_t count, loff_t *ppos) |
134 | { | 134 | { |
135 | char stkbuf[20]; | 135 | char stkbuf[20]; |
diff --git a/arch/ppc64/kernel/signal.c b/arch/ppc64/kernel/signal.c index a95a2b49a1d5..bf782276984c 100644 --- a/arch/ppc64/kernel/signal.c +++ b/arch/ppc64/kernel/signal.c | |||
@@ -42,11 +42,7 @@ | |||
42 | 42 | ||
43 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | 43 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) |
44 | 44 | ||
45 | #ifndef MIN | 45 | #define GP_REGS_SIZE min(sizeof(elf_gregset_t), sizeof(struct pt_regs)) |
46 | #define MIN(a,b) (((a) < (b)) ? (a) : (b)) | ||
47 | #endif | ||
48 | |||
49 | #define GP_REGS_SIZE MIN(sizeof(elf_gregset_t), sizeof(struct pt_regs)) | ||
50 | #define FP_REGS_SIZE sizeof(elf_fpregset_t) | 46 | #define FP_REGS_SIZE sizeof(elf_fpregset_t) |
51 | 47 | ||
52 | #define TRAMP_TRACEBACK 3 | 48 | #define TRAMP_TRACEBACK 3 |
diff --git a/arch/ppc64/kernel/signal32.c b/arch/ppc64/kernel/signal32.c index b0e167db6af9..3c2fa5c284c0 100644 --- a/arch/ppc64/kernel/signal32.c +++ b/arch/ppc64/kernel/signal32.c | |||
@@ -657,7 +657,7 @@ static int handle_rt_signal32(unsigned long sig, struct k_sigaction *ka, | |||
657 | 657 | ||
658 | /* Save user registers on the stack */ | 658 | /* Save user registers on the stack */ |
659 | frame = &rt_sf->uc.uc_mcontext; | 659 | frame = &rt_sf->uc.uc_mcontext; |
660 | if (put_user(regs->gpr[1], (unsigned long __user *)newsp)) | 660 | if (put_user(regs->gpr[1], (u32 __user *)newsp)) |
661 | goto badframe; | 661 | goto badframe; |
662 | 662 | ||
663 | if (vdso32_rt_sigtramp && current->thread.vdso_base) { | 663 | if (vdso32_rt_sigtramp && current->thread.vdso_base) { |
@@ -842,7 +842,7 @@ static int handle_signal32(unsigned long sig, struct k_sigaction *ka, | |||
842 | regs->link = (unsigned long) frame->mctx.tramp; | 842 | regs->link = (unsigned long) frame->mctx.tramp; |
843 | } | 843 | } |
844 | 844 | ||
845 | if (put_user(regs->gpr[1], (unsigned long __user *)newsp)) | 845 | if (put_user(regs->gpr[1], (u32 __user *)newsp)) |
846 | goto badframe; | 846 | goto badframe; |
847 | regs->gpr[1] = (unsigned long) newsp; | 847 | regs->gpr[1] = (unsigned long) newsp; |
848 | regs->gpr[3] = sig; | 848 | regs->gpr[3] = sig; |
diff --git a/arch/ppc64/kernel/smp.c b/arch/ppc64/kernel/smp.c index 1c92da3e4525..3b906cd94037 100644 --- a/arch/ppc64/kernel/smp.c +++ b/arch/ppc64/kernel/smp.c | |||
@@ -125,7 +125,7 @@ void __devinit smp_generic_kick_cpu(int nr) | |||
125 | * the processor will continue on to secondary_start | 125 | * the processor will continue on to secondary_start |
126 | */ | 126 | */ |
127 | paca[nr].cpu_start = 1; | 127 | paca[nr].cpu_start = 1; |
128 | mb(); | 128 | smp_mb(); |
129 | } | 129 | } |
130 | 130 | ||
131 | #endif /* CONFIG_PPC_MULTIPLATFORM */ | 131 | #endif /* CONFIG_PPC_MULTIPLATFORM */ |
@@ -256,7 +256,7 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic, | |||
256 | } | 256 | } |
257 | 257 | ||
258 | call_data = &data; | 258 | call_data = &data; |
259 | wmb(); | 259 | smp_wmb(); |
260 | /* Send a message to all other CPUs and wait for them to respond */ | 260 | /* Send a message to all other CPUs and wait for them to respond */ |
261 | smp_ops->message_pass(MSG_ALL_BUT_SELF, PPC_MSG_CALL_FUNCTION); | 261 | smp_ops->message_pass(MSG_ALL_BUT_SELF, PPC_MSG_CALL_FUNCTION); |
262 | 262 | ||
@@ -431,7 +431,7 @@ int generic_cpu_enable(unsigned int cpu) | |||
431 | 431 | ||
432 | /* get the target out of it's holding state */ | 432 | /* get the target out of it's holding state */ |
433 | per_cpu(cpu_state, cpu) = CPU_UP_PREPARE; | 433 | per_cpu(cpu_state, cpu) = CPU_UP_PREPARE; |
434 | wmb(); | 434 | smp_wmb(); |
435 | 435 | ||
436 | while (!cpu_online(cpu)) | 436 | while (!cpu_online(cpu)) |
437 | cpu_relax(); | 437 | cpu_relax(); |
@@ -447,7 +447,7 @@ void generic_cpu_die(unsigned int cpu) | |||
447 | int i; | 447 | int i; |
448 | 448 | ||
449 | for (i = 0; i < 100; i++) { | 449 | for (i = 0; i < 100; i++) { |
450 | rmb(); | 450 | smp_rmb(); |
451 | if (per_cpu(cpu_state, cpu) == CPU_DEAD) | 451 | if (per_cpu(cpu_state, cpu) == CPU_DEAD) |
452 | return; | 452 | return; |
453 | msleep(100); | 453 | msleep(100); |
@@ -463,7 +463,7 @@ void generic_mach_cpu_die(void) | |||
463 | cpu = smp_processor_id(); | 463 | cpu = smp_processor_id(); |
464 | printk(KERN_DEBUG "CPU%d offline\n", cpu); | 464 | printk(KERN_DEBUG "CPU%d offline\n", cpu); |
465 | __get_cpu_var(cpu_state) = CPU_DEAD; | 465 | __get_cpu_var(cpu_state) = CPU_DEAD; |
466 | wmb(); | 466 | smp_wmb(); |
467 | while (__get_cpu_var(cpu_state) != CPU_UP_PREPARE) | 467 | while (__get_cpu_var(cpu_state) != CPU_UP_PREPARE) |
468 | cpu_relax(); | 468 | cpu_relax(); |
469 | 469 | ||
@@ -515,7 +515,7 @@ int __devinit __cpu_up(unsigned int cpu) | |||
515 | * be written out to main store before we release | 515 | * be written out to main store before we release |
516 | * the processor. | 516 | * the processor. |
517 | */ | 517 | */ |
518 | mb(); | 518 | smp_mb(); |
519 | 519 | ||
520 | /* wake up cpus */ | 520 | /* wake up cpus */ |
521 | DBG("smp: kicking cpu %d\n", cpu); | 521 | DBG("smp: kicking cpu %d\n", cpu); |
diff --git a/arch/ppc64/kernel/time.c b/arch/ppc64/kernel/time.c index 77ded5a363b6..772a465b49f9 100644 --- a/arch/ppc64/kernel/time.c +++ b/arch/ppc64/kernel/time.c | |||
@@ -221,15 +221,15 @@ static __inline__ void timer_recalc_offset(unsigned long cur_tb) | |||
221 | temp_varp->tb_to_xs = do_gtod.varp->tb_to_xs; | 221 | temp_varp->tb_to_xs = do_gtod.varp->tb_to_xs; |
222 | temp_varp->tb_orig_stamp = new_tb_orig_stamp; | 222 | temp_varp->tb_orig_stamp = new_tb_orig_stamp; |
223 | temp_varp->stamp_xsec = new_stamp_xsec; | 223 | temp_varp->stamp_xsec = new_stamp_xsec; |
224 | mb(); | 224 | smp_mb(); |
225 | do_gtod.varp = temp_varp; | 225 | do_gtod.varp = temp_varp; |
226 | do_gtod.var_idx = temp_idx; | 226 | do_gtod.var_idx = temp_idx; |
227 | 227 | ||
228 | ++(systemcfg->tb_update_count); | 228 | ++(systemcfg->tb_update_count); |
229 | wmb(); | 229 | smp_wmb(); |
230 | systemcfg->tb_orig_stamp = new_tb_orig_stamp; | 230 | systemcfg->tb_orig_stamp = new_tb_orig_stamp; |
231 | systemcfg->stamp_xsec = new_stamp_xsec; | 231 | systemcfg->stamp_xsec = new_stamp_xsec; |
232 | wmb(); | 232 | smp_wmb(); |
233 | ++(systemcfg->tb_update_count); | 233 | ++(systemcfg->tb_update_count); |
234 | } | 234 | } |
235 | 235 | ||
@@ -648,7 +648,7 @@ void ppc_adjtimex(void) | |||
648 | temp_varp->tb_to_xs = new_tb_to_xs; | 648 | temp_varp->tb_to_xs = new_tb_to_xs; |
649 | temp_varp->stamp_xsec = new_stamp_xsec; | 649 | temp_varp->stamp_xsec = new_stamp_xsec; |
650 | temp_varp->tb_orig_stamp = do_gtod.varp->tb_orig_stamp; | 650 | temp_varp->tb_orig_stamp = do_gtod.varp->tb_orig_stamp; |
651 | mb(); | 651 | smp_mb(); |
652 | do_gtod.varp = temp_varp; | 652 | do_gtod.varp = temp_varp; |
653 | do_gtod.var_idx = temp_idx; | 653 | do_gtod.var_idx = temp_idx; |
654 | 654 | ||
@@ -662,10 +662,10 @@ void ppc_adjtimex(void) | |||
662 | * loops back and reads them again until this criteria is met. | 662 | * loops back and reads them again until this criteria is met. |
663 | */ | 663 | */ |
664 | ++(systemcfg->tb_update_count); | 664 | ++(systemcfg->tb_update_count); |
665 | wmb(); | 665 | smp_wmb(); |
666 | systemcfg->tb_to_xs = new_tb_to_xs; | 666 | systemcfg->tb_to_xs = new_tb_to_xs; |
667 | systemcfg->stamp_xsec = new_stamp_xsec; | 667 | systemcfg->stamp_xsec = new_stamp_xsec; |
668 | wmb(); | 668 | smp_wmb(); |
669 | ++(systemcfg->tb_update_count); | 669 | ++(systemcfg->tb_update_count); |
670 | 670 | ||
671 | write_sequnlock_irqrestore( &xtime_lock, flags ); | 671 | write_sequnlock_irqrestore( &xtime_lock, flags ); |
diff --git a/arch/ppc64/kernel/vdso32/Makefile b/arch/ppc64/kernel/vdso32/Makefile index ede2f7e477c2..0b1b0df973eb 100644 --- a/arch/ppc64/kernel/vdso32/Makefile +++ b/arch/ppc64/kernel/vdso32/Makefile | |||
@@ -1,7 +1,7 @@ | |||
1 | 1 | ||
2 | # List of files in the vdso, has to be asm only for now | 2 | # List of files in the vdso, has to be asm only for now |
3 | 3 | ||
4 | obj-vdso32 = sigtramp.o gettimeofday.o datapage.o cacheflush.o | 4 | obj-vdso32 = sigtramp.o gettimeofday.o datapage.o cacheflush.o note.o |
5 | 5 | ||
6 | # Build rules | 6 | # Build rules |
7 | 7 | ||
diff --git a/arch/ppc64/kernel/vdso32/cacheflush.S b/arch/ppc64/kernel/vdso32/cacheflush.S index c74fddb6afd4..0ed7ea721715 100644 --- a/arch/ppc64/kernel/vdso32/cacheflush.S +++ b/arch/ppc64/kernel/vdso32/cacheflush.S | |||
@@ -47,6 +47,7 @@ V_FUNCTION_BEGIN(__kernel_sync_dicache) | |||
47 | addi r6,r6,128 | 47 | addi r6,r6,128 |
48 | bdnz 1b | 48 | bdnz 1b |
49 | isync | 49 | isync |
50 | li r3,0 | ||
50 | blr | 51 | blr |
51 | .cfi_endproc | 52 | .cfi_endproc |
52 | V_FUNCTION_END(__kernel_sync_dicache) | 53 | V_FUNCTION_END(__kernel_sync_dicache) |
@@ -59,6 +60,7 @@ V_FUNCTION_BEGIN(__kernel_sync_dicache_p5) | |||
59 | .cfi_startproc | 60 | .cfi_startproc |
60 | sync | 61 | sync |
61 | isync | 62 | isync |
63 | li r3,0 | ||
62 | blr | 64 | blr |
63 | .cfi_endproc | 65 | .cfi_endproc |
64 | V_FUNCTION_END(__kernel_sync_dicache_p5) | 66 | V_FUNCTION_END(__kernel_sync_dicache_p5) |
diff --git a/arch/ppc64/kernel/vdso32/gettimeofday.S b/arch/ppc64/kernel/vdso32/gettimeofday.S index ca7f415195c4..2b48bf1fb109 100644 --- a/arch/ppc64/kernel/vdso32/gettimeofday.S +++ b/arch/ppc64/kernel/vdso32/gettimeofday.S | |||
@@ -58,6 +58,7 @@ V_FUNCTION_BEGIN(__kernel_gettimeofday) | |||
58 | stw r5,TZONE_TZ_DSTTIME(r11) | 58 | stw r5,TZONE_TZ_DSTTIME(r11) |
59 | 59 | ||
60 | 1: mtlr r12 | 60 | 1: mtlr r12 |
61 | li r3,0 | ||
61 | blr | 62 | blr |
62 | 63 | ||
63 | 2: mr r3,r10 | 64 | 2: mr r3,r10 |
diff --git a/arch/ppc64/kernel/vdso32/note.S b/arch/ppc64/kernel/vdso32/note.S new file mode 100644 index 000000000000..d4b5be4f3d5f --- /dev/null +++ b/arch/ppc64/kernel/vdso32/note.S | |||
@@ -0,0 +1,25 @@ | |||
1 | /* | ||
2 | * This supplies .note.* sections to go into the PT_NOTE inside the vDSO text. | ||
3 | * Here we can supply some information useful to userland. | ||
4 | */ | ||
5 | |||
6 | #include <linux/uts.h> | ||
7 | #include <linux/version.h> | ||
8 | |||
9 | #define ASM_ELF_NOTE_BEGIN(name, flags, vendor, type) \ | ||
10 | .section name, flags; \ | ||
11 | .balign 4; \ | ||
12 | .long 1f - 0f; /* name length */ \ | ||
13 | .long 3f - 2f; /* data length */ \ | ||
14 | .long type; /* note type */ \ | ||
15 | 0: .asciz vendor; /* vendor name */ \ | ||
16 | 1: .balign 4; \ | ||
17 | 2: | ||
18 | |||
19 | #define ASM_ELF_NOTE_END \ | ||
20 | 3: .balign 4; /* pad out section */ \ | ||
21 | .previous | ||
22 | |||
23 | ASM_ELF_NOTE_BEGIN(".note.kernel-version", "a", UTS_SYSNAME, 0) | ||
24 | .long LINUX_VERSION_CODE | ||
25 | ASM_ELF_NOTE_END | ||
diff --git a/arch/ppc64/kernel/vdso32/vdso32.lds.S b/arch/ppc64/kernel/vdso32/vdso32.lds.S index cca27bd03a57..11290c902ba3 100644 --- a/arch/ppc64/kernel/vdso32/vdso32.lds.S +++ b/arch/ppc64/kernel/vdso32/vdso32.lds.S | |||
@@ -20,6 +20,8 @@ SECTIONS | |||
20 | .gnu.version_d : { *(.gnu.version_d) } | 20 | .gnu.version_d : { *(.gnu.version_d) } |
21 | .gnu.version_r : { *(.gnu.version_r) } | 21 | .gnu.version_r : { *(.gnu.version_r) } |
22 | 22 | ||
23 | .note : { *(.note.*) } :text :note | ||
24 | |||
23 | . = ALIGN (16); | 25 | . = ALIGN (16); |
24 | .text : | 26 | .text : |
25 | { | 27 | { |
@@ -87,6 +89,7 @@ SECTIONS | |||
87 | PHDRS | 89 | PHDRS |
88 | { | 90 | { |
89 | text PT_LOAD FILEHDR PHDRS FLAGS(5); /* PF_R|PF_X */ | 91 | text PT_LOAD FILEHDR PHDRS FLAGS(5); /* PF_R|PF_X */ |
92 | note PT_NOTE FLAGS(4); /* PF_R */ | ||
90 | dynamic PT_DYNAMIC FLAGS(4); /* PF_R */ | 93 | dynamic PT_DYNAMIC FLAGS(4); /* PF_R */ |
91 | eh_frame_hdr 0x6474e550; /* PT_GNU_EH_FRAME, but ld doesn't match the name */ | 94 | eh_frame_hdr 0x6474e550; /* PT_GNU_EH_FRAME, but ld doesn't match the name */ |
92 | } | 95 | } |
diff --git a/arch/ppc64/kernel/vdso64/Makefile b/arch/ppc64/kernel/vdso64/Makefile index bd3f70b1a384..ab39988452cc 100644 --- a/arch/ppc64/kernel/vdso64/Makefile +++ b/arch/ppc64/kernel/vdso64/Makefile | |||
@@ -1,6 +1,6 @@ | |||
1 | # List of files in the vdso, has to be asm only for now | 1 | # List of files in the vdso, has to be asm only for now |
2 | 2 | ||
3 | obj-vdso64 = sigtramp.o gettimeofday.o datapage.o cacheflush.o | 3 | obj-vdso64 = sigtramp.o gettimeofday.o datapage.o cacheflush.o note.o |
4 | 4 | ||
5 | # Build rules | 5 | # Build rules |
6 | 6 | ||
diff --git a/arch/ppc64/kernel/vdso64/cacheflush.S b/arch/ppc64/kernel/vdso64/cacheflush.S index d9696ffcf334..e0725b7b7003 100644 --- a/arch/ppc64/kernel/vdso64/cacheflush.S +++ b/arch/ppc64/kernel/vdso64/cacheflush.S | |||
@@ -47,6 +47,7 @@ V_FUNCTION_BEGIN(__kernel_sync_dicache) | |||
47 | addi r6,r6,128 | 47 | addi r6,r6,128 |
48 | bdnz 1b | 48 | bdnz 1b |
49 | isync | 49 | isync |
50 | li r3,0 | ||
50 | blr | 51 | blr |
51 | .cfi_endproc | 52 | .cfi_endproc |
52 | V_FUNCTION_END(__kernel_sync_dicache) | 53 | V_FUNCTION_END(__kernel_sync_dicache) |
@@ -59,6 +60,7 @@ V_FUNCTION_BEGIN(__kernel_sync_dicache_p5) | |||
59 | .cfi_startproc | 60 | .cfi_startproc |
60 | sync | 61 | sync |
61 | isync | 62 | isync |
63 | li r3,0 | ||
62 | blr | 64 | blr |
63 | .cfi_endproc | 65 | .cfi_endproc |
64 | V_FUNCTION_END(__kernel_sync_dicache_p5) | 66 | V_FUNCTION_END(__kernel_sync_dicache_p5) |
diff --git a/arch/ppc64/kernel/vdso64/note.S b/arch/ppc64/kernel/vdso64/note.S new file mode 100644 index 000000000000..dc2a509f7e8a --- /dev/null +++ b/arch/ppc64/kernel/vdso64/note.S | |||
@@ -0,0 +1 @@ | |||
#include "../vdso32/note.S" | |||
diff --git a/arch/ppc64/kernel/vdso64/vdso64.lds.S b/arch/ppc64/kernel/vdso64/vdso64.lds.S index 942c815c7bc7..9cb28181da80 100644 --- a/arch/ppc64/kernel/vdso64/vdso64.lds.S +++ b/arch/ppc64/kernel/vdso64/vdso64.lds.S | |||
@@ -18,12 +18,14 @@ SECTIONS | |||
18 | .gnu.version_d : { *(.gnu.version_d) } | 18 | .gnu.version_d : { *(.gnu.version_d) } |
19 | .gnu.version_r : { *(.gnu.version_r) } | 19 | .gnu.version_r : { *(.gnu.version_r) } |
20 | 20 | ||
21 | .note : { *(.note.*) } :text :note | ||
22 | |||
21 | . = ALIGN (16); | 23 | . = ALIGN (16); |
22 | .text : | 24 | .text : |
23 | { | 25 | { |
24 | *(.text .stub .text.* .gnu.linkonce.t.*) | 26 | *(.text .stub .text.* .gnu.linkonce.t.*) |
25 | *(.sfpr .glink) | 27 | *(.sfpr .glink) |
26 | } | 28 | } :text |
27 | PROVIDE (__etext = .); | 29 | PROVIDE (__etext = .); |
28 | PROVIDE (_etext = .); | 30 | PROVIDE (_etext = .); |
29 | PROVIDE (etext = .); | 31 | PROVIDE (etext = .); |
@@ -88,6 +90,7 @@ SECTIONS | |||
88 | PHDRS | 90 | PHDRS |
89 | { | 91 | { |
90 | text PT_LOAD FILEHDR PHDRS FLAGS(5); /* PF_R|PF_X */ | 92 | text PT_LOAD FILEHDR PHDRS FLAGS(5); /* PF_R|PF_X */ |
93 | note PT_NOTE FLAGS(4); /* PF_R */ | ||
91 | dynamic PT_DYNAMIC FLAGS(4); /* PF_R */ | 94 | dynamic PT_DYNAMIC FLAGS(4); /* PF_R */ |
92 | eh_frame_hdr 0x6474e550; /* PT_GNU_EH_FRAME, but ld doesn't match the name */ | 95 | eh_frame_hdr 0x6474e550; /* PT_GNU_EH_FRAME, but ld doesn't match the name */ |
93 | } | 96 | } |
diff --git a/arch/ppc64/kernel/xics.c b/arch/ppc64/kernel/xics.c index eedd1d3c2a10..879f39b90a33 100644 --- a/arch/ppc64/kernel/xics.c +++ b/arch/ppc64/kernel/xics.c | |||
@@ -432,6 +432,7 @@ void xics_cause_IPI(int cpu) | |||
432 | { | 432 | { |
433 | ops->qirr_info(cpu, IPI_PRIORITY); | 433 | ops->qirr_info(cpu, IPI_PRIORITY); |
434 | } | 434 | } |
435 | #endif /* CONFIG_SMP */ | ||
435 | 436 | ||
436 | void xics_setup_cpu(void) | 437 | void xics_setup_cpu(void) |
437 | { | 438 | { |
@@ -439,9 +440,17 @@ void xics_setup_cpu(void) | |||
439 | 440 | ||
440 | ops->cppr_info(cpu, 0xff); | 441 | ops->cppr_info(cpu, 0xff); |
441 | iosync(); | 442 | iosync(); |
442 | } | ||
443 | 443 | ||
444 | #endif /* CONFIG_SMP */ | 444 | /* |
445 | * Put the calling processor into the GIQ. This is really only | ||
446 | * necessary from a secondary thread as the OF start-cpu interface | ||
447 | * performs this function for us on primary threads. | ||
448 | * | ||
449 | * XXX: undo of teardown on kexec needs this too, as may hotplug | ||
450 | */ | ||
451 | rtas_set_indicator(GLOBAL_INTERRUPT_QUEUE, | ||
452 | (1UL << interrupt_server_size) - 1 - default_distrib_server, 1); | ||
453 | } | ||
445 | 454 | ||
446 | void xics_init_IRQ(void) | 455 | void xics_init_IRQ(void) |
447 | { | 456 | { |
@@ -563,8 +572,7 @@ nextnode: | |||
563 | for (; i < NR_IRQS; ++i) | 572 | for (; i < NR_IRQS; ++i) |
564 | get_irq_desc(i)->handler = &xics_pic; | 573 | get_irq_desc(i)->handler = &xics_pic; |
565 | 574 | ||
566 | ops->cppr_info(boot_cpuid, 0xff); | 575 | xics_setup_cpu(); |
567 | iosync(); | ||
568 | 576 | ||
569 | ppc64_boot_msg(0x21, "XICS Done"); | 577 | ppc64_boot_msg(0x21, "XICS Done"); |
570 | } | 578 | } |