diff options
author | Paul Burton <paul.burton@imgtec.com> | 2014-07-11 11:46:54 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2014-08-01 18:06:44 -0400 |
commit | 37cddff8e330a8771afcdab96d9d8ec385584daf (patch) | |
tree | a59241907d2f786c63ac03580b0c67a60dc3c3fc /arch/mips/include/asm/processor.h | |
parent | 762a1f4388a22690cd4f848ba858e5f02d4bfc22 (diff) |
MIPS: 16 byte align MSA vector context
The MSA specification upon first read appears to suggest that it is safe
to perform vector loads & stores with arbitrary alignment. However it
leaves provision for "address-dependent exceptions"... Align the vector
context to a 16 byte boundary to ensure that the kernel cannot cause any
such exceptions.
Note that the fpu field of struct thread_struct was already at a 16 byte
boundary within the struct, the introduction of FPU_ALIGN simply makes
the requirement explicit. The only part of this impacting the generated
kernel binary is ARCH_MIN_TASKALIGN.
Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/7308/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/include/asm/processor.h')
-rw-r--r-- | arch/mips/include/asm/processor.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/mips/include/asm/processor.h b/arch/mips/include/asm/processor.h index ad70cba8daff..5733faba4f7f 100644 --- a/arch/mips/include/asm/processor.h +++ b/arch/mips/include/asm/processor.h | |||
@@ -238,7 +238,13 @@ typedef struct { | |||
238 | unsigned long seg; | 238 | unsigned long seg; |
239 | } mm_segment_t; | 239 | } mm_segment_t; |
240 | 240 | ||
241 | #define ARCH_MIN_TASKALIGN 8 | 241 | #ifdef CONFIG_CPU_HAS_MSA |
242 | # define ARCH_MIN_TASKALIGN 16 | ||
243 | # define FPU_ALIGN __aligned(16) | ||
244 | #else | ||
245 | # define ARCH_MIN_TASKALIGN 8 | ||
246 | # define FPU_ALIGN | ||
247 | #endif | ||
242 | 248 | ||
243 | struct mips_abi; | 249 | struct mips_abi; |
244 | 250 | ||
@@ -255,7 +261,7 @@ struct thread_struct { | |||
255 | unsigned long cp0_status; | 261 | unsigned long cp0_status; |
256 | 262 | ||
257 | /* Saved fpu/fpu emulator stuff. */ | 263 | /* Saved fpu/fpu emulator stuff. */ |
258 | struct mips_fpu_struct fpu; | 264 | struct mips_fpu_struct fpu FPU_ALIGN; |
259 | #ifdef CONFIG_MIPS_MT_FPAFF | 265 | #ifdef CONFIG_MIPS_MT_FPAFF |
260 | /* Emulated instruction count */ | 266 | /* Emulated instruction count */ |
261 | unsigned long emulated_fp; | 267 | unsigned long emulated_fp; |