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 30D02C433ED for ; Mon, 10 May 2021 13:23:34 +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 8903561278 for ; Mon, 10 May 2021 13:23:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8903561278 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=9Yx60J32WYE6sw1Rt+cP2JgFVIJ4rgZt4l3x3UXFKPM=; b=V5dl9EskldE//mgeZgxlwHaIa eSsW1t+PIkvASjr1SYVorA7hNslloqcYlp0gBioNPfNGjjyN0WLQQWxSzXh7jeW03IkR8N+cww88X SbblJIq8RoM2plngYrLK1iUtZTni0NojHfPvHV7eACdOd1YGDFELH17GH9vD44paNwEN+qygi3w/N ho4sCjGVvzKzaIZpBACz0KldvPwoXEhdptGwYkgzsCVKcEegmx4AvRfr5zWmtNTx/IOYCu60F7Y7L EfEzpea1XmJri5lxWPJWdY4nhu18veZ2qNByKcCUW2LVfGOcBzkW3koTTA4AsVsDRzXZixwsf6mRe 5Z2Icb3xQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lg5rL-00ERJY-BZ; Mon, 10 May 2021 13:22:07 +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 1lg5rB-00ERHI-F6 for linux-arm-kernel@desiato.infradead.org; Mon, 10 May 2021 13:21:57 +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=aNMN409vhgmIJzMSgLO/z7XdlSTjFBeziZjCWQllPk4=; b=ayZXXC90xKKsTyEvdy9fEJ+tp+ YiBzAYGnSjfuLCk/ovfC4fDkFaTQtm6TBD8YXbWj+PXI4XYNObcC3HUWXpQQw6m2+jABHlpY34+MP 2nzDnC93Rh7DwIwowKOkukJSD2VB3P2QimQ3bkBBldER00nse87ncnlLdyJ1sr0O+JTVhKGDQ1zrv YbuFOXSw6EGS5BttSlhnlyPvoTEZkKLEHYBV8SBorIU62+4yk2pdElsYmc24MurdK9zXYOJlNWc0a 9u3kD9f7fahXvR1OCK0Tgyqxobk5ji17Hj5QuCpAfCdPFW1biOMgayBgJYaGeVVhR3w550CEYD+NQ gO0CDG5Q==; Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lg5r5-008kD8-Gu for linux-arm-kernel@lists.infradead.org; Mon, 10 May 2021 13:21:56 +0000 Received: by mail-pg1-x535.google.com with SMTP id t193so739329pgb.4 for ; Mon, 10 May 2021 06:21:50 -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=aNMN409vhgmIJzMSgLO/z7XdlSTjFBeziZjCWQllPk4=; b=ItqtkaXHzA9SOc+NAaVNUjbNGvlX1vpO/6aLSRhVMWMYTwXTdoJwRosAyTe9mr3aAJ EXgpJ+Luz/2JaHktrfICACEbsm+aTNeZWyyG6qUbLQTBiZMG+5p4TxoAbx3iFA+JFgm5 t0PcCX6jhKHF8WMayvslT/ECNays92REEp3HIFu1i01jrzfc3csfA5EiUHAmRzj2wsmF fW5IQan7cINI6RJf/balIlj9CKxrzrS0Ypw4+P/igMREd+/tT6aZtxdxcDS0YS1byH0z 5fLobHIu7wwqhqZL5e08wQBHgCZz0BeinFMxFtkCcC+DR5TJso4Ng8XrRhneK8ZZw+Cx Dlkw== 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=aNMN409vhgmIJzMSgLO/z7XdlSTjFBeziZjCWQllPk4=; b=VmSZOVt01bE3+NPPYxdOePotuH7t22dPAkA08qdypN5CoLzp65DRE/GR9aTtJ8zGyO YoPVk2G5GjflGnGurP6AuMQ9dN/QBhg6GidAaQBz7c/Kw/DMz7EashjW7yVSDYDxEeFv MJXPaTKUaFxlzEalDB1sWp/mRyLe8Nluq31OTDO63WsbfKk2jEj8wW4R7mgL+GN+BRyD GBd2Vi8xNyhA+1s37WxS4LL2wl5QEohzqkhIPRiFzwt2jCcQNvtQYCVMr9Y3ZEtuKd0+ 15rcnCkiKsRTim/INoSBehAYrqA479Zr6MJxhSuwV48J/vhQ0vA5L0xOd6zMUC3Fwstx mPXg== X-Gm-Message-State: AOAM533QN3moIknnqAXvEOd7H9KDhYJ49nyMb3/G+uRijHyPJp5CE5ja S7F12KgyVHwSjwCfZRr+UQE= X-Google-Smtp-Source: ABdhPJzB9NtITnt+5bB6ip6N5wsPp2jrZ5DDAFu2MSMXUWorHaCUUtAaEz2GhcdhX1m/dbGSg0CFPQ== X-Received: by 2002:aa7:9992:0:b029:28e:b432:190a with SMTP id k18-20020aa799920000b029028eb432190amr24359592pfh.50.1620652910279; Mon, 10 May 2021 06:21:50 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id n8sm11129351pgm.7.2021.05.10.06.21.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 May 2021 06:21:49 -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 , 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 Subject: [PATCH stable 5.10 v2 3/4] ARM: 9020/1: mm: use correct section size macro to describe the FDT virtual address Date: Mon, 10 May 2021 06:21:10 -0700 Message-Id: <20210510132111.1690943-4-f.fainelli@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210510132111.1690943-1-f.fainelli@gmail.com> References: <20210510132111.1690943-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_062151_587194_174AC252 X-CRM114-Status: GOOD ( 19.95 ) 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 694aa6b4bd03..f90479d8b50c 100644 --- 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) { -- 2.25.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel