From patchwork Fri Feb 25 16:54:52 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 220 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:58 -0000 Delivered-To: patches@linaro.org Received: by 10.224.19.208 with SMTP id c16cs17236qab; Fri, 25 Feb 2011 08:55:19 -0800 (PST) Received: by 10.227.147.138 with SMTP id l10mr2341949wbv.197.1298652918414; Fri, 25 Feb 2011 08:55:18 -0800 (PST) Received: from mail-ww0-f42.google.com (mail-ww0-f42.google.com [74.125.82.42]) by mx.google.com with ESMTPS id y20si1704521wbh.26.2011.02.25.08.55.17 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 25 Feb 2011 08:55:18 -0800 (PST) Received-SPF: neutral (google.com: 74.125.82.42 is neither permitted nor denied by best guess record for domain of dave.martin@linaro.org) client-ip=74.125.82.42; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.42 is neither permitted nor denied by best guess record for domain of dave.martin@linaro.org) smtp.mail=dave.martin@linaro.org Received: by wwe15 with SMTP id 15so839260wwe.1 for ; Fri, 25 Feb 2011 08:55:17 -0800 (PST) Received: by 10.227.11.198 with SMTP id u6mr435481wbu.135.1298652917060; Fri, 25 Feb 2011 08:55:17 -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 y29sm686004wbd.16.2011.02.25.08.55.15 (version=SSLv3 cipher=OTHER); Fri, 25 Feb 2011 08:55:16 -0800 (PST) From: Dave Martin To: patches@arm.linux.org.uk Cc: patches@linaro.org, Dave Martin Subject: [PATCH] ARM: Thumb-2: Reflect ARM/Thumb-2 configuration in module vermagic Date: Fri, 25 Feb 2011 16:54:52 +0000 Message-Id: <1298652892-16384-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. Signed-off-by: Dave Martin Acked-by: Nicolas Pitre --- KernelVersion: rmk/p2v 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 */