KVM: s390: provide only a single function for setting the tod (fix SCK)
authorDavid Hildenbrand <david@redhat.com>
Wed, 7 Feb 2018 11:46:43 +0000 (12:46 +0100)
committerChristian Borntraeger <borntraeger@de.ibm.com>
Tue, 20 Feb 2018 20:51:28 +0000 (20:51 +0000)
commit0e7def5fb0dc53ddbb9f62a497d15f1e11ccdc36
tree0f79bbd4a0fc3e2c2cfc12fa494ce110e404bac0
parent1575767ef3cf5326701d2ae3075b7732cbc855e4
KVM: s390: provide only a single function for setting the tod (fix SCK)

Right now, SET CLOCK called in the guest does not properly take care of
the epoch index, as the call goes via the old kvm_s390_set_tod_clock()
interface. So the epoch index is neither reset to 0, if required, nor
properly set to e.g. 0xff on negative values.

Fix this by providing a single kvm_s390_set_tod_clock() function. Move
Multiple-epoch facility handling into it.

Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20180207114647.6220-3-david@redhat.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Fixes: 8fa1696ea781 ("KVM: s390: Multiple Epoch Facility support")
Cc: stable@vger.kernel.org
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
arch/s390/kvm/kvm-s390.c
arch/s390/kvm/kvm-s390.h
arch/s390/kvm/priv.c