mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nick Desaulniers <nick.desaulniers@gmail.com>
To: dave.hansen@linux.intel.com, luto@kernel.org,
	peterz@infradead.org, tglx@linutronix.de, mingo@redhat.com,
	bp@alien8.de, hpa@zytor.com
Cc: natechancellor@gmail.com,
	Nick Desaulniers <nick.desaulniers@gmail.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] x86/mm: annotate no_context with UNWIND_HINTS
Date: Sun, 14 Oct 2018 17:37:26 -0700	[thread overview]
Message-ID: <20181015003726.29103-1-nick.desaulniers@gmail.com> (raw)

Fixes the objtool warning:
arch/x86/mm/fault.o: warning: objtool: no_context()+0x220: unreachable
instruction

Link: https://github.com/ClangBuiltLinux/linux/issues/204
Signed-off-by: Nick Desaulniers <nick.desaulniers@gmail.com>
---
 arch/x86/mm/fault.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index 47bebfe6efa7..057d2178fa19 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -760,9 +760,11 @@ no_context(struct pt_regs *regs, unsigned long error_code,
 		 * and then double-fault, though, because we're likely to
 		 * break the console driver and lose most of the stack dump.
 		 */
-		asm volatile ("movq %[stack], %%rsp\n\t"
+		asm volatile (UNWIND_HINT_SAVE
+			      "movq %[stack], %%rsp\n\t"
 			      "call handle_stack_overflow\n\t"
-			      "1: jmp 1b"
+			      "1: jmp 1b\n\t"
+			      UNWIND_HINT_RESTORE
 			      : ASM_CALL_CONSTRAINT
 			      : "D" ("kernel stack overflow (page fault)"),
 				"S" (regs), "d" (address),
-- 
2.17.1


             reply	other threads:[~2018-10-15  0:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-15  0:37 Nick Desaulniers [this message]
2018-10-15  3:43 ` Andy Lutomirski
2018-10-15  5:17   ` Nathan Chancellor
2018-10-15 14:22     ` Josh Poimboeuf
2018-10-15 14:34     ` Andy Lutomirski
2018-10-15 15:22       ` Nathan Chancellor
2018-10-15 15:31         ` Josh Poimboeuf
2018-10-15 16:03           ` Andy Lutomirski
2018-10-15 16:07             ` Nathan Chancellor
2018-10-15 16:20             ` Josh Poimboeuf
2018-10-15 16:57             ` Nick Desaulniers
2018-10-15 17:23               ` Nick Desaulniers

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=20181015003726.29103-1-nick.desaulniers@gmail.com \
    --to=nick.desaulniers@gmail.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=natechancellor@gmail.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --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

all inboxes | Powered by JetHome®