[SRU][F][PATCH 0/2] KVM: s390: pv: don't allow userspace to set the clock under PV

Roxana Nicolescu roxana.nicolescu at canonical.com
Thu Feb 16 09:54:58 UTC 2023


BugLink: https://bugs.launchpad.net/bugs/1999882

[Impact]
Timer issues and RCU stalls after suspending and resuming an IBM SE guest.

KVM and QEMU try to set the guest's TOD clock after resume under PV,
even though that is not permitted under SE.
Hence,their view of the guest clock may deviate from the ultravisor's,
possibly causing KVM to re-dispatch the guest too late on clock comparator interrupts.

[Fix]
Don't set the clock after resume under PV. Note that kernel and QEMU patches
are required in lockstep, to avoid a warning message in QEMU.

[Test]
1. Start SE guest using libvirt.
2. Pause the guest using "virsh suspend", wait for a few seconds,
resume using "virsh resume".
3. Run "time sleep 1" in the guest.
4. The sleep should be 1 second. It used to be longer than 1 sec.

[Regression Potential]
Minor but it may cause some timer issues on the kvm SE quest side.

[Note]
Patch KVM: s390: pv: don't allow userspace to set the clock under PV
was applied from upstream to jammy and kinetic.
This set cherry-picks the commit for focal too.
Another commit KVM: s390x: fix SCK locking had to cherry-picked as well
in order to apply the changes properly.

Claudio Imbrenda (1):
  KVM: s390x: fix SCK locking

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

 Documentation/virt/kvm/devices/vm.txt |  4 ++++
 arch/s390/kvm/kvm-s390.c              | 31 ++++++++++++++++++++++-----
 arch/s390/kvm/kvm-s390.h              |  3 +--
 arch/s390/kvm/priv.c                  | 15 ++++++++++++-
 4 files changed, 45 insertions(+), 8 deletions(-)

-- 
2.34.1




More information about the kernel-team mailing list