From patchwork Wed Oct 31 19:28:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 991672 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="DuaXC7YI"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="WSq5yexA"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42ldj45pTdz9s1c for ; Thu, 1 Nov 2018 06:30:32 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=42ssZ219cRkJ3zmcESw7ahgny+HoHsg2O+WnX2zk9Ag=; b=DuaXC7YIwHQxlMFNQCHlBv44Ob v0/sYsyykTku4K0NsQyoTwWbc84vZPrVcQYLrwqS0bo54X/07DnMksq3+CgDLSTXXkQuqk3oNZf1A QWJldTNyZ1rtLD91xf5K8VMEJL7TypkC8n5rCjMqJahJZU5rK43/Oa59SwgrXTUcPNIo2bXPMJ1Vs MAsckSJBsDIX5snPe+kBv/MuGMd1KqR4PZ3H0gWkTo1hmeiNs+U7pOHVWZMNLbD3I6GtR4FpPOBwx +DmSTzdrgIDW9IoJZStNUSadJbzP+R8fiKVJ0cj8KT1RhCuxiFgCkw3yuH/sq1v1caJ8t5OFa7DIw xr3o4+7w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gHwCD-0002GD-Os; Wed, 31 Oct 2018 19:30:29 +0000 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gHwBG-0008Ot-2T; Wed, 31 Oct 2018 19:29:32 +0000 Received: by mail-pl1-x643.google.com with SMTP id bh10-v6so7762814plb.4; Wed, 31 Oct 2018 12:29:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rTVZhghR1gxb15QVkw14B49JVfrcKlPIwzmIf6W2ysc=; b=WSq5yexAx0eBb4UQ4yKmF9SzyZevUYMsBeeoVXiWiFIoRnyVzWlgbtsB0MHQ9LAzRQ 5x9Byv7ewitQN28uZlzGxh9Dut4KuhRtAC6hk3RfFVyjyUMkH5bf4boTjoO+kyQbmaVL GfejcvexUnua1b4T/spECN8FErCUEslSP8IkFR8BH4zPat8SPy3BfMxcPmNNDgle6FFE LQb5VSTzg7HAgKV1MavnSb4Itt6Qj8owr1ILe70zbTQ7GW47s8dcgxlG6LZWFAp2d8Rb LhowptkZEOBrd3HkDbzz4a4PUw0+UTFumwBF7jddBhgO49chctjjrTzUy+BAMc+lWlTt AE4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=rTVZhghR1gxb15QVkw14B49JVfrcKlPIwzmIf6W2ysc=; b=pMo4wLpDINq4XulpA7Zn4caIE2Q2jp4jRfzm9w6L78lRtUXt73MCLc9ZQGrIwFC0KI WvHjpIHQQI99BJnBeoE7O7pP+2h7bLVOH1wVKATuOAcMfTmRT4+7GbrnzRrSkC52XKkk w4Hr2TCki1sVZjw2l4TcsayUr0bsjzwGOh4lIBby5uHP0qR9UFP4a+BJ1sgl8e/dOwi+ Q5hHRwMnbYnaEKp38/NMen/LaOgGzoqeW+K5sgteyqmf6YJcMGY1U2B2dUmUZLlbXBmt xRgzpkYCqYRvyYYV8mDjA+HjYvhDGKvB4FIPuWxrqwilPSs+CvImUp9i0aTn2htlAc5q Nztw== X-Gm-Message-State: AGRZ1gLbJOfWzsENscUCdQ7gQgsLcU4A1Qdp4bSVG9fLySQg6iAdFvJt OJ1frBr7ucV+uRnPnmDOFjw= X-Google-Smtp-Source: AJdET5daDSQCBMa+OjcVRxtbuc863y8/PiXtLjcpg35yDdF2Ym5vyGrBdl/MR3b+yuGzq4Y7OLMuEQ== X-Received: by 2002:a17:902:8306:: with SMTP id bd6-v6mr4661149plb.321.1541014159363; Wed, 31 Oct 2018 12:29:19 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id z26-v6sm28926456pfh.77.2018.10.31.12.29.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 Oct 2018 12:29:18 -0700 (PDT) From: Florian Fainelli To: linux-kernel@vger.kernel.org Subject: [PATCH v3 5/6] of/fdt: Remove custom __early_init_dt_declare_initrd() implementation Date: Wed, 31 Oct 2018 12:28:42 -0700 Message-Id: <20181031192843.13230-6-f.fainelli@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181031192843.13230-1-f.fainelli@gmail.com> References: <20181031192843.13230-1-f.fainelli@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181031_122930_465697_A83D7AAF X-CRM114-Status: GOOD ( 15.66 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:643 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (f.fainelli[at]gmail.com) -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: CHANDAN VN , Catalin Marinas , Will Deacon , Stefan Agner , Masahiro Yamada , deanbo422@gmail.com, Frank Rowand , Florian Fainelli , linux@armlinux.org.uk, rppt@linux.ibm.com, Andrey Ryabinin , Laura Abbott , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE" , Marc Zyngier , Andrey Konovalov , Kristina Martsenko , Russell King , Rob Herring , green.hu@gmail.com, gxt@pku.edu.cn, "moderated list:ARM64 PORT AARCH64 ARCHITECTURE" , linux-snps-arc@lists.infradead.org, ard.biesheuvel@linaro.org, vgupta@synopsys.com, Johannes Weiner , Andrew Morton , Robin Murphy , Greg Hackmann MIME-Version: 1.0 Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Now that ARM64 uses phys_initrd_start/phys_initrd_size, we can get rid of its custom __early_init_dt_declare_initrd() which causes a fair amount of objects rebuild when changing CONFIG_BLK_DEV_INITRD. In order to make sure ARM64 does not produce a BUG() when VM debugging is turned on though, we must avoid early calls to __va() which is what __early_init_dt_declare_initrd() does and wrap this around to avoid running that code on ARM64. Signed-off-by: Florian Fainelli --- arch/arm64/include/asm/memory.h | 8 -------- drivers/of/fdt.c | 15 ++++++++++----- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h index b96442960aea..dc3ca21ba240 100644 --- a/arch/arm64/include/asm/memory.h +++ b/arch/arm64/include/asm/memory.h @@ -168,14 +168,6 @@ #define IOREMAP_MAX_ORDER (PMD_SHIFT) #endif -#ifdef CONFIG_BLK_DEV_INITRD -#define __early_init_dt_declare_initrd(__start, __end) \ - do { \ - initrd_start = (__start); \ - initrd_end = (__end); \ - } while (0) -#endif - #ifndef __ASSEMBLY__ #include diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index e34cb49231b5..4118a344cf45 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -892,15 +892,20 @@ const void * __init of_flat_dt_match_machine(const void *default_match, } #ifdef CONFIG_BLK_DEV_INITRD -#ifndef __early_init_dt_declare_initrd static void __early_init_dt_declare_initrd(unsigned long start, unsigned long end) { - initrd_start = (unsigned long)__va(start); - initrd_end = (unsigned long)__va(end); - initrd_below_start_ok = 1; + /* ARM64 would cause a BUG to occur here when CONFIG_DEBUG_VM is + * enabled since __va() is called too early. ARM64 does make use + * of phys_initrd_start/phys_initrd_size so we can skip this + * conversion. + */ + if (!IS_ENABLED(CONFIG_ARM64)) { + initrd_start = (unsigned long)__va(start); + initrd_end = (unsigned long)__va(end); + initrd_below_start_ok = 1; + } } -#endif /** * early_init_dt_check_for_initrd - Decode initrd location from flat tree