[8u] RFR: nativeInstruction atomicity and correctness of patching
Andrew Haley
aph at redhat.com
Wed Mar 30 15:25:29 UTC 2016
On 03/30/2016 04:15 PM, Anton Kozlov wrote:
> ICache::invalidate_word used here not to provide coherency between
> Icache and Dcache, but to maintain in-order visibillity of code
> modification.
What exactly are you trying to synchronize? Any code modifications
must have their own icache invalidation, which does a full DSB. But
this call does not modify any code.
> I mean, if NativeTrampolineCall::set_destination_mt_safe
> called before another code modification, effect of it will be observed
> by another cpu before effect of 2nd code modification.
Only if that other CPU executes a read fence.
> This is achieved by implementation of ICache::invalidate_word, which
> is just call to __clear_cache syscall wrapper.
I don't think there's any point. It's not instructions but data, so
ICache::invalidate_word is inappropriate.
Andrew.
More information about the aarch32-port-dev
mailing list