powerpc64: Fix boot on virtual-mode OF (PowerMac G5)

In 78599c32ef, CFI endproc decoration was
added to locore64.S. However, it missed the subtle detail that
__restartkernel_virtual() falls through to __restartkernel(). This was
causing boot failure on PowerMac G5, as it tried to execute the
epilogue as code.

Fix this by branching to __restartkernel() instead of intentionally
running off the end of the function.

While here, add some additional notes on how the virtual mode restart
works.

MFC after:	3 days
This commit is contained in:
Brandon Bergren 2021-02-07 16:05:41 -06:00
parent e44a78ce6f
commit d26f2a50ff

View File

@ -255,6 +255,16 @@ ASENTRY_NOPROF(__restartkernel_virtual)
addi %r14, %r14, 1
cmpdi %r14, 16
blt 1b
/*
* Now that we are set up with a temporary direct map, we can
* continue with __restartkernel. Translation will be switched
* back on at the rfid, at which point we will be executing from
* the temporary direct map we just installed, until the kernel
* takes over responsibility for the MMU.
*/
bl __restartkernel
nop
ASEND(__restartkernel_virtual)
ASENTRY_NOPROF(__restartkernel)