From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it0-x229.google.com (mail-it0-x229.google.com [IPv6:2607:f8b0:4001:c0b::229]) (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 D8D3880470 for ; Mon, 20 Mar 2017 11:19:33 -0700 (PDT) Received: by mail-it0-x229.google.com with SMTP id w124so30082479itb.0 for ; Mon, 20 Mar 2017 11:19:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=wJji7aTLk8sEH+cFo5Lpr2SYOmx0FlgE1aTQUqMohhc=; b=Bac3f12PTcqwB8McVPeifz9DhpzJwVoYHQNNIa/aZ2cFfIFCDwOe1vVTtSLsoYM6xv xa0XEcdI7M6enNIpFx4GBsxtblxS2xMukLrchwpeoF8yFM55Cd5aEef7nzV9In4rC62l DgX/ogIPRWAI0kcnkpX7uO1rHA2djFBwM2N3o= 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=wJji7aTLk8sEH+cFo5Lpr2SYOmx0FlgE1aTQUqMohhc=; b=cvypqU8W/1Fw7xDDD1KSGObWOKhASdyc9wO3iwx7SbCWfWooFw54ykCV85e55VK4+6 rODX1j+HqCQPMTvEz8PJoL7Nxo+OuGNmHI7+wKTWmP2vx1GvqhnLXjwJ/YczpwPVZpWG 6DufWCInDaZNM5yw07Gw560QwfwXUfJ7LzrllHqPUPnZiUT72Hw5c3lAquetHfOX+esX TinGlZJ3IOOocRPOdFMjpX9rPMstwJhRBw/KaVEOEHD6GkDdrCLqmHSwwWKra1oLzsey u0PODvcToY7Ha3YBET1tGTSP8N0qryz95Sapsbz01o6BVmC7LvpjcbyV6tTHA38hHe+k K6Xg== X-Gm-Message-State: AFeK/H2g2+PZhmg+RAS8y4PvqbxXJLnF4oqbuwp5I28IEd7+oJWOfn3IoJL5ZAismOePwi3FCJBM3qEmHh/CLKel X-Received: by 10.36.207.212 with SMTP id y203mr10345677itf.63.1490033973180; Mon, 20 Mar 2017 11:19:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.10.27 with HTTP; Mon, 20 Mar 2017 11:19:32 -0700 (PDT) In-Reply-To: References: From: Ard Biesheuvel Date: Mon, 20 Mar 2017 18:19:32 +0000 Message-ID: To: Michael Zimmermann 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:19:34 -0000 Content-Type: text/plain; charset=UTF-8 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.