From patchwork Wed Feb 17 12:35:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Fleming X-Patchwork-Id: 62101 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp2256843lbl; Wed, 17 Feb 2016 04:36:37 -0800 (PST) X-Received: by 10.66.142.132 with SMTP id rw4mr1754726pab.26.1455712597241; Wed, 17 Feb 2016 04:36:37 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id on6si1768197pac.30.2016.02.17.04.36.36; Wed, 17 Feb 2016 04:36:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dkim=pass header.i=@codeblueprint-co-uk.20150623.gappssmtp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965287AbcBQMgX (ORCPT + 30 others); Wed, 17 Feb 2016 07:36:23 -0500 Received: from mail-wm0-f47.google.com ([74.125.82.47]:35387 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965280AbcBQMgU (ORCPT ); Wed, 17 Feb 2016 07:36:20 -0500 Received: by mail-wm0-f47.google.com with SMTP id c200so211238625wme.0 for ; Wed, 17 Feb 2016 04:36:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codeblueprint-co-uk.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7Ijf6/Fv34JSZztsVY3UbWqoRbDdWmcju/BrJu6QqBc=; b=CtGp+ubeyBH/vCGCCJiRghJAz66Tc8qMex2d0Y/ji5FJC/AkFEbwgmCVraA+o7zfFR 83DjSKZWMnE5wDPyzOh7N8qcuWGBM6se9z43S0kdRRZXke2oM7jfz9vb8g0NGCcTt0V5 wkTEalvKnQsXQDffZKzGcXn25nciST8tKzQfYsMEFxcUs8FBP3RfS7Avb51f3A2SwT/c 436qubW2kNN4H4z9ym00gs5lm6+989XOvF3uSkXaiXXSp1nF81z7tvf7Jb7X6Nbs14Um g+h7OclUFkiNHW6G3Yxt/7raNG3iQnY0Kp97HB9vlctBVbr3jm0TxRwIgEEoub2ZLIg0 /tFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=7Ijf6/Fv34JSZztsVY3UbWqoRbDdWmcju/BrJu6QqBc=; b=VEh+5gNK65FljQv6nCYkcC8rsQirba+68J6hotQAvWygF3pqyARl4FvZEOzOD8cLHb XC0u7EwqgxzHSoLr7Zw+/yYGi81zMhPTdmlY7wQuTfALImidpeBx0a/v9a/5z2/Uj/9t 8ViBhKjBbnuqgwrZbj+1fWbUl6gKcNxaVITsJ7ogQJel/Rd+dy/IXMbcJ9vn/O3fr0Na qOmxHhO9F/zBX8g04vVvHuJivFsM1heYYiiVIfY1lFpgO1QXffbTG0jDFxRjRfuJRYyX LZ6sVDbX3iOhMC13yBJk/n8r4FLs/E1okW0/K1zB7AmBSFzkPlhiaPB/SjvNYIRWkrGR i9ig== X-Gm-Message-State: AG10YOQiGQKXo0LfRKhI3+9gHwZiFgVA9CXQNZbrlI6aqcPWpTCnWR+17ds9z2R24sym7Q== X-Received: by 10.194.63.7 with SMTP id c7mr1694937wjs.168.1455712579230; Wed, 17 Feb 2016 04:36:19 -0800 (PST) Received: from localhost (5ec16434.skybroadband.com. [94.193.100.52]) by smtp.gmail.com with ESMTPSA id av3sm1282343wjc.44.2016.02.17.04.36.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Feb 2016 04:36:18 -0800 (PST) From: Matt Fleming To: Ingo Molnar , Thomas Gleixner , "H . Peter Anvin" Cc: Ard Biesheuvel , linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, Matt Fleming , Mark Rutland Subject: [PATCH 06/13] efi/efistub: Prevent __init annotations from being used Date: Wed, 17 Feb 2016 12:35:59 +0000 Message-Id: <1455712566-16727-7-git-send-email-matt@codeblueprint.co.uk> X-Mailer: git-send-email 2.6.2 In-Reply-To: <1455712566-16727-1-git-send-email-matt@codeblueprint.co.uk> References: <1455712566-16727-1-git-send-email-matt@codeblueprint.co.uk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ard Biesheuvel __init annotations should not be used in the EFI stub, since the code is either included in the decompressor (x86, ARM) where they have no effect, or the whole stub is __init annotated at the section level (arm64), by renaming the sections, in which case the __init annotations will be redundant, and will result in section names like .init.init.text, and our linker script does not expect that. So un-#define __init so that its inadvertent use will force a build error. Signed-off-by: Ard Biesheuvel Acked-by: Mark Rutland Signed-off-by: Matt Fleming --- drivers/firmware/efi/libstub/efistub.h | 10 ++++++++++ 1 file changed, 10 insertions(+) -- 2.6.2 diff --git a/drivers/firmware/efi/libstub/efistub.h b/drivers/firmware/efi/libstub/efistub.h index 6b6548fda089..86ff7bfa6ace 100644 --- a/drivers/firmware/efi/libstub/efistub.h +++ b/drivers/firmware/efi/libstub/efistub.h @@ -5,6 +5,16 @@ /* error code which can't be mistaken for valid address */ #define EFI_ERROR (~0UL) +/* + * __init annotations should not be used in the EFI stub, since the code is + * either included in the decompressor (x86, ARM) where they have no effect, + * or the whole stub is __init annotated at the section level (arm64), by + * renaming the sections, in which case the __init annotation will be + * redundant, and will result in section names like .init.init.text, and our + * linker script does not expect that. + */ +#undef __init + void efi_char16_printk(efi_system_table_t *, efi_char16_t *); efi_status_t efi_open_volume(efi_system_table_t *sys_table_arg, void *__image,