forked from Minki/linux
d1c99108af
This reverts commit 1dde7415e9
. By putting
the RSB filling out of line and calling it, we waste one RSB slot for
returning from the function itself, which means one fewer actual function
call we can make if we're doing the Skylake abomination of call-depth
counting.
It also changed the number of RSB stuffings we do on vmexit from 32,
which was correct, to 16. Let's just stop with the bikeshedding; it
didn't actually *fix* anything anyway.
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: arjan.van.de.ven@intel.com
Cc: bp@alien8.de
Cc: dave.hansen@intel.com
Cc: jmattson@google.com
Cc: karahmed@amazon.de
Cc: kvm@vger.kernel.org
Cc: pbonzini@redhat.com
Cc: rkrcmar@redhat.com
Link: http://lkml.kernel.org/r/1519037457-7643-4-git-send-email-dwmw@amazon.co.uk
Signed-off-by: Ingo Molnar <mingo@kernel.org>
49 lines
1.2 KiB
ArmAsm
49 lines
1.2 KiB
ArmAsm
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
#include <linux/stringify.h>
|
|
#include <linux/linkage.h>
|
|
#include <asm/dwarf2.h>
|
|
#include <asm/cpufeatures.h>
|
|
#include <asm/alternative-asm.h>
|
|
#include <asm/export.h>
|
|
#include <asm/nospec-branch.h>
|
|
|
|
.macro THUNK reg
|
|
.section .text.__x86.indirect_thunk
|
|
|
|
ENTRY(__x86_indirect_thunk_\reg)
|
|
CFI_STARTPROC
|
|
JMP_NOSPEC %\reg
|
|
CFI_ENDPROC
|
|
ENDPROC(__x86_indirect_thunk_\reg)
|
|
.endm
|
|
|
|
/*
|
|
* Despite being an assembler file we can't just use .irp here
|
|
* because __KSYM_DEPS__ only uses the C preprocessor and would
|
|
* only see one instance of "__x86_indirect_thunk_\reg" rather
|
|
* than one per register with the correct names. So we do it
|
|
* the simple and nasty way...
|
|
*/
|
|
#define __EXPORT_THUNK(sym) _ASM_NOKPROBE(sym); EXPORT_SYMBOL(sym)
|
|
#define EXPORT_THUNK(reg) __EXPORT_THUNK(__x86_indirect_thunk_ ## reg)
|
|
#define GENERATE_THUNK(reg) THUNK reg ; EXPORT_THUNK(reg)
|
|
|
|
GENERATE_THUNK(_ASM_AX)
|
|
GENERATE_THUNK(_ASM_BX)
|
|
GENERATE_THUNK(_ASM_CX)
|
|
GENERATE_THUNK(_ASM_DX)
|
|
GENERATE_THUNK(_ASM_SI)
|
|
GENERATE_THUNK(_ASM_DI)
|
|
GENERATE_THUNK(_ASM_BP)
|
|
#ifdef CONFIG_64BIT
|
|
GENERATE_THUNK(r8)
|
|
GENERATE_THUNK(r9)
|
|
GENERATE_THUNK(r10)
|
|
GENERATE_THUNK(r11)
|
|
GENERATE_THUNK(r12)
|
|
GENERATE_THUNK(r13)
|
|
GENERATE_THUNK(r14)
|
|
GENERATE_THUNK(r15)
|
|
#endif
|