Other core's view after writing ICC_SGI1R_EL1 to trigger SGI

For example, the codes are executed in core0.

codes:

(1) send SGI to core1 ICC_SGI1R_EL1

(2) set(a) = 1

i)  Then the core1 will first see the irq or the change of variable a?

ii)  If I add ISB between (1) and (2), what happended?

iii)  If I add DMB (read and write)between (1) and (2), what happended?

iv)  If I add DSB (read and write)between (1) and (2), what happended?

After I tested, it seems that only iv) which add DSB makes core1 see (2) after (1).

I had checked the discription of DSB, I don't think any rules match this.

Any help will be appreciated. Thanks!

Parents
  • Thomas,

    ISB between (1) and (2) assures that the code is executed in order. But does not mean the write to the memory appears in order.
    The DMB/DSB assures that any write _before_ the DMB did reach the register/memory (or cache).
    But DMB w/o the ISB could mean, that the (2) is done before (1).
    But even if you add ISB; DMB you cannot be sure that core 1 sees a == 1 or its previous value as you only know the order of action in the one core, but not how this is distributed between the cores.
    So actually, you should reverse the order of (1) and (2).

Reply
  • Thomas,

    ISB between (1) and (2) assures that the code is executed in order. But does not mean the write to the memory appears in order.
    The DMB/DSB assures that any write _before_ the DMB did reach the register/memory (or cache).
    But DMB w/o the ISB could mean, that the (2) is done before (1).
    But even if you add ISB; DMB you cannot be sure that core 1 sees a == 1 or its previous value as you only know the order of action in the one core, but not how this is distributed between the cores.
    So actually, you should reverse the order of (1) and (2).

Children