Re: [edk2-devel] [PATCH v1 2/2] UefiCpuPkg/PiSmmCpuDxeSmm: Check BspIndex first before lock cmpxchg

2024-02-20 Thread Laszlo Ersek
On 2/20/24 04:41, Wu, Jiaxin wrote: >> From C11 "5.1.2.4 Multi-threaded executions and data races": >> >> - paragraph 4: "Two expression evaluations conflict if one of them >> modifies a memory location and the other one reads or modifies the same >> memory location." >> >> - paragraph 25: "The

Re: [edk2-devel] [PATCH v1 2/2] UefiCpuPkg/PiSmmCpuDxeSmm: Check BspIndex first before lock cmpxchg

2024-02-19 Thread Wu, Jiaxin
> From C11 "5.1.2.4 Multi-threaded executions and data races": > > - paragraph 4: "Two expression evaluations conflict if one of them > modifies a memory location and the other one reads or modifies the same > memory location." > > - paragraph 25: "The execution of a program contains a data race

Re: [edk2-devel] [PATCH v1 2/2] UefiCpuPkg/PiSmmCpuDxeSmm: Check BspIndex first before lock cmpxchg

2024-02-18 Thread Ni, Ray
> This patch makes me uncomfortable. I understand what it intends to do, > and the intent is not wrong, but we're again treating "volatile UINT32" > as atomic, and non-reorderable against the > InterlockedCompareExchange32(). This kind of "optimization" is what > people write cautionary tales