KVM: PPC: Book3S PR: Exiting split hack mode needs to fixup both PC and LR
authorCameron Kaiser <spectre@floodgap.com>
Tue, 31 Jul 2018 14:39:21 +0000 (07:39 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 24 Nov 2019 07:20:15 +0000 (08:20 +0100)
commit24ce099a5388f0d821fdb1db12a38e7abe20a646
tree5830faf04ef58adefbe3a7d51bd45e6b3c68207f
parent8b6021ca47a3975601e5adcdadb69c12b9731490
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