Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp1340814pxv; Fri, 23 Jul 2021 06:08:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVlUM4w6BqONO97fkjWWqY/3+0Ueo9WRh9LTqCEoiJZretHQl3MVHw64KMgkQYzepRbBgQ X-Received: by 2002:a05:6402:28b5:: with SMTP id eg53mr5393388edb.60.1627045683970; Fri, 23 Jul 2021 06:08:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627045683; cv=none; d=google.com; s=arc-20160816; b=XsjU0/Lkq/ZNAvgXgd0iXWgigDSuXsxba/I+Fq7YWaJw1mxNT1UQHAAu9m9Gse1zyh 8fv5GRkz5l8vcuxKSO4AWESIeSqMce3XLysxtckXspTJDLacKArjthCVWyyW+T5GYno+ iviS3cjoURefoAvAZLAIhZZJXEtfO+Z6xaC1NB1OTAVuqZFFS2aDFSs45566TWGDKEV3 kJv6hFTdAQ7VPnRAKWb0VsYdNNIIJ9Gre/fiM6G6f6Cc1oboBV5BQyj3mjt0R/BF20I1 paQd/XwqBlHFA99iXBQonwHb3YE0hJ88S7uV1er+0AjKrtNRCqgUUZ9S9RtDawQTbbFi z01Q== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=a4mjDLY6ExkBJdyRJzneXVll013q5OYTcyJJgO7eJ00=; b=VoEgxUQfgLZnGSxD218x0ZBFQjntW3O0qN1k9bSyvXeYfQEEhM6D/1vy3JK280qUwM EgSMM45p5QyU/uK66hOZzlNXMPjiuFum8JGRb1/F4OuS2FvzDinRnkGdSuwkTEdEz+25 deWfYBOrVh34zxKd4/vLsnGucaG+Fdbokrw02XnVD71ompp1w6gJ0HnCMq4t6xS36Q6r PSqwvfHMPSpjDi1hzUbY7CSxX0BPM7nPaNJacLAuz49wL7qpuOqPkz1UaBpZzx7xZZCI OMKkjMp3GO27ZDpUrUR6Yt0NQaRky62C3XyqPRky+l2r2566hzbP32LXGbAxNqWdeDsD sasA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d2si9322669edy.190.2021.07.23.06.07.38; Fri, 23 Jul 2021 06:08:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235128AbhGWMZR (ORCPT + 99 others); Fri, 23 Jul 2021 08:25:17 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:58503 "EHLO relay6-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232851AbhGWMZP (ORCPT ); Fri, 23 Jul 2021 08:25:15 -0400 Received: (Authenticated sender: alex@ghiti.fr) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 60443C0007; Fri, 23 Jul 2021 13:05:45 +0000 (UTC) From: Alexandre Ghiti To: Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Alexandre Ghiti Subject: [PATCH 4/5] riscv: Simplify BUILTIN_DTB device tree mapping handling Date: Fri, 23 Jul 2021 15:01:27 +0200 Message-Id: <20210723130128.47664-5-alex@ghiti.fr> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210723130128.47664-1-alex@ghiti.fr> References: <20210723130128.47664-1-alex@ghiti.fr> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org __PAGETABLE_PMD_FOLDED defines a 2-level page table that is only used in 32-bit kernel, so there is no need to check for CONFIG_64BIT in #ifndef __PAGETABLE_PMD_FOLDED and vice-versa. Signed-off-by: Alexandre Ghiti --- arch/riscv/mm/init.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c index 6b29c5791555..1b30ad7e3ebc 100644 --- a/arch/riscv/mm/init.c +++ b/arch/riscv/mm/init.c @@ -614,18 +614,14 @@ asmlinkage void __init setup_vm(uintptr_t dtb_pa) pa + PMD_SIZE, PMD_SIZE, PAGE_KERNEL); dtb_early_va = (void *)DTB_EARLY_BASE_VA + (dtb_pa & (PMD_SIZE - 1)); #else /* CONFIG_BUILTIN_DTB */ -#ifdef CONFIG_64BIT /* * __va can't be used since it would return a linear mapping address * whereas dtb_early_va will be used before setup_vm_final installs * the linear mapping. */ dtb_early_va = kernel_mapping_pa_to_va(XIP_FIXUP(dtb_pa)); -#else - dtb_early_va = __va(dtb_pa); -#endif /* CONFIG_64BIT */ #endif /* CONFIG_BUILTIN_DTB */ -#else +#else /* __PAGETABLE_PMD_FOLDED */ #ifndef CONFIG_BUILTIN_DTB /* Create two consecutive PGD mappings for FDT early scan */ pa = dtb_pa & ~(PGDIR_SIZE - 1); @@ -635,13 +631,9 @@ asmlinkage void __init setup_vm(uintptr_t dtb_pa) pa + PGDIR_SIZE, PGDIR_SIZE, PAGE_KERNEL); dtb_early_va = (void *)DTB_EARLY_BASE_VA + (dtb_pa & (PGDIR_SIZE - 1)); #else /* CONFIG_BUILTIN_DTB */ -#ifdef CONFIG_64BIT - dtb_early_va = kernel_mapping_pa_to_va(XIP_FIXUP(dtb_pa)); -#else dtb_early_va = __va(dtb_pa); -#endif /* CONFIG_64BIT */ #endif /* CONFIG_BUILTIN_DTB */ -#endif +#endif /* __PAGETABLE_PMD_FOLDED */ dtb_early_pa = dtb_pa; /* -- 2.30.2