Commit 4d5ac4b8 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull misc x86 fixes from Thomas Gleixner:
 "Two fixes for x86:

   - Provide a declaration for native_save_fl() which unbreaks the
     wreckage caused by making it 'extern inline'.

   - Fix the failing paravirt patching which is supposed to replace
     indirect with direct calls. The wreckage is caused by an incorrect
     clobber test"

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/paravirt: Fix spectre-v2 mitigations for paravirt guests
  x86/irqflags: Provide a declaration for native_save_fl
parents 203b4fc9 5800dc5c
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
* Interrupt control: * Interrupt control:
*/ */
/* Declaration required for gcc < 4.9 to prevent -Werror=missing-prototypes */
extern inline unsigned long native_save_fl(void);
extern inline unsigned long native_save_fl(void) extern inline unsigned long native_save_fl(void)
{ {
unsigned long flags; unsigned long flags;
......
...@@ -88,10 +88,12 @@ unsigned paravirt_patch_call(void *insnbuf, ...@@ -88,10 +88,12 @@ unsigned paravirt_patch_call(void *insnbuf,
struct branch *b = insnbuf; struct branch *b = insnbuf;
unsigned long delta = (unsigned long)target - (addr+5); unsigned long delta = (unsigned long)target - (addr+5);
if (tgt_clobbers & ~site_clobbers) if (len < 5) {
return len; /* target would clobber too much for this site */ #ifdef CONFIG_RETPOLINE
if (len < 5) WARN_ONCE("Failing to patch indirect CALL in %ps\n", (void *)addr);
#endif
return len; /* call too long for patch site */ return len; /* call too long for patch site */
}
b->opcode = 0xe8; /* call */ b->opcode = 0xe8; /* call */
b->delta = delta; b->delta = delta;
...@@ -106,8 +108,12 @@ unsigned paravirt_patch_jmp(void *insnbuf, const void *target, ...@@ -106,8 +108,12 @@ unsigned paravirt_patch_jmp(void *insnbuf, const void *target,
struct branch *b = insnbuf; struct branch *b = insnbuf;
unsigned long delta = (unsigned long)target - (addr+5); unsigned long delta = (unsigned long)target - (addr+5);
if (len < 5) if (len < 5) {
#ifdef CONFIG_RETPOLINE
WARN_ONCE("Failing to patch indirect JMP in %ps\n", (void *)addr);
#endif
return len; /* call too long for patch site */ return len; /* call too long for patch site */
}
b->opcode = 0xe9; /* jmp */ b->opcode = 0xe9; /* jmp */
b->delta = delta; b->delta = delta;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment