Commit 178bd789 authored by Thomas Huth's avatar Thomas Huth Committed by Cornelia Huck

KVM: s390: Fix clock comparator field for STORE STATUS

Only the most 7 significant bytes of the clock comparator must be
saved to the status area, and the byte at offset 304 has to be zero.
Signed-off-by: default avatarThomas Huth <thuth@linux.vnet.ibm.com>
Reviewed-by: default avatarCornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: default avatarCornelia Huck <cornelia.huck@de.ibm.com>
parent e879892c
...@@ -877,6 +877,7 @@ int kvm_s390_store_status_unloaded(struct kvm_vcpu *vcpu, unsigned long addr) ...@@ -877,6 +877,7 @@ int kvm_s390_store_status_unloaded(struct kvm_vcpu *vcpu, unsigned long addr)
{ {
unsigned char archmode = 1; unsigned char archmode = 1;
int prefix; int prefix;
u64 clkcomp;
if (addr == KVM_S390_STORE_STATUS_NOADDR) { if (addr == KVM_S390_STORE_STATUS_NOADDR) {
if (copy_to_guest_absolute(vcpu, 163ul, &archmode, 1)) if (copy_to_guest_absolute(vcpu, 163ul, &archmode, 1))
...@@ -920,8 +921,9 @@ int kvm_s390_store_status_unloaded(struct kvm_vcpu *vcpu, unsigned long addr) ...@@ -920,8 +921,9 @@ int kvm_s390_store_status_unloaded(struct kvm_vcpu *vcpu, unsigned long addr)
&vcpu->arch.sie_block->cputm, 8, prefix)) &vcpu->arch.sie_block->cputm, 8, prefix))
return -EFAULT; return -EFAULT;
clkcomp = vcpu->arch.sie_block->ckc >> 8;
if (__guestcopy(vcpu, addr + offsetof(struct save_area, clk_cmp), if (__guestcopy(vcpu, addr + offsetof(struct save_area, clk_cmp),
&vcpu->arch.sie_block->ckc, 8, prefix)) &clkcomp, 8, prefix))
return -EFAULT; return -EFAULT;
if (__guestcopy(vcpu, addr + offsetof(struct save_area, acc_regs), if (__guestcopy(vcpu, addr + offsetof(struct save_area, acc_regs),
......
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