I was reading kernel source code (version, 5.9) and have a question in $(kernel_root)/arch/arm64/kernel/head.S.
There is a function SYM_FUNC_START_LOCAL(__create_page_tables) and some codes:
adr_l x6, vabits_actual
str x5, [x6]
dmb sy
dc ivac, x6
It reads supported VA_BITS from the running platform and store the value into vabits_actua. I undetstand the corresponding d-cache line has to be invalidated due to stale data that will affect unexpected behavior when d-cache is enabled later.
In this code, the order of the string code and d-cache line invalidating code is kept with DMB barrier instruction. However, I don't know why it's necessary.
My question is why the order has to be kept even though the d-cache is disabled.