Hi Tim,

Your description looks correct to me.  The current design does have an 
assumption 
that the PCD database used in PEI is aligned with the PCD database used in DXE.

If the number of Dynamic/DynamicEx PCDs used in a platform changes, then the
PCD database associated with the PCD PEIM and PCD DXE Driver both need to be
updated.

I think it would be good to work on a method that allows the PEI Database and
DXE Database to be updated independently.

In general, if binary modules are used, then Dynamic PCDs can not be used.  
Instead
all Dynamic PCDs must be updated to by DynamicEx PCDs.  That is for binary
modules that performs PCD Get/Set operations through the PCD PPI/Protocol.

I think the gap here is that the PCD database does not have a build mode that 
forces use of only DynamicEx (TokenSpaceGuid, TokenNumber) for the entire 
database
contents.  If we added that build mode (so there are no "local token numbers")
then the PEI database and DXE database could be updated independently.

This build mode could only be enabled if there are no Dynamic PCDs.  In fact, 
this
build mode could be automatic if there are no Dynamic PCDs in DSC file.

Mike

> -----Original Message-----
> From: edk2-devel [mailto:[email protected]] On Behalf Of Tim 
> Lewis
> Sent: Tuesday, February 9, 2016 10:24 AM
> To: [email protected]
> Subject: [edk2] PCD Local Token Numbers in PEI/DXE
> 
> We have run into an interesting problem with the PCD database when the PEI 
> and DXE
> databases were not built at the same time. This happens with boot-block type
> arrangements. This is not a Dynamic vs. DynamicEx issue.
> 
> Short form:
> 
> 
> 1)      The standard PCD database for Dynamic/DynamicEx PCDs is broken into 
> two pieces,
> based on whether the PCD is access by a PEIM, a DXE driver, or both. The 
> pieces are
> embedded directly into the PCD PEIM and PCD DXE driver that produces the PCD 
> services.
> 
> 2)      Each Dynamic/DynamicEx PCD is assigned a unique "local token number" 
> This
> number is different than the token number which is in the PCD declaration in 
> the .dec
> file. This number is assigned at build time.
> 
> 3)      If a later version of the DXE PCD driver is a) built in a later 
> codebase where
> there are more or less PEI-access PCDs, but later b) executed with a version 
> of the PEI
> PCD database from the earlier codebase where there were fewer, it causes a 
> problem. For
> example, if the new PEI PCD database has 4 more, the new DXE PCD database 
> will start
> its numbering at +4. But when it is executed with the old PEI PCD database, 
> it will end
> up looking up the wrong PCD
> 
> We're not sure what the best course is to solve this. Frankly, the PCD 
> database format
> is a muddle. We have a temporary work-around, but we're wondering if anyone 
> has
> thoughts on a good solution.
> 
> Thanks,
> 
> Tim
> _______________________________________________
> edk2-devel mailing list
> [email protected]
> https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to