diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-09-03 20:36:37 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-09-03 20:36:37 -0400 |
commit | 3e25a2d90e7e303168540c5ecb726297940cb172 (patch) | |
tree | 14575147133b9e1dfab74d55a48cc05c25bec5b9 /arch | |
parent | 316343e2cfd9a4bb4c70d0e1991e7a74840fe29e (diff) | |
parent | 7888bc2b4778fda267a6e6422c4497dba865a47a (diff) |
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc:
powerpc: Fix for getting CPU number in power_save_ppc32_restore()
powerpc: Fix build error with 64K pages and !hugetlbfs
powerpc: Work around gcc's -fno-omit-frame-pointer bug
powerpc: Make sure _etext is after all kernel text
powerpc: Only make kernel text pages of linear mapping executable
powerpc: Fix uninitialised variable in VSX alignment code
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/Makefile | 5 | ||||
-rw-r--r-- | arch/powerpc/include/asm/pgtable-ppc64.h | 6 | ||||
-rw-r--r-- | arch/powerpc/kernel/Makefile | 7 | ||||
-rw-r--r-- | arch/powerpc/kernel/align.c | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/idle_6xx.S | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/idle_e500.S | 3 | ||||
-rw-r--r-- | arch/powerpc/kernel/vmlinux.lds.S | 7 | ||||
-rw-r--r-- | arch/powerpc/mm/hash_utils_64.c | 18 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/Makefile | 2 |
9 files changed, 31 insertions, 21 deletions
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index 9155c9312c1e..c6be19e9ceae 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile | |||
@@ -116,6 +116,11 @@ ifeq ($(CONFIG_6xx),y) | |||
116 | KBUILD_CFLAGS += -mcpu=powerpc | 116 | KBUILD_CFLAGS += -mcpu=powerpc |
117 | endif | 117 | endif |
118 | 118 | ||
119 | # Work around a gcc code-gen bug with -fno-omit-frame-pointer. | ||
120 | ifeq ($(CONFIG_FTRACE),y) | ||
121 | KBUILD_CFLAGS += -mno-sched-epilog | ||
122 | endif | ||
123 | |||
119 | cpu-as-$(CONFIG_4xx) += -Wa,-m405 | 124 | cpu-as-$(CONFIG_4xx) += -Wa,-m405 |
120 | cpu-as-$(CONFIG_6xx) += -Wa,-maltivec | 125 | cpu-as-$(CONFIG_6xx) += -Wa,-maltivec |
121 | cpu-as-$(CONFIG_POWER4) += -Wa,-maltivec | 126 | cpu-as-$(CONFIG_POWER4) += -Wa,-maltivec |
diff --git a/arch/powerpc/include/asm/pgtable-ppc64.h b/arch/powerpc/include/asm/pgtable-ppc64.h index db0b8f3b8807..4597c491e9b5 100644 --- a/arch/powerpc/include/asm/pgtable-ppc64.h +++ b/arch/powerpc/include/asm/pgtable-ppc64.h | |||
@@ -153,12 +153,10 @@ | |||
153 | #define __S110 PAGE_SHARED_X | 153 | #define __S110 PAGE_SHARED_X |
154 | #define __S111 PAGE_SHARED_X | 154 | #define __S111 PAGE_SHARED_X |
155 | 155 | ||
156 | #ifdef CONFIG_HUGETLB_PAGE | 156 | #ifdef CONFIG_PPC_MM_SLICES |
157 | |||
158 | #define HAVE_ARCH_UNMAPPED_AREA | 157 | #define HAVE_ARCH_UNMAPPED_AREA |
159 | #define HAVE_ARCH_UNMAPPED_AREA_TOPDOWN | 158 | #define HAVE_ARCH_UNMAPPED_AREA_TOPDOWN |
160 | 159 | #endif /* CONFIG_PPC_MM_SLICES */ | |
161 | #endif | ||
162 | 160 | ||
163 | #ifndef __ASSEMBLY__ | 161 | #ifndef __ASSEMBLY__ |
164 | 162 | ||
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile index 64f5948ebc9d..946daea780f1 100644 --- a/arch/powerpc/kernel/Makefile +++ b/arch/powerpc/kernel/Makefile | |||
@@ -14,12 +14,13 @@ endif | |||
14 | 14 | ||
15 | ifdef CONFIG_FTRACE | 15 | ifdef CONFIG_FTRACE |
16 | # Do not trace early boot code | 16 | # Do not trace early boot code |
17 | CFLAGS_REMOVE_cputable.o = -pg | 17 | CFLAGS_REMOVE_cputable.o = -pg -mno-sched-epilog |
18 | CFLAGS_REMOVE_prom_init.o = -pg | 18 | CFLAGS_REMOVE_prom_init.o = -pg -mno-sched-epilog |
19 | CFLAGS_REMOVE_btext.o = -pg -mno-sched-epilog | ||
19 | 20 | ||
20 | ifdef CONFIG_DYNAMIC_FTRACE | 21 | ifdef CONFIG_DYNAMIC_FTRACE |
21 | # dynamic ftrace setup. | 22 | # dynamic ftrace setup. |
22 | CFLAGS_REMOVE_ftrace.o = -pg | 23 | CFLAGS_REMOVE_ftrace.o = -pg -mno-sched-epilog |
23 | endif | 24 | endif |
24 | 25 | ||
25 | endif | 26 | endif |
diff --git a/arch/powerpc/kernel/align.c b/arch/powerpc/kernel/align.c index 367129789cc0..5af4e9b2dbe2 100644 --- a/arch/powerpc/kernel/align.c +++ b/arch/powerpc/kernel/align.c | |||
@@ -647,7 +647,7 @@ static int emulate_vsx(unsigned char __user *addr, unsigned int reg, | |||
647 | unsigned int flags, unsigned int length) | 647 | unsigned int flags, unsigned int length) |
648 | { | 648 | { |
649 | char *ptr = (char *) ¤t->thread.TS_FPR(reg); | 649 | char *ptr = (char *) ¤t->thread.TS_FPR(reg); |
650 | int ret; | 650 | int ret = 0; |
651 | 651 | ||
652 | flush_vsx_to_thread(current); | 652 | flush_vsx_to_thread(current); |
653 | 653 | ||
diff --git a/arch/powerpc/kernel/idle_6xx.S b/arch/powerpc/kernel/idle_6xx.S index 019b02d8844f..15c611de1ee2 100644 --- a/arch/powerpc/kernel/idle_6xx.S +++ b/arch/powerpc/kernel/idle_6xx.S | |||
@@ -158,7 +158,7 @@ _GLOBAL(power_save_ppc32_restore) | |||
158 | stw r9,_NIP(r11) /* make it do a blr */ | 158 | stw r9,_NIP(r11) /* make it do a blr */ |
159 | 159 | ||
160 | #ifdef CONFIG_SMP | 160 | #ifdef CONFIG_SMP |
161 | mfspr r12,SPRN_SPRG3 | 161 | rlwinm r12,r11,0,0,31-THREAD_SHIFT |
162 | lwz r11,TI_CPU(r12) /* get cpu number * 4 */ | 162 | lwz r11,TI_CPU(r12) /* get cpu number * 4 */ |
163 | slwi r11,r11,2 | 163 | slwi r11,r11,2 |
164 | #else | 164 | #else |
diff --git a/arch/powerpc/kernel/idle_e500.S b/arch/powerpc/kernel/idle_e500.S index 06304034b393..47a1a983ff88 100644 --- a/arch/powerpc/kernel/idle_e500.S +++ b/arch/powerpc/kernel/idle_e500.S | |||
@@ -84,10 +84,11 @@ _GLOBAL(power_save_ppc32_restore) | |||
84 | stw r9,_NIP(r11) /* make it do a blr */ | 84 | stw r9,_NIP(r11) /* make it do a blr */ |
85 | 85 | ||
86 | #ifdef CONFIG_SMP | 86 | #ifdef CONFIG_SMP |
87 | mfspr r12,SPRN_SPRG3 | 87 | rlwinm r12,r1,0,0,31-THREAD_SHIFT |
88 | lwz r11,TI_CPU(r12) /* get cpu number * 4 */ | 88 | lwz r11,TI_CPU(r12) /* get cpu number * 4 */ |
89 | slwi r11,r11,2 | 89 | slwi r11,r11,2 |
90 | #else | 90 | #else |
91 | li r11,0 | 91 | li r11,0 |
92 | #endif | 92 | #endif |
93 | |||
93 | b transfer_to_handler_cont | 94 | b transfer_to_handler_cont |
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S index 4a8ce62fe112..9f6c1ca1739e 100644 --- a/arch/powerpc/kernel/vmlinux.lds.S +++ b/arch/powerpc/kernel/vmlinux.lds.S | |||
@@ -66,11 +66,12 @@ SECTIONS | |||
66 | __got2_end = .; | 66 | __got2_end = .; |
67 | #endif /* CONFIG_PPC32 */ | 67 | #endif /* CONFIG_PPC32 */ |
68 | 68 | ||
69 | . = ALIGN(PAGE_SIZE); | ||
70 | _etext = .; | ||
71 | PROVIDE32 (etext = .); | ||
72 | } :kernel | 69 | } :kernel |
73 | 70 | ||
71 | . = ALIGN(PAGE_SIZE); | ||
72 | _etext = .; | ||
73 | PROVIDE32 (etext = .); | ||
74 | |||
74 | /* Read-only data */ | 75 | /* Read-only data */ |
75 | RODATA | 76 | RODATA |
76 | 77 | ||
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c index 14be408dfc9b..8920eea34528 100644 --- a/arch/powerpc/mm/hash_utils_64.c +++ b/arch/powerpc/mm/hash_utils_64.c | |||
@@ -191,12 +191,17 @@ int htab_bolt_mapping(unsigned long vstart, unsigned long vend, | |||
191 | unsigned long hash, hpteg; | 191 | unsigned long hash, hpteg; |
192 | unsigned long vsid = get_kernel_vsid(vaddr, ssize); | 192 | unsigned long vsid = get_kernel_vsid(vaddr, ssize); |
193 | unsigned long va = hpt_va(vaddr, vsid, ssize); | 193 | unsigned long va = hpt_va(vaddr, vsid, ssize); |
194 | unsigned long tprot = prot; | ||
195 | |||
196 | /* Make kernel text executable */ | ||
197 | if (in_kernel_text(vaddr)) | ||
198 | tprot &= ~HPTE_R_N; | ||
194 | 199 | ||
195 | hash = hpt_hash(va, shift, ssize); | 200 | hash = hpt_hash(va, shift, ssize); |
196 | hpteg = ((hash & htab_hash_mask) * HPTES_PER_GROUP); | 201 | hpteg = ((hash & htab_hash_mask) * HPTES_PER_GROUP); |
197 | 202 | ||
198 | BUG_ON(!ppc_md.hpte_insert); | 203 | BUG_ON(!ppc_md.hpte_insert); |
199 | ret = ppc_md.hpte_insert(hpteg, va, paddr, prot, | 204 | ret = ppc_md.hpte_insert(hpteg, va, paddr, tprot, |
200 | HPTE_V_BOLTED, psize, ssize); | 205 | HPTE_V_BOLTED, psize, ssize); |
201 | 206 | ||
202 | if (ret < 0) | 207 | if (ret < 0) |
@@ -584,7 +589,7 @@ void __init htab_initialize(void) | |||
584 | { | 589 | { |
585 | unsigned long table; | 590 | unsigned long table; |
586 | unsigned long pteg_count; | 591 | unsigned long pteg_count; |
587 | unsigned long prot, tprot; | 592 | unsigned long prot; |
588 | unsigned long base = 0, size = 0, limit; | 593 | unsigned long base = 0, size = 0, limit; |
589 | int i; | 594 | int i; |
590 | 595 | ||
@@ -660,10 +665,9 @@ void __init htab_initialize(void) | |||
660 | for (i=0; i < lmb.memory.cnt; i++) { | 665 | for (i=0; i < lmb.memory.cnt; i++) { |
661 | base = (unsigned long)__va(lmb.memory.region[i].base); | 666 | base = (unsigned long)__va(lmb.memory.region[i].base); |
662 | size = lmb.memory.region[i].size; | 667 | size = lmb.memory.region[i].size; |
663 | tprot = prot | (in_kernel_text(base) ? _PAGE_EXEC : 0); | ||
664 | 668 | ||
665 | DBG("creating mapping for region: %lx..%lx (prot: %x)\n", | 669 | DBG("creating mapping for region: %lx..%lx (prot: %x)\n", |
666 | base, size, tprot); | 670 | base, size, prot); |
667 | 671 | ||
668 | #ifdef CONFIG_U3_DART | 672 | #ifdef CONFIG_U3_DART |
669 | /* Do not map the DART space. Fortunately, it will be aligned | 673 | /* Do not map the DART space. Fortunately, it will be aligned |
@@ -680,21 +684,21 @@ void __init htab_initialize(void) | |||
680 | unsigned long dart_table_end = dart_tablebase + 16 * MB; | 684 | unsigned long dart_table_end = dart_tablebase + 16 * MB; |
681 | if (base != dart_tablebase) | 685 | if (base != dart_tablebase) |
682 | BUG_ON(htab_bolt_mapping(base, dart_tablebase, | 686 | BUG_ON(htab_bolt_mapping(base, dart_tablebase, |
683 | __pa(base), tprot, | 687 | __pa(base), prot, |
684 | mmu_linear_psize, | 688 | mmu_linear_psize, |
685 | mmu_kernel_ssize)); | 689 | mmu_kernel_ssize)); |
686 | if ((base + size) > dart_table_end) | 690 | if ((base + size) > dart_table_end) |
687 | BUG_ON(htab_bolt_mapping(dart_tablebase+16*MB, | 691 | BUG_ON(htab_bolt_mapping(dart_tablebase+16*MB, |
688 | base + size, | 692 | base + size, |
689 | __pa(dart_table_end), | 693 | __pa(dart_table_end), |
690 | tprot, | 694 | prot, |
691 | mmu_linear_psize, | 695 | mmu_linear_psize, |
692 | mmu_kernel_ssize)); | 696 | mmu_kernel_ssize)); |
693 | continue; | 697 | continue; |
694 | } | 698 | } |
695 | #endif /* CONFIG_U3_DART */ | 699 | #endif /* CONFIG_U3_DART */ |
696 | BUG_ON(htab_bolt_mapping(base, base + size, __pa(base), | 700 | BUG_ON(htab_bolt_mapping(base, base + size, __pa(base), |
697 | tprot, mmu_linear_psize, mmu_kernel_ssize)); | 701 | prot, mmu_linear_psize, mmu_kernel_ssize)); |
698 | } | 702 | } |
699 | 703 | ||
700 | /* | 704 | /* |
diff --git a/arch/powerpc/platforms/powermac/Makefile b/arch/powerpc/platforms/powermac/Makefile index 58ecdd72630f..be60d64be7ad 100644 --- a/arch/powerpc/platforms/powermac/Makefile +++ b/arch/powerpc/platforms/powermac/Makefile | |||
@@ -2,7 +2,7 @@ CFLAGS_bootx_init.o += -fPIC | |||
2 | 2 | ||
3 | ifdef CONFIG_FTRACE | 3 | ifdef CONFIG_FTRACE |
4 | # Do not trace early boot code | 4 | # Do not trace early boot code |
5 | CFLAGS_REMOVE_bootx_init.o = -pg | 5 | CFLAGS_REMOVE_bootx_init.o = -pg -mno-sched-epilog |
6 | endif | 6 | endif |
7 | 7 | ||
8 | obj-y += pic.o setup.o time.o feature.o pci.o \ | 8 | obj-y += pic.o setup.o time.o feature.o pci.o \ |