|
@@ -7,6 +7,7 @@
|
|
|
#ifdef CONFIG_PARAVIRT
|
|
|
#include <asm/pgtable_types.h>
|
|
|
#include <asm/asm.h>
|
|
|
+#include <asm/nospec-branch.h>
|
|
|
|
|
|
#include <asm/paravirt_types.h>
|
|
|
|
|
@@ -879,23 +880,27 @@ extern void default_banner(void);
|
|
|
|
|
|
#define INTERRUPT_RETURN \
|
|
|
PARA_SITE(PARA_PATCH(pv_cpu_ops, PV_CPU_iret), CLBR_NONE, \
|
|
|
- jmp PARA_INDIRECT(pv_cpu_ops+PV_CPU_iret))
|
|
|
+ ANNOTATE_RETPOLINE_SAFE; \
|
|
|
+ jmp PARA_INDIRECT(pv_cpu_ops+PV_CPU_iret);)
|
|
|
|
|
|
#define DISABLE_INTERRUPTS(clobbers) \
|
|
|
PARA_SITE(PARA_PATCH(pv_irq_ops, PV_IRQ_irq_disable), clobbers, \
|
|
|
PV_SAVE_REGS(clobbers | CLBR_CALLEE_SAVE); \
|
|
|
+ ANNOTATE_RETPOLINE_SAFE; \
|
|
|
call PARA_INDIRECT(pv_irq_ops+PV_IRQ_irq_disable); \
|
|
|
PV_RESTORE_REGS(clobbers | CLBR_CALLEE_SAVE);)
|
|
|
|
|
|
#define ENABLE_INTERRUPTS(clobbers) \
|
|
|
PARA_SITE(PARA_PATCH(pv_irq_ops, PV_IRQ_irq_enable), clobbers, \
|
|
|
PV_SAVE_REGS(clobbers | CLBR_CALLEE_SAVE); \
|
|
|
+ ANNOTATE_RETPOLINE_SAFE; \
|
|
|
call PARA_INDIRECT(pv_irq_ops+PV_IRQ_irq_enable); \
|
|
|
PV_RESTORE_REGS(clobbers | CLBR_CALLEE_SAVE);)
|
|
|
|
|
|
#ifdef CONFIG_X86_32
|
|
|
#define GET_CR0_INTO_EAX \
|
|
|
push %ecx; push %edx; \
|
|
|
+ ANNOTATE_RETPOLINE_SAFE; \
|
|
|
call PARA_INDIRECT(pv_cpu_ops+PV_CPU_read_cr0); \
|
|
|
pop %edx; pop %ecx
|
|
|
#else /* !CONFIG_X86_32 */
|
|
@@ -917,21 +922,25 @@ extern void default_banner(void);
|
|
|
*/
|
|
|
#define SWAPGS \
|
|
|
PARA_SITE(PARA_PATCH(pv_cpu_ops, PV_CPU_swapgs), CLBR_NONE, \
|
|
|
- call PARA_INDIRECT(pv_cpu_ops+PV_CPU_swapgs) \
|
|
|
+ ANNOTATE_RETPOLINE_SAFE; \
|
|
|
+ call PARA_INDIRECT(pv_cpu_ops+PV_CPU_swapgs); \
|
|
|
)
|
|
|
|
|
|
#define GET_CR2_INTO_RAX \
|
|
|
- call PARA_INDIRECT(pv_mmu_ops+PV_MMU_read_cr2)
|
|
|
+ ANNOTATE_RETPOLINE_SAFE; \
|
|
|
+ call PARA_INDIRECT(pv_mmu_ops+PV_MMU_read_cr2);
|
|
|
|
|
|
#define USERGS_SYSRET64 \
|
|
|
PARA_SITE(PARA_PATCH(pv_cpu_ops, PV_CPU_usergs_sysret64), \
|
|
|
CLBR_NONE, \
|
|
|
- jmp PARA_INDIRECT(pv_cpu_ops+PV_CPU_usergs_sysret64))
|
|
|
+ ANNOTATE_RETPOLINE_SAFE; \
|
|
|
+ jmp PARA_INDIRECT(pv_cpu_ops+PV_CPU_usergs_sysret64);)
|
|
|
|
|
|
#ifdef CONFIG_DEBUG_ENTRY
|
|
|
#define SAVE_FLAGS(clobbers) \
|
|
|
PARA_SITE(PARA_PATCH(pv_irq_ops, PV_IRQ_save_fl), clobbers, \
|
|
|
PV_SAVE_REGS(clobbers | CLBR_CALLEE_SAVE); \
|
|
|
+ ANNOTATE_RETPOLINE_SAFE; \
|
|
|
call PARA_INDIRECT(pv_irq_ops+PV_IRQ_save_fl); \
|
|
|
PV_RESTORE_REGS(clobbers | CLBR_CALLEE_SAVE);)
|
|
|
#endif
|