Why invalidate d-cache if MMU and d-cache are disabled by rule?

Jason Mielke jmielkeway at gmail.com
Sun Aug 9 11:08:01 EDT 2020


Trying to understand the

preserve_boot_args

function in

 arch/arm64/kernel/head.S

The function has a call to invalidate the 32 bytes of dcache area

SYM_CODE_START_LOCAL(preserve_boot_args)
    mov x21, x0             // x21=FDT

    adr_l   x0, boot_args           // record the contents of
    stp x21, x1, [x0]           // x0 .. x3 at kernel entry
    stp x2, x3, [x0, #16]

    dmb sy              // needed before dc ivac with
                        // MMU off

    mov x1, #0x20           // 4 x 8 bytes
    b   __inval_dcache_area     // tail call
SYM_CODE_END(preserve_boot_args)

This even though the MMU and d-cache must be disabled

/*
 * Kernel startup entry point.
 * ---------------------------
 *
 * The requirements are:
 *   MMU = off, D-cache = off, I-cache = on or off,
 *   x0 = physical address to the FDT blob.


What is the purpose?



More information about the linux-arm mailing list