From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 9BCDA803DB for ; Mon, 20 Mar 2017 09:17:55 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 04D2AC0528C3; Mon, 20 Mar 2017 16:17:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 04D2AC0528C3 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=lersek@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 04D2AC0528C3 Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-55.phx2.redhat.com [10.3.116.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9DAC45DD6A; Mon, 20 Mar 2017 16:17:54 +0000 (UTC) To: Michael Zimmermann , "edk2-devel@lists.01.org" , Ard Biesheuvel , Leif Lindholm , Yonghong Zhu , Liming Gao References: From: Laszlo Ersek Message-ID: <6e2ec64f-ab56-7c70-fe39-f139c7a1585b@redhat.com> Date: Mon, 20 Mar 2017 17:17:52 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 20 Mar 2017 16:17:56 +0000 (UTC) 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 16:17:55 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 03/20/17 17:06, Michael Zimmermann wrote: > Do I understand correctly, that a PcdSet on a 'PcdsPatchableInModule' > is only visible to the current module?(SEC, driver, application, ...) I've no experience with patchable-in-module PCDs. > 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. No experience with PrePi... > > 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. The DEC file that declares a given PCD provides the C language type for it, the default value, the token space GUID and the token number, and the set of "PCD flavors" that a specific platform DSC may choose for the PCD. In ArmVirtQemu.dsc, PcdSystemMemoryBase is defined under PcdsFixedAtBuild, which works well, so I wouldn't say the error is in HighMemDxe. Also, if some other DSC defined PcdSystemMemoryBase as a dynamic one, it would again work well (assuming the PCD were set early enough). My point is, a platform DSC and a (DXE) driver have to work together. Thanks Laszlo