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=-3.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 58F8CC433ED for ; Wed, 21 Apr 2021 08:33:37 +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 A04BA6143B for ; Wed, 21 Apr 2021 08:33:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A04BA6143B Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.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:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=1zw29iz30Pb25ya76b5bWckd7KJZf4GkmF+nhxvMcuQ=; b=A+j2TdVUBZun9kiLsh0rq8GmC IHadwXSWDrSWa0cB3W5/RZtd40CRxxBTR4OvrbE/QmSyc0H87nZD1yOX8uTcJSfWcsp2QC1SZ3zNO YELxICf3bDQ+iJXgAgSFr8O/r2QlxTMPNo5ivVVkSUPLIxp47A3YBKfT0iwjtZmX8ebfUQBnhKZU1 hgL8sSRqbIVVlIVpsDfTbBIxtaV+9/lotATX8G2a0JVLarIqcOcszwLwmd4cMvSeo0KsBz49Sdbcu yUBSqam6OnEt5moBdGGIuG+grmPgSrqs/YNpmLiefivlxRocF/xOZaGew2A3Vyc8y/iDB15nZe2u4 B2tulV2Gg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lZ8GR-00Dybu-HF; Wed, 21 Apr 2021 08:31:15 +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 1lZ8GO-00Dybn-Ag for linux-arm-kernel@desiato.infradead.org; Wed, 21 Apr 2021 08:31:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=mJcwZlu0Ar0OqbJ+UZHBMNI1VVtXFf5qDweduy1D6/0=; b=l3+nyWC3aZEWd6XIti9GH+iGK9 MRcdAfqW2z5giJtaaJvKwQ/JcNi54V4KmrvnoVE0hs6NSwKaxyWp3LwOmMCVq6gg8ok7I2ZTtrSbN 0JIP3e4lkKxIBU2s71xubTCqkrt/FnPJONlfLQao6QX16Mo7jd+xaX7tuNROSVoNZZWm2aP8LhEis qhC9dsVfS5QZHzQu8V+HIlQSNm9+1g5eO0Oq0PTs+/IcXhzABfq0SnpqWq2nlcIrQy2j7BAlvJnJM w1m1/epfgaKiDPuzggY0AmGqWgoT6ABEizJWpbgzhsxiooYQiAKEicBLIo0Ac1zgDd8ohZb7aXI3B /qZ6V90g==; Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lZ8GJ-00Ci4w-NE for linux-arm-kernel@lists.infradead.org; Wed, 21 Apr 2021 08:31:11 +0000 Received: by mail-wm1-x336.google.com with SMTP id y5-20020a05600c3645b0290132b13aaa3bso754023wmq.1 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=AD6Z5T8Q0i5hPOjbrGXAef2jTkskyHxjlggS7nJr5TiyowS+PffLGTYEjPPnJAOmRg TxOwUW4zlpldunVMl601PAjGtQhoXwNagz1++wgrzp56uVnGS2gscrz5aO2YI2c11C8l o6rrbyUQkJ7vz0FLYA+O249SPefu4r/EO2D2Y5s6Fs15EPRHsa1/N5TGhnZ+IQZISiOI ipiqL1cvXB2/jf18nmZmpUlpZdowT53a0myOWb3H+uqo2wGxSCGNfcrF/5S3QM4Fq0aQ 5yykXK8Nng1i9otRGN0QjBHyRi/mBrrNe0wDYTcKM6hjMsWkXUTN/n3V35tf+MrJcAjf tOPQ== X-Gm-Message-State: AOAM531TvcvTuRsYfbFXEMYpriSPjJmb9vZowCL5pyBiD2PR4h9WdwK4 eVJiFNBWbeZ2H0rkJk7Q0popyQ== X-Google-Smtp-Source: ABdhPJwEGruRSdnWTaFzBtUIiMhSy7VtcwIGQ/9y41wbzN7dfUybADZ1XDSeTl9FBzz3Ugj+bZUM4A== 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-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210421_013107_787886_623A035C X-CRM114-Status: GOOD ( 28.16 ) 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 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel