Skip to content

Commit ae4b60f

Browse files
Nico Boehrhcahca
authored andcommitted
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 <[email protected]> Reviewed-by: Claudio Imbrenda <[email protected]> Reviewed-by: Alexander Gordeev <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Janosch Frank <[email protected]> Signed-off-by: Heiko Carstens <[email protected]>
1 parent 8ee0d2f commit ae4b60f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

arch/s390/kernel/nmi.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,7 @@ static void notrace s390_backup_mcck_info(struct pt_regs *regs)
346346
struct sie_page *sie_page;
347347

348348
/* r14 contains the sie block, which was set in sie64a */
349-
struct kvm_s390_sie_block *sie_block =
350-
(struct kvm_s390_sie_block *) regs->gprs[14];
349+
struct kvm_s390_sie_block *sie_block = phys_to_virt(regs->gprs[14]);
351350

352351
if (sie_block == NULL)
353352
/* Something's seriously wrong, stop system. */

0 commit comments

Comments
 (0)