> EFI_HOB_GUID_TYPE *GuidHob; > MP_HAND_OFF *MpHandOff; > > - MpHandOff = NULL; > - GuidHob = GetFirstGuidHob (&mMpHandOffGuid); > - if (GuidHob != NULL) { > + for (GuidHob = GetFirstGuidHob (&mMpHandOffGuid); > + GuidHob != NULL; > + GuidHob = GetNextGuidHob (&mMpHandOffGuid, GET_NEXT_HOB > (GuidHob))) > + { > MpHandOff = (MP_HAND_OFF *)GET_GUID_HOB_DATA (GuidHob); > + if (MpHandOff->ProcessorIndex == ProcessorIndex) { > + return MpHandOff; > + }
Gerd, The code is doing correctly but I have concerns about the performance impact. With the prototype GetMpHandOffHob(), callers call it multiple times to enumerate all HOB instances. But every call is a HOB list enumeration from top of the HOB list which may be slow in a platform that contains lots of HOB items and the MpHandOff HOB instances happen to be in the very bottom. How about add another parameter "HobStart" to GetMpHandOffHob()? So that only the first call to GetMpHandOffHob() is a HOB list enumeration from top, latter calls start from the next HOB of the previous found MpHandOff HOB instance. -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#115576): https://edk2.groups.io/g/devel/message/115576 Mute This Topic: https://groups.io/mt/104369841/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-