Commit bbaf238b5f910f8f3dda4b96cf844f50b2dcc6fa

Authored by Chris Dearman
Committed by Ralf Baechle
1 parent 4037500ebc

[MIPS] Ensure that ST0_FR is never set on a 32 bit kernel

Signed-off-by: Chris Dearman <chris@mips.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

Showing 2 changed files with 4 additions and 5 deletions Side-by-side Diff

arch/mips/kernel/process.c
... ... @@ -77,9 +77,8 @@
77 77 unsigned long status;
78 78  
79 79 /* New thread loses kernel privileges. */
80   - status = regs->cp0_status & ~(ST0_CU0|ST0_CU1|KU_MASK);
  80 + status = regs->cp0_status & ~(ST0_CU0|ST0_CU1|ST0_FR|KU_MASK);
81 81 #ifdef CONFIG_64BIT
82   - status &= ~ST0_FR;
83 82 status |= test_thread_flag(TIF_32BIT_REGS) ? 0 : ST0_FR;
84 83 #endif
85 84 status |= KU_USER;
arch/mips/kernel/traps.c
... ... @@ -1317,11 +1317,11 @@
1317 1317 #endif
1318 1318 if (current_cpu_data.isa_level == MIPS_CPU_ISA_IV)
1319 1319 status_set |= ST0_XX;
  1320 + if (cpu_has_dsp)
  1321 + status_set |= ST0_MX;
  1322 +
1320 1323 change_c0_status(ST0_CU|ST0_MX|ST0_RE|ST0_FR|ST0_BEV|ST0_TS|ST0_KX|ST0_SX|ST0_UX,
1321 1324 status_set);
1322   -
1323   - if (cpu_has_dsp)
1324   - set_c0_status(ST0_MX);
1325 1325  
1326 1326 #ifdef CONFIG_CPU_MIPSR2
1327 1327 if (cpu_has_mips_r2) {