From patchwork Wed Mar 29 08:19:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Ghiti X-Patchwork-Id: 13192094 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 449AEC6FD18 for ; Wed, 29 Mar 2023 08:19:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=aFPI91JTX5hvTOgGDuPnwmZFtNxOEFSJ7UmxixWxY6I=; b=joeI7xogUYP4Aj q2INtHORtdOqDIReK3TTMPMhIwJi9yiqQiGX0AF6PWks21r/7JtNdpnGKpS2QyCQO2BK6XGa4y7Dr naEeLKP5zRHTs0qEQlDuQh/86m2a78tjlRYtGqpeyk27c5/kbAqEKLTOtrGb98AINY6hmPCSLa/Qu 2y5w/Yhj1faGVCkFf3l9dxvsc/EMbOOn62EIG6J140wwpYgR+t12a8vBfUp9kYBd8bc/LzVthDp/b +eAyKbgdwSwiroqp37HxI1LfSRBO/j7KYZTtaJlivp2NwvG6yxoS0mxXDFJn10IHysHEMy+4YYnia aRzh1w4gLAEz4AVjGLzg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1phR22-00H50H-09; Wed, 29 Mar 2023 08:19:46 +0000 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1phR1w-00H4xO-2w for linux-riscv@lists.infradead.org; Wed, 29 Mar 2023 08:19:44 +0000 Received: by mail-wm1-x32e.google.com with SMTP id o24-20020a05600c511800b003ef59905f26so8986094wms.2 for ; Wed, 29 Mar 2023 01:19:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20210112.gappssmtp.com; s=20210112; t=1680077974; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=olPuTVJAN4zMwmNPZ6aRAjo+h/QsedtQg1W0MV2/+c8=; b=4JF5/qgietg3bxay6q88J4jadm9tbedcL+YIaGNhIwz8YKRb/CvRBeTV4umGJEWq4j lXYSPgZaJpo0tVXg2yFIKIZfSBn1nM+pCoXZPZIMCUL+3Vqh2TBVIjldnDAZDW3t5ynZ byIi9/RdxcMI/zapfESfzB//6qXOFd5kz3AQVnEV4B/tnsIyT4PMWS6C8ZfO+DPnDUui iofLfYVUyOD6d1i7Qb55RnN7dyVtJ98voUtzW7bCEeXTcWKZIIW0WNKpyI2QB2EWWLP+ szxMqjitxdroPUIoUHspNweyAqmz+fapWzEqM730+mWiaST7+FwTwN7rnhBy3KgqM4a0 6TGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680077974; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=olPuTVJAN4zMwmNPZ6aRAjo+h/QsedtQg1W0MV2/+c8=; b=5C92uM4IsC5vKDPAGk7GZjGJEDG6M1BJRx2jDtpZvQw0j2d32yCWLndeDZg7VhLZtT CIdLMv11n8WT5hF/vBygkhvGlJ7XBkOzm3vLjz/DiCywrEcM+IrtJYW6y1+ky0KYzEOs pN417suV7GSO4DOD1bV0R0NejwMau8Yh3siYvovBm7d+uSbUcS/qmrP0uZWlWhz2DKuw E+6/48zQJ83/oeXh5wryt2n9XsGu1Jlqg2HnAxPE1gX4ljr8UahRYLKo4cqBD7SuQ9gk VgEaH3BuydeP1VQOP0q+AwKD9/EtzOWNPXSHfgehYRUTawXodTehMiiMCSiUWiurZxQ0 Y4qg== X-Gm-Message-State: AAQBX9dC6sQPIs0XBjy3E1aQcXW/fomzwyfLfPS8914/pcuK21g0SK2Z 4DVXpSQwVt8oRxAh8f62oiuYsw== X-Google-Smtp-Source: AKy350ba7NoMqjW8oJNYLSYupiBj+VkhqtyFEezaN8ebT0ysK+vZGrpWsjx1UPheUr50M05ZyMjXag== X-Received: by 2002:a1c:4b04:0:b0:3ed:c84c:7efe with SMTP id y4-20020a1c4b04000000b003edc84c7efemr1068097wma.7.1680077974759; Wed, 29 Mar 2023 01:19:34 -0700 (PDT) Received: from alex-rivos.ba.rivosinc.com (amontpellier-656-1-456-62.w92-145.abo.wanadoo.fr. [92.145.124.62]) by smtp.gmail.com with ESMTPSA id bd6-20020a05600c1f0600b003ef36ef3833sm1416512wmb.8.2023.03.29.01.19.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Mar 2023 01:19:34 -0700 (PDT) From: Alexandre Ghiti To: Jonathan Corbet , Paul Walmsley , Palmer Dabbelt , Albert Ou , Conor Dooley , linux-doc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Alexandre Ghiti Subject: [PATCH -fixes v2 0/3] Fixes for dtb mapping Date: Wed, 29 Mar 2023 10:19:29 +0200 Message-Id: <20230329081932.79831-1-alexghiti@rivosinc.com> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230329_011941_163713_584D8DDB X-CRM114-Status: UNSURE ( 8.16 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org We used to map the dtb differently between early_pg_dir and swapper_pg_dir which caused issues when we referenced addresses from the early mapping with swapper_pg_dir (reserved_mem): move the dtb mapping to the fixmap region in patch 1, which allows to simplify dtb handling in patch 2. base-commit-tag: v6.3-rc3 Changes in v2: * No functional changes! * Add RB/TB from Conor in patch 1 * Split patch 2 into 2 separate patches, as suggested by Conor * Fix the changelog, add Fixes tag, as suggested by Conor Alexandre Ghiti (3): riscv: Move early dtb mapping into the fixmap region riscv: Do not set initial_boot_params to the linear address of the dtb riscv: No need to relocate the dtb as it lies in the fixmap region Documentation/riscv/vm-layout.rst | 6 +-- arch/riscv/include/asm/fixmap.h | 8 +++ arch/riscv/include/asm/pgtable.h | 8 ++- arch/riscv/kernel/setup.c | 6 +-- arch/riscv/mm/init.c | 82 ++++++++++++++----------------- 5 files changed, 54 insertions(+), 56 deletions(-)