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=-2.2 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 C0B35C433ED for ; Wed, 21 Apr 2021 15:19:41 +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 2B870600D1 for ; Wed, 21 Apr 2021 15:19:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2B870600D1 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:In-Reply-To:MIME-Version:Date:Message-ID:References: Cc:To:From:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=n/P9YNi3DwMpdKdxj+dead3rKKLY8rkVDvDUHJeHiY0=; b=Gs4hVn8wr5Wf5WfH7eqGHznvW 1pAqsi3EILq4J0iEjHYOGM4Q79+jp31RupeuMMzlBmsX3zGFDZ6fy14StVe+BsRgphEEGpeyks8qP o/yNCb+ppl6tL2wzq46CnHHaSjp//5ByKLzf7M/Nr79KbLEubr+9+B04Ee4NuBQd6l3/n7e9VvmQU /UZ5OtI9/Tke+cbTAruIT2TOLFSTtsViOrEMi/pYigLILEpQlvJEcM1d+Jk3T9GzuNsnAZjcBGPGk n+oLfEpqQirWhYNjd324ky5YmgWr/ovXR9ttSKwnHp0n7QIKj9vnHuV9mzohnh5Uao+x6FeBGMrsn nvFITVHgA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lZEbv-00Eew2-HD; Wed, 21 Apr 2021 15:17:51 +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 1lZEbq-00EevU-N3 for linux-arm-kernel@desiato.infradead.org; Wed, 21 Apr 2021 15:17:46 +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:In-Reply-To:MIME-Version:Date:Message-ID:References:Cc:To:From: Subject:Sender:Reply-To:Content-ID:Content-Description; bh=KzQai6Tg69wKbEAWcqKNbEL/MC5Qt4Kn9kSRArYjd2g=; b=R0l91oYqj9FJTpb3QnZFmogEFk nF/gaDusBxHt8nUq3DyqVLF19iLiBRkrGwKp5eXvfTF42DD834H0x0m3/8JFv7jiRRJxEddwhSD3o 2WiFlzNYemqIG0XHhrUId52hV+xeT7rO2we8SpEJVTC4FsMkLcFRQiIM6GeTaYoNyBdwbEcoBdtrZ wq2lRsVy8dgFj1r5RCym+3lCTaHB+eFSqIA7qS4diY9qUYn7QwGXO/rAs1AWUMqzXKDX7E8G8Mdwn VHLq8zkcKvKO5hZqWJmRcFofzSV54YkguRb/QBQO3tIjnb/9/+hb04qyCntlmB+OtPLGhw6Z37lXY uYoVsFfQ==; Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lZEbk-00CzWK-TS for linux-arm-kernel@lists.infradead.org; Wed, 21 Apr 2021 15:17:45 +0000 Received: by mail-pg1-x52a.google.com with SMTP id w10so30171123pgh.5 for ; Wed, 21 Apr 2021 08:17:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=KzQai6Tg69wKbEAWcqKNbEL/MC5Qt4Kn9kSRArYjd2g=; b=s7lpu9qIoTGsbb3qGjUxrXpmysb//u/qu+m3Te9oX2yvS4cFW3GrodM0J1j8OpEuz3 7rJ/E3//KYlvJOCIr3CXPU17b5ER7R9cM9Nup+fg8uq8ay20aOIBqpzlM1Ed56i4SGYP 4402FemHi+AnOvtD8fFROic4B5IkxaY96gFWppCPnUoqgQ7+mDR9DbMUgSEVK0BRLVqU 1ESorBljqOxtuvFFAM48FVwfnK0yaWnSLk1moWpBSqwYM1D8TQeuP1Mr3T1Dtu4UcHDj KQ8hNoUWdVim/JBhkrZ6s1cT75lt1ONMY+MP3O/it58Yz4GmJ557nFpvB5/QwOPXJVx+ kglg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=KzQai6Tg69wKbEAWcqKNbEL/MC5Qt4Kn9kSRArYjd2g=; b=ZJJzHEX6r0ca5bIM+OxsCh3Cq87DsFLz9fduUbYvavwIigtCMyY4NrjSHTgPpJ3GlF W4wI3e7nE+e5d73mg+u/8kc4DvuWP0vnmlpFxC0mzBGoAugzubtb9/UU6g1If/OiN8Ef qZ1jm/1P153qjKeKA4k1o0V/ii/ut3nJFX4FuPCcenX8J+kzUVxmEba3B4NgA2vr5/KH OlGorSc934C9suSmJEuKId3g3BMqIA6tQwnZ3HMaBlraIuKP0YqLXetPgYYCLgBuvt3B SqdcXFAM1ldCaxRZHe/uXfNK8ZYFKa67eacVQJv94g6r6AZjXr9w63jvB6h/9OHB8mPq no/w== X-Gm-Message-State: AOAM533M/Xg3b63xQHG5CVSX60TcPcx8cxTMekgiCkIlQ8dZgRTMpLg+ i6a+T85aCVLeBorErdeMWeIn1ptNJW0= X-Google-Smtp-Source: ABdhPJxWgYwkYHXJWtQtqRBFUzxtigMBTBDBodEWRcQR33QhN1G7Hh69HONKn+mKsR3H0iVm3S5vpA== X-Received: by 2002:a65:5282:: with SMTP id y2mr22785908pgp.293.1619018259633; Wed, 21 Apr 2021 08:17:39 -0700 (PDT) Received: from [10.230.29.202] ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id h22sm2084545pfn.55.2021.04.21.08.17.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 21 Apr 2021 08:17:39 -0700 (PDT) Subject: Re: [v5.4 stable] arm: stm32: Regression observed on "no-map" reserved memory region From: Florian Fainelli To: Quentin Perret Cc: Ard Biesheuvel , Rob Herring , Alexandre TORGUE , Greg Kroah-Hartman , Sasha Levin , stable , Arnd Bergmann , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "linux-kernel@vger.kernel.org" , Nicolas Boichat , Stephen Boyd , KarimAllah Ahmed , Android Kernel Team , Architecture Mailman List , Frank Rowand , linux-arm-kernel References: <4a4734d6-49df-677b-71d3-b926c44d89a9@foss.st.com> <001f8550-b625-17d2-85a6-98a483557c70@foss.st.com> Message-ID: <498b8759-1a70-d80f-3a4d-39042b4f608e@gmail.com> Date: Wed, 21 Apr 2021 08:17:28 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210421_081741_007559_778A0963 X-CRM114-Status: GOOD ( 27.29 ) 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 On 4/21/2021 7:33 AM, Florian Fainelli wrote: > > > On 4/21/2021 1:31 AM, Quentin Perret wrote: >> On Tuesday 20 Apr 2021 at 09:33:56 (-0700), Florian Fainelli wrote: >>> I do wonder as well, we have a 32MB "no-map" reserved memory region on >>> our platforms located at 0xfe000000. Without the offending commit, >>> /proc/iomem looks like this: >>> >>> 40000000-fdffefff : System RAM >>> 40008000-40ffffff : Kernel code >>> 41e00000-41ef1d77 : Kernel data >>> 100000000-13fffffff : System RAM >>> >>> and with the patch applied, we have this: >>> >>> 40000000-fdffefff : System RAM >>> 40008000-40ffffff : Kernel code >>> 41e00000-41ef3db7 : Kernel data >>> fdfff000-ffffffff : System RAM >>> 100000000-13fffffff : System RAM >>> >>> so we can now see that the region 0xfe000000 - 0xfffffff is also cobbled >>> up with the preceding region which is a mailbox between Linux and the >>> secure monitor at 0xfdfff000 and of size 4KB. It seems like there is >>> >>> The memblock=debug outputs is also different: >>> >>> [ 0.000000] MEMBLOCK configuration: >>> [ 0.000000] memory size = 0xfdfff000 reserved size = 0x7ce4d20d >>> [ 0.000000] memory.cnt = 0x2 >>> [ 0.000000] memory[0x0] [0x00000040000000-0x000000fdffefff], >>> 0xbdfff000 bytes flags: 0x0 >>> [ 0.000000] memory[0x1] [0x00000100000000-0x0000013fffffff], >>> 0x40000000 bytes flags: 0x0 >>> [ 0.000000] reserved.cnt = 0x6 >>> [ 0.000000] reserved[0x0] [0x00000040003000-0x0000004000e494], >>> 0xb495 bytes flags: 0x0 >>> [ 0.000000] reserved[0x1] [0x00000040200000-0x00000041ef1d77], >>> 0x1cf1d78 bytes flags: 0x0 >>> [ 0.000000] reserved[0x2] [0x00000045000000-0x000000450fffff], >>> 0x100000 bytes flags: 0x0 >>> [ 0.000000] reserved[0x3] [0x00000047000000-0x0000004704ffff], >>> 0x50000 bytes flags: 0x0 >>> [ 0.000000] reserved[0x4] [0x000000c2c00000-0x000000fdbfffff], >>> 0x3b000000 bytes flags: 0x0 >>> [ 0.000000] reserved[0x5] [0x00000100000000-0x0000013fffffff], >>> 0x40000000 bytes flags: 0x0 >>> >>> [ 0.000000] MEMBLOCK configuration: >>> [ 0.000000] memory size = 0x100000000 reserved size = 0x7ca4f24d >>> [ 0.000000] memory.cnt = 0x3 >>> [ 0.000000] memory[0x0] [0x00000040000000-0x000000fdffefff], >>> 0xbdfff000 bytes flags: 0x0 >>> [ 0.000000] memory[0x1] [0x000000fdfff000-0x000000ffffffff], >>> 0x2001000 bytes flags: 0x4 >>> [ 0.000000] memory[0x2] [0x00000100000000-0x0000013fffffff], >>> 0x40000000 bytes flags: 0x0 >>> [ 0.000000] reserved.cnt = 0x6 >>> [ 0.000000] reserved[0x0] [0x00000040003000-0x0000004000e494], >>> 0xb495 bytes flags: 0x0 >>> [ 0.000000] reserved[0x1] [0x00000040200000-0x00000041ef3db7], >>> 0x1cf3db8 bytes flags: 0x0 >>> [ 0.000000] reserved[0x2] [0x00000045000000-0x000000450fffff], >>> 0x100000 bytes flags: 0x0 >>> [ 0.000000] reserved[0x3] [0x00000047000000-0x0000004704ffff], >>> 0x50000 bytes flags: 0x0 >>> [ 0.000000] reserved[0x4] [0x000000c3000000-0x000000fdbfffff], >>> 0x3ac00000 bytes flags: 0x0 >>> [ 0.000000] reserved[0x5] [0x00000100000000-0x0000013fffffff], >>> 0x40000000 bytes flags: 0x0 >>> >>> in the second case we can clearly see that the 32MB no-map region is now >>> considered as usable RAM. >>> >>> Hope this helps. >>> >>>> >>>> In any case, the mere fact that this causes a regression should be >>>> sufficient justification to revert/withdraw it from v5.4, as I don't >>>> see a reason why it was merged there in the first place. (It has no >>>> fixes tag or cc:stable) >>> >>> Agreed, however that means we still need to find out whether a more >>> recent kernel is also broken, I should be able to tell you that a little >>> later. >> >> FWIW I did test this on Qemu before posting. With 5.12-rc8 and a 1MiB >> no-map region at 0x80000000, I have the following: >> >> 40000000-7fffffff : System RAM >> 40210000-417fffff : Kernel code >> 41800000-41daffff : reserved >> 41db0000-4210ffff : Kernel data >> 48000000-48008fff : reserved >> 80000000-800fffff : reserved >> 80100000-13fffffff : System RAM >> fa000000-ffffffff : reserved >> 13b000000-13f5fffff : reserved >> 13f6de000-13f77dfff : reserved >> 13f77e000-13f77efff : reserved >> 13f77f000-13f7dafff : reserved >> 13f7dd000-13f7defff : reserved >> 13f7df000-13f7dffff : reserved >> 13f7e0000-13f7f3fff : reserved >> 13f7f4000-13f7fdfff : reserved >> 13f7fe000-13fffffff : reserved >> >> If I remove the 'no-map' qualifier from DT, I get this: >> >> 40000000-13fffffff : System RAM >> 40210000-417fffff : Kernel code >> 41800000-41daffff : reserved >> 41db0000-4210ffff : Kernel data >> 48000000-48008fff : reserved >> 80000000-800fffff : reserved >> fa000000-ffffffff : reserved >> 13b000000-13f5fffff : reserved >> 13f6de000-13f77dfff : reserved >> 13f77e000-13f77efff : reserved >> 13f77f000-13f7dafff : reserved >> 13f7dd000-13f7defff : reserved >> 13f7df000-13f7dffff : reserved >> 13f7e0000-13f7f3fff : reserved >> 13f7f4000-13f7fdfff : reserved >> 13f7fe000-13fffffff : reserved >> >> So this does seem to be working fine on my setup. I'll try again with >> 5.4 to see if I can repro. >> >> Also, 8a5a75e5e9e5 ("of/fdt: Make sure no-map does not remove already >> reserved regions") looks more likely to cause the issue observed here, >> but that shouldn't be silent. I get the following error message in dmesg >> if I if place the no-map region on top of the kernel image: >> >> OF: fdt: Reserved memory: failed to reserve memory for node 'foobar@40210000': base 0x0000000040210000, size 1 MiB >> >> Is that triggering on your end? > > It is not, otherwise I would have noticed earlier, can you try the same > thing that happens on my platform with a reserved region (without > no-map) adjacent to a reserved region with 'no-map'? I will test > different and newer kernels than 5.4 today to find out if this is still > a problem with upstream. I could confirm that v4.9.259 also have this > problem now. 5.10.31 works correctly and shows the following for my platform: 40000000-fdffefff : System RAM 40200000-40eaffff : Kernel code 40eb0000-4237ffff : reserved 42380000-425affff : Kernel data 45000000-450fffff : reserved 47000000-4704ffff : reserved 4761e000-47624fff : reserved f8c00000-fdbfffff : reserved fdfff000-ffffffff : reserved 100000000-13fffffff : System RAM 13b000000-13effffff : reserved 13f114000-13f173fff : reserved 13f174000-13f774fff : reserved 13f775000-13f7e8fff : reserved 13f7eb000-13f7ecfff : reserved 13f7ed000-13f7effff : reserved 13f7f0000-13fffffff : reserved -- Florian _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel