Commit 80248559 authored by Christian Borntraeger's avatar Christian Borntraeger

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: 4e0b1ab7 ("KVM: s390: gs support for kvm guests")
Signed-off-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: default avatarCornelia Huck <cornelia.huck@de.ibm.com>
parent fe722d13
...@@ -419,6 +419,8 @@ static int __write_machine_check(struct kvm_vcpu *vcpu, ...@@ -419,6 +419,8 @@ static int __write_machine_check(struct kvm_vcpu *vcpu,
/* take care of lazy register loading */ /* take care of lazy register loading */
save_fpu_regs(); save_fpu_regs();
save_access_regs(vcpu->run->s.regs.acrs); save_access_regs(vcpu->run->s.regs.acrs);
if (MACHINE_HAS_GS && vcpu->arch.gs_enabled)
save_gs_cb(current->thread.gs_cb);
/* Extended save area */ /* Extended save area */
rc = read_guest_lc(vcpu, __LC_MCESAD, &ext_sa_addr, rc = read_guest_lc(vcpu, __LC_MCESAD, &ext_sa_addr,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment