[8u] RFR: nativeInstruction atomicity and correctness of patching

Anton Kozlov akozlov at azul.com
Wed Mar 30 15:15:37 UTC 2016


Hi, Andrew,

ICache::invalidate_word used here not to provide coherency between
Icache and Dcache, but to maintain in-order visibillity of code
modification. 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. This is achieved
by implementation of ICache::invalidate_word, which is just call to
 __clear_cache syscall wrapper.

Thanks,
Anton

On Wed, 2016-03-30 at 14:10 +0100, Andrew Haley wrote:
> On 03/30/2016 02:00 PM, Anton Kozlov wrote:
> > +void NativeTrampolineCall::set_destination_mt_safe(address dest,
> > bool assert_lock) {
> > +  assert(is_at(addr()), "not call");
> > +  set_destination(dest);
> > +  ICache::invalidate_word(addr() + 8);
> > +}
> 
> I don't see the point of the ICache::invalidate.
> 
> 


More information about the aarch32-port-dev mailing list