KVM: PPC: Book3S PR: Exiting split hack mode needs to fixup both PC and LR
commit145fd9a5f66212231b4d50153acefee579c187b6
authorCameron Kaiser <spectre@floodgap.com>
Tue, 31 Jul 2018 14:39:21 +0000 (31 07:39 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 24 Nov 2019 07:23:07 +0000 (24 08:23 +0100)
treef269ce1b8425d77d4b18860ae27cf17f69add623
parent3b37711c9e7f20a79ca9a0c6fa3a9aac6ca17a9a
KVM: PPC: Book3S PR: Exiting split hack mode needs to fixup both PC and LR

[ Upstream commit 1006284c5e411872333967b1970c2ca46a9e225f ]

When an OS (currently only classic Mac OS) is running in KVM-PR and makes a
linked jump from code with split hack addressing enabled into code that does
not, LR is not correctly updated and reflects the previously munged PC.

To fix this, this patch undoes the address munge when exiting split
hack mode so that code relying on LR being a proper address will now
execute. This does not affect OS X or other operating systems running
on KVM-PR.

Signed-off-by: Cameron Kaiser <spectre@floodgap.com>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/powerpc/kvm/book3s.c