From: Nico Boehr <nrb@linux.ibm.com>
To: kvm@vger.kernel.org
Cc: frankja@linux.ibm.com, imbrenda@linux.ibm.com, borntraeger@linux.ibm.com
Subject: [RFC PATCH v1 0/1] KVM: s390: pv: fix clock comparator late after suspend/resume
Date: Thu, 25 Aug 2022 13:50:14 +0200 [thread overview]
Message-ID: <20220825115015.45545-1-nrb@linux.ibm.com> (raw)
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 | 9 +++++++++
1 file changed, 9 insertions(+)
--
2.36.1
next reply other threads:[~2022-08-25 11:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-25 11:50 Nico Boehr [this message]
2022-08-25 11:50 ` [RFC PATCH v1 1/1] KVM: s390: pv: don't allow userspace to set the clock under PV Nico Boehr
2022-08-26 11:35 ` Nico Boehr
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220825115015.45545-1-nrb@linux.ibm.com \
--to=nrb@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=frankja@linux.ibm.com \
--cc=imbrenda@linux.ibm.com \
--cc=kvm@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox