From patchwork Wed Mar 29 08:56:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9651039 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 44953601D7 for ; Wed, 29 Mar 2017 08:56:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3AA9826E82 for ; Wed, 29 Mar 2017 08:56:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2EF0D283B9; Wed, 29 Mar 2017 08:56:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.wl.linuxfoundation.org (Postfix) with SMTP id 27BA426E82 for ; Wed, 29 Mar 2017 08:56:40 +0000 (UTC) Received: (qmail 21570 invoked by uid 550); 29 Mar 2017 08:56:39 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 21532 invoked from network); 29 Mar 2017 08:56:36 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=hQ/8IZqhuye2knq0MYAte/lg2DyrQyWGc5zLhzVcFgo=; b=HXjTBvvEXPnwAlAxQe98d1Cz0LB8qIrCNzaddXJftzaVe6JcDa2RPd31pTotaotz59 q33ce29k33dhfFSAakDjFsE+FA8iPvqo2JxHnHoQUvlNm4HOk6U5oNo8rNcHxu0LR70F D2nhr031yRIRU6jA8SihPoOcW/e3dvYVwOrui/+g19sQinbLibHlH4Q8Y0zIkoKwPM8d Lfx7mii2BM/O+o7wc2caH7pQ0p/bG5+cwH+1VXCOSxdKlYBuc0crab0HxIYq6kn5EqUG KZWmNmkvTbDPjuR/ytNhCATPwlY70UcO2QjFtlZWyu+UW+cHn//grNxw88hQ9LbjPwPQ sYjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=hQ/8IZqhuye2knq0MYAte/lg2DyrQyWGc5zLhzVcFgo=; b=IQArRN5f3z0NvAa6XAh8F+xyqvWDQW0L8kx4Chq5M8Js7oVQlX7Z0k5ItNmCt1l72o j+QMk2fYozuIUtH4E0CLRuat1TejU5F5IEU/NWlhsjpYWwln4m1Lsh3XamKRSJ6G1A4i dZ1mO8VmMHNS6siw9QQOfKN8z8idUj5+M+/jcdPAc1dVQ/UexH9TB1c0rBEJh6DLVqQU ozlD2CZjowlwveO3KTWfmEFsludPL/F5ozVqw5DGprsEPFmE/f4XtWvEnAz8SvWEVZYm tOJZeo4PijqbfaXmiu2CpYWEfn7SqS4Z9rTwPHcK3J51K0IRxxrBk0SbFn/G6NWz3AxQ TRWg== X-Gm-Message-State: AFeK/H215LHGwYCX62oNhtHtUOALGVBBsSV8ZIA0HE3ts3kjuzAY2PpQubVi2E2T4M9fZGimiezTTgDsDET34A== X-Received: by 10.202.206.23 with SMTP id e23mr7083379oig.113.1490777784700; Wed, 29 Mar 2017 01:56:24 -0700 (PDT) MIME-Version: 1.0 Sender: arndbergmann@gmail.com In-Reply-To: References: <1485894263-91051-1-git-send-email-keescook@chromium.org> <1485894263-91051-2-git-send-email-keescook@chromium.org> From: Arnd Bergmann Date: Wed, 29 Mar 2017 10:56:24 +0200 X-Google-Sender-Auth: Egb-tI-mALV8qvhZcUVkCnhXs7M Message-ID: To: Kees Cook Cc: Linux Kernel Mailing List , Emese Revfy , Josh Triplett , PaX Team , Masahiro Yamada , minipli@ld-linux.so, Russell King - ARM Linux , Catalin Marinas , Rasmus Villemoes , David Brown , Benjamin Herrenschmidt , Thomas Gleixner , Andrew Morton , Jeff Layton , Sam Ravnborg , kernel-hardening@lists.openwall.com Subject: [kernel-hardening] Re: [PATCH v5 1/4] gcc-plugins: Add the initify gcc plugin X-Virus-Scanned: ClamAV using ClamSMTP And here is a workaround that I applied locally to avoid the ICE, but I wouldn't want to have this upstream. commit 8712fd8979a5730318a84922fbcb8791ea5af40e Author: Arnd Bergmann Date: Wed Mar 29 10:53:48 2017 +0200 work around initify ICE arch/arm/mach-mv78xx0/common.i: In function 'mv78xx0_init': arch/arm/mach-mv78xx0/common.i:28:38: internal compiler error: in search_constant_strings, at git/arm-soc/scripts/gcc-plugins/initify_plugin.c:1375 __attribute__ ((latent_entropy)) mv78xx0_init(void) ^~~~~~~~~~~~ 0x7fe5cd711b9d search_constant_strings /git/arm-soc/scripts/gcc-plugins/initify_plugin.c:1375 0x7fe5cd711950 search_constant_strings /git/arm-soc/scripts/gcc-plugins/initify_plugin.c:1335 0x7fe5cd711950 search_constant_strings /git/arm-soc/scripts/gcc-plugins/initify_plugin.c:1367 0x7fe5cd712abe search_constant_strings /git/arm-soc/scripts/gcc-plugins/initify_plugin.c:1506 0x7fe5cd712abe search_var_param /git/arm-soc/scripts/gcc-plugins/initify_plugin.c:1419 0x7fe5cd712abe search_const_strs /git/arm-soc/scripts/gcc-plugins/initify_plugin.c:1471 0x7fe5cd712abe initify_function_transform /git/arm-soc/scripts/gcc-plugins/initify_plugin.c:1519 0x932ce7 execute_one_ipa_transform_pass /home/arnd/git/gcc/gcc/passes.c:2207 0x932ce7 execute_all_ipa_transforms() /home/arnd/git/gcc/gcc/passes.c:2249 0x6b28fc cgraph_node::expand() /home/arnd/git/gcc/gcc/cgraphunit.c:2031 0x6b3e5c expand_all_functions /home/arnd/git/gcc/gcc/cgraphunit.c:2174 0x6b3e5c symbol_table::compile() /home/arnd/git/gcc/gcc/cgraphunit.c:2531 0x6b58b7 symbol_table::compile() /home/arnd/git/gcc/gcc/cgraphunit.c:2595 0x6b58b7 symbol_table::finalize_compilation_unit() /home/arnd/git/gcc/gcc/cgraphunit.c:2621 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See for instructions. Signed-off-by: Arnd Bergmann diff --git a/arch/arm/mach-mv78xx0/common.c b/arch/arm/mach-mv78xx0/common.c index f72e1e9f5fc5..66e04a770e32 100644 --- a/arch/arm/mach-mv78xx0/common.c +++ b/arch/arm/mach-mv78xx0/common.c @@ -348,31 +348,41 @@ void __ref mv78xx0_timer_init(void) /***************************************************************************** * General ****************************************************************************/ -static char * __init mv78xx0_id(void) +static const char * __init mv78xx0_id(void) { u32 dev, rev; + static const char *chip_ids[] = { + "MV78X00-Z0", + "MV78X00-Rev-Unsupported", + "MV78100-A0", + "MV78100-A1", + "MV78100-Rev-Unsupported", + "MV78200-A0", + "MV78200-Rev-Unsupported", + "Device-Unknown", + }; mv78xx0_pcie_id(&dev, &rev); if (dev == MV78X00_Z0_DEV_ID) { if (rev == MV78X00_REV_Z0) - return "MV78X00-Z0"; + return chip_ids[0]; else - return "MV78X00-Rev-Unsupported"; + return chip_ids[1]; } else if (dev == MV78100_DEV_ID) { if (rev == MV78100_REV_A0) - return "MV78100-A0"; + return chip_ids[2]; else if (rev == MV78100_REV_A1) - return "MV78100-A1"; + return chip_ids[3]; else - return "MV78100-Rev-Unsupported"; + return chip_ids[4]; } else if (dev == MV78200_DEV_ID) { if (rev == MV78100_REV_A0) - return "MV78200-A0"; + return chip_ids[5]; else - return "MV78200-Rev-Unsupported"; + return chip_ids[6]; } else { - return "Device-Unknown"; + return chip_ids[7]; } }