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 Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 26847C433F5 for ; Wed, 23 Mar 2022 18:54:18 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id BCFDC83FA9; Wed, 23 Mar 2022 19:54:15 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="M7M3Rkhw"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1C05F83F8A; Wed, 23 Mar 2022 19:54:13 +0100 (CET) Received: from mail-ua1-x930.google.com (mail-ua1-x930.google.com [IPv6:2607:f8b0:4864:20::930]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E4E9783F8A for ; Wed, 23 Mar 2022 19:54:09 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@google.com Received: by mail-ua1-x930.google.com with SMTP id 34so1075315uao.13 for ; Wed, 23 Mar 2022 11:54:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=AJxI3A+8MDdiCIB8imAqeZgzeBCwAdKeWIyBdMPhlXk=; b=M7M3RkhwkX0rGJZ9pYIOomM8i+i249j17dvKK9JBbE5pdXOiDfkbBqEAhzh5bmfrQ/ gXk/Wk7z3QV9wkZu96F33s3Ks7hVWj3d/kbWo6tQ5897UmadR3o3UyAIuTXq6E+RZEzN CrYHNyckpJE4ZNE1hGzNR/oaAiL+NDufKmOyE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=AJxI3A+8MDdiCIB8imAqeZgzeBCwAdKeWIyBdMPhlXk=; b=6RAWw7DhvuSvBgoipiotGL07PYWng/up+ZfKoO5jSs5AgG/Z0gwyJcmv/sw2ZduxPl 4flQJUcjaKkSYvuoqgsp8mbqA3UClwB39f0eu00XNq9GNZnsPvXXRvI6PNxHmzwzwC7k kwcIc4RQz2Gm2gTT5/r3RTkmvdqCGidMtRxdp2hqOrUUOoL/86+sKCN/XMFAthx9XoxZ X3bEZI7AQXdPN4rux7pfXMdbdDc4vDl4p6brO1fvUqPeWAOoOzILdAGtuSivF6LfYm5h 9psCYWtUMdj0j0EUU3XzzoLj+YGcxmWvghfocQx6DnkLoIW4oEQ/pyk9Np8UE+/Cpzqb +HYA== X-Gm-Message-State: AOAM531wvxHi2pD1WUohC15xLgTHGDDiqEuKTdwhdSjJeeaoBl5y1ORH ixZ1D3jyIumWKk0q2ykbWhEi+mdIyHDLPrbpffKW5w== X-Google-Smtp-Source: ABdhPJypJ1DSlSH1Wdk18IWzHfG+ROko7rRjHqcZji+fZEqMedftkdTMt0FRAc/NojJhfXcNkr7tAZskSWs2vocRSfA= X-Received: by 2002:a9f:3589:0:b0:342:4791:1b86 with SMTP id t9-20020a9f3589000000b0034247911b86mr760844uad.82.1648061648571; Wed, 23 Mar 2022 11:54:08 -0700 (PDT) MIME-Version: 1.0 References: <20220321214118.49334-1-kettenis@openbsd.org> In-Reply-To: From: Simon Glass Date: Wed, 23 Mar 2022 12:53:57 -0600 Message-ID: Subject: Re: [PATCH] arm: apple: Fix mem layout To: Mark Kettenis Cc: Mark Kettenis , U-Boot Mailing List , Tom Rini Content-Type: text/plain; charset="UTF-8" X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean Hi Mark, On Wed, 23 Mar 2022 at 04:18, Mark Kettenis wrote: > > > From: Simon Glass > > Date: Wed, 23 Mar 2022 03:59:58 -0600 > > > > Hi Mark, > > > > On Mon, 21 Mar 2022 at 15:41, Mark Kettenis wrote: > > > > > > The current approach for setting the environment variables that > > > describe the memory layout runs the risk of overlapping with > > > reserved memory regions. Use the lmb code to derive the addresses > > > for these variables instead. > > > > > > Signed-off-by: Mark Kettenis > > > --- > > > > > > Another candidate for 2022.04. Not a regression either, but the > > > current code may end up randomly failing due to address space > > > randomization. The efi_loader bootpath seems to be unaffected, but > > > attempt to load a Linux kernel directly are more likely to fail. > > > Also tested widely by people using the Asahi Linux installer. > > > > Where is the randomisation happening? > > There are a few factors here. The Apple bootloader loads m1n1 at a > somewhat random address. And then there are variations in how U-Boot > gets loaded (as a m1n1 payload, chainloaded, running under the m1n1 > hypervisor, etc.) that affect which memory ranges end up being > reserved in the DTB by m1n1. And the variation in firmware between > machines makes the memory map somewhat unpredictable too. OK, thanks, sounds complicated! > > > > arch/arm/mach-apple/board.c | 32 ++++++++++++++------------------ > > > 1 file changed, 14 insertions(+), 18 deletions(-) > > > > Reviewed-by: Simon Glass > >