From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ua0-x236.google.com (mail-ua0-x236.google.com [IPv6:2607:f8b0:400c:c08::236]) (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 BDE0780472 for ; Mon, 20 Mar 2017 11:37:25 -0700 (PDT) Received: by mail-ua0-x236.google.com with SMTP id 72so80977922uaf.3 for ; Mon, 20 Mar 2017 11:37:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=4x2+ezJqTGzbGmbY6x40ohHA1oh50iVgKXF5YsGxRAE=; b=M8bgdcWMLbg0tFjAF8mx+JEyAdu3qGw9vQXXKgkWUR19duRnhk7vttxmz+gNTW/cq6 eNaTlkj0K0kjo289scehD95yz1mG3pDkyLOGhQNgsnBLHoWnj+SPE5gRfpsam1/lNgFd az2sA5l2UQORZGnHP5NcQUJnBrlz1qbpDq2hpVR1BX7xVNyJE1mkL2FugZJJVHLh5DnY yIdwZsdapaVbHHr61578V/6SuuP5QKZbg8MfCW7AQHIH6eaXOWNfu4rmUNW+mW2XaBqA vpPRwmYVZ9/90rLYYycNHJkLKPuF9xN00MilAm2mXIE3H9XvH+Ml8dsoTtmv4VxyCz1f u1jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=4x2+ezJqTGzbGmbY6x40ohHA1oh50iVgKXF5YsGxRAE=; b=IQWLSibeD2VmCX75IbeaIWwdXZoyul8tW/fKej9XCniYwQX18GJz9xVgLDakCiTp81 W0XEaojDdBWFurwEDiMQzah2S8SfWs4oGTam7suH+xfxn50EuNYDZztNbCc3jfm4kL2m NFKUH2mA3rQOvzPowIhRxFXG71VPCk6Rho1gDYeiyP9Oh7vL4SUegIhXyfytmAQB1hyU QNai4288KH+MNQm03l0x4PC7S/tFDmn7UGks+P7sxDqFLOkFvR1GXLpbrgzPyuw6m850 exy1Lse0RikIrjGZSMwEfaYDYc33FE4a3WGOlxqF/h+iUXOw5cN1vSf9qPOq/RGPQ1YW c9bA== X-Gm-Message-State: AFeK/H2/MY6BQ5DIjGjKLCU6NhunoG8Upg2FVtW+pmrJNJuRJcMyAZTAxcRs1O6FLoF0Xna556Rs/XHw/+WUPA== X-Received: by 10.159.33.238 with SMTP id 101mr6282047uac.5.1490035044708; Mon, 20 Mar 2017 11:37:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.31.171.80 with HTTP; Mon, 20 Mar 2017 11:37:24 -0700 (PDT) In-Reply-To: References: From: Michael Zimmermann Date: Mon, 20 Mar 2017 19:37:24 +0100 Message-ID: To: Ard Biesheuvel Cc: "edk2-devel@lists.01.org" , Laszlo Ersek , Leif Lindholm , Yonghong Zhu , Liming Gao Subject: Re: visibility pf PcdSet X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Mar 2017 18:37:26 -0000 Content-Type: text/plain; charset=UTF-8 > So the best way to pass information from PrePi to DXE is using HOBs. Actually, it might be best for you to clone HighmemDxe if you need it, and use a HOB instead. I actually started a new port fully based on ArmVirtQemuKernel. So for me it's not a problem to adjust the code, I just thought you might want to know about the problem. > However, for a self relocating image (which I think you need for your application), PrePi is really the only way to go. Speaking about PrePi vs Pei - as far as I understand the only difference is that Pei is supposed to be booted via XIP from flash right? How would that work when running from DRAM?(even if it wasn't relocatable) If that would work, why can't we make a relocatable version of Pei? Thanks Michael On Mon, Mar 20, 2017 at 7:19 PM, Ard Biesheuvel wrote: > On 20 March 2017 at 16:06, Michael Zimmermann wrote: >> Do I understand correctly, that a PcdSet on a 'PcdsPatchableInModule' >> is only visible to the current module?(SEC, driver, application, ...) > > Yes. > >> Because I've tested this and a PcdSet on >> gArmTokenSpaceGuid.PcdSystemMemoryBase inisde PrePi is not visible >> inside a DXE_DRIVER - which means that for everyone else the value is >> still 0x0. >> > > Indeed. The relocatable PrePi needs a patchable PCD because it assigns > the value really early, in assembly code. But PrePi is a bit peculiar > as well, and I am pretty use SetPcd() on dynamic PCDs would not work > there either. > >> If this is the case and I don't have some platform bug, then there is >> probably a bug in ArmVirtPkg's HighMemDxe where this Pcd is used in a >> DXE_DRIVER: >> https://github.com/tianocore/edk2/blob/76874be3d411bf8daac051718e20932e0bf97d70/ArmVirtPkg/HighMemDxe/HighMemDxe.c#L70 >> It doesn't cause anything bad but it would show 'Failed to add System >> RAM @ START - END (Access Denied)' after calling AddMemorySpace for >> memory which has already been registered. >> > > Ah yes, well spotted. To be honest, PrePi is a bit of a hack, and I > actually recommend against it for new ports. However, for a self > relocating image (which I think you need for your application), PrePi > is really the only way to go. > > So the best way to pass information from PrePi to DXE is using HOBs. > Actually, it might be best for you to clone HighmemDxe if you need it, > and use a HOB instead.