diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-12 10:53:06 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-12 10:53:06 -0400 |
| commit | 75c0b3b466388f2fad60fda57b6ca2c4fabbcaf7 (patch) | |
| tree | 11de004529d01abded73a9392715baebab2e2a6d | |
| parent | 3568bd9720b4a775f28a718fcbb462ce2f386988 (diff) | |
| parent | a904f5f9eb7a55baacb2f4c1423cac8a8eb78a3a (diff) | |
Merge branch 'fixes' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'fixes' of master.kernel.org:/home/rmk/linux-2.6-arm:
ARM: 6870/1: The mandatory barrier rmb() must be a dsb() in for device accesses
ARM: 6892/1: handle ptrace requests to change PC during interrupted system calls
ARM: 6890/1: memmap: only free allocated memmap entries when using SPARSEMEM
ARM: zImage: the page table memory must be considered before relocation
ARM: zImage: make sure not to relocate on top of the relocation code
ARM: zImage: Fix bad SP address after relocating kernel
ARM: zImage: make sure the stack is 64-bit aligned
ARM: RiscPC: acornfb: fix section mismatches
ARM: RiscPC: etherh: fix section mismatches
| -rw-r--r-- | arch/arm/boot/compressed/Makefile | 2 | ||||
| -rw-r--r-- | arch/arm/boot/compressed/head.S | 35 | ||||
| -rw-r--r-- | arch/arm/boot/compressed/vmlinux.lds.in | 1 | ||||
| -rw-r--r-- | arch/arm/include/asm/system.h | 2 | ||||
| -rw-r--r-- | arch/arm/kernel/signal.c | 90 | ||||
| -rw-r--r-- | arch/arm/mach-realview/include/mach/barriers.h | 2 | ||||
| -rw-r--r-- | arch/arm/mach-tegra/include/mach/barriers.h | 2 | ||||
| -rw-r--r-- | arch/arm/mm/init.c | 16 | ||||
| -rw-r--r-- | drivers/net/arm/etherh.c | 4 | ||||
| -rw-r--r-- | drivers/video/acornfb.c | 26 |
10 files changed, 109 insertions, 71 deletions
diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile index 8ebbb511c783..0c6852d93506 100644 --- a/arch/arm/boot/compressed/Makefile +++ b/arch/arm/boot/compressed/Makefile | |||
| @@ -74,7 +74,7 @@ ZTEXTADDR := $(CONFIG_ZBOOT_ROM_TEXT) | |||
| 74 | ZBSSADDR := $(CONFIG_ZBOOT_ROM_BSS) | 74 | ZBSSADDR := $(CONFIG_ZBOOT_ROM_BSS) |
| 75 | else | 75 | else |
| 76 | ZTEXTADDR := 0 | 76 | ZTEXTADDR := 0 |
| 77 | ZBSSADDR := ALIGN(4) | 77 | ZBSSADDR := ALIGN(8) |
| 78 | endif | 78 | endif |
| 79 | 79 | ||
| 80 | SEDFLAGS = s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/ | 80 | SEDFLAGS = s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/ |
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S index adf583cd0c35..49f5b2eaaa87 100644 --- a/arch/arm/boot/compressed/head.S +++ b/arch/arm/boot/compressed/head.S | |||
| @@ -179,15 +179,14 @@ not_angel: | |||
| 179 | bl cache_on | 179 | bl cache_on |
| 180 | 180 | ||
| 181 | restart: adr r0, LC0 | 181 | restart: adr r0, LC0 |
| 182 | ldmia r0, {r1, r2, r3, r5, r6, r9, r11, r12} | 182 | ldmia r0, {r1, r2, r3, r6, r9, r11, r12} |
| 183 | ldr sp, [r0, #32] | 183 | ldr sp, [r0, #28] |
| 184 | 184 | ||
| 185 | /* | 185 | /* |
| 186 | * We might be running at a different address. We need | 186 | * We might be running at a different address. We need |
| 187 | * to fix up various pointers. | 187 | * to fix up various pointers. |
| 188 | */ | 188 | */ |
| 189 | sub r0, r0, r1 @ calculate the delta offset | 189 | sub r0, r0, r1 @ calculate the delta offset |
| 190 | add r5, r5, r0 @ _start | ||
| 191 | add r6, r6, r0 @ _edata | 190 | add r6, r6, r0 @ _edata |
| 192 | 191 | ||
| 193 | #ifndef CONFIG_ZBOOT_ROM | 192 | #ifndef CONFIG_ZBOOT_ROM |
| @@ -206,31 +205,40 @@ restart: adr r0, LC0 | |||
| 206 | /* | 205 | /* |
| 207 | * Check to see if we will overwrite ourselves. | 206 | * Check to see if we will overwrite ourselves. |
| 208 | * r4 = final kernel address | 207 | * r4 = final kernel address |
| 209 | * r5 = start of this image | ||
| 210 | * r9 = size of decompressed image | 208 | * r9 = size of decompressed image |
| 211 | * r10 = end of this image, including bss/stack/malloc space if non XIP | 209 | * r10 = end of this image, including bss/stack/malloc space if non XIP |
| 212 | * We basically want: | 210 | * We basically want: |
| 213 | * r4 >= r10 -> OK | 211 | * r4 - 16k page directory >= r10 -> OK |
| 214 | * r4 + image length <= r5 -> OK | 212 | * r4 + image length <= current position (pc) -> OK |
| 215 | */ | 213 | */ |
| 214 | add r10, r10, #16384 | ||
| 216 | cmp r4, r10 | 215 | cmp r4, r10 |
| 217 | bhs wont_overwrite | 216 | bhs wont_overwrite |
| 218 | add r10, r4, r9 | 217 | add r10, r4, r9 |
| 219 | cmp r10, r5 | 218 | ARM( cmp r10, pc ) |
| 219 | THUMB( mov lr, pc ) | ||
| 220 | THUMB( cmp r10, lr ) | ||
| 220 | bls wont_overwrite | 221 | bls wont_overwrite |
| 221 | 222 | ||
| 222 | /* | 223 | /* |
| 223 | * Relocate ourselves past the end of the decompressed kernel. | 224 | * Relocate ourselves past the end of the decompressed kernel. |
| 224 | * r5 = start of this image | ||
| 225 | * r6 = _edata | 225 | * r6 = _edata |
| 226 | * r10 = end of the decompressed kernel | 226 | * r10 = end of the decompressed kernel |
| 227 | * Because we always copy ahead, we need to do it from the end and go | 227 | * Because we always copy ahead, we need to do it from the end and go |
| 228 | * backward in case the source and destination overlap. | 228 | * backward in case the source and destination overlap. |
| 229 | */ | 229 | */ |
| 230 | /* Round up to next 256-byte boundary. */ | 230 | /* |
| 231 | add r10, r10, #256 | 231 | * Bump to the next 256-byte boundary with the size of |
| 232 | * the relocation code added. This avoids overwriting | ||
| 233 | * ourself when the offset is small. | ||
| 234 | */ | ||
| 235 | add r10, r10, #((reloc_code_end - restart + 256) & ~255) | ||
| 232 | bic r10, r10, #255 | 236 | bic r10, r10, #255 |
| 233 | 237 | ||
| 238 | /* Get start of code we want to copy and align it down. */ | ||
| 239 | adr r5, restart | ||
| 240 | bic r5, r5, #31 | ||
| 241 | |||
| 234 | sub r9, r6, r5 @ size to copy | 242 | sub r9, r6, r5 @ size to copy |
| 235 | add r9, r9, #31 @ rounded up to a multiple | 243 | add r9, r9, #31 @ rounded up to a multiple |
| 236 | bic r9, r9, #31 @ ... of 32 bytes | 244 | bic r9, r9, #31 @ ... of 32 bytes |
| @@ -245,6 +253,11 @@ restart: adr r0, LC0 | |||
| 245 | /* Preserve offset to relocated code. */ | 253 | /* Preserve offset to relocated code. */ |
| 246 | sub r6, r9, r6 | 254 | sub r6, r9, r6 |
| 247 | 255 | ||
| 256 | #ifndef CONFIG_ZBOOT_ROM | ||
| 257 | /* cache_clean_flush may use the stack, so relocate it */ | ||
| 258 | add sp, sp, r6 | ||
| 259 | #endif | ||
| 260 | |||
| 248 | bl cache_clean_flush | 261 | bl cache_clean_flush |
| 249 | 262 | ||
| 250 | adr r0, BSYM(restart) | 263 | adr r0, BSYM(restart) |
| @@ -333,7 +346,6 @@ not_relocated: mov r0, #0 | |||
| 333 | LC0: .word LC0 @ r1 | 346 | LC0: .word LC0 @ r1 |
| 334 | .word __bss_start @ r2 | 347 | .word __bss_start @ r2 |
| 335 | .word _end @ r3 | 348 | .word _end @ r3 |
| 336 | .word _start @ r5 | ||
| 337 | .word _edata @ r6 | 349 | .word _edata @ r6 |
| 338 | .word _image_size @ r9 | 350 | .word _image_size @ r9 |
| 339 | .word _got_start @ r11 | 351 | .word _got_start @ r11 |
| @@ -1062,6 +1074,7 @@ memdump: mov r12, r0 | |||
| 1062 | #endif | 1074 | #endif |
| 1063 | 1075 | ||
| 1064 | .ltorg | 1076 | .ltorg |
| 1077 | reloc_code_end: | ||
| 1065 | 1078 | ||
| 1066 | .align | 1079 | .align |
| 1067 | .section ".stack", "aw", %nobits | 1080 | .section ".stack", "aw", %nobits |
diff --git a/arch/arm/boot/compressed/vmlinux.lds.in b/arch/arm/boot/compressed/vmlinux.lds.in index 5309909d7282..ea80abe78844 100644 --- a/arch/arm/boot/compressed/vmlinux.lds.in +++ b/arch/arm/boot/compressed/vmlinux.lds.in | |||
| @@ -54,6 +54,7 @@ SECTIONS | |||
| 54 | .bss : { *(.bss) } | 54 | .bss : { *(.bss) } |
| 55 | _end = .; | 55 | _end = .; |
| 56 | 56 | ||
| 57 | . = ALIGN(8); /* the stack must be 64-bit aligned */ | ||
| 57 | .stack : { *(.stack) } | 58 | .stack : { *(.stack) } |
| 58 | 59 | ||
| 59 | .stab 0 : { *(.stab) } | 60 | .stab 0 : { *(.stab) } |
diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h index 885be097769d..832888d0c20c 100644 --- a/arch/arm/include/asm/system.h +++ b/arch/arm/include/asm/system.h | |||
| @@ -159,7 +159,7 @@ extern unsigned int user_debug; | |||
| 159 | #include <mach/barriers.h> | 159 | #include <mach/barriers.h> |
| 160 | #elif defined(CONFIG_ARM_DMA_MEM_BUFFERABLE) || defined(CONFIG_SMP) | 160 | #elif defined(CONFIG_ARM_DMA_MEM_BUFFERABLE) || defined(CONFIG_SMP) |
| 161 | #define mb() do { dsb(); outer_sync(); } while (0) | 161 | #define mb() do { dsb(); outer_sync(); } while (0) |
| 162 | #define rmb() dmb() | 162 | #define rmb() dsb() |
| 163 | #define wmb() mb() | 163 | #define wmb() mb() |
| 164 | #else | 164 | #else |
| 165 | #include <asm/memory.h> | 165 | #include <asm/memory.h> |
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c index cb8398317644..0340224cf73c 100644 --- a/arch/arm/kernel/signal.c +++ b/arch/arm/kernel/signal.c | |||
| @@ -597,19 +597,13 @@ setup_rt_frame(int usig, struct k_sigaction *ka, siginfo_t *info, | |||
| 597 | return err; | 597 | return err; |
| 598 | } | 598 | } |
| 599 | 599 | ||
| 600 | static inline void setup_syscall_restart(struct pt_regs *regs) | ||
| 601 | { | ||
| 602 | regs->ARM_r0 = regs->ARM_ORIG_r0; | ||
| 603 | regs->ARM_pc -= thumb_mode(regs) ? 2 : 4; | ||
| 604 | } | ||
| 605 | |||
| 606 | /* | 600 | |
