Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1685148 > unrolled thread

[PATCH v3 08/10] x86/asm: add unwind hint annotations to sync_core()

Started byJosh Poimboeuf <jpoimboe@redhat.com>
First post2017-07-11 17:40 +0200
Last post2017-07-18 12:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v3 08/10] x86/asm: add unwind hint annotations to sync_core() Josh Poimboeuf <jpoimboe@redhat.com> - 2017-07-11 17:40 +0200
    [tip:x86/asm] x86/asm: Add unwind hint annotations to sync_core() tip-bot for Josh Poimboeuf <tipbot@zytor.com> - 2017-07-18 12:50 +0200

#1685148 — [PATCH v3 08/10] x86/asm: add unwind hint annotations to sync_core()

FromJosh Poimboeuf <jpoimboe@redhat.com>
Date2017-07-11 17:40 +0200
Subject[PATCH v3 08/10] x86/asm: add unwind hint annotations to sync_core()
Message-ID<u25qy-454-23@gated-at.bofh.it>
This enables objtool to grok the iret in the middle of a C function.

Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
---
 arch/x86/include/asm/processor.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index 6a79547..b27dc9b 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -22,6 +22,7 @@ struct vm86;
 #include <asm/nops.h>
 #include <asm/special_insns.h>
 #include <asm/fpu/types.h>
+#include <asm/unwind_hints.h>
 
 #include <linux/personality.h>
 #include <linux/cache.h>
@@ -684,6 +685,7 @@ static inline void sync_core(void)
 	unsigned int tmp;
 
 	asm volatile (
+		UNWIND_HINT_SAVE
 		"mov %%ss, %0\n\t"
 		"pushq %q0\n\t"
 		"pushq %%rsp\n\t"
@@ -693,6 +695,7 @@ static inline void sync_core(void)
 		"pushq %q0\n\t"
 		"pushq $1f\n\t"
 		"iretq\n\t"
+		UNWIND_HINT_RESTORE
 		"1:"
 		: "=&r" (tmp), "+r" (__sp) : : "cc", "memory");
 #endif
-- 
2.7.5

[toc] | [next] | [standalone]


#1690077 — [tip:x86/asm] x86/asm: Add unwind hint annotations to sync_core()

Fromtip-bot for Josh Poimboeuf <tipbot@zytor.com>
Date2017-07-18 12:50 +0200
Subject[tip:x86/asm] x86/asm: Add unwind hint annotations to sync_core()
Message-ID<u4yeK-1hB-1@gated-at.bofh.it>
In reply to#1685148
Commit-ID:  76846bf3cb09e98881cb4908385a0e899716b01f
Gitweb:     http://git.kernel.org/tip/76846bf3cb09e98881cb4908385a0e899716b01f
Author:     Josh Poimboeuf <jpoimboe@redhat.com>
AuthorDate: Tue, 11 Jul 2017 10:33:45 -0500
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Tue, 18 Jul 2017 10:57:44 +0200

x86/asm: Add unwind hint annotations to sync_core()

This enables objtool to grok the iret in the middle of a C function.

Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Jiri Slaby <jslaby@suse.cz>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: live-patching@vger.kernel.org
Link: http://lkml.kernel.org/r/b057be26193c11d2ed3337b2107bc7adcba42c99.1499786555.git.jpoimboe@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/include/asm/processor.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index 6a79547..b27dc9b 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -22,6 +22,7 @@ struct vm86;
 #include <asm/nops.h>
 #include <asm/special_insns.h>
 #include <asm/fpu/types.h>
+#include <asm/unwind_hints.h>
 
 #include <linux/personality.h>
 #include <linux/cache.h>
@@ -684,6 +685,7 @@ static inline void sync_core(void)
 	unsigned int tmp;
 
 	asm volatile (
+		UNWIND_HINT_SAVE
 		"mov %%ss, %0\n\t"
 		"pushq %q0\n\t"
 		"pushq %%rsp\n\t"
@@ -693,6 +695,7 @@ static inline void sync_core(void)
 		"pushq %q0\n\t"
 		"pushq $1f\n\t"
 		"iretq\n\t"
+		UNWIND_HINT_RESTORE
 		"1:"
 		: "=&r" (tmp), "+r" (__sp) : : "cc", "memory");
 #endif

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web