[edk2-devel] [PATCH v8 07/10] OvmfPkg/SmmCpuFeaturesLib: call CPU hot-eject handler

Paolo Bonzini pbonzini at redhat.com
Tue Feb 23 07:45:35 UTC 2021


On 22/02/21 15:53, Laszlo Ersek wrote:
>> +
>> +  if (mCpuHotEjectData != NULL) {
>> +    CPU_HOT_EJECT_HANDLER Handler;
>> +
>> +    Handler = mCpuHotEjectData->Handler;
> This patch looks otherwise OK to me, but:
> 
> In patch v8 08/10, we have a ReleaseMemoryFence(). (For now, it is only
> expressed as a MemoryFence() call; we'll make that more precise later.)
> 
> (1) I think that should be paired with an AcquireMemoryFence() call,
> just before loading "mCpuHotEjectData->Handler" above -- for now, also
> expressed as a MemoryFence() call only.

In Linux terms, there is a control dependency here.  However, it should 
at least be a separate statement to load mCpuHotEjectData (which from my 
EDK2 reminiscences should be a global) into a local variable.  So

   EjectData = mCPUHotEjectData;
   // Optional AcquireMemoryFence here
   if (EjectData != NULL) {
     CPU_HOT_EJECT_HANDLER Handler;

     Handler = EjectData->Handler;
     if (Handler != NULL) {
       Handler (CpuIndex);
     }
   }

Thanks,

Paolo



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#72038): https://edk2.groups.io/g/devel/message/72038
Mute This Topic: https://groups.io/mt/80819862/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list