Skip to content

Commit c0e4578

Browse files
committed
Merge tag 'objtool-urgent-2021-06-24' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull objtool fixes from Ingo Molnar: "Address a number of objtool warnings that got reported. No change in behavior intended, but code generation might be impacted by commit 1f008d4 ("x86: Always inline task_size_max()")" * tag 'objtool-urgent-2021-06-24' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: locking/lockdep: Improve noinstr vs errors x86: Always inline task_size_max() x86/xen: Fix noinstr fail in exc_xen_unknown_trap() x86/xen: Fix noinstr fail in xen_pv_evtchn_do_upcall() x86/entry: Fix noinstr fail in __do_fast_syscall_32() objtool/x86: Ignore __x86_indirect_alt_* symbols
2 parents 7426ced + 49faa77 commit c0e4578

File tree

7 files changed

+16
-5
lines changed

7 files changed

+16
-5
lines changed

arch/x86/entry/common.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ static noinstr bool __do_fast_syscall_32(struct pt_regs *regs)
130130
/* User code screwed up. */
131131
regs->ax = -EFAULT;
132132

133-
instrumentation_end();
134133
local_irq_disable();
134+
instrumentation_end();
135135
irqentry_exit_to_user_mode(regs);
136136
return false;
137137
}
@@ -269,15 +269,16 @@ __visible noinstr void xen_pv_evtchn_do_upcall(struct pt_regs *regs)
269269
irqentry_state_t state = irqentry_enter(regs);
270270
bool inhcall;
271271

272+
instrumentation_begin();
272273
run_sysvec_on_irqstack_cond(__xen_pv_evtchn_do_upcall, regs);
273274

274275
inhcall = get_and_clear_inhcall();
275276
if (inhcall && !WARN_ON_ONCE(state.exit_rcu)) {
276-
instrumentation_begin();
277277
irqentry_exit_cond_resched();
278278
instrumentation_end();
279279
restore_inhcall(inhcall);
280280
} else {
281+
instrumentation_end();
281282
irqentry_exit(regs, state);
282283
}
283284
}

arch/x86/include/asm/page_64.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ void copy_page(void *to, void *from);
7575
*
7676
* With page table isolation enabled, we map the LDT in ... [stay tuned]
7777
*/
78-
static inline unsigned long task_size_max(void)
78+
static __always_inline unsigned long task_size_max(void)
7979
{
8080
unsigned long ret;
8181

arch/x86/lib/retpoline.S

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,16 @@ SYM_FUNC_START_NOALIGN(__x86_indirect_alt_call_\reg)
5858
2: .skip 5-(2b-1b), 0x90
5959
SYM_FUNC_END(__x86_indirect_alt_call_\reg)
6060

61+
STACK_FRAME_NON_STANDARD(__x86_indirect_alt_call_\reg)
62+
6163
SYM_FUNC_START_NOALIGN(__x86_indirect_alt_jmp_\reg)
6264
ANNOTATE_RETPOLINE_SAFE
6365
1: jmp *%\reg
6466
2: .skip 5-(2b-1b), 0x90
6567
SYM_FUNC_END(__x86_indirect_alt_jmp_\reg)
6668

69+
STACK_FRAME_NON_STANDARD(__x86_indirect_alt_jmp_\reg)
70+
6771
.endm
6872

6973
/*

arch/x86/xen/enlighten_pv.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,8 +592,10 @@ DEFINE_IDTENTRY_RAW(xenpv_exc_debug)
592592
DEFINE_IDTENTRY_RAW(exc_xen_unknown_trap)
593593
{
594594
/* This should never happen and there is no way to handle it. */
595+
instrumentation_begin();
595596
pr_err("Unknown trap in Xen PV mode.");
596597
BUG();
598+
instrumentation_end();
597599
}
598600

599601
#ifdef CONFIG_X86_MCE

include/linux/debug_locks.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@ extern int debug_locks_off(void);
2727
int __ret = 0; \
2828
\
2929
if (!oops_in_progress && unlikely(c)) { \
30+
instrumentation_begin(); \
3031
if (debug_locks_off() && !debug_locks_silent) \
3132
WARN(1, "DEBUG_LOCKS_WARN_ON(%s)", #c); \
33+
instrumentation_end(); \
3234
__ret = 1; \
3335
} \
3436
__ret; \

kernel/locking/lockdep.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -843,20 +843,22 @@ static int count_matching_names(struct lock_class *new_class)
843843
}
844844

845845
/* used from NMI context -- must be lockless */
846-
static __always_inline struct lock_class *
846+
static noinstr struct lock_class *
847847
look_up_lock_class(const struct lockdep_map *lock, unsigned int subclass)
848848
{
849849
struct lockdep_subclass_key *key;
850850
struct hlist_head *hash_head;
851851
struct lock_class *class;
852852

853853
if (unlikely(subclass >= MAX_LOCKDEP_SUBCLASSES)) {
854+
instrumentation_begin();
854855
debug_locks_off();
855856
printk(KERN_ERR
856857
"BUG: looking up invalid subclass: %u\n", subclass);
857858
printk(KERN_ERR
858859
"turning off the locking correctness validator.\n");
859860
dump_stack();
861+
instrumentation_end();
860862
return NULL;
861863
}
862864

lib/debug_locks.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ EXPORT_SYMBOL_GPL(debug_locks_silent);
3636
/*
3737
* Generic 'turn off all lock debugging' function:
3838
*/
39-
noinstr int debug_locks_off(void)
39+
int debug_locks_off(void)
4040
{
4141
if (debug_locks && __debug_locks_off()) {
4242
if (!debug_locks_silent) {

0 commit comments

Comments
 (0)