Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp88197iof; Sun, 5 Jun 2022 22:00:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw25KZDirGmTYeDP8Hdd5MyyrmZ1mb9hQSZ3ul2TBOCmxXi1MkMJLwUvfeoTXtBudIBbwbm X-Received: by 2002:a17:90b:21d3:b0:1e3:2eee:3aba with SMTP id ll19-20020a17090b21d300b001e32eee3abamr24667566pjb.232.1654491632781; Sun, 05 Jun 2022 22:00:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654491632; cv=none; d=google.com; s=arc-20160816; b=OCE2JQvQbegK6777U59ztrW3Ng1u5MJ9KOBJI1vpZw1jlfS1L/BPa4ib+z3NBLnM4m R8DsJjMtP3VkvUrbkKXLn1qc6ux7Nualp4x8tWmYlEPM29TrKeUKy532xxPV3hscvlnS aCwDzH28i7Ul2Cd45MOoFODiz8G+VCS90j+6OGzbPP2UKaEbAF7w+mpMZUN3032Fn20M FJJdYaXPaTdTU2au+DdqaWIVROxMJK3nRcSphH+zMb4t7EZs1TSZQLWOd8wNzGknnxRs TC1lqrsIWcSlbK1h1upR7Ui7RI9IIWo5t4lpa5MkSwrtXL/XIOKSPIsGV/EzwjEQkzg0 s7Gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter; bh=FEAy194PWq95HNbYDnr1IqurmUH0R2wQrRmS1HC000s=; b=eicUVrdEZUTr40TA8EowLXBbxbkaXB7rIlIiRJeqwmPfjTmTMOV4uw7SYl6xlFuaE1 671+pRMX3gs/j1+FpNcwxQPg0zQNrVozhSPa/7M1PdoT1ubQZiQ/Trd7Yfmj+F9YSXEI rFcJKELN5iTH5Gghlk7LwvFPKus2+iRFqT191TSS8jo3JNWY+Ec69GWS/BDv6anc97Ya BZIXDZcWqMZEaJhVovx+ZDQRoKxzJtNL45BPMvKunLqH9jzFS9iBPgp9/rfipuVFKse/ x81a2PRblaRoPf/+dbBk2vfBxONv324Vq6RUSywIXzE0VFTwKsVKPGJDqX5quRf8IU5m 2kiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=P1D+qmFK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id i5-20020aa78b45000000b00518be006107si18211562pfd.116.2022.06.05.22.00.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 22:00:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=P1D+qmFK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 870AA1248D8; Sun, 5 Jun 2022 21:14:32 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233695AbiFDIxl (ORCPT + 99 others); Sat, 4 Jun 2022 04:53:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231640AbiFDIxh (ORCPT ); Sat, 4 Jun 2022 04:53:37 -0400 Received: from conuserg-11.nifty.com (conuserg-11.nifty.com [210.131.2.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DCE520BD3 for ; Sat, 4 Jun 2022 01:53:35 -0700 (PDT) Received: from grover.sesame (133-32-177-133.west.xps.vectant.ne.jp [133.32.177.133]) (authenticated) by conuserg-11.nifty.com with ESMTP id 2548p0xo013521; Sat, 4 Jun 2022 17:51:00 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com 2548p0xo013521 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1654332661; bh=FEAy194PWq95HNbYDnr1IqurmUH0R2wQrRmS1HC000s=; h=From:To:Cc:Subject:Date:From; b=P1D+qmFKkOacKls3HlfteNNBNbd46qHxatZFOoNxKzKI7qCjiD7P5mXwp51JouN3e WvF8ToAxeBgnAny1boG6PxhPcFE42TG+1OSnhr8UtAAdz6ncuHuVA8tYENs6QfI3sM R7zrVo8VuWsASAk7d2fQbqnma/rf8H1xhe6AIQvgD7tfZNaCMvngd+gv9Z7Ts9DriX 13zgBwgocKc9E2+G04x8jh+7ayALIgY71pdsjLPXaAxidMveTXBtRz/2VdmC2kvynE XgeL5A8l2/cFWe37pBB8rsG3m6zg1mV5SdHi56K64Ec4xfdDZdXuPvUfnN3zpyZUwQ XIOXj7GpyrfGw== X-Nifty-SrcIP: [133.32.177.133] From: Masahiro Yamada To: Michael Ellerman , linuxppc-dev@lists.ozlabs.org Cc: Benjamin Herrenschmidt , Paul Mackerras , Masahiro Yamada , Christophe Leroy , Diana Craciun , Frank Rowand , Jason Yan , Rob Herring , Scott Wood , linux-kernel@vger.kernel.org Subject: [PATCH] powerpc: get rid of #include Date: Sat, 4 Jun 2022 17:50:50 +0900 Message-Id: <20220604085050.4078927-1-masahiroy@kernel.org> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org You cannot include here because it is generated in init/Makefile but there is no guarantee that it happens before arch/powerpc/mm/nohash/kaslr_booke.c is compiled for parallel builds. The places where you can reliably include are: - init/ (because init/Makefile can specify the dependency) - arch/*/boot/ (because it is compiled after vmlinux) Commit f231e4333312 ("hexagon: get rid of #include ") fixed the last breakage at that time, but powerpc re-added this. was unneeded because 'build_str' is almost the same as 'linux_banner' defined in init/version.c Let's copy the solution from MIPS. (get_random_boot() in arch/mips/kernel/relocate.c) Fixes: 6a38ea1d7b94 ("powerpc/fsl_booke/32: randomize the kernel image offset") Signed-off-by: Masahiro Yamada --- If this gets into the mainline before -rc2 or -rc3, I will base my kbuild work on top of this. arch/powerpc/mm/nohash/kaslr_booke.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/mm/nohash/kaslr_booke.c b/arch/powerpc/mm/nohash/kaslr_booke.c index 96c38f971603..5f81c076621f 100644 --- a/arch/powerpc/mm/nohash/kaslr_booke.c +++ b/arch/powerpc/mm/nohash/kaslr_booke.c @@ -18,7 +18,6 @@ #include #include #include -#include #include struct regions { @@ -36,10 +35,6 @@ struct regions { int reserved_mem_size_cells; }; -/* Simplified build-specific string for starting entropy. */ -static const char build_str[] = UTS_RELEASE " (" LINUX_COMPILE_BY "@" - LINUX_COMPILE_HOST ") (" LINUX_COMPILER ") " UTS_VERSION; - struct regions __initdata regions; static __init void kaslr_get_cmdline(void *fdt) @@ -70,7 +65,8 @@ static unsigned long __init get_boot_seed(void *fdt) { unsigned long hash = 0; - hash = rotate_xor(hash, build_str, sizeof(build_str)); + /* build-specific string for starting entropy. */ + hash = rotate_xor(hash, linux_banner, strlen(linux_banner)); hash = rotate_xor(hash, fdt, fdt_totalsize(fdt)); return hash; -- 2.32.0