Quantcast
Channel: Active questions tagged linux-kernel - Stack Overflow
Viewing all articles
Browse latest Browse all 12241

What is the purpose of invalidating D-cache when D-cache is off?

$
0
0

In the Linux kernel source arch/arm64/kernel/head.S the boot requirements state it is necessary for the bootloader to enter with the D-cache off:

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

Then, in the preserve_boot_args() function, there is a call to invalidate an area of the D-cache after loading arguments into the boot_args array

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 callSYM_CODE_END(preserve_boot_args)

Why does the D-cache line need to be invalidated if the D-cache is off?


Viewing all articles
Browse latest Browse all 12241

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>