Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp325220pxy; Wed, 21 Apr 2021 04:06:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqeMSa/sfDypQiKuTvA9poM4cUp63i47Tt9Zidwh2z4aZLb20o+S/Pi8P9ldNBpgjBpwA2 X-Received: by 2002:a17:906:3e54:: with SMTP id t20mr32266030eji.53.1619003188703; Wed, 21 Apr 2021 04:06:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619003188; cv=none; d=google.com; s=arc-20160816; b=acPBhSLe3uJl4QitcdBLOh9Wjo7/I/gKH+OQBm3nnSlIRzkE71KKKljH+LbCW2sl6r ksrp99M8FtMmV33YWcvu+QiNVjPnEeF1N7U4fGhoLQ4oX31nBZvpJcZN4x6YkjqzFoxk 8My2NHSuHDVtzK2BltqQkQYup47IaffUt9W70nSUMlMdjrHN21n2Ox4CxE+jbNb3v7N3 f8iQyL/F/T12b0p4EFY1Z060g6hN+X5gXyd4yGRjZD8+IW3cehV3/S8jx/mAHmYux//X kMLpLW2qMpQbrTgovVngE2sWjO7pSda+BzRtHhK3+/amuKcrXCII/1dhmGh0HuOCsL/9 wflA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=mJcwZlu0Ar0OqbJ+UZHBMNI1VVtXFf5qDweduy1D6/0=; b=XgD18sCgBTQlLQfpUfLXCDbJPRjopb46TmBTgBDxtz97XDF+5Ni+JqH7nDPNxT9kkX wd21cCix0y6Z/U2zZMXIUmkmq5/jvfDVP7BWrpu7ucUB9cku8x7r6t8gF+b83YUFNPQm MQyr4SZwMK7w3oNcW/i7zegL9u0dsOyRYH1BGhykETCxQ0o+UOU527IgLriZAB8y7oE/ bsf7IO/yQk7SoCGgtMPtB2fy6CVn3pYZODhnB/rY/pBuZz6jAdFMlCtn4ouvpRx5wyqe wFWfLnkl35yAESN0J8lKD3r/sVc+sJDESggdecxkdRsj/XugXXPBXKJ9NHxNSD+7KgTT 6O/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=o024ty8U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l3si1484520ejn.543.2021.04.21.04.05.54; Wed, 21 Apr 2021 04:06:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=o024ty8U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235030AbhDUIbi (ORCPT + 99 others); Wed, 21 Apr 2021 04:31:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234632AbhDUIbh (ORCPT ); Wed, 21 Apr 2021 04:31:37 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED6A5C06174A for ; Wed, 21 Apr 2021 01:31:04 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id k4-20020a7bc4040000b02901331d89fb83so743213wmi.5 for ; Wed, 21 Apr 2021 01:31:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=mJcwZlu0Ar0OqbJ+UZHBMNI1VVtXFf5qDweduy1D6/0=; b=o024ty8UnwIIrWAXLRcFarFxMWg7aB5MoAF8/o0gVibbG8v/5/bOJSDD6mISRw2/3t RISq8FAaPPdXjtCkc80AWVZZhVMXSS9ePy/0e42mO8s65dFlUpQtGRxAzzUexbPHTd6M E93/bEHx+TF1PTCdAkNCXbq6Pp+HRcW0ij6FCmQkFFbVoW6lQ++b5RuvNMMe+wNz/h3/ PbB7VRCpoGtVwhW/m+6VhBrAkJDqFoDnHmnr+0FTaBBaq8a72TaQ7IaFKCSmpQlYp9Pq v0kVNof5TCP9ajsRScnrw6YgYHN4D5Xa6TM1a1Qiz3aZsJ+jjQlgmTFShG0WApO6GR58 GRaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=mJcwZlu0Ar0OqbJ+UZHBMNI1VVtXFf5qDweduy1D6/0=; b=tnmg6SgDANpkY7OjvuRcrn27iIL6YoDXeZGEbABkmpDfvBsvrlELaHX/hXAtNQWzUo 7K4liwrpwRVXgx8xy4Zpfe/Aj6tT2jG+k+QomImxzmxiFwkMTVCeWeG5d19ao4giHh7+ a2v/MXKjleGDvR8eMVzMZpjua7I4YJKqTQkpz1Sd7kU3smdmErN9jMUeysNgIWAY/WWQ gWomD6NjgjG2I0i9RSBToC/SGTrv9E4CqMsBlx2s7NZ64r5X3DOE2FjNfwE+4YNneVWM /uh2Qaz8gZ/ufa1TmO0RijCwjlgGvZ8n5cWevRz/nRh7iMH0HtZJZR8FSdSkYsm9MEvt 0OIw== X-Gm-Message-State: AOAM533sqh/kys0L13iDj7AdapYlxguwshsoqCJlL9/N4AMlqJYlb7OX I5+qV/ZqaR0CIpv7+/Icl+qpSg== X-Received: by 2002:a1c:b3c5:: with SMTP id c188mr2432123wmf.168.1618993863536; Wed, 21 Apr 2021 01:31:03 -0700 (PDT) Received: from google.com (105.168.195.35.bc.googleusercontent.com. [35.195.168.105]) by smtp.gmail.com with ESMTPSA id g5sm2156525wrq.30.2021.04.21.01.31.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Apr 2021 01:31:02 -0700 (PDT) Date: Wed, 21 Apr 2021 08:31:00 +0000 From: Quentin Perret To: Florian Fainelli 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 Subject: Re: [v5.4 stable] arm: stm32: Regression observed on "no-map" reserved memory region Message-ID: References: <4a4734d6-49df-677b-71d3-b926c44d89a9@foss.st.com> <001f8550-b625-17d2-85a6-98a483557c70@foss.st.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? Thanks, Quentin