]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ARM: soft-reboot into same mode that we entered the kernel
authorRussell King <rmk+kernel@armlinux.org.uk>
Mon, 3 Apr 2017 18:37:46 +0000 (19:37 +0100)
committerChristoffer Dall <cdall@linaro.org>
Sun, 9 Apr 2017 14:49:24 +0000 (07:49 -0700)
commit9da5ac236de6ab2189c999eb9ddddeef1431ab68
tree586a9df656c6c6e1d5c2c341cc4204c5cb9f3d5c
parent1342337bc80a5bfb9aa83574da9fb2e22cc64121
ARM: soft-reboot into same mode that we entered the kernel

When we soft-reboot (eg, kexec) from one kernel into the next, we need
to ensure that we enter the new kernel in the same processor mode as
when we were entered, so that (eg) the new kernel can install its own
hypervisor - the old kernel's hypervisor will have been overwritten.

In order to do this, we need to pass a flag to cpu_reset() so it knows
what to do, and we need to modify the kernel's own hypervisor stub to
allow it to handle a soft-reboot.

As we are always guaranteed to install our own hypervisor if we're
entered in HYP32 mode, and KVM will have moved itself out of the way
on kexec/normal reboot, we can assume that our hypervisor is in place
when we want to kexec, so changing our hypervisor API should not be a
problem.

Tested-by: Keerthy <j-keerthy@ti.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <cdall@linaro.org>
arch/arm/include/asm/proc-fns.h
arch/arm/kernel/hyp-stub.S
arch/arm/kernel/reboot.c
arch/arm/mm/proc-v7.S