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 12044C433ED for ; Mon, 10 May 2021 13:35:35 +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 6CF2761288 for ; Mon, 10 May 2021 13:35:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6CF2761288 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=9CJMzqIiZ69N7EWj8Gomi9qk/5JlWrhJK12qyvisdjU=; b=DfiNuXNazzBajMiGXBoVYCHSb 18judkhLfUfmAKPOzdlFUGArftRtG5mrYuZNqc+0+Q2JSyQMxMh0IiKftIFhVLYdLn6oesx7sfEPy 9T7+5LRDdZZp6W/qouKy7AQXnJwF7i3NSBbUEmFrh+HByPknAKEHzLaNf2vuxHKIPwHx6tuWdQ20+ tp9ol/o6+sODITqrnqMLMstNpeoTY1YkSVU7pP5Xbmye9Ua8dBf3dQFlN9VGVAUSSxLeE/lriZvWC JE2jqZ+chOv+J5iQrZSHkxHLcl5A1WXkqxytuZSm97e6heKu/Kv8eGO0GIrs1aqMNTqa7OBpqVNoL lA6yBrAYw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lg631-00ETC3-8u; Mon, 10 May 2021 13:34:11 +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-00ET7k-Oo for linux-arm-kernel@desiato.infradead.org; Mon, 10 May 2021 13:33:36 +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=SWc6HvBPJvv2dkce5ud+kbAsCLR0AEFXu+aa6as3WtI=; b=m96PRMuxlep02GX9KYcLUdQuTH Ub40aei/9CoNJWXdOBX+uUSxHKGPFkGik1KppISvT039NRPn8A6cWBnD9Y1PVnybQsmJVtrn5nquP JJi7mAyEc9kZ2VURcGEh3rcMWfdHTiH2IQ8+MjItoVga+sw4GibpgemqX0OpqeEFUVYxC8Y7iWZNT yKNdnbhDC9hEGqMMDpXuu2Ce6bNOfxdOeZxROBFokdFo/V7IamK8TN5OL1rXuyk7xP5T9BHQ2ZiR0 qQaz4LWlFdiGalQqXhJWRdT7S2DGOqZr8PFlXQcybCxauMa3PjWyj5HBWn9GMP+9EOMHi031ZACFX TiLU8Llw==; Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lg62P-008kmA-43 for linux-arm-kernel@lists.infradead.org; Mon, 10 May 2021 13:33:35 +0000 Received: by mail-pj1-x1035.google.com with SMTP id gc22-20020a17090b3116b02901558435aec1so10339892pjb.4 for ; Mon, 10 May 2021 06:33:32 -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=SWc6HvBPJvv2dkce5ud+kbAsCLR0AEFXu+aa6as3WtI=; b=RYQEnGEMhpGjvohnk2yQjpWAbJ8bTMQdWfcTL7H678yAe8WA8MT6WwVlhApozlBfu7 rV63Wi1f73OnVRBIfQu1fdgj3/O8xRMUUz6l4tWPCK5Pcx3GaoNc+hhdUm/guRnbd/EP 2gZD/RBVSF02kDXw5SwSu7GDl8bucgAr0ljCjgYBxHOhV9gstO/ZpUpDGRlLOzSvo3Dl WXjTHW6WuUFfOiCdcFZxGI6uszimldO8rc5ZTZtNV4ZxMJBaYVEaYfoi6ncrubJonDo2 4KP+uiz+h6VdPTun5x06QAWEx3LjlXwkZD2NQowW3AuLE3dU6Y0qDvN2qsRhFA75shEg mXTg== 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=SWc6HvBPJvv2dkce5ud+kbAsCLR0AEFXu+aa6as3WtI=; b=RFrJIQHTipdhItgrvj/5k0ylPs2rhiS3vd1iz4WvcsIDwTife9lWKcXl20iQ+AFVuX nNez7wpRdR48fK9Nejw32pYpdDKjJ1e3eDlJWhJnJtBhgd6xvz08tLRp3oGlQ416Rs1H A4kMPi7GUh4BxCQPFAiG2uS0/pqQlWMvnpAgwKq7VYXQ9669YQezEAm52+Z2CdLB9PDx 1CXW0Wbw3zp9ISeTZRf6eUv3Nv7+zL/AHG1igA79SYYZyIsuZKFgyMfWk24k2V0CwG/r u2MCH9HgmHA9JXvGCW8qW95rMu5iE9Aqvl5ZgDpU1aNKZKcMSF4JtGO1SgM8A7X6wbQD QoXQ== X-Gm-Message-State: AOAM530DgrfyUKE+sXr+6bInFUnseri08DbRjV64kiGyycgOHotS41ns cu+x3dWl6+HkqirCRwfdqs4= X-Google-Smtp-Source: ABdhPJz5zGBsiedFPuOElsetInFE8TbXFegdd8SF+sdd6CJEMJsKqSMEetYIXPAzp7MJI1rVupRvpA== X-Received: by 2002:a17:90a:3948:: with SMTP id n8mr28760783pjf.32.1620653612080; Mon, 10 May 2021 06:33:32 -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.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 May 2021 06:33:31 -0700 (PDT) From: Florian Fainelli To: stable@vger.kernel.org Cc: Ard Biesheuvel , "kernelci.org bot" , Linus Walleij , Russell King , Florian Fainelli , Jonathan Corbet , Russell King , 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 4/4] ARM: 9027/1: head.S: explicitly map DT even if it lives in the first physical section Date: Mon, 10 May 2021 06:33:21 -0700 Message-Id: <20210510133321.1790243-5-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_063333_184725_5254AE23 X-CRM114-Status: GOOD ( 18.94 ) 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 10fce53c0ef8f6e79115c3d9e0d7ea1338c3fa37 upstream The early ATAGS/DT mapping code uses SECTION_SHIFT to mask low order bits of R2, and decides that no ATAGS/DTB were provided if the resulting value is 0x0. This means that on systems where DRAM starts at 0x0 (such as Raspberry Pi), no explicit mapping of the DT will be created if R2 points into the first 1 MB section of memory. This was not a problem before, because the decompressed kernel is loaded at the base of DRAM and mapped using sections as well, and so as long as the DT is referenced via a virtual address that uses the same translation (the linear map, in this case), things work fine. However, commit 7a1be318f579 ("9012/1: move device tree mapping out of linear region") changes this, and now the DT is referenced via a virtual address that is disjoint from the linear mapping of DRAM, and so we need the early code to create the DT mapping unconditionally. So let's create the early DT mapping for any value of R2 != 0x0. Reported-by: "kernelci.org bot" Reviewed-by: Linus Walleij Signed-off-by: Ard Biesheuvel Signed-off-by: Russell King Signed-off-by: Florian Fainelli --- arch/arm/kernel/head.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S index 4f49e8c71ef1..5ceed4d9ee03 100644 --- a/arch/arm/kernel/head.S +++ b/arch/arm/kernel/head.S @@ -274,10 +274,10 @@ __create_page_tables: * We map 2 sections in case the ATAGs/DTB crosses a section boundary. */ mov r0, r2, lsr #SECTION_SHIFT - movs r0, r0, lsl #SECTION_SHIFT + cmp r2, #0 ldrne r3, =FDT_FIXED_BASE >> (SECTION_SHIFT - PMD_ORDER) addne r3, r3, r4 - orrne r6, r7, r0 + orrne r6, r7, r0, lsl #SECTION_SHIFT strne r6, [r3], #1 << PMD_ORDER addne r6, r6, #1 << SECTION_SHIFT strne r6, [r3] -- 2.25.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel