This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

dsb and dmb

Hi all:

I have some questions about DMB and DSB in armv8.

(1)

In armv8 Reference Manual doc, it says "The DMB instruction does not ensure the completion of any of the memory accesses for which it ensures relative order".

But in ARM Cortex-A Series Programmer’s Guide for ARMv8-A doc, it explains some dmb/dsb parameters.
for example :

<option> | Ordered Accesses (before – after) | Shareability Domain
         LD | Load –Load, Load – Store              | Full system

Load - Load/Store:
This means that the barrier requires all loads to complete before the barrier but
does not require stores to complete. Both loads and stores that appear after the
barrier in program order must wait for the barrier to complete.

Since Load - Load/Store means the barrier requires all loads to complete before the barrier, I think it has ensured the completion of memory access, so I am confused.

(2)

In ARM Cortex-A Series Programmer’s Guide for ARMv8-A doc, it also says DSB "enforces the same ordering as the Data Memory Barrier, but has the additional effect of blocking execution of any further instructions, not just loads or stores, or both, until synchronization is complete".

Since DSB can block any instructions, what's "ST" in "DSB ST" for?

(3)

I have already knew that DSB can replace DMB safely, but in what situation should we only use "DSB", not "DMB"? what's the difference between DSB and DMB? An example should be great.

Thanks!

Parents
  • Hi 42Bastian Schick :

    Very thanks for the examples!

    There are other questions that confusing me.

    (1) According to ARMV8 reference Manual, DMB seems to ensure that all affected memory accesses are Observed-by each PE.

    but I don't understand the difference between visibility and completion. Can you give me an extra example to explain in which situation memory access is visible but hasn't been completed?

    (2) In "DSB ST", does that mean the DSB instruction only block loads and stores? Not all instructions?

Reply
  • Hi 42Bastian Schick :

    Very thanks for the examples!

    There are other questions that confusing me.

    (1) According to ARMV8 reference Manual, DMB seems to ensure that all affected memory accesses are Observed-by each PE.

    but I don't understand the difference between visibility and completion. Can you give me an extra example to explain in which situation memory access is visible but hasn't been completed?

    (2) In "DSB ST", does that mean the DSB instruction only block loads and stores? Not all instructions?

Children