title: What is the purpose of invalidating D-cache when D-cache is off?
body: <p>In the Linux kernel source <em>arch/arm64/kernel/head.S</em> the boot requirements state it is necessary for the bootloader to enter with the D-cache off:</p>
  <pre class="lang-asm prettyprint-override"><code>/*
   * Kernel startup entry point.
   * ---------------------------
   *
   * The requirements are:
   *   MMU = off, D-cache = off, I-cache = on or off,
   *   x0 = physical address to the FDT blob.
   ...
   */
  </code></pre>
  <p>Then, in the <code>preserve_boot_args()</code> function, there is a call to invalidate an area of the D-cache after loading arguments into the <code>boot_args</code> array</p>
  <pre class="lang-asm prettyprint-override"><code>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)
  </code></pre>
  <p>Why does the D-cache line need to be invalidated if the D-cache is off?</p>