Re: MemoryFence()


Laszlo Ersek
 

On 02/11/21 10:07, Paolo Bonzini wrote:
On 10/02/21 20:07, Andrew Fish wrote:
Laszlo,

I think it makes sense to “break this up”. Seems like we need correct
primitives and documentation on how to use them. It is easy enough
after that to use code review to make new code “correct”, but as you
say fixing the general volatile usage (especially given some of the
VC++ behavior) is a big undertaking. Let us not have perfection block
being able to do it correctly going forward.

Changing the CPU drivers (MP libraries) is a complex undertaking as
we really need to test against the various compilers. I’ve tracked
down quite a few MP bugs in proprietary CPU drivers that did not show
up under VC++, but did under clang.
I think the first step should be to introduce the new fence primitives
and fixing MemoryFence to be what it says on the tin.
Right, I hope to propose some patches after the stable tag.

I can volunteer for the work of removing volatile once those are in.
Thanks, Paolo -- should not be your job, but I'll gladly take your help.
Seeing a few examples from you will hopefully teach me some patterns.

Laszlo

Join rfc@edk2.groups.io to automatically receive all group messages.