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


Groups > linux.kernel > #1722708

[PATCH 4/8] livepatch: Add klp-convert annotation helpers

From Joao Moreira <jmoreira@suse.de>
Newsgroups linux.kernel
Subject [PATCH 4/8] livepatch: Add klp-convert annotation helpers
Date 2017-08-29 21:10 +0200
Message-ID <ujU3E-6AB-21@gated-at.bofh.it> (permalink)
References <ujU3D-6AB-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Josh Poimboeuf <jpoimboe@redhat.com>

Define macros KLP_MODULE_RELOC and KLP_SYMPOS in
include/linux/livepatch.h to improve user-friendliness of the
livepatch annotation process.

[jmoreira:
* split up: move KLP_MODULE_RELOC from previous patch to here
* add KLP_SYMPOS
* move macros from include/uapi/livepatch.h to include/linux/livepatch.h
]

Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Joao Moreira <jmoreira@suse.de>
---
 include/linux/livepatch.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/include/linux/livepatch.h b/include/linux/livepatch.h
index 96a75be7ef50..3956929f21bc 100644
--- a/include/linux/livepatch.h
+++ b/include/linux/livepatch.h
@@ -165,6 +165,17 @@ static inline bool klp_have_reliable_stack(void)
 	       IS_ENABLED(CONFIG_HAVE_RELIABLE_STACKTRACE);
 }
 
+/* Used to annotate symbol relocations in livepatches */
+#define KLP_MODULE_RELOC(obj)						\
+	struct klp_module_reloc						\
+	__attribute__((__section__(".klp.module_relocs." #obj)))
+
+#define KLP_SYMPOS(symbol, pos)						\
+	{								\
+		.sym = &symbol,						\
+		.sympos = pos,						\
+	},
+
 #else /* !CONFIG_LIVEPATCH */
 
 static inline int klp_module_coming(struct module *mod) { return 0; }
-- 
2.12.0

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH 4/8] livepatch: Add klp-convert annotation helpers Joao Moreira <jmoreira@suse.de> - 2017-08-29 21:10 +0200

csiph-web