From patchwork Wed Feb 23 11:53:41 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 205 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:40:50 -0000 Delivered-To: patches@linaro.org Received: by 10.224.19.208 with SMTP id c16cs285616qab; Wed, 23 Feb 2011 03:53:51 -0800 (PST) Received: by 10.213.10.141 with SMTP id p13mr278908ebp.5.1298462031111; Wed, 23 Feb 2011 03:53:51 -0800 (PST) Received: from mail-ey0-f178.google.com (mail-ey0-f178.google.com [209.85.215.178]) by mx.google.com with ESMTPS id w5si18982134eeh.12.2011.02.23.03.53.50 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 23 Feb 2011 03:53:51 -0800 (PST) Received-SPF: neutral (google.com: 209.85.215.178 is neither permitted nor denied by best guess record for domain of dave.martin@linaro.org) client-ip=209.85.215.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.215.178 is neither permitted nor denied by best guess record for domain of dave.martin@linaro.org) smtp.mail=dave.martin@linaro.org Received: by eya25 with SMTP id 25so1886777eya.37 for ; Wed, 23 Feb 2011 03:53:50 -0800 (PST) Received: by 10.213.31.196 with SMTP id z4mr4153739ebc.1.1298462029902; Wed, 23 Feb 2011 03:53:49 -0800 (PST) Received: from LinaroE102765.arm.com (host86-144-161-218.range86-144.btcentralplus.com [86.144.161.218]) by mx.google.com with ESMTPS id x54sm4644563eeh.5.2011.02.23.03.53.47 (version=SSLv3 cipher=OTHER); Wed, 23 Feb 2011 03:53:48 -0800 (PST) From: Dave Martin To: linux-arm-kernel@lists.infradead.org Cc: patches@linaro.org, Dave Martin Subject: [PATCH v2] ARM: Thumb-2: Reflect ARM/Thumb-2 configuration in module vermagic Date: Wed, 23 Feb 2011 11:53:41 +0000 Message-Id: <1298462021-22177-1-git-send-email-dave.martin@linaro.org> X-Mailer: git-send-email 1.7.1 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 Acked-by: Nicolas Pitre --- 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 */