alistair23-linux/arch/s390/kvm
David Hildenbrand 1575767ef3 KVM: s390: consider epoch index on TOD clock syncs
For now, we don't take care of over/underflows. Especially underflows
are critical:

Assume the epoch is currently 0 and we get a sync request for delta=1,
meaning the TOD is moved forward by 1 and we have to fix it up by
subtracting 1 from the epoch. Right now, this will leave the epoch
index untouched, resulting in epoch=-1, epoch_idx=0, which is wrong.

We have to take care of over and underflows, also for the VSIE case. So
let's factor out calculation into a separate function.

Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20180207114647.6220-5-david@redhat.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Fixes: 8fa1696ea7 ("KVM: s390: Multiple Epoch Facility support")
Cc: stable@vger.kernel.org
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
[use u8 for idx]
2018-02-20 20:51:21 +00:00
..
diag.c KVM: s390: add vcpu stat counters for many instruction 2018-01-24 16:49:02 +01:00
gaccess.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
gaccess.h KVM: s390: Remove redundant license text 2017-12-06 09:18:42 +01:00
guestdbg.c KVM: s390: Remove redundant license text 2017-12-06 09:18:42 +01:00
intercept.c KVM: s390: use switch vs jump table in intercept.c 2018-02-14 13:53:43 +00:00
interrupt.c KVM: s390: take care of clock-comparator sign control 2018-02-20 20:50:29 +00:00
irq.h KVM: s390: Remove redundant license text 2017-12-06 09:18:42 +01:00
Kconfig KVM: introduce kvm_arch_vcpu_async_ioctl 2017-12-14 09:26:59 +01:00
kvm-s390.c KVM: s390: consider epoch index on TOD clock syncs 2018-02-20 20:51:21 +00:00
kvm-s390.h KVM: s390: use switch vs jump table in intercept.c 2018-02-14 13:53:43 +00:00
Makefile KVM: s390: Remove redundant license text 2017-12-06 09:18:42 +01:00
priv.c KVM: s390: use switch vs jump table in priv.c 2018-02-14 13:53:43 +00:00
sigp.c KVM: s390: introduce and use kvm_s390_test_cpuflags() 2018-01-24 17:46:42 +01:00
trace-s390.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
trace.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vsie.c KVM: s390: force bp isolation for VSIE 2018-02-14 12:00:59 +00:00