public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] ARM: Thumb-2: Reflect ARM/Thumb-2 configuration in module vermagic
@ 2011-02-22 13:48 Dave Martin
  2011-02-22 20:03 ` Nicolas Pitre
  0 siblings, 1 reply; 4+ messages in thread
From: Dave Martin @ 2011-02-22 13:48 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.

Signed-off-by: Dave Martin <dave.martin@linaro.org>
---
 arch/arm/include/asm/module.h |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/module.h b/arch/arm/include/asm/module.h
index 12c8e68..09fcaa0 100644
--- a/arch/arm/include/asm/module.h
+++ b/arch/arm/include/asm/module.h
@@ -25,8 +25,15 @@ struct mod_arch_specific {
 };
 
 /*
- * Include the ARM architecture version.
+ * Include the ARM architecture version and instruction set architecture.
  */
-#define MODULE_ARCH_VERMAGIC	"ARMv" __stringify(__LINUX_ARM_ARCH__) " "
+#ifdef CONFIG_THUMB2_KERNEL
+#define ARM_ARCH_VERMAGIC_ISAFAMILY " thumb2"
+#else
+#define ARM_ARCH_VERMAGIC_ISAFAMILY ""
+#endif
+
+#define MODULE_ARCH_VERMAGIC	"ARMv" __stringify(__LINUX_ARM_ARCH__) \
+	ARM_ARCH_VERMAGIC_ISAFAMILY " "
 
 #endif /* _ASM_ARM_MODULE_H */
-- 
1.7.1

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

* [PATCH] ARM: Thumb-2: Reflect ARM/Thumb-2 configuration in module vermagic
  2011-02-22 13:48 [PATCH] ARM: Thumb-2: Reflect ARM/Thumb-2 configuration in module vermagic Dave Martin
@ 2011-02-22 20:03 ` Nicolas Pitre
  2011-02-22 20:25   ` Russell King - ARM Linux
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Pitre @ 2011-02-22 20:03 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, 22 Feb 2011, Dave Martin wrote:

> 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.

Too bad.

> 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.
> 
> Signed-off-by: Dave Martin <dave.martin@linaro.org>

Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>



> ---
>  arch/arm/include/asm/module.h |   11 +++++++++--
>  1 files changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/include/asm/module.h b/arch/arm/include/asm/module.h
> index 12c8e68..09fcaa0 100644
> --- a/arch/arm/include/asm/module.h
> +++ b/arch/arm/include/asm/module.h
> @@ -25,8 +25,15 @@ struct mod_arch_specific {
>  };
>  
>  /*
> - * Include the ARM architecture version.
> + * Include the ARM architecture version and instruction set architecture.
>   */
> -#define MODULE_ARCH_VERMAGIC	"ARMv" __stringify(__LINUX_ARM_ARCH__) " "
> +#ifdef CONFIG_THUMB2_KERNEL
> +#define ARM_ARCH_VERMAGIC_ISAFAMILY " thumb2"
> +#else
> +#define ARM_ARCH_VERMAGIC_ISAFAMILY ""
> +#endif
> +
> +#define MODULE_ARCH_VERMAGIC	"ARMv" __stringify(__LINUX_ARM_ARCH__) \
> +	ARM_ARCH_VERMAGIC_ISAFAMILY " "
>  
>  #endif /* _ASM_ARM_MODULE_H */
> -- 
> 1.7.1
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

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

* [PATCH] ARM: Thumb-2: Reflect ARM/Thumb-2 configuration in module vermagic
  2011-02-22 20:03 ` Nicolas Pitre
@ 2011-02-22 20:25   ` Russell King - ARM Linux
  2011-02-22 20:35     ` Nicolas Pitre
  0 siblings, 1 reply; 4+ messages in thread
From: Russell King - ARM Linux @ 2011-02-22 20:25 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Feb 22, 2011 at 03:03:46PM -0500, Nicolas Pitre wrote:
> On Tue, 22 Feb 2011, Dave Martin wrote:
> 
> > 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.
> 
> Too bad.
> 
> > 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.
> > 
> > Signed-off-by: Dave Martin <dave.martin@linaro.org>
> 
> Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>

Lets wait until after the next merge window has gone, or let's have a
patch which takes account of stuff already merged.  Either way, there
little point acking it as it needs an effective rewrite to fit around
the P2V changes to this file.

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

* [PATCH] ARM: Thumb-2: Reflect ARM/Thumb-2 configuration in module vermagic
  2011-02-22 20:25   ` Russell King - ARM Linux
@ 2011-02-22 20:35     ` Nicolas Pitre
  0 siblings, 0 replies; 4+ messages in thread
From: Nicolas Pitre @ 2011-02-22 20:35 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, 22 Feb 2011, Russell King - ARM Linux wrote:

> On Tue, Feb 22, 2011 at 03:03:46PM -0500, Nicolas Pitre wrote:
> > On Tue, 22 Feb 2011, Dave Martin wrote:
> > 
> > > 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.
> > 
> > Too bad.
> > 
> > > 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.
> > > 
> > > Signed-off-by: Dave Martin <dave.martin@linaro.org>
> > 
> > Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org>
> 
> Lets wait until after the next merge window has gone, or let's have a
> patch which takes account of stuff already merged.  Either way, there
> little point acking it as it needs an effective rewrite to fit around
> the P2V changes to this file.

It certainly can be made to apply on top of your p2v-stable branch.


Nicolas

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

end of thread, other threads:[~2011-02-22 20:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-22 13:48 [PATCH] ARM: Thumb-2: Reflect ARM/Thumb-2 configuration in module vermagic Dave Martin
2011-02-22 20:03 ` Nicolas Pitre
2011-02-22 20:25   ` Russell King - ARM Linux
2011-02-22 20:35     ` Nicolas Pitre

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