* PcdDebugPropertyMask in DSC: How to I set different values for PEI and DXE?
@ 2022-02-16 21:01 Andrew Fish
2022-02-16 22:10 ` [edk2-devel] " Michael D Kinney
0 siblings, 1 reply; 9+ messages in thread
From: Andrew Fish @ 2022-02-16 21:01 UTC (permalink / raw)
To: edk2-devel-groups-io
I’m trying to have a different platform policy for PcdDebugPropertyMask in PEI and DXE. I can’t figure out how to do without overriding every PEIM that I build?
My PEI and DXE has the same arch so I can’t use the CPU Arch to tell them apart.
Is there something I’m missing?
Thanks,
Andrew Fish
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [edk2-devel] PcdDebugPropertyMask in DSC: How to I set different values for PEI and DXE?
2022-02-16 21:01 PcdDebugPropertyMask in DSC: How to I set different values for PEI and DXE? Andrew Fish
@ 2022-02-16 22:10 ` Michael D Kinney
2022-02-17 3:25 ` Andrew Fish
0 siblings, 1 reply; 9+ messages in thread
From: Michael D Kinney @ 2022-02-16 22:10 UTC (permalink / raw)
To: devel@edk2.groups.io, afish@apple.com, Kinney, Michael D
Hi Andrew,
Current DSC syntax for platform scoped [PcdsXXX] sections only supports
CPU Arch and SKUID.
So there is no mechanism today to specify different PCD values based on
module type.
You can manage this in the DSC file, but it does require the module
scoped <PcdXXX> section for each module INF that requires a different
value that the platform scoped [PcdXXX] section.
Mike
> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Andrew Fish via groups.io
> Sent: Wednesday, February 16, 2022 1:02 PM
> To: edk2-devel-groups-io <devel@edk2.groups.io>
> Subject: [edk2-devel] PcdDebugPropertyMask in DSC: How to I set different values for PEI and DXE?
>
> I’m trying to have a different platform policy for PcdDebugPropertyMask in PEI and DXE. I can’t figure out how to do without
> overriding every PEIM that I build?
>
> My PEI and DXE has the same arch so I can’t use the CPU Arch to tell them apart.
>
> Is there something I’m missing?
>
> Thanks,
>
> Andrew Fish
>
>
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [edk2-devel] PcdDebugPropertyMask in DSC: How to I set different values for PEI and DXE?
2022-02-16 22:10 ` [edk2-devel] " Michael D Kinney
@ 2022-02-17 3:25 ` Andrew Fish
2022-02-17 18:52 ` Michael D Kinney
0 siblings, 1 reply; 9+ messages in thread
From: Andrew Fish @ 2022-02-17 3:25 UTC (permalink / raw)
To: Mike Kinney; +Cc: devel@edk2.groups.io
> On Feb 16, 2022, at 2:10 PM, Kinney, Michael D <michael.d.kinney@intel.com> wrote:
>
> Hi Andrew,
>
> Current DSC syntax for platform scoped [PcdsXXX] sections only supports
> CPU Arch and SKUID.
>
> So there is no mechanism today to specify different PCD values based on
> module type.
>
> You can manage this in the DSC file, but it does require the module
> scoped <PcdXXX> section for each module INF that requires a different
> value that the platform scoped [PcdXXX] section.
>
Mike,
That is what I ended up doing, but it required overriding every PEIM and PEI Core. Seemed kind of excessive.
I think people cheat and use IA32 vs X64 to mean PEI vs. DXE on X64 platforms.
Thanks,
Andrew Fish
> Mike
>
>> -----Original Message-----
>> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Andrew Fish via groups.io
>> Sent: Wednesday, February 16, 2022 1:02 PM
>> To: edk2-devel-groups-io <devel@edk2.groups.io>
>> Subject: [edk2-devel] PcdDebugPropertyMask in DSC: How to I set different values for PEI and DXE?
>>
>> I’m trying to have a different platform policy for PcdDebugPropertyMask in PEI and DXE. I can’t figure out how to do without
>> overriding every PEIM that I build?
>>
>> My PEI and DXE has the same arch so I can’t use the CPU Arch to tell them apart.
>>
>> Is there something I’m missing?
>>
>> Thanks,
>>
>> Andrew Fish
>>
>>
>>
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [edk2-devel] PcdDebugPropertyMask in DSC: How to I set different values for PEI and DXE?
2022-02-17 3:25 ` Andrew Fish
@ 2022-02-17 18:52 ` Michael D Kinney
2022-02-17 20:22 ` Andrew Fish
0 siblings, 1 reply; 9+ messages in thread
From: Michael D Kinney @ 2022-02-17 18:52 UTC (permalink / raw)
To: Andrew Fish, Kinney, Michael D; +Cc: devel@edk2.groups.io
I agree that your approach is the only way right now.
Do you have a feature request???
Mike
> -----Original Message-----
> From: Andrew Fish <afish@apple.com>
> Sent: Wednesday, February 16, 2022 7:26 PM
> To: Kinney, Michael D <michael.d.kinney@intel.com>
> Cc: devel@edk2.groups.io
> Subject: Re: [edk2-devel] PcdDebugPropertyMask in DSC: How to I set different values for PEI and DXE?
>
>
>
> > On Feb 16, 2022, at 2:10 PM, Kinney, Michael D <michael.d.kinney@intel.com> wrote:
> >
> > Hi Andrew,
> >
> > Current DSC syntax for platform scoped [PcdsXXX] sections only supports
> > CPU Arch and SKUID.
> >
> > So there is no mechanism today to specify different PCD values based on
> > module type.
> >
> > You can manage this in the DSC file, but it does require the module
> > scoped <PcdXXX> section for each module INF that requires a different
> > value that the platform scoped [PcdXXX] section.
> >
>
> Mike,
>
> That is what I ended up doing, but it required overriding every PEIM and PEI Core. Seemed kind of excessive.
>
> I think people cheat and use IA32 vs X64 to mean PEI vs. DXE on X64 platforms.
>
> Thanks,
>
> Andrew Fish
>
> > Mike
> >
> >> -----Original Message-----
> >> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Andrew Fish via groups.io
> >> Sent: Wednesday, February 16, 2022 1:02 PM
> >> To: edk2-devel-groups-io <devel@edk2.groups.io>
> >> Subject: [edk2-devel] PcdDebugPropertyMask in DSC: How to I set different values for PEI and DXE?
> >>
> >> I’m trying to have a different platform policy for PcdDebugPropertyMask in PEI and DXE. I can’t figure out how to do without
> >> overriding every PEIM that I build?
> >>
> >> My PEI and DXE has the same arch so I can’t use the CPU Arch to tell them apart.
> >>
> >> Is there something I’m missing?
> >>
> >> Thanks,
> >>
> >> Andrew Fish
> >>
> >>
> >>
> >
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [edk2-devel] PcdDebugPropertyMask in DSC: How to I set different values for PEI and DXE?
2022-02-17 18:52 ` Michael D Kinney
@ 2022-02-17 20:22 ` Andrew Fish
2022-02-18 0:26 ` Oram, Isaac W
0 siblings, 1 reply; 9+ messages in thread
From: Andrew Fish @ 2022-02-17 20:22 UTC (permalink / raw)
To: Mike Kinney; +Cc: devel@edk2.groups.io
> On Feb 17, 2022, at 10:52 AM, Kinney, Michael D <michael.d.kinney@intel.com> wrote:
>
> I agree that your approach is the only way right now.
>
> Do you have a feature request???
Well it does seem like a reasonable thing to be able to do? What do other people think?
I was able to refactor my code and I did not actually end up needing to override every PEIM and the PEI Core.
Thanks,
Andrew Fish
>
> Mike
>
>> -----Original Message-----
>> From: Andrew Fish <afish@apple.com>
>> Sent: Wednesday, February 16, 2022 7:26 PM
>> To: Kinney, Michael D <michael.d.kinney@intel.com>
>> Cc: devel@edk2.groups.io
>> Subject: Re: [edk2-devel] PcdDebugPropertyMask in DSC: How to I set different values for PEI and DXE?
>>
>>
>>
>>> On Feb 16, 2022, at 2:10 PM, Kinney, Michael D <michael.d.kinney@intel.com> wrote:
>>>
>>> Hi Andrew,
>>>
>>> Current DSC syntax for platform scoped [PcdsXXX] sections only supports
>>> CPU Arch and SKUID.
>>>
>>> So there is no mechanism today to specify different PCD values based on
>>> module type.
>>>
>>> You can manage this in the DSC file, but it does require the module
>>> scoped <PcdXXX> section for each module INF that requires a different
>>> value that the platform scoped [PcdXXX] section.
>>>
>>
>> Mike,
>>
>> That is what I ended up doing, but it required overriding every PEIM and PEI Core. Seemed kind of excessive.
>>
>> I think people cheat and use IA32 vs X64 to mean PEI vs. DXE on X64 platforms.
>>
>> Thanks,
>>
>> Andrew Fish
>>
>>> Mike
>>>
>>>> -----Original Message-----
>>>> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Andrew Fish via groups.io
>>>> Sent: Wednesday, February 16, 2022 1:02 PM
>>>> To: edk2-devel-groups-io <devel@edk2.groups.io>
>>>> Subject: [edk2-devel] PcdDebugPropertyMask in DSC: How to I set different values for PEI and DXE?
>>>>
>>>> I’m trying to have a different platform policy for PcdDebugPropertyMask in PEI and DXE. I can’t figure out how to do without
>>>> overriding every PEIM that I build?
>>>>
>>>> My PEI and DXE has the same arch so I can’t use the CPU Arch to tell them apart.
>>>>
>>>> Is there something I’m missing?
>>>>
>>>> Thanks,
>>>>
>>>> Andrew Fish
>>>>
>>>>
>>>>
>>>
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [edk2-devel] PcdDebugPropertyMask in DSC: How to I set different values for PEI and DXE?
2022-02-17 20:22 ` Andrew Fish
@ 2022-02-18 0:26 ` Oram, Isaac W
2022-02-18 0:41 ` Andrew Fish
0 siblings, 1 reply; 9+ messages in thread
From: Oram, Isaac W @ 2022-02-18 0:26 UTC (permalink / raw)
To: devel@edk2.groups.io, afish@apple.com, Kinney, Michael D
Andrew,
It is a reasonable ask, but I lean towards voting no. We can more or less do the equivalent by breaking a monolithic build into a set of phase specific build/DSC/FDF or something similar. That seems more flexible anyway. Maybe we want binaries with settings based on maturity more than phase. And so on.
My primary concern that the complexity added to an already complex feature. PCD have a lot of binary compatibility challenges anyway. And this doesn't add any that don't already exist, but it does make it a lot easier to introduce a mismatch issue.
My more recreational question is if this makes sense in most cases, or if there are a limited set of PCD that it makes sense for. A lot of similar PCD are much more like shared constants and thus it doesn't make a lot of sense for them to vary across executables. E.G. drivers are asking for problems if they change max string lengths inconsistently. There are definitely more than one PCD where it seems reasonable. Maybe they are the "wrong" type though. Maybe they should be a dynamic type if a flexible usage is desired.
Tangentially related, there was some previous work to make macros for phase architectures.
[Defines]
PEI_ARCH = IA32
DXE_ARCH = X64
Enabling [Components.$(PEI_ARCH)] and [Components.$(DXE_ARCH)]
https://bugzilla.tianocore.org/show_bug.cgi?id=2308
If we do something with PCD, we should probably try to be consistent with this and maybe extend it or integrate it into DSC syntax. With standalone MM, it probably makes more sense to have PEI, DXE, and SMM. RT would also make sense to have different settings. I have mixed feelings about BDS. I think it makes sense to see it as a potentially independent phase that isn't currently. But also probably won't ever be independent from DXE.
Regards,
Isaac
-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Andrew Fish via groups.io
Sent: Thursday, February 17, 2022 12:22 PM
To: Kinney, Michael D <michael.d.kinney@intel.com>
Cc: devel@edk2.groups.io
Subject: Re: [edk2-devel] PcdDebugPropertyMask in DSC: How to I set different values for PEI and DXE?
> On Feb 17, 2022, at 10:52 AM, Kinney, Michael D <michael.d.kinney@intel.com> wrote:
>
> I agree that your approach is the only way right now.
>
> Do you have a feature request???
Well it does seem like a reasonable thing to be able to do? What do other people think?
I was able to refactor my code and I did not actually end up needing to override every PEIM and the PEI Core.
Thanks,
Andrew Fish
>
> Mike
>
>> -----Original Message-----
>> From: Andrew Fish <afish@apple.com>
>> Sent: Wednesday, February 16, 2022 7:26 PM
>> To: Kinney, Michael D <michael.d.kinney@intel.com>
>> Cc: devel@edk2.groups.io
>> Subject: Re: [edk2-devel] PcdDebugPropertyMask in DSC: How to I set different values for PEI and DXE?
>>
>>
>>
>>> On Feb 16, 2022, at 2:10 PM, Kinney, Michael D <michael.d.kinney@intel.com> wrote:
>>>
>>> Hi Andrew,
>>>
>>> Current DSC syntax for platform scoped [PcdsXXX] sections only
>>> supports CPU Arch and SKUID.
>>>
>>> So there is no mechanism today to specify different PCD values based
>>> on module type.
>>>
>>> You can manage this in the DSC file, but it does require the module
>>> scoped <PcdXXX> section for each module INF that requires a
>>> different value that the platform scoped [PcdXXX] section.
>>>
>>
>> Mike,
>>
>> That is what I ended up doing, but it required overriding every PEIM and PEI Core. Seemed kind of excessive.
>>
>> I think people cheat and use IA32 vs X64 to mean PEI vs. DXE on X64 platforms.
>>
>> Thanks,
>>
>> Andrew Fish
>>
>>> Mike
>>>
>>>> -----Original Message-----
>>>> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of
>>>> Andrew Fish via groups.io
>>>> Sent: Wednesday, February 16, 2022 1:02 PM
>>>> To: edk2-devel-groups-io <devel@edk2.groups.io>
>>>> Subject: [edk2-devel] PcdDebugPropertyMask in DSC: How to I set different values for PEI and DXE?
>>>>
>>>> I’m trying to have a different platform policy for
>>>> PcdDebugPropertyMask in PEI and DXE. I can’t figure out how to do without overriding every PEIM that I build?
>>>>
>>>> My PEI and DXE has the same arch so I can’t use the CPU Arch to tell them apart.
>>>>
>>>> Is there something I’m missing?
>>>>
>>>> Thanks,
>>>>
>>>> Andrew Fish
>>>>
>>>>
>>>>
>>>
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [edk2-devel] PcdDebugPropertyMask in DSC: How to I set different values for PEI and DXE?
2022-02-18 0:26 ` Oram, Isaac W
@ 2022-02-18 0:41 ` Andrew Fish
2022-02-18 1:36 ` Michael D Kinney
0 siblings, 1 reply; 9+ messages in thread
From: Andrew Fish @ 2022-02-18 0:41 UTC (permalink / raw)
To: devel, Isaac W Oram; +Cc: Mike Kinney
[-- Attachment #1: Type: text/plain, Size: 5846 bytes --]
> On Feb 17, 2022, at 4:26 PM, Oram, Isaac W <isaac.w.oram@intel.com> wrote:
>
> Andrew,
>
> It is a reasonable ask, but I lean towards voting no. We can more or less do the equivalent by breaking a monolithic build into a set of phase specific build/DSC/FDF or something similar. That seems more flexible anyway. Maybe we want binaries with settings based on maturity more than phase. And so on.
>
>
> My primary concern that the complexity added to an already complex feature. PCD have a lot of binary compatibility challenges anyway. And this doesn't add any that don't already exist, but it does make it a lot easier to introduce a mismatch issue.
>
I shot my self in the foot with the Fixed* macro in a library so I did not get the drivers override. So I feel that pain. You need to used the non Fixed form from a lib to get the value from the global produced by the driver.
>
> My more recreational question is if this makes sense in most cases, or if there are a limited set of PCD that it makes sense for. A lot of similar PCD are much more like shared constants and thus it doesn't make a lot of sense for them to vary across executables. E.G. drivers are asking for problems if they change max string lengths inconsistently. There are definitely more than one PCD where it seems reasonable. Maybe they are the "wrong" type though. Maybe they should be a dynamic type if a flexible usage is desired.
>
I was trying to have different settings for gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask is regards to the action taken on an ASSERT.
To be honest it was not my 1st choice and I was working around some early boot exception handling code not saving the EFI_SYSTEM_CONTEXT and blocking the scheme I was trying to use.
>
> Tangentially related, there was some previous work to make macros for phase architectures.
>
> [Defines]
> PEI_ARCH = IA32
> DXE_ARCH = X64
>
> Enabling [Components.$(PEI_ARCH)] and [Components.$(DXE_ARCH)]
>
In my case PEI_ARCH == DXE_ARCH so this kind of trick is not helpful. The reality is this trick only works for non virtualized X64 platforms and the edk2 supports a lot more flavors of platforms than X64.
Thanks,
Andrew Fish
> https://bugzilla.tianocore.org/show_bug.cgi?id=2308 <https://bugzilla.tianocore.org/show_bug.cgi?id=2308>
>
> If we do something with PCD, we should probably try to be consistent with this and maybe extend it or integrate it into DSC syntax. With standalone MM, it probably makes more sense to have PEI, DXE, and SMM. RT would also make sense to have different settings. I have mixed feelings about BDS. I think it makes sense to see it as a potentially independent phase that isn't currently. But also probably won't ever be independent from DXE.
>
> Regards,
> Isaac
>
>
> -----Original Message-----
> From: devel@edk2.groups.io <mailto:devel@edk2.groups.io> <devel@edk2.groups.io <mailto:devel@edk2.groups.io>> On Behalf Of Andrew Fish via groups.io <http://groups.io/>
> Sent: Thursday, February 17, 2022 12:22 PM
> To: Kinney, Michael D <michael.d.kinney@intel.com <mailto:michael.d.kinney@intel.com>>
> Cc: devel@edk2.groups.io <mailto:devel@edk2.groups.io>
> Subject: Re: [edk2-devel] PcdDebugPropertyMask in DSC: How to I set different values for PEI and DXE?
>
>
>
>> On Feb 17, 2022, at 10:52 AM, Kinney, Michael D <michael.d.kinney@intel.com> wrote:
>>
>> I agree that your approach is the only way right now.
>>
>> Do you have a feature request???
>
> Well it does seem like a reasonable thing to be able to do? What do other people think?
>
> I was able to refactor my code and I did not actually end up needing to override every PEIM and the PEI Core.
>
> Thanks,
>
> Andrew Fish
>
>>
>> Mike
>>
>>> -----Original Message-----
>>> From: Andrew Fish <afish@apple.com>
>>> Sent: Wednesday, February 16, 2022 7:26 PM
>>> To: Kinney, Michael D <michael.d.kinney@intel.com>
>>> Cc: devel@edk2.groups.io
>>> Subject: Re: [edk2-devel] PcdDebugPropertyMask in DSC: How to I set different values for PEI and DXE?
>>>
>>>
>>>
>>>> On Feb 16, 2022, at 2:10 PM, Kinney, Michael D <michael.d.kinney@intel.com> wrote:
>>>>
>>>> Hi Andrew,
>>>>
>>>> Current DSC syntax for platform scoped [PcdsXXX] sections only
>>>> supports CPU Arch and SKUID.
>>>>
>>>> So there is no mechanism today to specify different PCD values based
>>>> on module type.
>>>>
>>>> You can manage this in the DSC file, but it does require the module
>>>> scoped <PcdXXX> section for each module INF that requires a
>>>> different value that the platform scoped [PcdXXX] section.
>>>>
>>>
>>> Mike,
>>>
>>> That is what I ended up doing, but it required overriding every PEIM and PEI Core. Seemed kind of excessive.
>>>
>>> I think people cheat and use IA32 vs X64 to mean PEI vs. DXE on X64 platforms.
>>>
>>> Thanks,
>>>
>>> Andrew Fish
>>>
>>>> Mike
>>>>
>>>>> -----Original Message-----
>>>>> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of
>>>>> Andrew Fish via groups.io
>>>>> Sent: Wednesday, February 16, 2022 1:02 PM
>>>>> To: edk2-devel-groups-io <devel@edk2.groups.io>
>>>>> Subject: [edk2-devel] PcdDebugPropertyMask in DSC: How to I set different values for PEI and DXE?
>>>>>
>>>>> I’m trying to have a different platform policy for
>>>>> PcdDebugPropertyMask in PEI and DXE. I can’t figure out how to do without overriding every PEIM that I build?
>>>>>
>>>>> My PEI and DXE has the same arch so I can’t use the CPU Arch to tell them apart.
>>>>>
>>>>> Is there something I’m missing?
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Andrew Fish
>>>>>
>>>>>
>>>>>
>>>>
>>
>
>
>
>
>
>
>
>
>
[-- Attachment #2: Type: text/html, Size: 39173 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [edk2-devel] PcdDebugPropertyMask in DSC: How to I set different values for PEI and DXE?
2022-02-18 0:41 ` Andrew Fish
@ 2022-02-18 1:36 ` Michael D Kinney
2022-02-18 2:49 ` Andrew Fish
0 siblings, 1 reply; 9+ messages in thread
From: Michael D Kinney @ 2022-02-18 1:36 UTC (permalink / raw)
To: Andrew Fish, devel@edk2.groups.io, Oram, Isaac W,
Kinney, Michael D
[-- Attachment #1: Type: text/plain, Size: 6722 bytes --]
Hi Andrew,
I forgot about the library constraints.
Unless we want to first add a feature to build a library instance for each module type into
a different build output directory, we cannot support setting a FixedAtBuild PCD for each
module type.
If you use PatchableInModule, you can post process all the modules to set individual
module PCD values. You have to do two steps. One DSC to build all the modules and
generate AsBuiltInf. 2nd DSC/FDF that references the AsBuildInfs and sets the
PatchableInModule PCD values in the scope of the modules needed.
The only reason the different ARCHs for PEI and DXE works is because the libs
for each ARCH are build separately and already have different build output locations.
Mike
From: Andrew Fish <afish@apple.com>
Sent: Thursday, February 17, 2022 4:42 PM
To: devel@edk2.groups.io; Oram, Isaac W <isaac.w.oram@intel.com>
Cc: Kinney, Michael D <michael.d.kinney@intel.com>
Subject: Re: [edk2-devel] PcdDebugPropertyMask in DSC: How to I set different values for PEI and DXE?
On Feb 17, 2022, at 4:26 PM, Oram, Isaac W <isaac.w.oram@intel.com<mailto:isaac.w.oram@intel.com>> wrote:
Andrew,
It is a reasonable ask, but I lean towards voting no. We can more or less do the equivalent by breaking a monolithic build into a set of phase specific build/DSC/FDF or something similar. That seems more flexible anyway. Maybe we want binaries with settings based on maturity more than phase. And so on.
My primary concern that the complexity added to an already complex feature. PCD have a lot of binary compatibility challenges anyway. And this doesn't add any that don't already exist, but it does make it a lot easier to introduce a mismatch issue.
I shot my self in the foot with the Fixed* macro in a library so I did not get the drivers override. So I feel that pain. You need to used the non Fixed form from a lib to get the value from the global produced by the driver.
My more recreational question is if this makes sense in most cases, or if there are a limited set of PCD that it makes sense for. A lot of similar PCD are much more like shared constants and thus it doesn't make a lot of sense for them to vary across executables. E.G. drivers are asking for problems if they change max string lengths inconsistently. There are definitely more than one PCD where it seems reasonable. Maybe they are the "wrong" type though. Maybe they should be a dynamic type if a flexible usage is desired.
I was trying to have different settings for gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask is regards to the action taken on an ASSERT.
To be honest it was not my 1st choice and I was working around some early boot exception handling code not saving the EFI_SYSTEM_CONTEXT and blocking the scheme I was trying to use.
Tangentially related, there was some previous work to make macros for phase architectures.
[Defines]
PEI_ARCH = IA32
DXE_ARCH = X64
Enabling [Components.$(PEI_ARCH)] and [Components.$(DXE_ARCH)]
In my case PEI_ARCH == DXE_ARCH so this kind of trick is not helpful. The reality is this trick only works for non virtualized X64 platforms and the edk2 supports a lot more flavors of platforms than X64.
Thanks,
Andrew Fish
https://bugzilla.tianocore.org/show_bug.cgi?id=2308
If we do something with PCD, we should probably try to be consistent with this and maybe extend it or integrate it into DSC syntax. With standalone MM, it probably makes more sense to have PEI, DXE, and SMM. RT would also make sense to have different settings. I have mixed feelings about BDS. I think it makes sense to see it as a potentially independent phase that isn't currently. But also probably won't ever be independent from DXE.
Regards,
Isaac
-----Original Message-----
From: devel@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io<mailto:devel@edk2.groups.io>> On Behalf Of Andrew Fish via groups.io<http://groups.io/>
Sent: Thursday, February 17, 2022 12:22 PM
To: Kinney, Michael D <michael.d.kinney@intel.com<mailto:michael.d.kinney@intel.com>>
Cc: devel@edk2.groups.io<mailto:devel@edk2.groups.io>
Subject: Re: [edk2-devel] PcdDebugPropertyMask in DSC: How to I set different values for PEI and DXE?
On Feb 17, 2022, at 10:52 AM, Kinney, Michael D <michael.d.kinney@intel.com<mailto:michael.d.kinney@intel.com>> wrote:
I agree that your approach is the only way right now.
Do you have a feature request???
Well it does seem like a reasonable thing to be able to do? What do other people think?
I was able to refactor my code and I did not actually end up needing to override every PEIM and the PEI Core.
Thanks,
Andrew Fish
Mike
-----Original Message-----
From: Andrew Fish <afish@apple.com<mailto:afish@apple.com>>
Sent: Wednesday, February 16, 2022 7:26 PM
To: Kinney, Michael D <michael.d.kinney@intel.com<mailto:michael.d.kinney@intel.com>>
Cc: devel@edk2.groups.io<mailto:devel@edk2.groups.io>
Subject: Re: [edk2-devel] PcdDebugPropertyMask in DSC: How to I set different values for PEI and DXE?
On Feb 16, 2022, at 2:10 PM, Kinney, Michael D <michael.d.kinney@intel.com<mailto:michael.d.kinney@intel.com>> wrote:
Hi Andrew,
Current DSC syntax for platform scoped [PcdsXXX] sections only
supports CPU Arch and SKUID.
So there is no mechanism today to specify different PCD values based
on module type.
You can manage this in the DSC file, but it does require the module
scoped <PcdXXX> section for each module INF that requires a
different value that the platform scoped [PcdXXX] section.
Mike,
That is what I ended up doing, but it required overriding every PEIM and PEI Core. Seemed kind of excessive.
I think people cheat and use IA32 vs X64 to mean PEI vs. DXE on X64 platforms.
Thanks,
Andrew Fish
Mike
-----Original Message-----
From: devel@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io<mailto:devel@edk2.groups.io>> On Behalf Of
Andrew Fish via groups.io<http://groups.io>
Sent: Wednesday, February 16, 2022 1:02 PM
To: edk2-devel-groups-io <devel@edk2.groups.io<mailto:devel@edk2.groups.io>>
Subject: [edk2-devel] PcdDebugPropertyMask in DSC: How to I set different values for PEI and DXE?
I’m trying to have a different platform policy for
PcdDebugPropertyMask in PEI and DXE. I can’t figure out how to do without overriding every PEIM that I build?
My PEI and DXE has the same arch so I can’t use the CPU Arch to tell them apart.
Is there something I’m missing?
Thanks,
Andrew Fish
[-- Attachment #2: Type: text/html, Size: 60569 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [edk2-devel] PcdDebugPropertyMask in DSC: How to I set different values for PEI and DXE?
2022-02-18 1:36 ` Michael D Kinney
@ 2022-02-18 2:49 ` Andrew Fish
0 siblings, 0 replies; 9+ messages in thread
From: Andrew Fish @ 2022-02-18 2:49 UTC (permalink / raw)
To: edk2-devel-groups-io, Mike Kinney; +Cc: Isaac W Oram
[-- Attachment #1: Type: text/plain, Size: 7640 bytes --]
> On Feb 17, 2022, at 5:36 PM, Michael D Kinney <michael.d.kinney@intel.com> wrote:
>
> Hi Andrew,
>
> I forgot about the library constraints.
>
> Unless we want to first add a feature to build a library instance for each module type into
> a different build output directory, we cannot support setting a FixedAtBuild PCD for each
> module type.
>
Mike,
Yea I’m thinking this is a good reason to maybe not add more knobs.
I was trying to get tricky and have code conditionally use a global so I could use the lib XIP when I shot myself in the foot.
Thanks,
Andrew Fish
> If you use PatchableInModule, you can post process all the modules to set individual
> module PCD values. You have to do two steps. One DSC to build all the modules and
> generate AsBuiltInf. 2nd DSC/FDF that references the AsBuildInfs and sets the
> PatchableInModule PCD values in the scope of the modules needed.
>
> The only reason the different ARCHs for PEI and DXE works is because the libs
> for each ARCH are build separately and already have different build output locations.
>
> Mike
>
>
>
> From: Andrew Fish <afish@apple.com <mailto:afish@apple.com>>
> Sent: Thursday, February 17, 2022 4:42 PM
> To: devel@edk2.groups.io <mailto:devel@edk2.groups.io>; Oram, Isaac W <isaac.w.oram@intel.com <mailto:isaac.w.oram@intel.com>>
> Cc: Kinney, Michael D <michael.d.kinney@intel.com <mailto:michael.d.kinney@intel.com>>
> Subject: Re: [edk2-devel] PcdDebugPropertyMask in DSC: How to I set different values for PEI and DXE?
>
>
>
>
> On Feb 17, 2022, at 4:26 PM, Oram, Isaac W <isaac.w.oram@intel.com <mailto:isaac.w.oram@intel.com>> wrote:
>
> Andrew,
>
> It is a reasonable ask, but I lean towards voting no. We can more or less do the equivalent by breaking a monolithic build into a set of phase specific build/DSC/FDF or something similar. That seems more flexible anyway. Maybe we want binaries with settings based on maturity more than phase. And so on.
>
>
> My primary concern that the complexity added to an already complex feature. PCD have a lot of binary compatibility challenges anyway. And this doesn't add any that don't already exist, but it does make it a lot easier to introduce a mismatch issue.
>
>
> I shot my self in the foot with the Fixed* macro in a library so I did not get the drivers override. So I feel that pain. You need to used the non Fixed form from a lib to get the value from the global produced by the driver.
>
>
>
> My more recreational question is if this makes sense in most cases, or if there are a limited set of PCD that it makes sense for. A lot of similar PCD are much more like shared constants and thus it doesn't make a lot of sense for them to vary across executables. E.G. drivers are asking for problems if they change max string lengths inconsistently. There are definitely more than one PCD where it seems reasonable. Maybe they are the "wrong" type though. Maybe they should be a dynamic type if a flexible usage is desired.
>
>
> I was trying to have different settings for gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask is regards to the action taken on an ASSERT.
>
> To be honest it was not my 1st choice and I was working around some early boot exception handling code not saving the EFI_SYSTEM_CONTEXT and blocking the scheme I was trying to use.
>
>
>
> Tangentially related, there was some previous work to make macros for phase architectures.
>
> [Defines]
> PEI_ARCH = IA32
> DXE_ARCH = X64
>
> Enabling [Components.$(PEI_ARCH)] and [Components.$(DXE_ARCH)]
>
>
> In my case PEI_ARCH == DXE_ARCH so this kind of trick is not helpful. The reality is this trick only works for non virtualized X64 platforms and the edk2 supports a lot more flavors of platforms than X64.
>
> Thanks,
>
> Andrew Fish
>
>
> https://bugzilla.tianocore.org/show_bug.cgi?id=2308 <https://bugzilla.tianocore.org/show_bug.cgi?id=2308>
>
> If we do something with PCD, we should probably try to be consistent with this and maybe extend it or integrate it into DSC syntax. With standalone MM, it probably makes more sense to have PEI, DXE, and SMM. RT would also make sense to have different settings. I have mixed feelings about BDS. I think it makes sense to see it as a potentially independent phase that isn't currently. But also probably won't ever be independent from DXE.
>
> Regards,
> Isaac
>
>
> -----Original Message-----
> From: devel@edk2.groups.io <mailto:devel@edk2.groups.io> <devel@edk2.groups.io <mailto:devel@edk2.groups.io>> On Behalf Of Andrew Fish via groups.io <http://groups.io/>
> Sent: Thursday, February 17, 2022 12:22 PM
> To: Kinney, Michael D <michael.d.kinney@intel.com <mailto:michael.d.kinney@intel.com>>
> Cc: devel@edk2.groups.io <mailto:devel@edk2.groups.io>
> Subject: Re: [edk2-devel] PcdDebugPropertyMask in DSC: How to I set different values for PEI and DXE?
>
>
>
>
> On Feb 17, 2022, at 10:52 AM, Kinney, Michael D <michael.d.kinney@intel.com <mailto:michael.d.kinney@intel.com>> wrote:
>
> I agree that your approach is the only way right now.
>
> Do you have a feature request???
>
> Well it does seem like a reasonable thing to be able to do? What do other people think?
>
> I was able to refactor my code and I did not actually end up needing to override every PEIM and the PEI Core.
>
> Thanks,
>
> Andrew Fish
>
>
>
> Mike
>
>
> -----Original Message-----
> From: Andrew Fish <afish@apple.com <mailto:afish@apple.com>>
> Sent: Wednesday, February 16, 2022 7:26 PM
> To: Kinney, Michael D <michael.d.kinney@intel.com <mailto:michael.d.kinney@intel.com>>
> Cc: devel@edk2.groups.io <mailto:devel@edk2.groups.io>
> Subject: Re: [edk2-devel] PcdDebugPropertyMask in DSC: How to I set different values for PEI and DXE?
>
>
>
>
> On Feb 16, 2022, at 2:10 PM, Kinney, Michael D <michael.d.kinney@intel.com <mailto:michael.d.kinney@intel.com>> wrote:
>
> Hi Andrew,
>
> Current DSC syntax for platform scoped [PcdsXXX] sections only
> supports CPU Arch and SKUID.
>
> So there is no mechanism today to specify different PCD values based
> on module type.
>
> You can manage this in the DSC file, but it does require the module
> scoped <PcdXXX> section for each module INF that requires a
> different value that the platform scoped [PcdXXX] section.
>
>
> Mike,
>
> That is what I ended up doing, but it required overriding every PEIM and PEI Core. Seemed kind of excessive.
>
> I think people cheat and use IA32 vs X64 to mean PEI vs. DXE on X64 platforms.
>
> Thanks,
>
> Andrew Fish
>
>
> Mike
>
>
> -----Original Message-----
> From: devel@edk2.groups.io <mailto:devel@edk2.groups.io> <devel@edk2.groups.io <mailto:devel@edk2.groups.io>> On Behalf Of
> Andrew Fish via groups.io <http://groups.io/>
> Sent: Wednesday, February 16, 2022 1:02 PM
> To: edk2-devel-groups-io <devel@edk2.groups.io <mailto:devel@edk2.groups.io>>
> Subject: [edk2-devel] PcdDebugPropertyMask in DSC: How to I set different values for PEI and DXE?
>
> I’m trying to have a different platform policy for
> PcdDebugPropertyMask in PEI and DXE. I can’t figure out how to do without overriding every PEIM that I build?
>
> My PEI and DXE has the same arch so I can’t use the CPU Arch to tell them apart.
>
> Is there something I’m missing?
>
> Thanks,
>
> Andrew Fish
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
[-- Attachment #2: Type: text/html, Size: 25984 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2022-02-18 2:49 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-16 21:01 PcdDebugPropertyMask in DSC: How to I set different values for PEI and DXE? Andrew Fish
2022-02-16 22:10 ` [edk2-devel] " Michael D Kinney
2022-02-17 3:25 ` Andrew Fish
2022-02-17 18:52 ` Michael D Kinney
2022-02-17 20:22 ` Andrew Fish
2022-02-18 0:26 ` Oram, Isaac W
2022-02-18 0:41 ` Andrew Fish
2022-02-18 1:36 ` Michael D Kinney
2022-02-18 2:49 ` Andrew Fish
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox