From: Peter Zijlstra <peterz@infradead.org>
To: x86@kernel.org
Cc: linux-kernel@vger.kernel.org, peterz@infradead.org,
rdunlap@infradead.org, jpoimboe@redhat.com, sfr@canb.auug.org.au,
tony.luck@intel.com
Subject: [PATCH 1/6] x86/entry: Fix noinstr fail
Date: Wed, 06 Jan 2021 15:36:20 +0100 [thread overview]
Message-ID: <20210106144017.472696632@infradead.org> (raw)
In-Reply-To: 20210106143619.479313782@infradead.org
vmlinux.o: warning: objtool: __do_fast_syscall_32()+0x47: call to syscall_enter_from_user_mode_work() leaves .noinstr.text section
Fixes: 4facb95b7ada ("x86/entry: Unbreak 32bit fast syscall")
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
---
arch/x86/entry/common.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
--- a/arch/x86/entry/common.c
+++ b/arch/x86/entry/common.c
@@ -73,10 +73,8 @@ static __always_inline void do_syscall_3
unsigned int nr)
{
if (likely(nr < IA32_NR_syscalls)) {
- instrumentation_begin();
nr = array_index_nospec(nr, IA32_NR_syscalls);
regs->ax = ia32_sys_call_table[nr](regs);
- instrumentation_end();
}
}
@@ -91,8 +89,11 @@ __visible noinstr void do_int80_syscall_
* or may not be necessary, but it matches the old asm behavior.
*/
nr = (unsigned int)syscall_enter_from_user_mode(regs, nr);
+ instrumentation_begin();
do_syscall_32_irqs_on(regs, nr);
+
+ instrumentation_end();
syscall_exit_to_user_mode(regs);
}
@@ -121,11 +122,12 @@ static noinstr bool __do_fast_syscall_32
res = get_user(*(u32 *)®s->bp,
(u32 __user __force *)(unsigned long)(u32)regs->sp);
}
- instrumentation_end();
if (res) {
/* User code screwed up. */
regs->ax = -EFAULT;
+
+ instrumentation_end();
syscall_exit_to_user_mode(regs);
return false;
}
@@ -135,6 +137,8 @@ static noinstr bool __do_fast_syscall_32
/* Now this is just like a normal syscall. */
do_syscall_32_irqs_on(regs, nr);
+
+ instrumentation_end();
syscall_exit_to_user_mode(regs);
return true;
}
next prev parent reply other threads:[~2021-01-06 14:45 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-06 14:36 [PATCH 0/6] x86 noinstr fixes Peter Zijlstra
2021-01-06 14:36 ` Peter Zijlstra [this message]
2021-01-12 20:12 ` [tip: x86/urgent] x86/entry: Fix noinstr fail tip-bot2 for Peter Zijlstra
2021-01-06 14:36 ` [PATCH 2/6] x86/sev: Fix nonistr violation Peter Zijlstra
2021-01-06 17:59 ` Randy Dunlap
2021-01-07 9:36 ` Peter Zijlstra
2021-01-07 10:18 ` [PATCH 7/6] x86: __always_inline __{rd,wr}msr() Peter Zijlstra
2021-01-07 10:31 ` David Laight
2021-01-07 16:49 ` Randy Dunlap
2021-01-12 20:12 ` [tip: x86/urgent] x86/sev: Fix nonistr violation tip-bot2 for Peter Zijlstra
2021-01-06 14:36 ` [PATCH 3/6] locking/lockdep: Cure noinstr fail Peter Zijlstra
2021-01-12 20:12 ` [tip: x86/urgent] " tip-bot2 for Peter Zijlstra
2021-01-06 14:36 ` [PATCH 4/6] locking/lockdep: Avoid noinstr warning for DEBUG_LOCKDEP Peter Zijlstra
2021-01-12 20:12 ` [tip: x86/urgent] " tip-bot2 for Peter Zijlstra
2021-01-06 14:36 ` [PATCH 5/6] x86/mce: Remove explicit/superfluous tracing Peter Zijlstra
2021-01-12 20:12 ` [tip: x86/urgent] " tip-bot2 for Peter Zijlstra
2021-01-06 14:36 ` [RFC][PATCH 6/6] x86/mce: Dont use noinstr for now Peter Zijlstra
2021-01-06 14:57 ` Boris Petkov
2021-01-07 10:06 ` Borislav Petkov
2021-01-07 12:58 ` Peter Zijlstra
2021-01-07 13:13 ` Borislav Petkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210106144017.472696632@infradead.org \
--to=peterz@infradead.org \
--cc=jpoimboe@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rdunlap@infradead.org \
--cc=sfr@canb.auug.org.au \
--cc=tony.luck@intel.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).