]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/prom_init: Undo relocation before entering secure mode
authorThiago Jung Bauermann <bauerman@linux.ibm.com>
Wed, 11 Sep 2019 16:34:33 +0000 (13:34 -0300)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 29 Oct 2019 04:12:17 +0000 (15:12 +1100)
commitd0923ffe1298ac28090f6f860ef152583a670582
tree5eee04a29358d33c8c5667db4fc31a0496a94f33
parente5f0fe5970d6f2b5c4b66285a1e9b5ce65a98baf
powerpc/prom_init: Undo relocation before entering secure mode

The ultravisor will do an integrity check of the kernel image but we
relocated it so the check will fail. Restore the original image by
relocating it back to the kernel virtual base address.

This works because during build vmlinux is linked with an expected
virtual runtime address of KERNELBASE.

Fixes: ba5c9729bbad ("powerpc/prom_init: Add the ESM call to prom_init")
Signed-off-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
Tested-by: Michael Anderson <andmike@linux.ibm.com>
[mpe: Add IS_ENABLED() to fix the CONFIG_RELOCATABLE=n build]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20190911163433.12822-1-bauerman@linux.ibm.com
arch/powerpc/include/asm/elf.h
arch/powerpc/kernel/prom_init.c
arch/powerpc/kernel/prom_init_check.sh