linux/arch/mips
Matt Redfearn c496f3c08a MIPS: Fix exception entry when CONFIG_EVA enabled
Commit 9fef686863 ("MIPS: Make SAVE_SOME more standard") made several
changes to the order in which registers are saved in the SAVE_SOME
macro, used by exception handlers to save the processor state. In
particular, it removed the
move   k1, sp
in the delay slot of the branch testing if the processor is already in
kernel mode. This is replaced later in the macro by a
move   k0, sp
When CONFIG_EVA is disabled, this instruction actually appears in the
delay slot of the branch. However, when CONFIG_EVA is enabled, instead
the RPS workaround of
MFC0	k0, CP0_ENTRYHI
appears in the delay slot. This results in k0 not containing the stack
pointer, but some unrelated value, which is then saved to the kernel
stack. On exit from the exception, this bogus value is restored to the
stack pointer, resulting in an OOPS.

Fix this by moving the save of SP in k0 explicitly in the delay slot of
the branch, outside of the CONFIG_EVA section, restoring the expected
instruction ordering when CONFIG_EVA is active.

Fixes: 9fef686863 ("MIPS: Make SAVE_SOME more standard")
Signed-off-by: Matt Redfearn <matt.redfearn@mips.com>
Reported-by: Vladimir Kondratiev <vladimir.kondratiev@intel.com>
Reviewed-by: Corey Minyard <cminyard@mvista.com>
Reviewed-by: James Hogan <jhogan@kernel.org>
Patchwork: https://patchwork.linux-mips.org/patch/17471/
Signed-off-by: James Hogan <jhogan@kernel.org>
2017-10-31 23:49:33 +00:00
..
alchemy Merge branch '4.14-features' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2017-09-15 20:43:33 -07:00
ar7 MIPS: AR7: allow NULL clock for clk_get_rate 2017-09-06 12:35:21 +02:00
ath25
ath79 MIPS: PCI: Move map_irq() hooks out of initdata 2017-09-19 14:55:26 -05:00
bcm47xx MIPS: BCM47XX: Fix button inversion for Asus WL-500W 2017-02-17 11:16:46 +00:00
bcm63xx MIPS: BCM63XX: allow NULL clock for clk_get_rate 2017-09-06 12:36:21 +02:00
bmips MIPS: BMIPS: Support APPENDED_DTB 2016-10-06 17:31:02 +02:00
boot MIPS: jz4780: DTS: Probe the jz4740-rtc driver from devicetree 2017-09-06 10:13:38 +02:00
cavium-octeon MIPS: Octeon: Allow access to CIU3 IRQ domains. 2017-09-04 21:19:03 +02:00
cobalt MIPS: Cobalt: Fix typo 2016-08-03 08:16:30 +02:00
configs Merge branch '4.14-features' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2017-09-15 20:43:33 -07:00
dec MIPS: DEC: Fix an int-handler.S CPU_DADDI_WORKAROUNDS regression 2017-08-07 16:31:03 +02:00
emma MIPS: Avoid old-style declaration 2017-01-25 02:51:11 +01:00
fw MIPS: SMP: Constify smp ops 2017-08-29 15:21:50 +02:00
generic MIPS: generic: Fix NI 169445 its build 2017-10-31 22:55:44 +00:00
include MIPS: Fix exception entry when CONFIG_EVA enabled 2017-10-31 23:49:33 +00:00
jazz MIPS: Audit and remove any unnecessary uses of module.h 2017-02-14 09:00:25 +00:00
jz4740 MIPS: jz4740: Remove custom GPIO code 2017-05-22 17:26:34 +02:00
kernel Update MIPS email addresses 2017-10-31 22:42:39 +00:00
kvm kvm,mips: Fix potential swait_active() races 2017-09-15 16:57:13 +02:00
lantiq MIPS: lantiq: Remove the arch/mips/lantiq/xway/reset.c implementation 2017-09-04 21:19:03 +02:00
lasat MIPS: Audit and remove any unnecessary uses of module.h 2017-02-14 09:00:25 +00:00
lib MIPS: Add __ioread64_copy 2017-09-04 13:53:14 +02:00
loongson32 MIPS: loongson1: set default number of rx and tx queues for stmmac 2017-10-09 14:53:38 +02:00
loongson64 MIPS: Loongson 2F: allow NULL clock for clk_get_rate 2017-09-06 12:36:59 +02:00
math-emu MIPS: math-emu: Remove pr_err() calls from fpu_emu() 2017-10-09 16:33:34 +02:00
mm Update MIPS email addresses 2017-10-31 22:42:39 +00:00
mti-malta Update MIPS email addresses 2017-10-31 22:42:39 +00:00
net MIPS: bpf: Fix uninitialised target compiler error 2017-10-09 14:53:38 +02:00
netlogic Merge branch '4.14-features' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2017-09-15 20:43:33 -07:00
oprofile MIPS: Abstract CPU core & VP(E) ID access through accessor functions 2017-08-30 00:57:26 +02:00
paravirt MIPS: SMP: Allow boot_secondary SMP op to return errors 2017-08-30 00:57:27 +02:00
pci Update MIPS email addresses 2017-10-31 22:42:39 +00:00
pic32 clocksource/drivers: Rename clocksource_probe to timer_probe 2017-06-14 11:59:16 +02:00
pistachio MIPS: Remove unnecessary inclusions of linux/irqchip/mips-gic.h 2017-09-04 13:53:14 +02:00
pmcs-msp71xx MIPS: MSP71xx: Include asm/setup.h 2017-09-21 16:15:17 +02:00
pnx833x mtd: nand: Rename nand.h into rawnand.h 2017-08-13 10:11:49 +02:00
power
ralink MIPS: ralink: allow NULL clock for clk_get_rate 2017-09-06 12:37:45 +02:00
rb532 mtd: nand: Rename nand.h into rawnand.h 2017-08-13 10:11:49 +02:00
sgi-ip22 mips: sgi-ip22: ecard: use dev_groups and not dev_attrs for bus_type 2017-06-09 11:00:45 +02:00
sgi-ip27 MIPS: SMP: Allow boot_secondary SMP op to return errors 2017-08-30 00:57:27 +02:00
sgi-ip32 MIPS: Add missing include files 2017-03-08 10:38:06 +01:00
sibyte MIPS: SMP: Allow boot_secondary SMP op to return errors 2017-08-30 00:57:27 +02:00
sni char/genrtc: remove asm-generic/rtc.h from mips 2016-06-04 00:23:36 +02:00
tools Update MIPS email addresses 2017-10-31 22:42:39 +00:00
txx9 MIPS: PCI: Move map_irq() hooks out of initdata 2017-09-19 14:55:26 -05:00
vdso MIPS: Add DWARF unwinding to assembly 2017-09-06 11:01:52 +02:00
vr41xx MIPS: Audit and remove any unnecessary uses of module.h 2017-02-14 09:00:25 +00:00
xilfpga clocksource/drivers: Rename clocksource_probe to timer_probe 2017-06-14 11:59:16 +02:00
Kbuild MIPS: Disable Werror when W= is set 2017-04-10 11:56:07 +02:00
Kbuild.platforms MIPS: generic: Convert SEAD-3 to a generic board 2016-10-06 18:04:20 +02:00
Kconfig MIPS: Make CONFIG_MIPS_MT_SMP default y 2017-08-30 00:57:28 +02:00
Kconfig.debug MIPS: Sibyte: Fix Kconfig warning. 2017-04-21 03:34:01 +02:00
Makefile MIPS: Add DWARF unwinding to assembly 2017-09-06 11:01:52 +02:00
Makefile.postlink MIPS: Fix distclean with Makefile.postlink 2017-02-13 18:57:34 +00:00