On Fri, Mar 22, 2024 at 08:29:28AM +0000, Sun, CepingX wrote:
> On Thursday, March 21, 2024 8:25 PM Gerd Hoffmann wrote:
> > Well, just try to read them.  If present they can just be measured.
> > If not present we can either skip them, or measure with an empty data 
> > field to indicate it is not present.
> My understanding :
> If the fw_cfg is present,  it must be measured and consumed later.
> Is this correct?

I think that would be the best strategy.  In SEC or early PEI read the
items, cache them in HOBs, optionally measure them.

When consumed just fetch them from the cache.  For entries we are
measuring caching is mandatory (to make sure we are actually using
the same data we have measured).

> > But then you have to find and update all callsites (or at least the 
> > ones where we care about measurement).
> In your solution,  if we cache all items that need to be measured,
> we would have to add a new API (example: QemuFwCfgGetDataFromCache ())  to 
> get the data from cache.

No, we only need to update QemuFwCfgSelectItem + QemuFwCfgReadBytes to
support reading from the cache.

QemuFwCfgGetDataFromCache() can be added as additional API, and
callsites have the option to either switch over, or continue to
use the existing API.

take care,
  Gerd



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117032): https://edk2.groups.io/g/devel/message/117032
Mute This Topic: https://groups.io/mt/104880546/21656
Group Owner: [email protected]
Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to