From: Benjamin Herrenschmidt <[email-masked]>
Date: Thu, 31 May 2018 14:33:38 +1000

prom_init is a rather "special" bit of code. Run once when booting
from Open Firmware as pretty much the very first thing we do, it
will perform all communications with OF before it gets killed and
extract the device-tree for the kernel use. It will then re-enter
the kernel at its main entry point but this time with an FDT.

Future secure VM support will require that entry to happen in the
form of a call to the Ultravisor, which will check the integrity
of the kernel image.

Thus it's critical that prom_init doesn't actually write to the
portions of the kernel potentially being checked, or if it does,
undoes it.

This series is a set of a cleanup and a first step in that direction.

All of prom_init static (it shares no globals with the rest of the
kernel appart from some rodata stuff) are moved to a separate ELF
section placed in .bss if they are writeable, or .rodata if not.

We can later move that section elsewhere if necessary or re-clear
the .bss before entering the kernel.

prom_init already takes care of restoring relocs to their original
state.