From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A794BC433B4 for ; Mon, 10 May 2021 13:35:42 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0F185613E1 for ; Mon, 10 May 2021 13:35:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0F185613E1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: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:List-Owner; bh=QNKfU5JO9W2WcX5SNi17k0n30ZJCSabvj1XfTrEm1dM=; b=pkHcCQfYwOxkV2ueBos+6oUOX gj17PE4RjTiGSj5XqleveuaXFYTmes1qW1511wcndIoNXbXhxsaHAXJRayKMkSS+KLoqNJM1+LxPF G45AvKwB5poLK33SPIagOYaqVjhE5/XEPxqr9thp0la5g0d+xINvL/U1NhX08XC5qMlK2OdcZoZYR Ze2588JqAMh76Gd1WPThFA4pl+jlcn+cXG2emJ8FanelSKbLa+6INuqpGLyHPqazZomi+d1hX1OzY Ew9HGUJvANjGp6bDM/Nl49U3LuuFvmlxsVamHGKJ+QjrITQ/mVPLqJBQWmQz+Ryo+OPAyDSoBCmj2 vQt8hapJA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lg63A-00ETDw-Sw; Mon, 10 May 2021 13:34:22 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lg62S-00ET7l-Ro for linux-arm-kernel@desiato.infradead.org; Mon, 10 May 2021 13:33:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=GdEsPts6/FPz2ykV0GJlUYI1XtzHN0Ot6bY7JwXZfAw=; b=zr3Kyr1tARkxpfdAKiORnvPhg3 wU04wI5MpiKXZc1LNdnSqSSg2V/ltaDQka4jP0oj/ZDTSGbRX/jbXae5G0g3xvTxw2f08xEl4Fcgv uuf9lVRFN2IDHDcD0qjtEj4Bk0o3GfPD9uis4XkVCp/6LdH8RjU1+BaMnem6c1YNc7Y4vCT56yAfk HoalhfAsifQL9eQBUlfOQrrmbTEUm7K82BKxA0HvebkrsG27I2mFOt1oM+XOUZvyyJNkeOaxBao1N 5l3HxL2asnsasPTpiYLmoTQm/DtzX/zD2raV26eE3w6UwcriaBppRPj4YX7sYkRsi9x3AqTxEy2t+ 8xuIuAHw==; Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lg62Q-008km7-4P for linux-arm-kernel@lists.infradead.org; Mon, 10 May 2021 13:33:35 +0000 Received: by mail-pl1-x62d.google.com with SMTP id t21so9148114plo.2 for ; Mon, 10 May 2021 06:33:31 -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 :mime-version:content-transfer-encoding; bh=GdEsPts6/FPz2ykV0GJlUYI1XtzHN0Ot6bY7JwXZfAw=; b=tApArNJG0m5HL6BFaZZIzhAn8a2UZfxTOv6G1Df6+CkTvtS5+0kOUjgawquqT25FTt 2MASkt/xMkEGBpaITalcKLLfEwKrX0zKV9ijVu4QntbnBJdLb+4kRZmBeucEbBRzvRAc fKIA9tyT91piw+Fmhgy5pyZLj1ujYqclgpmXDvd9URQVrw0nzTrEuTdgUwKpRTBOQvGs 7YdxwLrXGl7b+BhOnmyhXKxI8s3LLuSskmYk4V+nh1iiDrbWB3C3Y8Uq1kgkwO5rXL39 8xqsPCy91LtscmFjtLZ2j1dSSEUfPypSWk8th+fEFXH3E1lsV2XYtn6MgHy8gnFZvgHc e9Fw== 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:mime-version:content-transfer-encoding; bh=GdEsPts6/FPz2ykV0GJlUYI1XtzHN0Ot6bY7JwXZfAw=; b=uG4xHNjkQGXHtYXbt8IFPUYMHJL+ZoCIA2p28MU2xNgDN5vWj9fyKSmcgYYD0AeQVi xXshgOx9xOuHBl5MDKsSnekBhUiYSmHFTTfIF9dqq15kk63BG+xUZU5cpzfjhP2wXqO2 J7tDLl0PqY/tLYFpUQMWu9AqVfwLCd63r2mvLp6YRoEA/FW9YtkNfW9Rq803w1A1IKQO SYpmg/AUHuom4UoEvPYVWoGEkuDPuFe0YvXjKRFpODm9Yb0egoVV3wZ5qzdVyAT9g6K1 PY+yEfzdk5iyPs6UoZzMIFVzEK7g4bUWis2R+F9pjVH2v3q68TVwbj9qBuSVVtLeDvog NhwA== X-Gm-Message-State: AOAM530qN31wVCVD7688w6vcjYrvdzbqYMgkNAW20fp2CikqLL0OX+xH 4K2dtwhwQgiuEkMDqtiDYKU= X-Google-Smtp-Source: ABdhPJzj7luZDanpLohMyeueroTg00hxLK0yiyn5bOR0gc17xYsleZPp3ARDo5RQYowDCfDNQkn6+A== X-Received: by 2002:a17:90a:4615:: with SMTP id w21mr28299082pjg.50.1620653610549; Mon, 10 May 2021 06:33:30 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id w127sm7906564pfw.4.2021.05.10.06.33.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 May 2021 06:33:30 -0700 (PDT) From: Florian Fainelli To: stable@vger.kernel.org Cc: Ard Biesheuvel , Joel Stanley , Marek Szyprowski , Russell King , Florian Fainelli , Jonathan Corbet , Russell King , Linus Walleij , Nicolas Pitre , Sasha Levin , linux-doc@vger.kernel.org (open list:DOCUMENTATION), linux-kernel@vger.kernel.org (open list), linux-arm-kernel@lists.infradead.org (moderated list:ARM PORT), Greg Kroah-Hartman Subject: [PATCH stable 5.4 v2 3/4] ARM: 9020/1: mm: use correct section size macro to describe the FDT virtual address Date: Mon, 10 May 2021 06:33:20 -0700 Message-Id: <20210510133321.1790243-4-f.fainelli@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210510133321.1790243-1-f.fainelli@gmail.com> References: <20210510133321.1790243-1-f.fainelli@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210510_063334_194249_9AA14AE8 X-CRM114-Status: GOOD ( 19.19 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Ard Biesheuvel commit fc2933c133744305236793025b00c2f7d258b687 upstream Commit 149a3ffe62b9dbc3 ("9012/1: move device tree mapping out of linear region") created a permanent, read-only section mapping of the device tree blob provided by the firmware, and added a set of macros to get the base and size of the virtually mapped FDT based on the physical address. However, while the mapping code uses the SECTION_SIZE macro correctly, the macros use PMD_SIZE instead, which means something entirely different on ARM when using short descriptors, and is therefore not the right quantity to use here. So replace PMD_SIZE with SECTION_SIZE. While at it, change the names of the macro and its parameter to clarify that it returns the virtual address of the start of the FDT, based on the physical address in memory. Tested-by: Joel Stanley Tested-by: Marek Szyprowski Signed-off-by: Ard Biesheuvel Signed-off-by: Russell King Signed-off-by: Florian Fainelli --- arch/arm/include/asm/memory.h | 6 +++--- arch/arm/kernel/setup.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h index bb79e52aeb90..f717d7122d9d 100644 --- a/arch/arm/include/asm/memory.h +++ b/arch/arm/include/asm/memory.h @@ -68,8 +68,8 @@ #define XIP_VIRT_ADDR(physaddr) (MODULES_VADDR + ((physaddr) & 0x000fffff)) #define FDT_FIXED_BASE UL(0xff800000) -#define FDT_FIXED_SIZE (2 * PMD_SIZE) -#define FDT_VIRT_ADDR(physaddr) ((void *)(FDT_FIXED_BASE | (physaddr) % PMD_SIZE)) +#define FDT_FIXED_SIZE (2 * SECTION_SIZE) +#define FDT_VIRT_BASE(physbase) ((void *)(FDT_FIXED_BASE | (physbase) % SECTION_SIZE)) #if !defined(CONFIG_SMP) && !defined(CONFIG_ARM_LPAE) /* @@ -111,7 +111,7 @@ extern unsigned long vectors_base; #define MODULES_VADDR PAGE_OFFSET #define XIP_VIRT_ADDR(physaddr) (physaddr) -#define FDT_VIRT_ADDR(physaddr) ((void *)(physaddr)) +#define FDT_VIRT_BASE(physbase) ((void *)(physbase)) #endif /* !CONFIG_MMU */ diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index d9bc70f25728..924285d0bccd 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c @@ -1080,7 +1080,7 @@ void __init setup_arch(char **cmdline_p) void *atags_vaddr = NULL; if (__atags_pointer) - atags_vaddr = FDT_VIRT_ADDR(__atags_pointer); + atags_vaddr = FDT_VIRT_BASE(__atags_pointer); setup_processor(); if (atags_vaddr) { -- 2.25.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel