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=-14.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 A6579C433B4 for ; Mon, 17 May 2021 11:44:24 +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 331FB60FD7 for ; Mon, 17 May 2021 11:44:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 331FB60FD7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linuxfoundation.org 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:Message-ID:In-Reply-To:Date:From:Cc:To: Subject:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References:List-Owner; bh=CAwVjY0E1DytlvY6Qhp0VVu0rwFci1H10ECddnNGxAQ=; b=bqrvq77wwC6IRApoLIeCgR7Eq Wsc8h/Tg4nsAGuAj+cYPMNpz8LQleKjX1clReheUE6QrxjLTCl0uhF0ZdkH24Hj9PwDnoLjnTRdxR TBCGCsNG/XJLdhvt0Gv4fRodrBMvd5voSvWIraYxONBKFIJZJK8oFVsUgup9KAedPILkeoTmnIM58 BqABKraZWz+3B0WuQJj4ZLGTOypRDpKB69xWEY6ziotQhytKnWtumygs1h63T5BBsxNsGxaCXpcJn a9c/t1TjJpa3jgnJYSlSEsxYewu3DkfdbPoJNUGnbnHx2wCvwPE+ZJGTKi+eKMXk1I8Md9gq2aICd E2Zcba7vw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1libbH-00ElbK-R5; Mon, 17 May 2021 11:39:59 +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 1libZd-00El90-Qh for linux-arm-kernel@desiato.infradead.org; Mon, 17 May 2021 11:38:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:From:Cc:To:Subject: Sender:Reply-To:Content-ID:Content-Description:References; bh=9tc9QMHnVlVbfKfzNhcX/511CNIqIKKGGaRN8Bvy1aY=; b=0duebSZWL8ZILE04eFMedv3RjC ueeq4EKF/xEATS9el2PaUmgXfkj75LrMXAevqUKac/5NCXgEG8iIaFvG7qGcJB+HgRg9tGZZvvRaB idcq6qI1jBABtFQSCgJg9Wu0IgUFV+Xl8WuNBj8J6/5hbVJsTKlI257I4v41P9XWp9beMNNyMwyQa NEBk3VNO606KJhXyd8ffg7NpEH7VeL1nvOm8s2bPvK2JqaqO6501j/yV+0mG8aMsCA5wl+3cbJ6Wz 6qrB4vla/dZXTjaF+AeDdRr0fMdYTMl5eYgDYym8j7Ukb9JoF119XewRVle8bOXyJzzzzJrkcSEne DQZ5bSdg==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1libZa-00DizM-RV for linux-arm-kernel@lists.infradead.org; Mon, 17 May 2021 11:38:12 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 17F9561073; Mon, 17 May 2021 11:38:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621251490; bh=Wx6rNpq47/xGnB9iPN1j/KCowMdX500Xq7kkJDEA9TI=; h=Subject:To:Cc:From:Date:In-Reply-To:From; b=Mj4DRgIZZwd01TJuEG1/sz9c+muqbAKQItSYAg5ZxU4BJ/9TJfLxjSvRm+MF3PazC 52rpWkcjZvUt8xQ38BAWhpz6yjpGYiXtujYNcnYZz+BlEGmhrLVqqZakp3YwjHCKqe SnwBQ0fKX//z484OSATgh93Prz9kz0o1IbFtnoeg= Subject: Patch "ARM: 9020/1: mm: use correct section size macro to describe the FDT virtual address" has been added to the 5.10-stable tree To: akpm@linux-foundation.org, ardb@kernel.org, corbet@lwn.net, f.fainelli@gmail.com, gregkh@linuxfoundation.org, jcmvbkbc@gmail.com, joe@perches.com, joel@jms.id.au, linus.walleij@linaro.org, linux-arm-kernel@lists.infradead.org, linux@armlinux.org.uk, m.szyprowski@samsung.com, ndesaulniers@google.com, nico@fluxnic.net, rmk+kernel@armlinux.org.uk, rppt@kernel.org, sashal@kernel.org, tiantao6@hisilicon.com Cc: From: Date: Mon, 17 May 2021 13:37:58 +0200 In-Reply-To: <20210510132111.1690943-4-f.fainelli@gmail.com> Message-ID: <162125147881186@kroah.com> MIME-Version: 1.0 X-stable: commit X-Patchwork-Hint: ignore X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210517_043810_965021_0F607AB2 X-CRM114-Status: GOOD ( 19.55 ) 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 This is a note to let you know that I've just added the patch titled ARM: 9020/1: mm: use correct section size macro to describe the FDT virtual address to the 5.10-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: arm-9020-1-mm-use-correct-section-size-macro-to-describe-the-fdt-virtual-address.patch and it can be found in the queue-5.10 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From foo@baz Mon May 17 01:35:13 PM CEST 2021 From: Florian Fainelli Date: Mon, 10 May 2021 06:21:10 -0700 Subject: ARM: 9020/1: mm: use correct section size macro to describe the FDT virtual address To: stable@vger.kernel.org Cc: Ard Biesheuvel , Joel Stanley , Marek Szyprowski , Russell King , Florian Fainelli , Jonathan Corbet , Russell King , Nicolas Pitre , Linus Walleij , Mike Rapoport , Andrew Morton , Nick Desaulniers , Joe Perches , Max Filippov , Tian Tao , 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 , Sasha Levin Message-ID: <20210510132111.1690943-4-f.fainelli@gmail.com> 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 Signed-off-by: Greg Kroah-Hartman --- arch/arm/include/asm/memory.h | 6 +++--- arch/arm/kernel/setup.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) --- 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 */ --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c @@ -1086,7 +1086,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) { Patches currently in stable-queue which might be from f.fainelli@gmail.com are queue-5.10/arm-9020-1-mm-use-correct-section-size-macro-to-describe-the-fdt-virtual-address.patch queue-5.10/arm-9011-1-centralize-phys-to-virt-conversion-of-dt-atags-address.patch queue-5.10/arm-9027-1-head.s-explicitly-map-dt-even-if-it-lives-in-the-first-physical-section.patch queue-5.10/arm-9012-1-move-device-tree-mapping-out-of-linear-region.patch _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel