|
|
Log in / Subscribe / Register

Support for the TSO memory model on Arm CPUs

Support for the TSO memory model on Arm CPUs

Posted Apr 27, 2024 6:26 UTC (Sat) by pbonzini (subscriber, #60935)
In reply to: Support for the TSO memory model on Arm CPUs by nksingh
Parent article: Support for the TSO memory model on Arm CPUs

As far as I understand, Apple is a funding member of Arm. As such, they are allowed to implement non standard extensions whereas most other vendors can't.


to post comments

Support for the TSO memory model on Arm CPUs

Posted Apr 27, 2024 17:59 UTC (Sat) by thoughtpolice (subscriber, #87455) [Link] (2 responses)

Yes, in practice all the cores that implemented it are custom designs, and Fujitsu, Nvidia and Apple are all architecture licensees, so they're allowed to do that. Not all of Nvidia's custom designs, at least, use TSO; Carmel (Xavier) is TSO only, while Denver2 (TX2) is weakly ordered.

TSO is a bit weird though because I was under the impression ARM's rules were something like "Non-standard extensions can't be externally 'visible' or documented for consumption and the core must fully comply with the spec." That's why Apple doesn't (and probably can't!) document extensions like this one, that allows TSO to be toggled. But the memory model is pretty visible? Maybe it's all a bit weaselly; after all, if the default memory model is stronger than the spec requires, then every correctly written weakly ordered program should behave the same anyway, so it's not "visible". On the other hand, incorrect programs may behave differently than they would under a weak model, but you could argue that TSO behaviors are "just" a subset of weakly ordered behaviors, and thus it's in spec.

Support for the TSO memory model on Arm CPUs

Posted Apr 28, 2024 4:46 UTC (Sun) by anton (subscriber, #25547) [Link]

Yes, weak ordering is not an architectural feature, it's a lack of a defined feature. An implementation that provides stronger ordering still satisfies the architectural requirements. And unlike, say, an additional instruction, where the architecture actually requires a specific behaviour (typically an illegal instruction exception) when the encoding for the new instruction is encountered, but the implementation with the additional instruction behaves differently, a stronger ordered implementation satisfies the (lack of) architectural requirements of the weakly ordered architecture. Another way of looking at it is that a program written for a weakly ordered architecture will behave as intended on an implementation with stronger ordering, so there is no test to say that the strongly ordered implementation does not satisfy the requirements of the architecture.

My guess is that this clause in the architectural license is indeed there to prevent licensees from squatting on currently unused instruction encoding space or currently illegal behaviour that ARM intends to reserve for future extensions.

The only thing that might be an issue here is the switch that Apple implemented. I guess they implemented it in something like a model-specific register (i.e. an area that the architecture leaves for implementations to define), and then that should satisfy the architectural license. I wonder, though, why Apple bothered with the switch; why not just do what Fujitsu did according to the article, and implement TSO throughout?

Support for the TSO memory model on Arm CPUs

Posted Apr 29, 2024 20:28 UTC (Mon) by justincormack (subscriber, #70439) [Link]

Apple does not actually anywhere refer to their cores as Arm (its Apple Silicon please), and Arm does not usually refer to them at all. Of course everyone else does.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds