Skip to contentSkip to conversation

ARM: Thumb-2: Reflect ARM/Thumb-2 configuration in module vermagic

PATCH Superseded Dave Martin 2 participants 5 messages Feb 23, 2011 – Feb 25, 2011 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ARM: Thumb-2: Reflect ARM/Thumb-2 configuration in module vermagic

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.

---
KernelVersion: rmk/p2v

 arch/arm/include/asm/module.h |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
arch/arm/include/asm/module.h +8 -0
index a2b775b..543b449 100644
@@ -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 */
Signature · 1 line
1.7.1
#1 lore raw

PATCH v2 1/1 ARM: Thumb-2: Reflect ARM/Thumb-2 configuration in module vermagic

Hello.

Quoted 9 lines · Dave Martin

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.

Patch changelog should follow the -- tearline.

Quoted 2 lines

WBR, Sergei

#2 lore raw

PATCH v2 1/1 ARM: Thumb-2: Reflect ARM/Thumb-2 configuration in module vermagic

Quoted 12 lines · Sergei Shtylyov

Hello.

Quoted 7 lines · Dave Martin

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.

Quoted 9 lines
Quoted 1 line

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

? Patch changelog should follow the -- tearline.

Quoted 2 lines

WBR, Sergei

Opinions seem to differ... I have no strong opinion on this myself.

Cheers
---Dave

#3 lore raw

PATCH v2 1/1 ARM: Thumb-2: Reflect ARM/Thumb-2 configuration in module vermagic

Hello.

Quoted 8 lines · Dave Martin
Quoted 7 lines
Quoted 7 lines

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.

Quoted 6 lines
Quoted 4 lines

Patch changelog should follow the -- tearline.

Quoted 2 lines

Opinions seem to differ... I have no strong opinion on this myself.

At least that's what Documentation/SubmittingPatches suggests:

<<
One good use for the additional comments after the "---" marker is for a diffstat, to show what files have changed, and the number of inserted and deleted lines per file. A diffstat is especially useful on bigger patches. Other comments relevant only to the moment or the maintainer, not suitable for the permanent changelog, should also go here. A good example of such comments might be "patch changelogs" which describe what has changed between the v1 and v2 version of the patch.

Quoted 4 lines
Quoted 1 line

Cheers
---Dave

WBR, Sergei

#4 lore raw

PATCH v2 1/1 ARM: Thumb-2: Reflect ARM/Thumb-2 configuration in module vermagic

Quoted 21 lines · Sergei Shtylyov

Hello.

Quoted 8 lines · Dave Martin
Quoted 7 lines
Quoted 7 lines

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.

Quoted 4 lines
Quoted 4 lines

?Patch changelog should follow the -- tearline.

Quoted 2 lines

?> Opinions seem to differ... I have no strong opinion on this myself.

? At least that's what Documentation/SubmittingPatches suggests:

Quoted 9 lines

<<
One good use for the additional comments after the "---" marker is for a diffstat, to show what files have changed, and the number of inserted and deleted lines per file. ?A diffstat is especially useful on bigger patches. ?Other comments relevant only to the moment or the maintainer, not suitable for the permanent changelog, should also go here. ?A good example of such comments might be "patch changelogs" which describe what has changed between the v1 and v2 version of the patch.

Fair enough. Doesn't sounds like a inflexible rule all the same, but when the history ceases to be relevant when the patch is merged upstream (as in my case) is may be better to do as you suggest. I agree with Grant that it may sometimes be useful to preserve some of this information in the final commit for more complex/subtle cases, though.

I normally tidy up the cruft before sending a patch to Russell's patch system in any case.

Cheers
---Dave