diff options
Diffstat (limited to 'arch/powerpc')
| -rw-r--r-- | arch/powerpc/Kconfig | 1 | ||||
| -rw-r--r-- | arch/powerpc/kernel/kprobes.c | 2 | ||||
| -rw-r--r-- | arch/powerpc/kernel/ptrace.c | 4 | ||||
| -rw-r--r-- | arch/powerpc/kernel/setup-common.c | 20 | ||||
| -rw-r--r-- | arch/powerpc/kernel/setup_64.c | 3 | ||||
| -rw-r--r-- | arch/powerpc/kernel/smp.c | 4 | ||||
| -rw-r--r-- | arch/powerpc/kernel/vdso32/vdso32.lds.S | 219 | ||||
| -rw-r--r-- | arch/powerpc/kernel/vdso64/vdso64.lds.S | 225 | ||||
| -rw-r--r-- | arch/powerpc/mm/init_64.c | 67 | ||||
| -rw-r--r-- | arch/powerpc/mm/mem.c | 45 | ||||
| -rw-r--r-- | arch/powerpc/platforms/cell/cbe_cpufreq.c | 2 |
11 files changed, 332 insertions, 260 deletions
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 037664d496d7..5e001ad588a7 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig | |||
| @@ -295,6 +295,7 @@ config ARCH_FLATMEM_ENABLE | |||
| 295 | config ARCH_SPARSEMEM_ENABLE | 295 | config ARCH_SPARSEMEM_ENABLE |
| 296 | def_bool y | 296 | def_bool y |
| 297 | depends on PPC64 | 297 | depends on PPC64 |
| 298 | select SPARSEMEM_VMEMMAP_ENABLE | ||
| 298 | 299 | ||
| 299 | config ARCH_SPARSEMEM_DEFAULT | 300 | config ARCH_SPARSEMEM_DEFAULT |
| 300 | def_bool y | 301 | def_bool y |
diff --git a/arch/powerpc/kernel/kprobes.c b/arch/powerpc/kernel/kprobes.c index 440f5a87271f..5338e4855712 100644 --- a/arch/powerpc/kernel/kprobes.c +++ b/arch/powerpc/kernel/kprobes.c | |||
| @@ -38,6 +38,8 @@ | |||
| 38 | DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL; | 38 | DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL; |
| 39 | DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); | 39 | DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); |
| 40 | 40 | ||
| 41 | struct kretprobe_blackpoint kretprobe_blacklist[] = {{NULL, NULL}}; | ||
| 42 | |||
| 41 | int __kprobes arch_prepare_kprobe(struct kprobe *p) | 43 | int __kprobes arch_prepare_kprobe(struct kprobe *p) |
| 42 | { | 44 | { |
| 43 | int ret = 0; | 45 | int ret = 0; |
diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c index cf7732cdd6c7..3e17d154d0d4 100644 --- a/arch/powerpc/kernel/ptrace.c +++ b/arch/powerpc/kernel/ptrace.c | |||
| @@ -505,10 +505,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
| 505 | ret = ptrace_set_debugreg(child, addr, data); | 505 | ret = ptrace_set_debugreg(child, addr, data); |
| 506 | break; | 506 | break; |
| 507 | 507 | ||
| 508 | case PTRACE_DETACH: | ||
| 509 | ret = ptrace_detach(child, data); | ||
| 510 | break; | ||
| 511 | |||
| 512 | #ifdef CONFIG_PPC64 | 508 | #ifdef CONFIG_PPC64 |
| 513 | case PTRACE_GETREGS64: | 509 | case PTRACE_GETREGS64: |
| 514 | #endif | 510 | #endif |
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index 36c90ba2d312..2de00f870edc 100644 --- a/arch/powerpc/kernel/setup-common.c +++ b/arch/powerpc/kernel/setup-common.c | |||
| @@ -413,16 +413,28 @@ void __init smp_setup_cpu_maps(void) | |||
| 413 | of_node_put(dn); | 413 | of_node_put(dn); |
| 414 | } | 414 | } |
| 415 | 415 | ||
| 416 | vdso_data->processorCount = num_present_cpus(); | ||
| 417 | #endif /* CONFIG_PPC64 */ | ||
| 418 | } | ||
| 419 | |||
| 420 | /* | ||
| 421 | * Being that cpu_sibling_map is now a per_cpu array, then it cannot | ||
| 422 | * be initialized until the per_cpu areas have been created. This | ||
| 423 | * function is now called from setup_per_cpu_areas(). | ||
| 424 | */ | ||
| 425 | void __init smp_setup_cpu_sibling_map(void) | ||
| 426 | { | ||
| 427 | #if defined(CONFIG_PPC64) | ||
| 428 | int cpu; | ||
| 429 | |||
| 416 | /* | 430 | /* |
| 417 | * Do the sibling map; assume only two threads per processor. | 431 | * Do the sibling map; assume only two threads per processor. |
| 418 | */ | 432 | */ |
| 419 | for_each_possible_cpu(cpu) { | 433 | for_each_possible_cpu(cpu) { |
| 420 | cpu_set(cpu, cpu_sibling_map[cpu]); | 434 | cpu_set(cpu, per_cpu(cpu_sibling_map, cpu)); |
| 421 | if (cpu_has_feature(CPU_FTR_SMT)) | 435 | if (cpu_has_feature(CPU_FTR_SMT)) |
| 422 | cpu_set(cpu ^ 0x1, cpu_sibling_map[cpu]); | 436 | cpu_set(cpu ^ 0x1, per_cpu(cpu_sibling_map, cpu)); |
| 423 | } | 437 | } |
| 424 | |||
| 425 | vdso_data->processorCount = num_present_cpus(); | ||
| 426 | #endif /* CONFIG_PPC64 */ | 438 | #endif /* CONFIG_PPC64 */ |
| 427 | } | 439 | } |
| 428 | #endif /* CONFIG_SMP */ | 440 | #endif /* CONFIG_SMP */ |
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index 008ab6823b02..0e014550b83f 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c | |||
| @@ -597,6 +597,9 @@ void __init setup_per_cpu_areas(void) | |||
| 597 | paca[i].data_offset = ptr - __per_cpu_start; | 597 | paca[i].data_offset = ptr - __per_cpu_start; |
| 598 | memcpy(ptr, __per_cpu_start, __per_cpu_end - __per_cpu_start); | 598 | memcpy(ptr, __per_cpu_start, __per_cpu_end - __per_cpu_start); |
| 599 | } | 599 | } |
| 600 | |||
| 601 | /* Now that per_cpu is setup, initialize cpu_sibling_map */ | ||
| 602 | smp_setup_cpu_sibling_map(); | ||
| 600 | } | 603 | } |
| 601 | #endif | 604 | #endif |
| 602 | 605 | ||
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c index d30f08fa0297..338950aeb6f6 100644 --- a/arch/powerpc/kernel/smp.c +++ b/arch/powerpc/kernel/smp.c | |||
| @@ -61,11 +61,11 @@ struct thread_info *secondary_ti; | |||
| 61 | 61 | ||
| 62 | cpumask_t cpu_possible_map = CPU_MASK_NONE; | 62 | cpumask_t cpu_possible_map = CPU_MASK_NONE; |
| 63 | cpumask_t cpu_online_map = CPU_MASK_NONE; | 63 | cpumask_t cpu_online_map = CPU_MASK_NONE; |
| 64 | cpumask_t cpu_sibling_map[NR_CPUS] = { [0 ... NR_CPUS-1] = CPU_MASK_NONE }; | 64 | DEFINE_PER_CPU(cpumask_t, cpu_sibling_map) = CPU_MASK_NONE; |
| 65 | 65 | ||
| 66 | EXPORT_SYMBOL(cpu_online_map); | 66 | EXPORT_SYMBOL(cpu_online_map); |
| 67 | EXPORT_SYMBOL(cpu_possible_map); | 67 | EXPORT_SYMBOL(cpu_possible_map); |
| 68 | EXPORT_SYMBOL(cpu_sibling_map); | 68 | EXPORT_PER_CPU_SYMBOL(cpu_sibling_map); |
| 69 | 69 | ||
| 70 | /* SMP operations for this machine */ | 70 | /* SMP operations for this machine */ |
| 71 | struct smp_ops_t *smp_ops; | 71 | struct smp_ops_t *smp_ops; |
diff --git a/arch/powerpc/kernel/vdso32/vdso32.lds.S b/arch/powerpc/kernel/vdso32/vdso32.lds.S index 26e138c4ce17..9352ab5200e5 100644 --- a/arch/powerpc/kernel/vdso32/vdso32.lds.S +++ b/arch/powerpc/kernel/vdso32/vdso32.lds.S | |||
| @@ -1,130 +1,147 @@ | |||
| 1 | |||
| 2 | /* | 1 | /* |
| 3 | * This is the infamous ld script for the 32 bits vdso | 2 | * This is the infamous ld script for the 32 bits vdso |
| 4 | * library | 3 | * library |
| 5 | */ | 4 | */ |
| 6 | #include <asm/vdso.h> | 5 | #include <asm/vdso.h> |
| 7 | 6 | ||
| 8 | /* Default link addresses for the vDSOs */ | ||
| 9 | OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc") | 7 | OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc") |
| 10 | OUTPUT_ARCH(powerpc:common) | 8 | OUTPUT_ARCH(powerpc:common) |
| 11 | ENTRY(_start) | 9 | ENTRY(_start) |
| 12 | 10 | ||
| 13 | SECTIONS | 11 | SECTIONS |
| 14 | { | 12 | { |
| 15 | . = VDSO32_LBASE + SIZEOF_HEADERS; | 13 | . = VDSO32_LBASE + SIZEOF_HEADERS; |
| 16 | .hash : { *(.hash) } :text | 14 | |
| 17 | .gnu.hash : { *(.gnu.hash) } | 15 | .hash : { *(.hash) } :text |
| 18 | .dynsym : { *(.dynsym) } | 16 | .gnu.hash : { *(.gnu.hash) } |
| 19 | .dynstr : { *(.dynstr) } | 17 | .dynsym : { *(.dynsym) } |
| 20 | .gnu.version : { *(.gnu.version) } | 18 | .dynstr : { *(.dynstr) } |
| 21 | .gnu.version_d : { *(.gnu.version_d) } | 19 | .gnu.version : { *(.gnu.version) } |
| 22 | .gnu.version_r : { *(.gnu.version_r) } | 20 | .gnu.version_d : { *(.gnu.version_d) } |
| 23 | 21 | .gnu.version_r : { *(.gnu.version_r) } | |
| 24 | .note : { *(.note.*) } :text :note | 22 | |
| 25 | 23 | .note : { *(.note.*) } :text :note | |
| 26 | . = ALIGN (16); | 24 | |
| 27 | .text : | 25 | . = ALIGN(16); |
| 28 | { | 26 | .text : { |
| 29 | *(.text .stub .text.* .gnu.linkonce.t.*) | 27 | *(.text .stub .text.* .gnu.linkonce.t.*) |
| 30 | } | 28 | } |
| 31 | PROVIDE (__etext = .); | 29 | PROVIDE(__etext = .); |
| 32 | PROVIDE (_etext = .); | 30 | PROVIDE(_etext = .); |
| 33 | PROVIDE (etext = .); | 31 | PROVIDE(etext = .); |
| 34 | 32 | ||
| 35 | . = ALIGN(8); | 33 | . = ALIGN(8); |
| 36 | __ftr_fixup : { | 34 | __ftr_fixup : { *(__ftr_fixup) } |
| 37 | *(__ftr_fixup) | ||
| 38 | } | ||
| 39 | 35 | ||
| 40 | #ifdef CONFIG_PPC64 | 36 | #ifdef CONFIG_PPC64 |
| 41 | . = ALIGN(8); | 37 | . = ALIGN(8); |
| 42 | __fw_ftr_fixup : { | 38 | __fw_ftr_fixup : { *(__fw_ftr_fixup) } |
| 43 | *(__fw_ftr_fixup) | ||
| 44 | } | ||
| 45 | #endif | 39 | #endif |
| 46 | 40 | ||
| 47 | /* Other stuff is appended to the text segment: */ | 41 | /* |
| 48 | .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } | 42 | * Other stuff is appended to the text segment: |
| 49 | .rodata1 : { *(.rodata1) } | 43 | */ |
| 50 | 44 | .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } | |
| 51 | .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr | 45 | .rodata1 : { *(.rodata1) } |
| 52 | .eh_frame : { KEEP (*(.eh_frame)) } :text | 46 | |
| 53 | .gcc_except_table : { *(.gcc_except_table) } | 47 | .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr |
| 54 | .fixup : { *(.fixup) } | 48 | .eh_frame : { KEEP (*(.eh_frame)) } :text |
| 55 | 49 | .gcc_except_table : { *(.gcc_except_table) } | |
| 56 | .dynamic : { *(.dynamic) } :text :dynamic | 50 | .fixup : { *(.fixup) } |
| 57 | .got : { *(.got) } | 51 | |
| 58 | .plt : { *(.plt) } | 52 | .dynamic : { *(.dynamic) } :text :dynamic |
| 59 | 53 | .got : { *(.got) } | |
| 60 | _end = .; | 54 | .plt : { *(.plt) } |
| 61 | __end = .; | 55 | |
| 62 | PROVIDE (end = .); | 56 | _end = .; |
| 63 | 57 | __end = .; | |
| 64 | 58 | PROVIDE(end = .); | |
| 65 | /* Stabs debugging sections are here too | 59 | |
| 66 | */ | 60 | /* |
| 67 | .stab 0 : { *(.stab) } | 61 | * Stabs debugging sections are here too. |
| 68 | .stabstr 0 : { *(.stabstr) } | 62 | */ |
| 69 | .stab.excl 0 : { *(.stab.excl) } | 63 | .stab 0 : { *(.stab) } |
| 70 | .stab.exclstr 0 : { *(.stab.exclstr) } | 64 | .stabstr 0 : { *(.stabstr) } |
| 71 | .stab.index 0 : { *(.stab.index) } | 65 | .stab.excl 0 : { *(.stab.excl) } |
| 72 | .stab.indexstr 0 : { *(.stab.indexstr) } | 66 | .stab.exclstr 0 : { *(.stab.exclstr) } |
| 73 | .comment 0 : { *(.comment) } | 67 | .stab.index 0 : { *(.stab.index) } |
| 74 | .debug 0 : { *(.debug) } | 68 | .stab.indexstr 0 : { *(.stab.indexstr) } |
| 75 | .line 0 : { *(.line) } | 69 | .comment 0 : { *(.comment) } |
| 76 | 70 | ||
| 77 | .debug_srcinfo 0 : { *(.debug_srcinfo) } | 71 | /* |
| 78 | .debug_sfnames 0 : { *(.debug_sfnames) } | 72 | * DWARF debug sections. |
| 79 | 73 | * Symbols in the DWARF debugging sections are relative to the beginning | |
| 80 | .debug_aranges 0 : { *(.debug_aranges) } | 74 | * of the section so we begin them at 0. |
| 81 | .debug_pubnames 0 : { *(.debug_pubnames) } | 75 | */ |
| 82 | 76 | /* DWARF 1 */ | |
| 83 | .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } | 77 | .debug 0 : { *(.debug) } |
| 84 | .debug_abbrev 0 : { *(.debug_abbrev) } | 78 | .line 0 : { *(.line) } |
| 85 | .debug_line 0 : { *(.debug_line) } | 79 | /* GNU DWARF 1 extensions */ |
| 86 | .debug_frame 0 : { *(.debug_frame) } | 80 | .debug_srcinfo 0 : { *(.debug_srcinfo) } |
| 87 | .debug_str 0 : { *(.debug_str) } | 81 | .debug_sfnames 0 : { *(.debug_sfnames) } |
| 88 | .debug_loc 0 : { *(.debug_loc) } | 82 | /* DWARF 1.1 and DWARF 2 */ |
| 89 | .debug_macinfo 0 : { *(.debug_macinfo) } | 83 | .debug_aranges 0 : { *(.debug_aranges) } |
| 90 | 84 | .debug_pubnames 0 : { *(.debug_pubnames) } | |
| 91 | .debug_weaknames 0 : { *(.debug_weaknames) } | 85 | /* DWARF 2 */ |
| 92 | .debug_funcnames 0 : { *(.debug_funcnames) } | 86 | .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } |
| 93 | .debug_typenames 0 : { *(.debug_typenames) } | 87 | .debug_abbrev 0 : { *(.debug_abbrev) } |
| 94 | .debug_varnames 0 : { *(.debug_varnames) } | 88 | .debug_line 0 : { *(.debug_line) } |
| 95 | 89 | .debug_frame 0 : { *(.debug_frame) } | |
| 96 | /DISCARD/ : { *(.note.GNU-stack) } | 90 | .debug_str 0 : { *(.debug_str) } |
| 97 | /DISCARD/ : { *(.data .data.* .gnu.linkonce.d.* .sdata*) } | 91 | .debug_loc 0 : { *(.debug_loc) } |
| 98 | /DISCARD/ : { *(.bss .sbss .dynbss .dynsbss) } | 92 | .debug_macinfo 0 : { *(.debug_macinfo) } |
| 93 | /* SGI/MIPS DWARF 2 extensions */ | ||
| 94 | .debug_weaknames 0 : { *(.debug_weaknames) } | ||
| 95 | .debug_funcnames 0 : { *(.debug_funcnames) } | ||
| 96 | .debug_typenames 0 : { *(.debug_typenames) } | ||
| 97 | .debug_varnames 0 : { *(.debug_varnames) } | ||
| 98 | |||
| 99 | /DISCARD/ : { | ||
| 100 | *(.note.GNU-stack) | ||
| 101 | *(.data .data.* .gnu.linkonce.d.* .sdata*) | ||
| 102 | *(.bss .sbss .dynbss .dynsbss) | ||
| 103 | } | ||
| 99 | } | 104 | } |
| 100 | 105 | ||
| 106 | /* | ||
| 107 | * Very old versions of ld do not recognize this name token; use the constant. | ||
| 108 | */ | ||
| 109 | #define PT_GNU_EH_FRAME 0x6474e550 | ||
| 101 | 110 | ||
| 111 | /* | ||
| 112 | * We must supply the ELF program headers explicitly to get just one | ||
| 113 | * PT_LOAD segment, and set the flags explicitly to make segments read-only. | ||
| 114 | */ | ||
| 102 | PHDRS | 115 | PHDRS |
| 103 | { | 116 | { |
| 104 | text PT_LOAD FILEHDR PHDRS FLAGS(5); /* PF_R|PF_X */ | 117 | text PT_LOAD FILEHDR PHDRS FLAGS(5); /* PF_R|PF_X */ |
| 105 | note PT_NOTE FLAGS(4); /* PF_R */ | 118 | dynamic PT_DYNAMIC FLAGS(4); /* PF_R */ |
| 106 | dynamic PT_DYNAMIC FLAGS(4); /* PF_R */ | 119 | note PT_NOTE FLAGS(4); /* PF_R */ |
| 107 | eh_frame_hdr 0x6474e550; /* PT_GNU_EH_FRAME, but ld doesn't match the name */ | 120 | eh_frame_hdr PT_GNU_EH_FRAME; |
| 108 | } | 121 | } |
| 109 | 122 | ||
| 110 | |||
| 111 | /* | 123 | /* |
| 112 | * This controls what symbols we export from the DSO. | 124 | * This controls what symbols we export from the DSO. |
| 113 | */ | 125 | */ |
| 114 | VERSION | 126 | VERSION |
| 115 | { | 127 | { |
| 116 | VDSO_VERSION_STRING { | 128 | VDSO_VERSION_STRING { |
| 117 | global: | 129 | global: |
| 118 | __kernel_datapage_offset; /* Has to be there for the kernel to find */ | 130 | /* |
| 119 | __kernel_get_syscall_map; | 131 | * Has to be there for the kernel to find |
| 120 | __kernel_gettimeofday; | 132 | */ |
| 121 | __kernel_clock_gettime; | 133 | __kernel_datapage_offset; |
| 122 | __kernel_clock_getres; | 134 | |
| 123 | __kernel_get_tbfreq; | 135 | __kernel_get_syscall_map; |
| 124 | __kernel_sync_dicache; | 136 | __kernel_gettimeofday; |
| 125 | __kernel_sync_dicache_p5; | 137 | __kernel_clock_gettime; |
| 126 | __kernel_sigtramp32; | 138 | __kernel_clock_getres; |
| 127 | __kernel_sigtramp_rt32; | 139 | __kernel_get_tbfreq; |
| 128 | local: *; | 140 | __kernel_sync_dicache; |
| 129 | }; | 141 | __kernel_sync_dicache_p5; |
| 142 | __kernel_sigtramp32; | ||
| 143 | __kernel_sigtramp_rt32; | ||
| 144 | |||
| 145 | local: *; | ||
| 146 | }; | ||
| 130 | } | 147 | } |
diff --git a/arch/powerpc/kernel/vdso64/vdso64.lds.S b/arch/powerpc/kernel/vdso64/vdso64.lds.S index 2d70f35d50b5..932b3fdb34b9 100644 --- a/arch/powerpc/kernel/vdso64/vdso64.lds.S +++ b/arch/powerpc/kernel/vdso64/vdso64.lds.S | |||
| @@ -10,100 +10,114 @@ ENTRY(_start) | |||
| 10 | 10 | ||
| 11 | SECTIONS | 11 | SECTIONS |
| 12 | { | 12 | { |
| 13 | . = VDSO64_LBASE + SIZEOF_HEADERS; | 13 | . = VDSO64_LBASE + SIZEOF_HEADERS; |
| 14 | .hash : { *(.hash) } :text | 14 | |
| 15 | .gnu.hash : { *(.gnu.hash) } | 15 | .hash : { *(.hash) } :text |
| 16 | .dynsym : { *(.dynsym) } | 16 | .gnu.hash : { *(.gnu.hash) } |
| 17 | .dynstr : { *(.dynstr) } | 17 | .dynsym : { *(.dynsym) } |
| 18 | .gnu.version : { *(.gnu.version) } | 18 | .dynstr : { *(.dynstr) } |
| 19 | .gnu.version_d : { *(.gnu.version_d) } | 19 | .gnu.version : { *(.gnu.version) } |
| 20 | .gnu.version_r : { *(.gnu.version_r) } | 20 | .gnu.version_d : { *(.gnu.version_d) } |
| 21 | 21 | .gnu.version_r : { *(.gnu.version_r) } | |
| 22 | .note : { *(.note.*) } :text :note | 22 | |
| 23 | 23 | .note : { *(.note.*) } :text :note | |
| 24 | . = ALIGN (16); | 24 | |
| 25 | .text : | 25 | . = ALIGN(16); |
| 26 | { | 26 | .text : { |
| 27 | *(.text .stub .text.* .gnu.linkonce.t.*) | 27 | *(.text .stub .text.* .gnu.linkonce.t.*) |
| 28 | *(.sfpr .glink) | 28 | *(.sfpr .glink) |
| 29 | } :text | 29 | } :text |
| 30 | PROVIDE (__etext = .); | 30 | PROVIDE(__etext = .); |
| 31 | PROVIDE (_etext = .); | 31 | PROVIDE(_etext = .); |
| 32 | PROVIDE (etext = .); | 32 | PROVIDE(etext = .); |
| 33 | 33 | ||
| 34 | . = ALIGN(8); | 34 | . = ALIGN(8); |
| 35 | __ftr_fixup : { | 35 | __ftr_fixup : { *(__ftr_fixup) } |
| 36 | *(__ftr_fixup) | 36 | |
| 37 | } | 37 | . = ALIGN(8); |
| 38 | 38 | __fw_ftr_fixup : { *(__fw_ftr_fixup) } | |
| 39 | . = ALIGN(8); | 39 | |
| 40 | __fw_ftr_fixup : { | 40 | /* |
| 41 | *(__fw_ftr_fixup) | 41 | * Other stuff is appended to the text segment: |
| 42 | } | 42 | */ |
| 43 | 43 | .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } | |
| 44 | /* Other stuff is appended to the text segment: */ | 44 | .rodata1 : { *(.rodata1) } |
| 45 | .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } | 45 | |
| 46 | .rodata1 : { *(.rodata1) } | 46 | .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr |
| 47 | .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr | 47 | .eh_frame : { KEEP (*(.eh_frame)) } :text |
| 48 | .eh_frame : { KEEP (*(.eh_frame)) } :text | 48 | .gcc_except_table : { *(.gcc_except_table) } |
| 49 | .gcc_except_table : { *(.gcc_except_table) } | 49 | |
| 50 | 50 | .opd ALIGN(8) : { KEEP (*(.opd)) } | |
| 51 | .opd ALIGN(8) : { KEEP (*(.opd)) } | 51 | .got ALIGN(8) : { *(.got .toc) } |
| 52 | .got ALIGN(8) : { *(.got .toc) } | 52 | .rela.dyn ALIGN(8) : { *(.rela.dyn) } |
| 53 | .rela.dyn ALIGN(8) : { *(.rela.dyn) } | 53 | |
| 54 | 54 | .dynamic : { *(.dynamic) } :text :dynamic | |
| 55 | .dynamic : { *(.dynamic) } :text :dynamic | 55 | |
| 56 | 56 | _end = .; | |
| 57 | _end = .; | 57 | PROVIDE(end = .); |
| 58 | PROVIDE (end = .); | 58 | |
| 59 | 59 | /* | |
| 60 | /* Stabs debugging sections are here too | 60 | * Stabs debugging sections are here too. |
| 61 | */ | 61 | */ |
| 62 | .stab 0 : { *(.stab) } | 62 | .stab 0 : { *(.stab) } |
| 63 | .stabstr 0 : { *(.stabstr) } | 63 | .stabstr 0 : { *(.stabstr) } |
| 64 | .stab.excl 0 : { *(.stab.excl) } | 64 | .stab.excl 0 : { *(.stab.excl) } |
| 65 | .stab.exclstr 0 : { *(.stab.exclstr) } | 65 | .stab.exclstr 0 : { *(.stab.exclstr) } |
| 66 | .stab.index 0 : { *(.stab.index) } | 66 | .stab.index 0 : { *(.stab.index) } |
| 67 | .stab.indexstr 0 : { *(.stab.indexstr) } | 67 | .stab.indexstr 0 : { *(.stab.indexstr) } |
| 68 | .comment 0 : { *(.comment) } | 68 | .comment 0 : { *(.comment) } |
| 69 | /* DWARF debug sectio/ns. | 69 | |
| 70 | Symbols in the DWARF debugging sections are relative to the beginning | 70 | /* |
| 71 | of the section so we begin them at 0. */ | 71 | * DWARF debug sections. |
| 72 | /* DWARF 1 */ | 72 | * Symbols in the DWARF debugging sections are relative to the beginning |
| 73 | .debug 0 : { *(.debug) } | 73 | * of the section so we begin them at 0. |
| 74 | .line 0 : { *(.line) } | 74 | */ |
| 75 | /* GNU DWARF 1 extensions */ | 75 | /* DWARF 1 */ |
| 76 | .debug_srcinfo 0 : { *(.debug_srcinfo) } | 76 | .debug 0 : { *(.debug) } |
| 77 | .debug_sfnames 0 : { *(.debug_sfnames) } | 77 | .line 0 : { *(.line) } |
| 78 | /* DWARF 1.1 and DWARF 2 */ | 78 | /* GNU DWARF 1 extensions */ |
| 79 | .debug_aranges 0 : { *(.debug_aranges) } | 79 | .debug_srcinfo 0 : { *(.debug_srcinfo) } |
| 80 | .debug_pubnames 0 : { *(.debug_pubnames) } | 80 | .debug_sfnames 0 : { *(.debug_sfnames) } |
| 81 | /* DWARF 2 */ | 81 | /* DWARF 1.1 and DWARF 2 */ |
| 82 | .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } | 82 | .debug_aranges 0 : { *(.debug_aranges) } |
| 83 | .debug_abbrev 0 : { *(.debug_abbrev) } | 83 | .debug_pubnames 0 : { *(.debug_pubnames) } |
| 84 | .debug_line 0 : { *(.debug_line) } | 84 | /* DWARF 2 */ |
| 85 | .debug_frame 0 : { *(.debug_frame) } | 85 | .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } |
| 86 | .debug_str 0 : { *(.debug_str) } | 86 | .debug_abbrev 0 : { *(.debug_abbrev) } |
| 87 | .debug_loc 0 : { *(.debug_loc) } | 87 | .debug_line 0 : { *(.debug_line) } |
| 88 | .debug_macinfo 0 : { *(.debug_macinfo) } | 88 | .debug_frame 0 : { *(.debug_frame) } |
| 89 | /* SGI/MIPS DWARF 2 extensions */ | 89 | .debug_str 0 : { *(.debug_str) } |
| 90 | .debug_weaknames 0 : { *(.debug_weaknames) } | 90 | .debug_loc 0 : { *(.debug_loc) } |
| 91 | .debug_funcnames 0 : { *(.debug_funcnames) } | 91 | .debug_macinfo 0 : { *(.debug_macinfo) } |
| 92 | .debug_typenames 0 : { *(.debug_typenames) } | 92 | /* SGI/MIPS DWARF 2 extensions */ |
| 93 | .debug_varnames 0 : { *(.debug_varnames) } | 93 | .debug_weaknames 0 : { *(.debug_weaknames) } |
| 94 | 94 | .debug_funcnames 0 : { *(.debug_funcnames) } | |
| 95 | /DISCARD/ : { *(.note.GNU-stack) } | 95 | .debug_typenames 0 : { *(.debug_typenames) } |
| 96 | /DISCARD/ : { *(.branch_lt) } | 96 | .debug_varnames 0 : { *(.debug_varnames) } |
| 97 | /DISCARD/ : { *(.data .data.* .gnu.linkonce.d.*) } | 97 | |
| 98 | /DISCARD/ : { *(.bss .sbss .dynbss .dynsbss) } | 98 | /DISCARD/ : { |
| 99 | *(.note.GNU-stack) | ||
| 100 | *(.branch_lt) | ||
| 101 | *(.data .data.* .gnu.linkonce.d.* .sdata*) | ||
| 102 | *(.bss .sbss .dynbss .dynsbss) | ||
| 103 | } | ||
| 99 | } | 104 | } |
| 100 | 105 | ||
| 106 | /* | ||
| 107 | * Very old versions of ld do not recognize this name token; use the constant. | ||
| 108 | */ | ||
| 109 | #define PT_GNU_EH_FRAME 0x6474e550 | ||
| 110 | |||
| 111 | /* | ||
| 112 | * We must supply the ELF program headers explicitly to get just one | ||
| 113 | * PT_LOAD segment, and set the flags explicitly to make segments read-only. | ||
| 114 | */ | ||
| 101 | PHDRS | 115 | PHDRS |
| 102 | { | 116 | { |
| 103 | text PT_LOAD FILEHDR PHDRS FLAGS(5); /* PF_R|PF_X */ | 117 | text PT_LOAD FILEHDR PHDRS FLAGS(5); /* PF_R|PF_X */ |
| 104 | note PT_NOTE FLAGS(4); /* PF_R */ | 118 | dynamic PT_DYNAMIC FLAGS(4); /* PF_R */ |
| 105 | dynamic PT_DYNAMIC FLAGS(4); /* PF_R */ | 119 | note PT_NOTE FLAGS(4); /* PF_R */ |
| 106 | eh_frame_hdr 0x6474e550; /* PT_GNU_EH_FRAME, but ld doesn't match the name */ | 120 | eh_frame_hdr PT_GNU_EH_FRAME; |
| 107 | } | 121 | } |
| 108 | 122 | ||
| 109 | /* | 123 | /* |
| @@ -111,17 +125,22 @@ PHDRS | |||
| 111 | */ | 125 | */ |
| 112 | VERSION | 126 | VERSION |
| 113 | { | 127 | { |
| 114 | VDSO_VERSION_STRING { | 128 | VDSO_VERSION_STRING { |
| 115 | global: | 129 | global: |
| 116 | __kernel_datapage_offset; /* Has to be there for the kernel to find */ | 130 | /* |
| 117 | __kernel_get_syscall_map; | 131 | * Has to be there for the kernel to find |
| 118 | __kernel_gettimeofday; | 132 | */ |
| 119 | __kernel_clock_gettime; | 133 | __kernel_datapage_offset; |
| 120 | __kernel_clock_getres; | 134 | |
| 121 | __kernel_get_tbfreq; | 135 | __kernel_get_syscall_map; |
| 122 | __kernel_sync_dicache; | 136 | __kernel_gettimeofday; |
| 123 | __kernel_sync_dicache_p5; | 137 | __kernel_clock_gettime; |
| 124 | __kernel_sigtramp_rt64; | 138 | __kernel_clock_getres; |
| 125 | local: *; | 139 | __kernel_get_tbfreq; |
| 126 | }; | 140 | __kernel_sync_dicache; |
| 141 | __kernel_sync_dicache_p5; | ||
| 142 | __kernel_sigtramp_rt64; | ||
| 143 | |||
| 144 | local: *; | ||
| 145 | }; | ||
| 127 | } | 146 | } |
diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c index fa90f6561b9f..29ed495444f5 100644 --- a/arch/powerpc/mm/init_64.c +++ b/arch/powerpc/mm/init_64.c | |||
| @@ -183,3 +183,70 @@ void pgtable_cache_init(void) | |||
| 183 | zero_ctor); | 183 | zero_ctor); |
| 184 | } | 184 | } |
| 185 | } | 185 | } |
| 186 | |||
| 187 | #ifdef CONFIG_SPARSEMEM_VMEMMAP | ||
| 188 | /* | ||
| 189 | * Given an address within the vmemmap, determine the pfn of the page that | ||
| 190 | * represents the start of the section it is within. Note that we have to | ||
| 191 | * do this by hand as the proffered address may not be correctly aligned. | ||
| 192 | * Subtraction of non-aligned pointers produces undefined results. | ||
| 193 | */ | ||
| 194 | unsigned long __meminit vmemmap_section_start(unsigned long page) | ||
| 195 | { | ||
| 196 | unsigned long offset = page - ((unsigned long)(vmemmap)); | ||
| 197 | |||
| 198 | /* Return the pfn of the start of the section. */ | ||
| 199 | return (offset / sizeof(struct page)) & PAGE_SECTION_MASK; | ||
| 200 | } | ||
| 201 | |||
| 202 | /* | ||
| 203 | * Check if this vmemmap page is already initialised. If any section | ||
| 204 | * which overlaps this vmemmap page is initialised then this page is | ||
| 205 | * initialised already. | ||
| 206 | */ | ||
| 207 | int __meminit vmemmap_populated(unsigned long start, int page_size) | ||
| 208 | { | ||
| 209 | unsigned long end = start + page_size; | ||
| 210 | |||
| 211 | for (; start < end; start += (PAGES_PER_SECTION * sizeof(struct page))) | ||
| 212 | if (pfn_valid(vmemmap_section_start(start))) | ||
| 213 | return 1; | ||
| 214 | |||
| 215 | return 0; | ||
| 216 | } | ||
| 217 | |||
| 218 | int __meminit vmemmap_populate(struct page *start_page, | ||
| 219 | unsigned long nr_pages, int node) | ||
| 220 | { | ||
| 221 | unsigned long mode_rw; | ||
| 222 | unsigned long start = (unsigned long)start_page; | ||
| 223 | unsigned long end = (unsigned long)(start_page + nr_pages); | ||
| 224 | unsigned long page_size = 1 << mmu_psize_defs[mmu_linear_psize].shift; | ||
| 225 | |||
| 226 | mode_rw = _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_COHERENT | PP_RWXX; | ||
| 227 | |||
| 228 | /* Align to the page size of the linear mapping. */ | ||
| 229 | start = _ALIGN_DOWN(start, page_size); | ||
| 230 | |||
| 231 | for (; start < end; start += page_size) { | ||
| 232 | int mapped; | ||
| 233 | void *p; | ||
| 234 | |||
| 235 | if (vmemmap_populated(start, page_size)) | ||
| 236 | continue; | ||
| 237 | |||
| 238 | p = vmemmap_alloc_block(page_size, node); | ||
| 239 | if (!p) | ||
| 240 | return -ENOMEM; | ||
| 241 | |||
| 242 | printk(KERN_WARNING "vmemmap %08lx allocated at %p, " | ||
| 243 | "physical %p.\n", start, p, __pa(p)); | ||
| 244 | |||
| 245 | mapped = htab_bolt_mapping(start, start + page_size, | ||
| 246 | __pa(p), mode_rw, mmu_linear_psize); | ||
| 247 | BUG_ON(mapped < 0); | ||
| 248 | } | ||
| 249 | |||
| 250 | return 0; | ||
| 251 | } | ||
| 252 | #endif | ||
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c index 32dcfc9b0082..81eb96ec13b2 100644 --- a/arch/powerpc/mm/mem.c +++ b/arch/powerpc/mm/mem.c | |||
| @@ -129,51 +129,6 @@ int __devinit arch_add_memory(int nid, u64 start, u64 size) | |||
| 129 | return __add_pages(zone, start_pfn, nr_pages); | 129 | return __add_pages(zone, start_pfn, nr_pages); |
| 130 | } | 130 | } |
| 131 | 131 | ||
| 132 | /* | ||
| 133 | * First pass at this code will check to determine if the remove | ||
| 134 | * request is within the RMO. Do not allow removal within the RMO. | ||
| 135 | */ | ||
| 136 | int __devinit remove_memory(u64 start, u64 size) | ||
| 137 | { | ||
| 138 | struct zone *zone; | ||
| 139 | unsigned long start_pfn, end_pfn, nr_pages; | ||
| 140 | |||
| 141 | start_pfn = start >> PAGE_SHIFT; | ||
| 142 | nr_pages = size >> PAGE_SHIFT; | ||
| 143 | end_pfn = start_pfn + nr_pages; | ||
| 144 | |||
| 145 | printk("%s(): Attempting to remove memoy in range " | ||
| 146 | "%lx to %lx\n", __func__, start, start+size); | ||
| 147 | /* | ||
| 148 | * check for range within RMO | ||
| 149 | */ | ||
| 150 | zone = page_zone(pfn_to_page(start_pfn)); | ||
| 151 | |||
| 152 | printk("%s(): memory will be removed from " | ||
| 153 | "the %s zone\n", __func__, zone->name); | ||
| 154 | |||
| 155 | /* | ||
| 156 | * not handling removing memory ranges that | ||
| 157 | * overlap multiple zones yet | ||
| 158 | */ | ||
| 159 | if (end_pfn > (zone->zone_start_pfn + zone->spanned_pages)) | ||
| 160 | goto overlap; | ||
| 161 | |||
| 162 | /* make sure it is NOT in RMO */ | ||
| 163 | if ((start < lmb.rmo_size) || ((start+size) < lmb.rmo_size)) { | ||
| 164 | printk("%s(): range to be removed must NOT be in RMO!\n", | ||
| 165 | __func__); | ||
| 166 | goto in_rmo; | ||
| 167 | } | ||
| 168 | |||
| 169 | return __remove_pages(zone, start_pfn, nr_pages); | ||
| 170 | |||
| 171 | overlap: | ||
| 172 | printk("%s(): memory range to be removed overlaps " | ||
| 173 | "multiple zones!!!\n", __func__); | ||
| 174 | in_rmo: | ||
| 175 | return -1; | ||
| 176 | } | ||
| 177 | #endif /* CONFIG_MEMORY_HOTPLUG */ | 132 | #endif /* CONFIG_MEMORY_HOTPLUG */ |
| 178 | 133 | ||
| 179 | void show_mem(void) | 134 | void show_mem(void) |
diff --git a/arch/powerpc/platforms/cell/cbe_cpufreq.c b/arch/powerpc/platforms/cell/cbe_cpufreq.c index 5123e9d4164b..13d5a87f13b1 100644 --- a/arch/powerpc/platforms/cell/cbe_cpufreq.c +++ b/arch/powerpc/platforms/cell/cbe_cpufreq.c | |||
| @@ -117,7 +117,7 @@ static int cbe_cpufreq_cpu_init(struct cpufreq_policy *policy) | |||
| 117 | policy->cur = cbe_freqs[cur_pmode].frequency; | 117 | policy->cur = cbe_freqs[cur_pmode].frequency; |
| 118 | 118 | ||
| 119 | #ifdef CONFIG_SMP | 119 | #ifdef CONFIG_SMP |
| 120 | policy->cpus = cpu_sibling_map[policy->cpu]; | 120 | policy->cpus = per_cpu(cpu_sibling_map, policy->cpu); |
| 121 | #endif | 121 | #endif |
| 122 | 122 | ||
| 123 | cpufreq_frequency_table_get_attr(cbe_freqs, policy->cpu); | 123 | cpufreq_frequency_table_get_attr(cbe_freqs, policy->cpu); |
