Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp748388pxb; Fri, 3 Sep 2021 12:31:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJchcmKcdrNV60OatEBwwh6oPBhOQQZQsJxGjB+4E1PoAKQ6/4865DjZQidgMsOMEXQiok X-Received: by 2002:a17:907:7252:: with SMTP id ds18mr463481ejc.105.1630697493409; Fri, 03 Sep 2021 12:31:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630697493; cv=none; d=google.com; s=arc-20160816; b=wT3yGQuSzNh7fpNxG8hoVCFW4X283BbIPUYGF5t4iix1LKb8j3hyc1fw0WtTl8a6cF i7v5rkPkkxY6otqyAQB6dyh0th48qwJYGO0UGrFnqWDZHiz629LpKrIeD8aaDni1au8u x4m5PWBEOUAkh7OtqVG7foWxaZdsQvFXCyHProGJ9rZahJ2lyY/b3IJ3lNjfb6xZkBBa 0hSZDLrytQbQ0YeaHZTSwIBkp/7YeLvNHnqtMI/soADi+ouT8o/Jv63W5BZAE8DMnxzk 8cJSbb29KkJB8sGOLNldmpdpgLxoSuHQaMu49iwK5xdN/h16a/MSKIGFqrwfea0PQ8vs cOLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=GHPzr9KnRPIHt8M4CiAcDe/rlIXPuUPBCeZTgZ5vpIQ=; b=Q2AQrm8J36wwu6RgYOrl6ERCp5ziqP/Fm98rzgpw/eXJYYww083YiV33XQC0woIEoe ktuenWJtMrN1F5D1ARFi7cHjkvfJnxQwow6ZeZL1F52P5XIpud8APuzGhGZF+0UjdMBR 4EV8HVeS7VtXugmglHrWl6fMUa3Vq7VxDkUn0sc3z2ETPwb/RQQEcyggbRKobbv0lDdb kMs6hlON2U0D0kukfZ/e9fT90LIQyOwjv/XJDc3It2pyf6GSuhwevwJUriI9RMQlDJ61 fjD+ylO3JzTXobVD9fEsXWTSVPUgNEw/sv1RrYcdYkKKcpi7sjUAsynnDGh06WkggCMa 4hsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=c3CYMEUb; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l22si351709eds.481.2021.09.03.12.31.09; Fri, 03 Sep 2021 12:31:33 -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=@kernel.org header.s=k20201202 header.b=c3CYMEUb; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349753AbhICRsY (ORCPT + 99 others); Fri, 3 Sep 2021 13:48:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:43896 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229789AbhICRsY (ORCPT ); Fri, 3 Sep 2021 13:48:24 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CB5E4610F9; Fri, 3 Sep 2021 17:47:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1630691243; bh=GHPzr9KnRPIHt8M4CiAcDe/rlIXPuUPBCeZTgZ5vpIQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=c3CYMEUbv15YTiTAMOAltio0RwKJ9DpXmmhtIvrga36APhG0IAGJItdZ1cEzzosDW HqtMQZBKd2n857R7HUdbp9lnmAFDdIyDOuOSZTqvvtK3SozaG0A8EoSzYW1AshwgJk s7oUKeQtqCEy7fxTmOFfUD4t2I1Kgcut6D7WjtA6ZAyMpODKLQX7yC/IHSkdfWftle vSVC+Un7bVTgdsDfqDH0YctarxpA8THtIUF7LzKoXtcmnQBwqxzd6/GYLepexCPRpq vRNpFqg8Ma4f+0yUJ0wXOFFa5OlHQ9sJOvokuIWmJnkUxAzT1S+SxcfYia+F8z9TmU xxKnOg8TEOGuA== Received: by mail-oi1-f169.google.com with SMTP id w144so106866oie.13; Fri, 03 Sep 2021 10:47:23 -0700 (PDT) X-Gm-Message-State: AOAM5329qerYbnEpHa0mHOEH3mWxK4xyhHMAArJoDBImI2woIAo2MYGp AK0YnqqAgfrl3lTijLJPDr42v6ZxIwCLBbCbUyQ= X-Received: by 2002:a54:418e:: with SMTP id 14mr29159oiy.174.1630691242892; Fri, 03 Sep 2021 10:47:22 -0700 (PDT) MIME-Version: 1.0 References: <20210730134552.853350-1-bert@biot.com> <20210730134552.853350-5-bert@biot.com> <7d3e2c5b-931c-1f82-77a3-fc51268f1986@nbd.name> In-Reply-To: <7d3e2c5b-931c-1f82-77a3-fc51268f1986@nbd.name> From: Ard Biesheuvel Date: Fri, 3 Sep 2021 19:47:12 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 4/5] ARM: Add basic support for EcoNet EN7523 SoC To: Felix Fietkau Cc: Arnd Bergmann , Bert Vermeulen , DTML , Linux Kernel Mailing List , Linux ARM , Russell King , Linus Walleij , Andrew Morton , Geert Uytterhoeven , Anshuman Khandual , Krzysztof Kozlowski , John Crispin , YiFei Zhu , Mike Rapoport , =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= , Nick Desaulniers , Kees Cook , Masahiro Yamada , Nathan Chancellor , Viresh Kumar Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 3 Sept 2021 at 18:20, Felix Fietkau wrote: > > > On 2021-08-01 18:44, Ard Biesheuvel wrote: > > On Fri, 30 Jul 2021 at 16:48, Arnd Bergmann wrote: > >> > >> Why is this needed? > >> > >> Note also the comment directly above it exlaining > >> # Text offset. This list is sorted numerically by address in order to > >> # provide a means to avoid/resolve conflicts in multi-arch kernels. > >> > > > > Yes, please drop this - it is a horrible hack and it's already quite > > disappointing that we are stuck with it for the foreseeable future. > > > > So I assume the purpose of this is to protect the first 128k of DRAM > > to be protected from being overwritten by the decompressor? > > > > It would be best to move this reserved region elsewhere, but I can > > understand that this is no longer an option. So the alternatives are > > - omit this window from the /memory node, and rely on Geert's recent > > decompressor changes which make it discover the usable memory from the > > DT, or > > - better would be to use a /memreserve/ here (which you may already > > have?), and teach the newly added decompressor code to take those into > > account when choosing the target window for decompressing the kernel. > I looked into this issue myself and found that this approach has a > significant drawback: 2 MiB of RAM is permanently wasted for something > that only needs to be preserved during boot time. > How so? If that memory region carries your PSCI implementation, it should be preserved permanently. So at least the 512k are permanently reserved. > If the first 256 or 512 KiB of RAM are reserved in the decompressor, it > means that the first 2 MiB need to be reserved, because that's the > granularity for the kernel page mapping when the MMU is turned on. > Indeed. > If we reserve it, we also need to need to take it out of the physical > RAM address range, so there's no way to reclaim it later. > > On the other hand, with the simple textofs solution, I believe it gets > freed in a late initcall, making it usable. > > So what's the right approach to deal with this? > The right solution here is to fix your firmware/bootloader so that the PSCI reserved region is moved to the top of memory. Adding more TEXT_OFFSET hacks is really not the right approach here.