On Tue, Sep 30, 2014 at 11:52:28AM +0200, Laszlo Ersek wrote: > > So, my n00b question is why bother with PCDs in the first place, given > > that their use in AcpiTimerLib (where the bulk of the savings from > > ditching the IS_Q35 macro is realized) may be frowned upon ? > > I agree that PCDs are not optimal here; see my other email. In some > AcpiTimerLib clients they are downright unavailable. > > > Why set the global static variable based on retrieving a PCD and not > > based on just reading the host bridge DID during the constructor ? > > You can't set globals in AcpiTimerLib, no matter where you'd populate > them *from*. See my other email.
And now I remember you telling me about commit d3a24ff5 and "no globals in AcpiTimerLib" a while back -- so we're condemned to check the host bridge DID each and every single time we try to access a power management register. > > Either way, we save reading the bridge DID during each of the > > bazillion calls to GetTimerTick, and what's reading the host bridge > > DID a few tens of times (15xTimerLibConstructor plus three or four more) > > if it gets us out of mixing PCDs with AcpiTimerLib ? > > The cost of the libraries I recommended in my other email is: > - SEC and PEI_CORE: same as now > > - PEIM, DXE_CORE, DXE_RUNTIME_DRIVER, DXE_DRIVER: GetFirstGuidHob(). A > linear search that doesn't trap to the hypervisor. I expect the HOB > list to have a few tens of elements at most. Also, caching the HOB > once found would turn this into O(1). > > - UEFI_DRIVER, UEFI_APPLICATION, alternative 1: library construction > (ie. driver / app startup) is somewhat expensive, but access is O(1) > afterwards (cached values). > > - UEFI_DRIVER, UEFI_APPLICATION, alternative 2: same HOB-based library > instance as above. So before I decide whether or not to go down that rabbit hole, can we re-evaluate the decision to simply use some form of macro (of the IS_Q35_HOSTBRIDGE and PCI_PM_REG sort) ? With all the naming convention fixes you and others suggested earlier, of course. The library alternative would essentially just wrap this inside another (arguably more OO-ish, professional-looking) layer, or am I getting that wrong ? Thanks, --Gabriel ------------------------------------------------------------------------------ Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-devel