summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorNico Boehr <nrb@linux.ibm.com>2023-02-16 15:12:08 +0300
committerHeiko Carstens <hca@linux.ibm.com>2023-02-27 17:29:36 +0300
commitae4b60f6b7a8d25c7253cab104468d22efcecf1a (patch)
tree6120aa3d442aef4d8e959f99fae786a028279488 /arch
parent8ee0d2fb4dfa3465ea2030dec59a6f6fe3005804 (diff)
downloadlinux-ae4b60f6b7a8d25c7253cab104468d22efcecf1a.tar.xz
s390/nmi: fix virtual-physical address confusion
When a machine check is received while in SIE, it is reinjected into the guest in some cases. The respective code needs to access the sie_block, which is taken from the backed up R14. Since reinjection only occurs while we are in SIE (i.e. between the labels sie_entry and sie_leave in entry.S and thus if CIF_MCCK_GUEST is set), the backed up R14 will always contain a physical address in s390_backup_mcck_info. This currently works, because virtual and physical addresses are the same. Add phys_to_virt() to resolve the virtual-physical confusion. Signed-off-by: Nico Boehr <nrb@linux.ibm.com> Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com> Link: https://lore.kernel.org/r/20230216121208.4390-2-nrb@linux.ibm.com Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/s390/kernel/nmi.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/s390/kernel/nmi.c b/arch/s390/kernel/nmi.c
index 5dbf274719a9..56d9c559afa1 100644
--- a/arch/s390/kernel/nmi.c
+++ b/arch/s390/kernel/nmi.c
@@ -346,8 +346,7 @@ static void notrace s390_backup_mcck_info(struct pt_regs *regs)
struct sie_page *sie_page;
/* r14 contains the sie block, which was set in sie64a */
- struct kvm_s390_sie_block *sie_block =
- (struct kvm_s390_sie_block *) regs->gprs[14];
+ struct kvm_s390_sie_block *sie_block = phys_to_virt(regs->gprs[14]);
if (sie_block == NULL)
/* Something's seriously wrong, stop system. */