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/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to