x86/xen: Make irq_disable() noinstr
authorPeter Zijlstra <peterz@infradead.org>
Thu, 24 Jun 2021 09:41:20 +0000 (11:41 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Fri, 17 Sep 2021 11:20:23 +0000 (13:20 +0200)
vmlinux.o: warning: objtool: pv_ops[31]: native_irq_disable
vmlinux.o: warning: objtool: pv_ops[31]: __raw_callee_save_xen_irq_disable
vmlinux.o: warning: objtool: pv_ops[31]: xen_irq_disable_direct
vmlinux.o: warning: objtool: lock_is_held_type()+0x5b: call to pv_ops[31]() leaves .noinstr.text section

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Juergen Gross <jgross@suse.com>
Link: https://lore.kernel.org/r/20210624095148.933869441@infradead.org
arch/x86/kernel/paravirt.c
arch/x86/xen/irq.c
arch/x86/xen/xen-asm.S

index 75f0d241752bc3d9629e911fc80e33c39f0919f4..ebc45360ffd40f8b25801e0d5b45f9831b4afa6e 100644 (file)
@@ -243,6 +243,11 @@ static noinstr void pv_native_irq_enable(void)
 {
        native_irq_enable();
 }
+
+static noinstr void pv_native_irq_disable(void)
+{
+       native_irq_disable();
+}
 #endif
 
 enum paravirt_lazy_mode paravirt_get_lazy_mode(void)
@@ -306,7 +311,7 @@ struct paravirt_patch_template pv_ops = {
 
        /* Irq ops. */
        .irq.save_fl            = __PV_IS_CALLEE_SAVE(native_save_fl),
-       .irq.irq_disable        = __PV_IS_CALLEE_SAVE(native_irq_disable),
+       .irq.irq_disable        = __PV_IS_CALLEE_SAVE(pv_native_irq_disable),
        .irq.irq_enable         = __PV_IS_CALLEE_SAVE(pv_native_irq_enable),
        .irq.safe_halt          = native_safe_halt,
        .irq.halt               = native_halt,
index 7fb4cf28879e3804d9da15f412134fa6ab3101a6..f52b60df4e0c89df37ee795c32ac1cd53e1915b0 100644 (file)
@@ -42,7 +42,7 @@ asmlinkage __visible noinstr unsigned long xen_save_fl(void)
 }
 __PV_CALLEE_SAVE_REGS_THUNK(xen_save_fl, ".noinstr.text");
 
-asmlinkage __visible void xen_irq_disable(void)
+asmlinkage __visible noinstr void xen_irq_disable(void)
 {
        /* There's a one instruction preempt window here.  We need to
           make sure we're don't switch CPUs between getting the vcpu
@@ -51,7 +51,7 @@ asmlinkage __visible void xen_irq_disable(void)
        this_cpu_read(xen_vcpu)->evtchn_upcall_mask = 1;
        preempt_enable_no_resched();
 }
-PV_CALLEE_SAVE_REGS_THUNK(xen_irq_disable);
+__PV_CALLEE_SAVE_REGS_THUNK(xen_irq_disable, ".noinstr.text");
 
 asmlinkage __visible noinstr void xen_irq_enable(void)
 {
index 2225195288906290a19bcb5d52bfc1bf06d4786d..220dd96784947624d9d43fb62dd72e4ae0614936 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/init.h>
 #include <linux/linkage.h>
 
+.pushsection .noinstr.text, "ax"
 /*
  * Disabling events is simply a matter of making the event mask
  * non-zero.
@@ -30,8 +31,6 @@ SYM_FUNC_START(xen_irq_disable_direct)
        ret
 SYM_FUNC_END(xen_irq_disable_direct)
 
-.pushsection .noinstr.text, "ax"
-
 /*
  * Force an event check by making a hypercall, but preserve regs
  * before making the call.