aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Daney <david.daney@cavium.com>2012-07-19 03:11:14 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-08-01 15:26:54 -0400
commit689415c18f0ca810c48fe907ab4a349b40d66df0 (patch)
tree1a2e3500d82fc77e88f318720c73499414be3469
parent6d40de834ce9bb2964a70b7f91a98406eceb0399 (diff)
MIPS: Properly align the .data..init_task section.
commit 7b1c0d26a8e272787f0f9fcc5f3e8531df3b3409 upstream. Improper alignment can lead to unbootable systems and/or random crashes. [ralf@linux-mips.org: This is a lond standing bug since 6eb10bc9e2deab06630261cd05c4cb1e9a60e980 (kernel.org) rsp. c422a10917f75fd19fa7fe070aaaa23e384dae6f (lmo) [MIPS: Clean up linker script using new linker script macros.] so dates back to 2.6.32.] Signed-off-by: David Daney <david.daney@cavium.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/3881/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--arch/mips/include/asm/thread_info.h4
-rw-r--r--arch/mips/kernel/vmlinux.lds.S3
2 files changed, 4 insertions, 3 deletions
diff --git a/arch/mips/include/asm/thread_info.h b/arch/mips/include/asm/thread_info.h
index 97f8bf6639e..adda036bba1 100644
--- a/arch/mips/include/asm/thread_info.h
+++ b/arch/mips/include/asm/thread_info.h
@@ -60,6 +60,8 @@ struct thread_info {
60register struct thread_info *__current_thread_info __asm__("$28"); 60register struct thread_info *__current_thread_info __asm__("$28");
61#define current_thread_info() __current_thread_info 61#define current_thread_info() __current_thread_info
62 62
63#endif /* !__ASSEMBLY__ */
64
63/* thread information allocation */ 65/* thread information allocation */
64#if defined(CONFIG_PAGE_SIZE_4KB) && defined(CONFIG_32BIT) 66#if defined(CONFIG_PAGE_SIZE_4KB) && defined(CONFIG_32BIT)
65#define THREAD_SIZE_ORDER (1) 67#define THREAD_SIZE_ORDER (1)
@@ -97,8 +99,6 @@ register struct thread_info *__current_thread_info __asm__("$28");
97 99
98#define free_thread_info(info) kfree(info) 100#define free_thread_info(info) kfree(info)
99 101
100#endif /* !__ASSEMBLY__ */
101
102#define PREEMPT_ACTIVE 0x10000000 102#define PREEMPT_ACTIVE 0x10000000
103 103
104/* 104/*
diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S
index a81176f44c7..be281c69f6c 100644
--- a/arch/mips/kernel/vmlinux.lds.S
+++ b/arch/mips/kernel/vmlinux.lds.S
@@ -1,5 +1,6 @@
1#include <asm/asm-offsets.h> 1#include <asm/asm-offsets.h>
2#include <asm/page.h> 2#include <asm/page.h>
3#include <asm/thread_info.h>
3#include <asm-generic/vmlinux.lds.h> 4#include <asm-generic/vmlinux.lds.h>
4 5
5#undef mips 6#undef mips
@@ -73,7 +74,7 @@ SECTIONS
73 .data : { /* Data */ 74 .data : { /* Data */
74 . = . + DATAOFFSET; /* for CONFIG_MAPPED_KERNEL */ 75 . = . + DATAOFFSET; /* for CONFIG_MAPPED_KERNEL */
75 76
76 INIT_TASK_DATA(PAGE_SIZE) 77 INIT_TASK_DATA(THREAD_SIZE)
77 NOSAVE_DATA 78 NOSAVE_DATA
78 CACHELINE_ALIGNED_DATA(1 << CONFIG_MIPS_L1_CACHE_SHIFT) 79 CACHELINE_ALIGNED_DATA(1 << CONFIG_MIPS_L1_CACHE_SHIFT)
79 READ_MOSTLY_DATA(1 << CONFIG_MIPS_L1_CACHE_SHIFT) 80 READ_MOSTLY_DATA(1 << CONFIG_MIPS_L1_CACHE_SHIFT)