Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

KVM: s390: fix stale machine check data for guarded storage

When delivering a machine check the CPU state is "loaded", which
means that some registers are already in the host registers.
Before writing the register content into the machine check
save area, we must make sure that we save the content of the
registers into the data structures that are used for delivering
the machine check.
We already do the right thing for access, vector/floating point
registers, let's do the same for guarded storage.

Fixes: 4e0b1ab72b8a ("KVM: s390: gs support for kvm guests")
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>

+2
+2
arch/s390/kvm/interrupt.c
··· 419 419 /* take care of lazy register loading */ 420 420 save_fpu_regs(); 421 421 save_access_regs(vcpu->run->s.regs.acrs); 422 + if (MACHINE_HAS_GS && vcpu->arch.gs_enabled) 423 + save_gs_cb(current->thread.gs_cb); 422 424 423 425 /* Extended save area */ 424 426 rc = read_guest_lc(vcpu, __LC_MCESAD, &ext_sa_addr,