public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH v2] ARM: Thumb-2: Reflect ARM/Thumb-2 configuration in module vermagic
@ 2011-02-23 11:53 Dave Martin
  2011-02-23 21:24 ` Sergei Shtylyov
  0 siblings, 1 reply; 5+ messages in thread
From: Dave Martin @ 2011-02-23 11:53 UTC (permalink / raw)
  To: linux-arm-kernel

Loading Thumb-2 modules into an ARM kernel or vice-versa isn't
guaranteed to work safely, since the kernel is not interworking-
aware everywhere.

This patch adds "thumb2" to the module vermagic when
CONFIG_THUMB2_KERNEL is enabled, to help avoid accidental loading
of modules into the wrong kernel.

v2: modified to apply consistently on top of rmk's p2v branch.

Signed-off-by: Dave Martin <dave.martin@linaro.org>
Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
---
KernelVersion: rmk/p2v

 arch/arm/include/asm/module.h |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/arch/arm/include/asm/module.h b/arch/arm/include/asm/module.h
index a2b775b..543b449 100644
--- a/arch/arm/include/asm/module.h
+++ b/arch/arm/include/asm/module.h
@@ -40,8 +40,16 @@ struct mod_arch_specific {
 #define MODULE_ARCH_VERMAGIC_P2V ""
 #endif
 
+/* Add instruction set architecture tag to distinguish ARM/Thumb kernels */
+#ifdef CONFIG_THUMB2_KERNEL
+#define MODULE_ARCH_VERMAGIC_ARMTHUMB "thumb2 "
+#else
+#define MODULE_ARCH_VERMAGIC_ARMTHUMB ""
+#endif
+
 #define MODULE_ARCH_VERMAGIC \
 	MODULE_ARCH_VERMAGIC_ARMVSN \
+	MODULE_ARCH_VERMAGIC_ARMTHUMB \
 	MODULE_ARCH_VERMAGIC_P2V
 
 #endif /* _ASM_ARM_MODULE_H */
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-02-25 18:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-23 11:53 [PATCH v2] ARM: Thumb-2: Reflect ARM/Thumb-2 configuration in module vermagic Dave Martin
2011-02-23 21:24 ` Sergei Shtylyov
2011-02-24 11:06   ` Dave Martin
2011-02-25 17:53     ` Sergei Shtylyov
2011-02-25 18:18       ` Dave Martin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox