Skip to content

Commit 09c4130

Browse files
author
Peter Zijlstra
committed
x86/xen: Make irq_disable() noinstr
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) <[email protected]> Reviewed-by: Juergen Gross <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent d7bfc7d commit 09c4130

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

arch/x86/kernel/paravirt.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,11 @@ static noinstr void pv_native_irq_enable(void)
243243
{
244244
native_irq_enable();
245245
}
246+
247+
static noinstr void pv_native_irq_disable(void)
248+
{
249+
native_irq_disable();
250+
}
246251
#endif
247252

248253
enum paravirt_lazy_mode paravirt_get_lazy_mode(void)
@@ -306,7 +311,7 @@ struct paravirt_patch_template pv_ops = {
306311

307312
/* Irq ops. */
308313
.irq.save_fl = __PV_IS_CALLEE_SAVE(native_save_fl),
309-
.irq.irq_disable = __PV_IS_CALLEE_SAVE(native_irq_disable),
314+
.irq.irq_disable = __PV_IS_CALLEE_SAVE(pv_native_irq_disable),
310315
.irq.irq_enable = __PV_IS_CALLEE_SAVE(pv_native_irq_enable),
311316
.irq.safe_halt = native_safe_halt,
312317
.irq.halt = native_halt,

arch/x86/xen/irq.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ asmlinkage __visible noinstr unsigned long xen_save_fl(void)
4242
}
4343
__PV_CALLEE_SAVE_REGS_THUNK(xen_save_fl, ".noinstr.text");
4444

45-
asmlinkage __visible void xen_irq_disable(void)
45+
asmlinkage __visible noinstr void xen_irq_disable(void)
4646
{
4747
/* There's a one instruction preempt window here. We need to
4848
make sure we're don't switch CPUs between getting the vcpu
@@ -51,7 +51,7 @@ asmlinkage __visible void xen_irq_disable(void)
5151
this_cpu_read(xen_vcpu)->evtchn_upcall_mask = 1;
5252
preempt_enable_no_resched();
5353
}
54-
PV_CALLEE_SAVE_REGS_THUNK(xen_irq_disable);
54+
__PV_CALLEE_SAVE_REGS_THUNK(xen_irq_disable, ".noinstr.text");
5555

5656
asmlinkage __visible noinstr void xen_irq_enable(void)
5757
{

arch/x86/xen/xen-asm.S

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <linux/init.h>
2222
#include <linux/linkage.h>
2323

24+
.pushsection .noinstr.text, "ax"
2425
/*
2526
* Disabling events is simply a matter of making the event mask
2627
* non-zero.
@@ -30,8 +31,6 @@ SYM_FUNC_START(xen_irq_disable_direct)
3031
ret
3132
SYM_FUNC_END(xen_irq_disable_direct)
3233

33-
.pushsection .noinstr.text, "ax"
34-
3534
/*
3635
* Force an event check by making a hypercall, but preserve regs
3736
* before making the call.

0 commit comments

Comments
 (0)