lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1687247415-32057-2-git-send-email-tangyouling@loongson.cn>
Date:   Tue, 20 Jun 2023 15:50:07 +0800
From:   Youling Tang <tangyouling@...ngson.cn>
To:     Josh Poimboeuf <jpoimboe@...nel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Huacai Chen <chenhuacai@...nel.org>,
        madvenka@...ux.microsoft.com
Cc:     chenzhongjin@...wei.com, WANG Xuerui <kernel@...0n.name>,
        Xi Ruoyao <xry111@...111.site>, live-patching@...r.kernel.org,
        linux-kernel@...r.kernel.org, loongarch@...ts.linux.dev,
        tangyouling00@...il.com, youling.tang@...look.com
Subject: [RFC PATCH v1 11/23] objtool: Add annotate_reachable() for objtools

x86 removed annotate_reachable and replaced it with ASM_REACHABLE
which is not suitable for LoongArch micro.

Re-add annotation_reachable() for LoongArch.

Signed-off-by: Chen Zhongjin <chenzhongjin@...wei.com>
Signed-off-by: Youling Tang <tangyouling@...ngson.cn>
---
 include/linux/compiler.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 947a60b801db..6b33de8bf7c3 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -117,6 +117,14 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
  */
 #define __stringify_label(n) #n
 
+#define __annotate_reachable(c) ({					\
+	asm volatile(__stringify_label(c) ":\n\t"			\
+			".pushsection .discard.reachable\n\t"		\
+			".long " __stringify_label(c) "b - .\n\t"	\
+			".popsection\n\t");				\
+})
+#define annotate_reachable() __annotate_reachable(__COUNTER__)
+
 #define __annotate_unreachable(c) ({					\
 	asm volatile(__stringify_label(c) ":\n\t"			\
 		     ".pushsection .discard.unreachable\n\t"		\
@@ -129,6 +137,7 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
 #define __annotate_jump_table __section(".rodata..c_jump_table")
 
 #else /* !CONFIG_OBJTOOL */
+#define annotate_reachable()
 #define annotate_unreachable()
 #define __annotate_jump_table
 #endif /* CONFIG_OBJTOOL */
-- 
2.39.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ