From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:4864:20::341; helo=mail-wm1-x341.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 9B1432194D387 for ; Wed, 23 Jan 2019 01:42:29 -0800 (PST) Received: by mail-wm1-x341.google.com with SMTP id m22so1272390wml.3 for ; Wed, 23 Jan 2019 01:42:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=TteW7mN+V+sSmaTd1TNhuDXTcZJNNUFef6nOF0EHVv4=; b=Ga/Kwmzh95MsileWJnfdbxnv8+Bvb7dXS8cU4j/LvdtSmMmofpXa3LjHNOr6MJ7J6s lSYSZH1VIZzj0Enn6QzmOHoc+34TRgZ4SqPEMMHY4jTjb6pmQtmcaJ09bLrju4iM+B5N sd7RammrqA+WG6GT3u0BiwtcbpoV2z7od30nM= 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:content-transfer-encoding :in-reply-to:user-agent; bh=TteW7mN+V+sSmaTd1TNhuDXTcZJNNUFef6nOF0EHVv4=; b=fjkZraH5EDfBpGr8yCppWSnAJ7fdLGSSjnhGz+IarisNdSIsnHhmJCCu9AYGywmpGR TKqWD8N6XgLkc4dkepiEfrO0LAVlKdklqctKAXuTzcjuKECYmICk6O4IBtDH8hSE+T+b DGfkUqVLEGdq4mfItrsnEq9lW5VdNNnStniSZaKJvD3uy6Ksp047RqFJwHzMFGFa9j7V CaFODLk+cYVKf1hPPFCnzyq3Cdss2hzJbsmW6TjyiEk5xh9UUlp30o5V6uT+bZYVd9PM BMk54FCbkx1NKLwN2jd/i7qq1i24WuGV9HewMbmGNjQSJEvl+E8gOx5wxMcLubWI9uQz nRwQ== X-Gm-Message-State: AJcUukeawWIwYgkp4icqsnJ0m7c/VvoLRlDFPxsWopZrF/9dVz86FKrb 2xyYKWzavHur2chfGe/jS6kKfw== X-Google-Smtp-Source: ALg8bN5RyM483EpHKM4K5jRe5jJ12ReL1TtgjqXrAobgj3nCSDGDbWxA3ei60FvxLpvQECfSYqofdg== X-Received: by 2002:a1c:4046:: with SMTP id n67mr1873087wma.123.1548236547569; Wed, 23 Jan 2019 01:42:27 -0800 (PST) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id a18sm120051690wrp.13.2019.01.23.01.42.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 Jan 2019 01:42:26 -0800 (PST) Date: Wed, 23 Jan 2019 09:42:25 +0000 From: Leif Lindholm To: Marcin Wojtas Cc: edk2-devel-01 , Ard Biesheuvel , nadavh@marvell.com, "jsd@semihalf.com" , Grzegorz Jaszczyk , Kostya Porotchkin Message-ID: <20190123094225.ifxrr6r562htbnaw@bivouac.eciton.net> References: <1548120742-11928-1-git-send-email-mw@semihalf.com> <1548120742-11928-2-git-send-email-mw@semihalf.com> <20190122172643.i6newphbfjiertsb@bivouac.eciton.net> <20190122190649.x2bh7gd5szxmfxy5@bivouac.eciton.net> <20190122202627.ccu3koeskydsvjus@bivouac.eciton.net> <20190122210937.rf44pvv6gaudlme7@bivouac.eciton.net> MIME-Version: 1.0 In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [platforms: PATCH v2 1/4] Marvell/Armada7k8k: Shift PEI stack base X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 X-List-Received-Date: Wed, 23 Jan 2019 09:42:30 -0000 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit On Wed, Jan 23, 2019 at 09:28:40AM +0100, Marcin Wojtas wrote: > wt., 22 sty 2019 o 22:10 Leif Lindholm napisaƂ(a): > > > > On Tue, Jan 22, 2019 at 09:56:14PM +0100, Marcin Wojtas wrote: > > > > > > I think I gave my suggestion for the resolution of this problem (with > > > > > > moving StackBase to 0x05400000 as the alternative) in my previous > > > > > > reply. > > > > > > > > > > > > > > > > Yes, and I answered, presenting the alternative memory map with > > > > > additional 64kB "cut out" on top of 20MB "hole" of memory, which I'm > > > > > not fancy, given available space inside the 20MB chunk. > > > > > > > > Please go back and reread my first and my second email. > > > > Then please point out where I have, other than as an alternative > > > > solution, suggested growing the cutout size. > > > > > > > > Then perhaps we can rewind this conversation and try again? > > > > > > Ok. So would it be sufficient to replace > > > gMarvellTokenSpaceGuid.PcdSecureRegionBase with two sets of separate > > > PCDs for ARM-TF runtime services and OPTEE leaving the PEI stack base > > > @0x43f0000? > > > > That would be lovely, thank you :) > > > > (Although your reference to wanting to keep the PEI stack area out of > > the hands of the operating system might mean that you want three? I'll > > leave that to your discretion.) > > > > PEI stack has its own PCDs: > gArmPlatformTokenSpaceGuid.PcdCPUCoresStackBase > gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize > > I want to keep it simple (and btw aligned with U-Boot booting the > mainline DTB with single 20MB reserved memory area), so what I intend > to do is to limit reserved region in Armada7k8kMemoryInitPeiLib.c with > PcdArmTFRegionBase (@0x4000000) up to PcdOpteeRegionBase + > PcdOpteeRegionSize (@0x5400000). I am totally online with you wanting to align the reservation of 20MB of RAM with U-Boot. If you want to remove the 2MB gap between ARM-TF and Optee from use by the OS, you need to reserve that 2MB window. Not pretend that it forms part of an adjacent region that you also happen to want to keep out of the hands of the OS. The point of the source code is not wiggling the correct signal lines to create an expected behaviour. Were that the case, we'd be hacking programs directly into binary. The point of the source code is to describe what is being done such that someone else can come in and understand it. Saving 15 (or 30, or whatever) lines of boilerplate text by making the code misleading is not a win. You want to solve this by making PcdCPUCorePrimaryStackSize 2MB? Fine. It's not misleading, and you could always shrink it if you need the remainder for something else. You want to solve this by setting up a third reserved area of (2MB - PcdCPUCorePrimaryStackSize)? Fine. You want to solve this by making the source code say that a memory region is simultaneously reserved for Secure world and where our Non-secure stack resides? Not fine. That is what I mean by semantic sense. Best Regards, Leif