[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 03/21] s390x/tod-kvm: don't save/restore the TOD in PV guests
From: |
Thomas Huth |
Subject: |
[PULL 03/21] s390x/tod-kvm: don't save/restore the TOD in PV guests |
Date: |
Fri, 28 Oct 2022 15:22:46 +0200 |
From: Nico Boehr <nrb@linux.ibm.com>
Under PV, the guest's TOD clock is under control of the ultravisor and the
hypervisor cannot change it.
With upcoming kernel changes[1], the Linux kernel will reject QEMU's
request to adjust the guest's clock in this case, so don't attempt to set
the clock.
This avoids the following warning message on save/restore of a PV guest:
warning: Unable to set KVM guest TOD clock: Operation not supported
[1] https://lore.kernel.org/all/20221011160712.928239-2-nrb@linux.ibm.com/
Fixes: c3347ed0d2ee ("s390x: protvirt: Support unpack facility")
Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
Message-Id: <20221012123229.1196007-1-nrb@linux.ibm.com>
[thuth: Add curly braces]
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
hw/s390x/tod-kvm.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/hw/s390x/tod-kvm.c b/hw/s390x/tod-kvm.c
index 9d0cbfbce2..e2202dae2d 100644
--- a/hw/s390x/tod-kvm.c
+++ b/hw/s390x/tod-kvm.c
@@ -13,6 +13,7 @@
#include "qemu/module.h"
#include "sysemu/runstate.h"
#include "hw/s390x/tod.h"
+#include "hw/s390x/pv.h"
#include "kvm/kvm_s390x.h"
static void kvm_s390_get_tod_raw(S390TOD *tod, Error **errp)
@@ -84,6 +85,14 @@ static void kvm_s390_tod_vm_state_change(void *opaque, bool
running,
S390TODState *td = opaque;
Error *local_err = NULL;
+ /*
+ * Under PV, the clock is under ultravisor control, hence we cannot restore
+ * it on resume.
+ */
+ if (s390_is_pv()) {
+ return;
+ }
+
if (running && td->stopped) {
/* Set the old TOD when running the VM - start the TOD clock. */
kvm_s390_set_tod_raw(&td->base, &local_err);
--
2.31.1
- [PULL 00/21] s390x and qtest patches, Thomas Huth, 2022/10/28
- [PULL 04/21] tests/tcg/s390x: Test compiler flags only once, not every time, Thomas Huth, 2022/10/28
- [PULL 03/21] s390x/tod-kvm: don't save/restore the TOD in PV guests,
Thomas Huth <=
- [PULL 05/21] target/s390x: Fix emulation of the VISTR instruction, Thomas Huth, 2022/10/28
- [PULL 02/21] s390x: step down as general arch maintainer, Thomas Huth, 2022/10/28
- [PULL 07/21] MAINTAINERS: target/s390x/: add Ilya as reviewer, Thomas Huth, 2022/10/28
- [PULL 01/21] s390x/pv: remove semicolon from macro definition, Thomas Huth, 2022/10/28
- [PULL 06/21] tests/tcg/s390x: Add a test for the vistr instruction, Thomas Huth, 2022/10/28
- [PULL 09/21] tests/qtest/cxl-test: Remove temporary directories after testing, Thomas Huth, 2022/10/28
- [PULL 08/21] tests/qtest/tpm: Clean up remainders of swtpm, Thomas Huth, 2022/10/28
- [PULL 12/21] tests: Add sndio to the FreeBSD CI containers / VM, Thomas Huth, 2022/10/28
- [PULL 15/21] tests/qtest: Support libqtest to build and run on Windows, Thomas Huth, 2022/10/28
- [PULL 10/21] tests/qtest/libqos/e1000e: Use e1000_regs.h, Thomas Huth, 2022/10/28