Skip to content

Commit 4d5ac4b

Browse files
committed
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
2 parents 203b4fc + 5800dc5 commit 4d5ac4b

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

arch/x86/include/asm/irqflags.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
* Interrupt control:
1414
*/
1515

16+
/* Declaration required for gcc < 4.9 to prevent -Werror=missing-prototypes */
17+
extern inline unsigned long native_save_fl(void);
1618
extern inline unsigned long native_save_fl(void)
1719
{
1820
unsigned long flags;

arch/x86/kernel/paravirt.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,12 @@ unsigned paravirt_patch_call(void *insnbuf,
8888
struct branch *b = insnbuf;
8989
unsigned long delta = (unsigned long)target - (addr+5);
9090

91-
if (tgt_clobbers & ~site_clobbers)
92-
return len; /* target would clobber too much for this site */
93-
if (len < 5)
91+
if (len < 5) {
92+
#ifdef CONFIG_RETPOLINE
93+
WARN_ONCE("Failing to patch indirect CALL in %ps\n", (void *)addr);
94+
#endif
9495
return len; /* call too long for patch site */
96+
}
9597

9698
b->opcode = 0xe8; /* call */
9799
b->delta = delta;
@@ -106,8 +108,12 @@ unsigned paravirt_patch_jmp(void *insnbuf, const void *target,
106108
struct branch *b = insnbuf;
107109
unsigned long delta = (unsigned long)target - (addr+5);
108110

109-
if (len < 5)
111+
if (len < 5) {
112+
#ifdef CONFIG_RETPOLINE
113+
WARN_ONCE("Failing to patch indirect JMP in %ps\n", (void *)addr);
114+
#endif
110115
return len; /* call too long for patch site */
116+
}
111117

112118
b->opcode = 0xe9; /* jmp */
113119
b->delta = delta;

0 commit comments

Comments
 (0)