aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/include/asm/irqflags.h2
-rw-r--r--arch/x86/kernel/paravirt.c14
2 files changed, 12 insertions, 4 deletions
diff --git a/arch/x86/include/asm/irqflags.h b/arch/x86/include/asm/irqflags.h
index c4fc17220df9..c14f2a74b2be 100644
--- a/arch/x86/include/asm/irqflags.h
+++ b/arch/x86/include/asm/irqflags.h
@@ -13,6 +13,8 @@
13 * Interrupt control: 13 * Interrupt control:
14 */ 14 */
15 15
16/* Declaration required for gcc < 4.9 to prevent -Werror=missing-prototypes */
17extern inline unsigned long native_save_fl(void);
16extern inline unsigned long native_save_fl(void) 18extern inline unsigned long native_save_fl(void)
17{ 19{
18 unsigned long flags; 20 unsigned long flags;
diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
index 99dc79e76bdc..930c88341e4e 100644
--- a/arch/x86/kernel/paravirt.c
+++ b/arch/x86/kernel/paravirt.c
@@ -88,10 +88,12 @@ unsigned paravirt_patch_call(void *insnbuf,
88 struct branch *b = insnbuf; 88 struct branch *b = insnbuf;
89 unsigned long delta = (unsigned long)target - (addr+5); 89 unsigned long delta = (unsigned long)target - (addr+5);
90 90
91 if (tgt_clobbers & ~site_clobbers) 91 if (len < 5) {
92 return len; /* target would clobber too much for this site */ 92#ifdef CONFIG_RETPOLINE
93 if (len < 5) 93 WARN_ONCE("Failing to patch indirect CALL in %ps\n", (void *)addr);
94#endif
94 return len; /* call too long for patch site */ 95 return len; /* call too long for patch site */
96 }
95 97
96 b->opcode = 0xe8; /* call */ 98 b->opcode = 0xe8; /* call */
97 b->delta = delta; 99 b->delta = delta;
@@ -106,8 +108,12 @@ unsigned paravirt_patch_jmp(void *insnbuf, const void *target,
106 struct branch *b = insnbuf; 108 struct branch *b = insnbuf;
107 unsigned long delta = (unsigned long)target - (addr+5); 109 unsigned long delta = (unsigned long)target - (addr+5);
108 110
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
110 return len; /* call too long for patch site */ 115 return len; /* call too long for patch site */
116 }
111 117
112 b->opcode = 0xe9; /* jmp */ 118 b->opcode = 0xe9; /* jmp */
113 b->delta = delta; 119 b->delta = delta;