diff options
| author | Ingo Molnar <mingo@kernel.org> | 2015-08-18 09:39:47 +0200 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2015-08-18 09:39:47 +0200 |
| commit | a5dd19249607474ed680f16b4f5e8477d2b68689 (patch) | |
| tree | 1aeeef053773c07bc02f3aa637febc80ceb96732 /arch/mips/include/asm/stackframe.h | |
| parent | 6b7e26547fad7ace3dcb27a5babd2317fb9d1e12 (diff) | |
| parent | 512255a2ad2c832ca7d4de9f31245f73781922d0 (diff) | |
| download | linux-a5dd19249607474ed680f16b4f5e8477d2b68689.tar.gz linux-a5dd19249607474ed680f16b4f5e8477d2b68689.tar.bz2 linux-a5dd19249607474ed680f16b4f5e8477d2b68689.zip | |
Merge branch 'x86/urgent' into x86/asm to fix up conflicts and to pick up fixes
Conflicts:
arch/x86/entry/entry_64_compat.S
arch/x86/math-emu/get_address.c
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/mips/include/asm/stackframe.h')
| -rw-r--r-- | arch/mips/include/asm/stackframe.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/arch/mips/include/asm/stackframe.h b/arch/mips/include/asm/stackframe.h index 28d6d9364bd1..a71da576883c 100644 --- a/arch/mips/include/asm/stackframe.h +++ b/arch/mips/include/asm/stackframe.h @@ -152,6 +152,31 @@ .set noreorder bltz k0, 8f move k1, sp +#ifdef CONFIG_EVA + /* + * Flush interAptiv's Return Prediction Stack (RPS) by writing + * EntryHi. Toggling Config7.RPS is slower and less portable. + * + * The RPS isn't automatically flushed when exceptions are + * taken, which can result in kernel mode speculative accesses + * to user addresses if the RPS mispredicts. That's harmless + * when user and kernel share the same address space, but with + * EVA the same user segments may be unmapped to kernel mode, + * even containing sensitive MMIO regions or invalid memory. + * + * This can happen when the kernel sets the return address to + * ret_from_* and jr's to the exception handler, which looks + * more like a tail call than a function call. If nested calls + * don't evict the last user address in the RPS, it will + * mispredict the return and fetch from a user controlled + * address into the icache. + * + * More recent EVA-capable cores with MAAR to restrict + * speculative accesses aren't affected. + */ + MFC0 k0, CP0_ENTRYHI + MTC0 k0, CP0_ENTRYHI +#endif .set reorder /* Called from user mode, new stack. */ get_saved_sp |
