All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH v2 0/1] KVM: s390: pv: fix clock comparator late after suspend/resume
@ 2022-08-29  7:56 Nico Boehr
  2022-08-29  7:56 ` [RFC PATCH v2 1/1] KVM: s390: pv: don't allow userspace to set the clock under PV Nico Boehr
  0 siblings, 1 reply; 6+ messages in thread
From: Nico Boehr @ 2022-08-29  7:56 UTC (permalink / raw)
  To: kvm; +Cc: frankja, imbrenda, borntraeger

v1->v2:
---
- fix broken migration due to deadlock

After a PV guest in QEMU has been paused and resumed, clock comparator
interrupts are delivered to the guest much too late.

This is caused by QEMU's tod-kvm device restoring the guest's TOD clock
upon guest resume. This is not possible with PV, since the guest's TOD
clock is controlled by the ultravisor.

Even if not allowed under PV, KVM allowed the respective call from
userspace (VM attribute KVM_S390_VM_TOD) and updated its internal data
structures on this call. This can make the ultravisor's and KVM's view
of the guest TOD clock inconsistent. This in turn can lead to the late
delivery of clock comparator interrupts when KVM calculates when to wake
the guest.

This fixes the kernel portion of the problem by disallowing the vm attr
call for the guest TOD clock so userspace cannot mess up KVM's view of
the guest TOD. This fix causes an ugly warning in QEMU though, hence
another fix is due for QEMU to simply not even attempt to set the guest
TOD on resume.

Nico Boehr (1):
  KVM: s390: pv: don't allow userspace to set the clock under PV

 arch/s390/kvm/kvm-s390.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

-- 
2.36.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-10-05 15:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-29  7:56 [RFC PATCH v2 0/1] KVM: s390: pv: fix clock comparator late after suspend/resume Nico Boehr
2022-08-29  7:56 ` [RFC PATCH v2 1/1] KVM: s390: pv: don't allow userspace to set the clock under PV Nico Boehr
2022-08-31 13:26   ` Nico Boehr
2022-09-20 11:07   ` Christian Borntraeger
2022-10-05 13:55     ` Nico Boehr
2022-10-05 15:08   ` Claudio Imbrenda

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.