From 07b2c8e034d80ff92e202405c494d2ff80fcf848 Mon Sep 17 00:00:00 2001 From: Matthew Rosato Date: Thu, 18 Jan 2024 13:51:49 -0500 Subject: [PATCH 01/11] s390x/pci: avoid double enable/disable of aif MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use a flag to keep track of whether AIF is currently enabled. This can be used to avoid enabling/disabling AIF multiple times as well as to determine whether or not it should be disabled during reset processing. Fixes: d0bc7091c2 ("s390x/pci: enable adapter event notification for interpreted devices") Reported-by: Cédric Le Goater Reviewed-by: Eric Farman Signed-off-by: Matthew Rosato Message-ID: <20240118185151.265329-2-mjrosato@linux.ibm.com> Reviewed-by: Cédric Le Goater Signed-off-by: Thomas Huth --- hw/s390x/s390-pci-kvm.c | 25 +++++++++++++++++++++++-- include/hw/s390x/s390-pci-bus.h | 1 + 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/hw/s390x/s390-pci-kvm.c b/hw/s390x/s390-pci-kvm.c index ff41e4106d..1ee510436c 100644 --- a/hw/s390x/s390-pci-kvm.c +++ b/hw/s390x/s390-pci-kvm.c @@ -27,6 +27,7 @@ bool s390_pci_kvm_interp_allowed(void) int s390_pci_kvm_aif_enable(S390PCIBusDevice *pbdev, ZpciFib *fib, bool assist) { + int rc; struct kvm_s390_zpci_op args = { .fh = pbdev->fh, .op = KVM_S390_ZPCIOP_REG_AEN, @@ -38,15 +39,35 @@ int s390_pci_kvm_aif_enable(S390PCIBusDevice *pbdev, ZpciFib *fib, bool assist) .u.reg_aen.flags = (assist) ? 0 : KVM_S390_ZPCIOP_REGAEN_HOST }; - return kvm_vm_ioctl(kvm_state, KVM_S390_ZPCI_OP, &args); + if (pbdev->aif) { + return -EINVAL; + } + + rc = kvm_vm_ioctl(kvm_state, KVM_S390_ZPCI_OP, &args); + if (rc == 0) { + pbdev->aif = true; + } + + return rc; } int s390_pci_kvm_aif_disable(S390PCIBusDevice *pbdev) { + int rc; + struct kvm_s390_zpci_op args = { .fh = pbdev->fh, .op = KVM_S390_ZPCIOP_DEREG_AEN }; - return kvm_vm_ioctl(kvm_state, KVM_S390_ZPCI_OP, &args); + if (!pbdev->aif) { + return -EINVAL; + } + + rc = kvm_vm_ioctl(kvm_state, KVM_S390_ZPCI_OP, &args); + if (rc == 0) { + pbdev->aif = false; + } + + return rc; } diff --git a/include/hw/s390x/s390-pci-bus.h b/include/hw/s390x/s390-pci-bus.h index b1bdbeaeb5..435e788867 100644 --- a/include/hw/s390x/s390-pci-bus.h +++ b/include/hw/s390x/s390-pci-bus.h @@ -361,6 +361,7 @@ struct S390PCIBusDevice { bool unplug_requested; bool interp; bool forwarding_assist; + bool aif; QTAILQ_ENTRY(S390PCIBusDevice) link; }; From 30e35258e25c75c9d799c34fd89afcafffb37084 Mon Sep 17 00:00:00 2001 From: Matthew Rosato Date: Thu, 18 Jan 2024 13:51:50 -0500 Subject: [PATCH 02/11] s390x/pci: refresh fh before disabling aif MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Typically we refresh the host fh during CLP enable, however it's possible that the device goes through multiple reset events before the guest performs another CLP enable. Let's handle this for now by refreshing the host handle from vfio before disabling aif. Fixes: 03451953c7 ("s390x/pci: reset ISM passthrough devices on shutdown and system reset") Reported-by: Cédric Le Goater Reviewed-by: Eric Farman Signed-off-by: Matthew Rosato Message-ID: <20240118185151.265329-3-mjrosato@linux.ibm.com> Reviewed-by: Cédric Le Goater Signed-off-by: Thomas Huth --- hw/s390x/s390-pci-kvm.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hw/s390x/s390-pci-kvm.c b/hw/s390x/s390-pci-kvm.c index 1ee510436c..9eef4fc3ec 100644 --- a/hw/s390x/s390-pci-kvm.c +++ b/hw/s390x/s390-pci-kvm.c @@ -18,6 +18,7 @@ #include "hw/s390x/s390-pci-bus.h" #include "hw/s390x/s390-pci-kvm.h" #include "hw/s390x/s390-pci-inst.h" +#include "hw/s390x/s390-pci-vfio.h" #include "cpu_models.h" bool s390_pci_kvm_interp_allowed(void) @@ -64,6 +65,14 @@ int s390_pci_kvm_aif_disable(S390PCIBusDevice *pbdev) return -EINVAL; } + /* + * The device may have already been reset but we still want to relinquish + * the guest ISC, so always be sure to use an up-to-date host fh. + */ + if (!s390_pci_get_host_fh(pbdev, &args.fh)) { + return -EPERM; + } + rc = kvm_vm_ioctl(kvm_state, KVM_S390_ZPCI_OP, &args); if (rc == 0) { pbdev->aif = false; From 68c691ca99a2538d6a53a70ce8a9ce06ee307ff1 Mon Sep 17 00:00:00 2001 From: Matthew Rosato Date: Thu, 18 Jan 2024 13:51:51 -0500 Subject: [PATCH 03/11] s390x/pci: drive ISM reset from subsystem reset MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ISM devices are sensitive to manipulation of the IOMMU, so the ISM device needs to be reset before the vfio-pci device is reset (triggering a full UNMAP). In order to ensure this occurs, trigger ISM device resets from subsystem_reset before triggering the PCI bus reset (which will also trigger vfio-pci reset). This only needs to be done for ISM devices which were enabled for use by the guest. Further, ensure that AIF is disabled as part of the reset event. Fixes: ef1535901a ("s390x: do a subsystem reset before the unprotect on reboot") Fixes: 03451953c7 ("s390x/pci: reset ISM passthrough devices on shutdown and system reset") Reported-by: Cédric Le Goater Signed-off-by: Matthew Rosato Message-ID: <20240118185151.265329-4-mjrosato@linux.ibm.com> Reviewed-by: Eric Farman Reviewed-by: Cédric Le Goater Signed-off-by: Thomas Huth --- hw/s390x/s390-pci-bus.c | 26 +++++++++++++++++--------- hw/s390x/s390-virtio-ccw.c | 8 ++++++++ include/hw/s390x/s390-pci-bus.h | 1 + 3 files changed, 26 insertions(+), 9 deletions(-) diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c index 347580ebac..3e57d5faca 100644 --- a/hw/s390x/s390-pci-bus.c +++ b/hw/s390x/s390-pci-bus.c @@ -151,20 +151,12 @@ static void s390_pci_shutdown_notifier(Notifier *n, void *opaque) pci_device_reset(pbdev->pdev); } -static void s390_pci_reset_cb(void *opaque) -{ - S390PCIBusDevice *pbdev = opaque; - - pci_device_reset(pbdev->pdev); -} - static void s390_pci_perform_unplug(S390PCIBusDevice *pbdev) { HotplugHandler *hotplug_ctrl; if (pbdev->pft == ZPCI_PFT_ISM) { notifier_remove(&pbdev->shutdown_notifier); - qemu_unregister_reset(s390_pci_reset_cb, pbdev); } /* Unplug the PCI device */ @@ -1132,7 +1124,6 @@ static void s390_pcihost_plug(HotplugHandler *hotplug_dev, DeviceState *dev, if (pbdev->pft == ZPCI_PFT_ISM) { pbdev->shutdown_notifier.notify = s390_pci_shutdown_notifier; qemu_register_shutdown_notifier(&pbdev->shutdown_notifier); - qemu_register_reset(s390_pci_reset_cb, pbdev); } } else { pbdev->fh |= FH_SHM_EMUL; @@ -1279,6 +1270,23 @@ static void s390_pci_enumerate_bridge(PCIBus *bus, PCIDevice *pdev, pci_default_write_config(pdev, PCI_SUBORDINATE_BUS, s->bus_no, 1); } +void s390_pci_ism_reset(void) +{ + S390pciState *s = s390_get_phb(); + + S390PCIBusDevice *pbdev, *next; + + /* Trigger reset event for each passthrough ISM device currently in-use */ + QTAILQ_FOREACH_SAFE(pbdev, &s->zpci_devs, link, next) { + if (pbdev->interp && pbdev->pft == ZPCI_PFT_ISM && + pbdev->fh & FH_MASK_ENABLE) { + s390_pci_kvm_aif_disable(pbdev); + + pci_device_reset(pbdev->pdev); + } + } +} + static void s390_pcihost_reset(DeviceState *dev) { S390pciState *s = S390_PCI_HOST_BRIDGE(dev); diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index eaf61d3640..c99682b07d 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -118,6 +118,14 @@ static void subsystem_reset(void) DeviceState *dev; int i; + /* + * ISM firmware is sensitive to unexpected changes to the IOMMU, which can + * occur during reset of the vfio-pci device (unmap of entire aperture). + * Ensure any passthrough ISM devices are reset now, while CPUs are paused + * but before vfio-pci cleanup occurs. + */ + s390_pci_ism_reset(); + for (i = 0; i < ARRAY_SIZE(reset_dev_types); i++) { dev = DEVICE(object_resolve_path_type("", reset_dev_types[i], NULL)); if (dev) { diff --git a/include/hw/s390x/s390-pci-bus.h b/include/hw/s390x/s390-pci-bus.h index 435e788867..2c43ea123f 100644 --- a/include/hw/s390x/s390-pci-bus.h +++ b/include/hw/s390x/s390-pci-bus.h @@ -401,5 +401,6 @@ S390PCIBusDevice *s390_pci_find_dev_by_target(S390pciState *s, const char *target); S390PCIBusDevice *s390_pci_find_next_avail_dev(S390pciState *s, S390PCIBusDevice *pbdev); +void s390_pci_ism_reset(void); #endif From 48c1c25a55cdf02d21b1781531e21299736b193a Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Thu, 18 Jan 2024 11:37:56 +0100 Subject: [PATCH 04/11] qemu-options: Remove the deprecated -no-hpet option It's been marked as deprecated since QEMU 8.0, so it should be fine to remove this now. Reviewed-by: Markus Armbruster Message-ID: <20240118103759.130748-2-thuth@redhat.com> Signed-off-by: Thomas Huth --- docs/about/deprecated.rst | 6 ------ docs/about/removed-features.rst | 8 ++++++++ qemu-options.hx | 7 ------- system/vl.c | 4 ---- 4 files changed, 8 insertions(+), 17 deletions(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 2e15040246..3dcb652132 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -63,12 +63,6 @@ as short-form boolean values, and passed to plugins as ``arg_name=on``. However, short-form booleans are deprecated and full explicit ``arg_name=on`` form is preferred. -``-no-hpet`` (since 8.0) -'''''''''''''''''''''''' - -The HPET setting has been turned into a machine property. -Use ``-machine hpet=off`` instead. - ``-no-acpi`` (since 8.0) '''''''''''''''''''''''' diff --git a/docs/about/removed-features.rst b/docs/about/removed-features.rst index f04036987b..52d240ade9 100644 --- a/docs/about/removed-features.rst +++ b/docs/about/removed-features.rst @@ -460,6 +460,14 @@ in this case. Note that the default audio backend must be configured on the command line if the ``-nodefaults`` options is used. +``-no-hpet`` (removed in 9.0) +''''''''''''''''''''''''''''' + +The HPET setting has been turned into a machine property. +Use ``-machine hpet=off`` instead. + + + QEMU Machine Protocol (QMP) commands ------------------------------------ diff --git a/qemu-options.hx b/qemu-options.hx index 1912b19cb8..38d38abd6d 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -2656,13 +2656,6 @@ SRST machine only). ERST -DEF("no-hpet", 0, QEMU_OPTION_no_hpet, - "-no-hpet disable HPET\n", QEMU_ARCH_I386) -SRST -``-no-hpet`` - Disable HPET support. Deprecated, use '-machine hpet=off' instead. -ERST - DEF("acpitable", HAS_ARG, QEMU_OPTION_acpitable, "-acpitable [sig=str][,rev=n][,oem_id=str][,oem_table_id=str][,oem_rev=n][,asl_compiler_id=str][,asl_compiler_rev=n][,{data|file}=file1[:file2]...]\n" " ACPI table description\n", QEMU_ARCH_I386) diff --git a/system/vl.c b/system/vl.c index 53850a1daf..f08c4c8193 100644 --- a/system/vl.c +++ b/system/vl.c @@ -3373,10 +3373,6 @@ void qemu_init(int argc, char **argv) warn_report("-no-acpi is deprecated, use '-machine acpi=off' instead"); qdict_put_str(machine_opts_dict, "acpi", "off"); break; - case QEMU_OPTION_no_hpet: - warn_report("-no-hpet is deprecated, use '-machine hpet=off' instead"); - qdict_put_str(machine_opts_dict, "hpet", "off"); - break; case QEMU_OPTION_no_reboot: olist = qemu_find_opts("action"); qemu_opts_parse_noisily(olist, "reboot=shutdown", false); From 4a6410104491b703116cd12ef18a61d13cb5a23f Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Thu, 18 Jan 2024 11:37:57 +0100 Subject: [PATCH 05/11] qemu-options: Remove the deprecated -no-acpi option It's been marked as deprecated since QEMU 8.0, so it should be fine to remove this now. Message-ID: <20240118103759.130748-3-thuth@redhat.com> Reviewed-by: Markus Armbruster Reviewed-by: Michael Tokarev Signed-off-by: Thomas Huth --- docs/about/deprecated.rst | 6 ------ docs/about/removed-features.rst | 5 +++++ docs/specs/tpm.rst | 4 ++-- hw/i386/pc.c | 4 ++-- qemu-options.hx | 9 --------- system/vl.c | 4 ---- 6 files changed, 9 insertions(+), 23 deletions(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 3dcb652132..aa2cbe0d74 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -63,12 +63,6 @@ as short-form boolean values, and passed to plugins as ``arg_name=on``. However, short-form booleans are deprecated and full explicit ``arg_name=on`` form is preferred. -``-no-acpi`` (since 8.0) -'''''''''''''''''''''''' - -The ``-no-acpi`` setting has been turned into a machine property. -Use ``-machine acpi=off`` instead. - ``-async-teardown`` (since 8.1) ''''''''''''''''''''''''''''''' diff --git a/docs/about/removed-features.rst b/docs/about/removed-features.rst index 52d240ade9..ae728b6130 100644 --- a/docs/about/removed-features.rst +++ b/docs/about/removed-features.rst @@ -466,6 +466,11 @@ line if the ``-nodefaults`` options is used. The HPET setting has been turned into a machine property. Use ``-machine hpet=off`` instead. +``-no-acpi`` (removed in 9.0) +''''''''''''''''''''''''''''' + +The ``-no-acpi`` setting has been turned into a machine property. +Use ``-machine acpi=off`` instead. QEMU Machine Protocol (QMP) commands diff --git a/docs/specs/tpm.rst b/docs/specs/tpm.rst index c96776a369..68cb8cf7e6 100644 --- a/docs/specs/tpm.rst +++ b/docs/specs/tpm.rst @@ -343,9 +343,9 @@ In case an Arm virt machine is emulated, use the following command line: .. code-block:: console - qemu-system-aarch64 -machine virt,gic-version=3,accel=kvm \ + qemu-system-aarch64 -machine virt,gic-version=3,acpi=off \ -cpu host -m 4G \ - -nographic -no-acpi \ + -nographic -accel kvm \ -chardev socket,id=chrtpm,path=/tmp/mytpm1/swtpm-sock \ -tpmdev emulator,id=tpm0,chardev=chrtpm \ -device tpm-tis-device,tpmdev=tpm0 \ diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 496498df3a..803244e5cc 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1348,7 +1348,7 @@ static void pc_memory_pre_plug(HotplugHandler *hotplug_dev, DeviceState *dev, Error *local_err = NULL; /* - * When -no-acpi is used with Q35 machine type, no ACPI is built, + * When "acpi=off" is used with the Q35 machine type, no ACPI is built, * but pcms->acpi_dev is still created. Check !acpi_enabled in * addition to cover this case. */ @@ -1396,7 +1396,7 @@ static void pc_memory_unplug_request(HotplugHandler *hotplug_dev, X86MachineState *x86ms = X86_MACHINE(hotplug_dev); /* - * When -no-acpi is used with Q35 machine type, no ACPI is built, + * When "acpi=off" is used with the Q35 machine type, no ACPI is built, * but pcms->acpi_dev is still created. Check !acpi_enabled in * addition to cover this case. */ diff --git a/qemu-options.hx b/qemu-options.hx index 38d38abd6d..844a189fb0 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -2647,15 +2647,6 @@ SRST needed to boot from old floppy disks. ERST -DEF("no-acpi", 0, QEMU_OPTION_no_acpi, - "-no-acpi disable ACPI\n", QEMU_ARCH_I386 | QEMU_ARCH_ARM) -SRST -``-no-acpi`` - Disable ACPI (Advanced Configuration and Power Interface) support. - Use it if your guest OS complains about ACPI problems (PC target - machine only). -ERST - DEF("acpitable", HAS_ARG, QEMU_OPTION_acpitable, "-acpitable [sig=str][,rev=n][,oem_id=str][,oem_table_id=str][,oem_rev=n][,asl_compiler_id=str][,asl_compiler_rev=n][,{data|file}=file1[:file2]...]\n" " ACPI table description\n", QEMU_ARCH_I386) diff --git a/system/vl.c b/system/vl.c index f08c4c8193..7e258889f3 100644 --- a/system/vl.c +++ b/system/vl.c @@ -3369,10 +3369,6 @@ void qemu_init(int argc, char **argv) display_remote++; break; #endif - case QEMU_OPTION_no_acpi: - warn_report("-no-acpi is deprecated, use '-machine acpi=off' instead"); - qdict_put_str(machine_opts_dict, "acpi", "off"); - break; case QEMU_OPTION_no_reboot: olist = qemu_find_opts("action"); qemu_opts_parse_noisily(olist, "reboot=shutdown", false); From 2582489fecd6042d69e1fa060ab5ff89f4cef550 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Thu, 18 Jan 2024 11:37:58 +0100 Subject: [PATCH 06/11] qemu-options: Remove the deprecated -async-teardown option It's been marked as deprecated since QEMU 8.1 (and was only available since QEMU 8.0 anyway), so it should be fine to remove this now. Reviewed-by: Claudio Imbrenda Reviewed-by: Markus Armbruster Message-ID: <20240118103759.130748-4-thuth@redhat.com> Signed-off-by: Thomas Huth --- docs/about/deprecated.rst | 5 ----- docs/about/removed-features.rst | 5 +++++ qemu-options.hx | 10 ---------- system/vl.c | 6 ------ 4 files changed, 5 insertions(+), 21 deletions(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index aa2cbe0d74..1c92a17896 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -63,11 +63,6 @@ as short-form boolean values, and passed to plugins as ``arg_name=on``. However, short-form booleans are deprecated and full explicit ``arg_name=on`` form is preferred. -``-async-teardown`` (since 8.1) -''''''''''''''''''''''''''''''' - -Use ``-run-with async-teardown=on`` instead. - ``-chroot`` (since 8.1) ''''''''''''''''''''''' diff --git a/docs/about/removed-features.rst b/docs/about/removed-features.rst index ae728b6130..43f64a26ba 100644 --- a/docs/about/removed-features.rst +++ b/docs/about/removed-features.rst @@ -472,6 +472,11 @@ Use ``-machine hpet=off`` instead. The ``-no-acpi`` setting has been turned into a machine property. Use ``-machine acpi=off`` instead. +``-async-teardown`` (removed in 9.0) +'''''''''''''''''''''''''''''''''''' + +Use ``-run-with async-teardown=on`` instead. + QEMU Machine Protocol (QMP) commands ------------------------------------ diff --git a/qemu-options.hx b/qemu-options.hx index 844a189fb0..8299f5cc0f 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -4977,16 +4977,6 @@ HXCOMM Internal use DEF("qtest", HAS_ARG, QEMU_OPTION_qtest, "", QEMU_ARCH_ALL) DEF("qtest-log", HAS_ARG, QEMU_OPTION_qtest_log, "", QEMU_ARCH_ALL) -#ifdef __linux__ -DEF("async-teardown", 0, QEMU_OPTION_asyncteardown, - "-async-teardown enable asynchronous teardown\n", - QEMU_ARCH_ALL) -SRST -``-async-teardown`` - This option is deprecated and should no longer be used. The new option - ``-run-with async-teardown=on`` is a replacement. -ERST -#endif #ifdef CONFIG_POSIX DEF("run-with", HAS_ARG, QEMU_OPTION_run_with, "-run-with [async-teardown=on|off][,chroot=dir]\n" diff --git a/system/vl.c b/system/vl.c index 7e258889f3..924356f864 100644 --- a/system/vl.c +++ b/system/vl.c @@ -3600,12 +3600,6 @@ void qemu_init(int argc, char **argv) case QEMU_OPTION_daemonize: os_set_daemonize(true); break; -#if defined(CONFIG_LINUX) - /* deprecated */ - case QEMU_OPTION_asyncteardown: - init_async_teardown(); - break; -#endif case QEMU_OPTION_run_with: { const char *str; opts = qemu_opts_parse_noisily(qemu_find_opts("run-with"), From 1e7886e9e2068a4d83c1a05011cf21e638090ec5 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Thu, 18 Jan 2024 11:37:59 +0100 Subject: [PATCH 07/11] qemu-options: Remove the deprecated -chroot option It's been marked as deprecated since QEMU 8.1, so it should be fine to remove this now. Reviewed-by: Markus Armbruster Message-ID: <20240118103759.130748-5-thuth@redhat.com> Signed-off-by: Thomas Huth --- docs/about/deprecated.rst | 5 ----- docs/about/removed-features.rst | 5 +++++ qemu-options.hx | 12 ------------ system/vl.c | 5 ----- 4 files changed, 5 insertions(+), 22 deletions(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 1c92a17896..9a2c994617 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -63,11 +63,6 @@ as short-form boolean values, and passed to plugins as ``arg_name=on``. However, short-form booleans are deprecated and full explicit ``arg_name=on`` form is preferred. -``-chroot`` (since 8.1) -''''''''''''''''''''''' - -Use ``-run-with chroot=dir`` instead. - ``-singlestep`` (since 8.1) ''''''''''''''''''''''''''' diff --git a/docs/about/removed-features.rst b/docs/about/removed-features.rst index 43f64a26ba..a8546f4787 100644 --- a/docs/about/removed-features.rst +++ b/docs/about/removed-features.rst @@ -477,6 +477,11 @@ Use ``-machine acpi=off`` instead. Use ``-run-with async-teardown=on`` instead. +``-chroot`` (removed in 9.0) +'''''''''''''''''''''''''''' + +Use ``-run-with chroot=dir`` instead. + QEMU Machine Protocol (QMP) commands ------------------------------------ diff --git a/qemu-options.hx b/qemu-options.hx index 8299f5cc0f..42d813474b 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -4792,18 +4792,6 @@ SRST ``-nodefaults`` option will disable all those default devices. ERST -#ifndef _WIN32 -DEF("chroot", HAS_ARG, QEMU_OPTION_chroot, \ - "-chroot dir chroot to dir just before starting the VM (deprecated)\n", - QEMU_ARCH_ALL) -#endif -SRST -``-chroot dir`` - Deprecated, use '-run-with chroot=...' instead. - Immediately before starting guest execution, chroot to the specified - directory. Especially useful in combination with -runas. -ERST - #ifndef _WIN32 DEF("runas", HAS_ARG, QEMU_OPTION_runas, \ "-runas user change to user id user just before starting the VM\n" \ diff --git a/system/vl.c b/system/vl.c index 924356f864..c125fb9079 100644 --- a/system/vl.c +++ b/system/vl.c @@ -3592,11 +3592,6 @@ void qemu_init(int argc, char **argv) exit(1); } break; - case QEMU_OPTION_chroot: - warn_report("option is deprecated," - " use '-run-with chroot=...' instead"); - os_set_chroot(optarg); - break; case QEMU_OPTION_daemonize: os_set_daemonize(true); break; From fe17522d854aa7da4c01ca80ef194af4c2aaead3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Wed, 17 Jan 2024 16:14:28 +0100 Subject: [PATCH 08/11] qapi: Remove deprecated 'singlestep' member of StatusInfo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This member has been deprecated before the 8.1 release, in commit 34c18203d4 ("qmp: Deprecate 'singlestep' member of StatusInfo"). Time to drop it. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Markus Armbruster Message-ID: <20240117151430.29235-2-philmd@linaro.org> Signed-off-by: Thomas Huth --- docs/about/deprecated.rst | 14 -------------- qapi/run-state.json | 11 ----------- system/runstate.c | 8 -------- tests/qemu-iotests/183.out | 4 ++-- tests/qemu-iotests/234.out | 8 ++++---- tests/qemu-iotests/262.out | 4 ++-- tests/qemu-iotests/280.out | 2 +- 7 files changed, 9 insertions(+), 42 deletions(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 9a2c994617..25527da423 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -151,20 +151,6 @@ accepted incorrect commands will return an error. Users should make sure that all arguments passed to ``device_add`` are consistent with the documented property types. -``StatusInfo`` member ``singlestep`` (since 8.1) -'''''''''''''''''''''''''''''''''''''''''''''''' - -The ``singlestep`` member of the ``StatusInfo`` returned from the -``query-status`` command is deprecated. This member has a confusing -name and it never did what the documentation claimed or what its name -suggests. We do not believe that anybody is actually using the -information provided in this member. - -The information it reports is whether the TCG JIT is in "one -instruction per translated block" mode (which can be set on the -command line or via the HMP, but not via QMP). The information remains -available via the HMP 'info jit' command. - QEMU Machine Protocol (QMP) events ---------------------------------- diff --git a/qapi/run-state.json b/qapi/run-state.json index ca05502e0a..08bc99cb85 100644 --- a/qapi/run-state.json +++ b/qapi/run-state.json @@ -106,25 +106,15 @@ # # @running: true if all VCPUs are runnable, false if not runnable # -# @singlestep: true if using TCG with one guest instruction per -# translation block -# # @status: the virtual machine @RunState # # Features: # -# @deprecated: Member 'singlestep' is deprecated (with no -# replacement). -# # Since: 0.14 # -# Notes: @singlestep is enabled on the command line with '-accel -# tcg,one-insn-per-tb=on', or with the HMP 'one-insn-per-tb' -# command. ## { 'struct': 'StatusInfo', 'data': {'running': 'bool', - 'singlestep': { 'type': 'bool', 'features': [ 'deprecated' ]}, 'status': 'RunState'} } ## @@ -140,7 +130,6 @@ # # -> { "execute": "query-status" } # <- { "return": { "running": true, -# "singlestep": false, # "status": "running" } } ## { 'command': 'query-status', 'returns': 'StatusInfo', diff --git a/system/runstate.c b/system/runstate.c index fb07b7b71a..d6ab860eca 100644 --- a/system/runstate.c +++ b/system/runstate.c @@ -242,15 +242,7 @@ bool runstate_needs_reset(void) StatusInfo *qmp_query_status(Error **errp) { StatusInfo *info = g_malloc0(sizeof(*info)); - AccelState *accel = current_accel(); - /* - * We ignore errors, which will happen if the accelerator - * is not TCG. "singlestep" is meaningless for other accelerators, - * so we will set the StatusInfo field to false for those. - */ - info->singlestep = object_property_get_bool(OBJECT(accel), - "one-insn-per-tb", NULL); info->running = runstate_is_running(); info->status = current_run_state; diff --git a/tests/qemu-iotests/183.out b/tests/qemu-iotests/183.out index fd9c2e52a5..9277643853 100644 --- a/tests/qemu-iotests/183.out +++ b/tests/qemu-iotests/183.out @@ -30,13 +30,13 @@ read 65536/65536 bytes at offset 0 'arguments': { 'uri': 'unix:SOCK_DIR/migrate', 'blk': true } } {"return": {}} { 'execute': 'query-status' } -{"return": {"status": "postmigrate", "singlestep": false, "running": false}} +{"return": {"status": "postmigrate", "running": false}} === Do some I/O on the destination === { 'execute': 'query-status' } {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "RESUME"} -{"return": {"status": "running", "singlestep": false, "running": true}} +{"return": {"status": "running", "running": true}} { 'execute': 'human-monitor-command', 'arguments': { 'command-line': 'qemu-io disk "read -P 0x55 0 64k"' } } diff --git a/tests/qemu-iotests/234.out b/tests/qemu-iotests/234.out index 692976d1c6..ac8b64350c 100644 --- a/tests/qemu-iotests/234.out +++ b/tests/qemu-iotests/234.out @@ -15,8 +15,8 @@ Starting migration to B... {"data": {"status": "completed"}, "event": "MIGRATION", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} completed completed -{"return": {"running": false, "singlestep": false, "status": "postmigrate"}} -{"return": {"running": true, "singlestep": false, "status": "running"}} +{"return": {"running": false, "status": "postmigrate"}} +{"return": {"running": true, "status": "running"}} Add a second parent to drive0-file... {"return": {}} Restart A with -incoming and second parent... @@ -32,5 +32,5 @@ Starting migration back to A... {"data": {"status": "completed"}, "event": "MIGRATION", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} completed completed -{"return": {"running": true, "singlestep": false, "status": "running"}} -{"return": {"running": false, "singlestep": false, "status": "postmigrate"}} +{"return": {"running": true, "status": "running"}} +{"return": {"running": false, "status": "postmigrate"}} diff --git a/tests/qemu-iotests/262.out b/tests/qemu-iotests/262.out index 8e04c496c4..b8a2d3598d 100644 --- a/tests/qemu-iotests/262.out +++ b/tests/qemu-iotests/262.out @@ -13,5 +13,5 @@ Starting migration to B... {"data": {"status": "completed"}, "event": "MIGRATION", "timestamp": {"microseconds": "USECS", "seconds": "SECS"}} completed completed -{"return": {"running": false, "singlestep": false, "status": "postmigrate"}} -{"return": {"running": true, "singlestep": false, "status": "running"}} +{"return": {"running": false, "status": "postmigrate"}} +{"return": {"running": true, "status": "running"}} diff --git a/tests/qemu-iotests/280.out b/tests/qemu-iotests/280.out index c75f437c00..546dbb4a68 100644 --- a/tests/qemu-iotests/280.out +++ b/tests/qemu-iotests/280.out @@ -12,7 +12,7 @@ Enabling migration QMP events on VM... VM is now stopped: completed {"execute": "query-status", "arguments": {}} -{"return": {"running": false, "singlestep": false, "status": "postmigrate"}} +{"return": {"running": false, "status": "postmigrate"}} === Create a snapshot of the disk image === {"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "file", "filename": "TEST_DIR/PID-top", "size": 0}}} From 97b6e1d35f35463307bf9086b7a3fd8bf3212a19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Wed, 17 Jan 2024 16:14:29 +0100 Subject: [PATCH 09/11] hmp: Remove deprecated 'singlestep' command MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This command has been deprecated before the 8.1 release, in commit e9ccfdd91d ("hmp: Add 'one-insn-per-tb' command equivalent to 'singlestep'"). Time to drop it. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: "Dr. David Alan Gilbert" Reviewed-by: Markus Armbruster Message-ID: <20240117151430.29235-3-philmd@linaro.org> Signed-off-by: Thomas Huth --- docs/about/deprecated.rst | 9 --------- docs/about/removed-features.rst | 6 ++++++ hmp-commands.hx | 13 ------------- tests/qtest/test-hmp.c | 1 - 4 files changed, 6 insertions(+), 23 deletions(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 25527da423..316a26a82c 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -167,15 +167,6 @@ points was removed in 7.0. However QMP still exposed the vcpu parameter. This argument has now been deprecated and the remaining remaining trace points that used it are selected just by name. -Human Monitor Protocol (HMP) commands -------------------------------------- - -``singlestep`` (since 8.1) -'''''''''''''''''''''''''' - -The ``singlestep`` command has been replaced by the ``one-insn-per-tb`` -command, which has the same behaviour but a less misleading name. - Host Architectures ------------------ diff --git a/docs/about/removed-features.rst b/docs/about/removed-features.rst index a8546f4787..855d788259 100644 --- a/docs/about/removed-features.rst +++ b/docs/about/removed-features.rst @@ -635,6 +635,12 @@ Use ``migrate-set-parameters`` instead. This command didn't produce any output already. Removed with no replacement. +``singlestep`` (removed in 9.0) +''''''''''''''''''''''''''''''' + +The ``singlestep`` command has been replaced by the ``one-insn-per-tb`` +command, which has the same behaviour but a less misleading name. + Guest Emulator ISAs ------------------- diff --git a/hmp-commands.hx b/hmp-commands.hx index 2db5701d49..17b5ea839d 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -398,19 +398,6 @@ SRST If called with option off, the emulation returns to normal mode. ERST - { - .name = "singlestep", - .args_type = "option:s?", - .params = "[on|off]", - .help = "deprecated synonym for one-insn-per-tb", - .cmd = hmp_one_insn_per_tb, - }, - -SRST -``singlestep [off]`` - This is a deprecated synonym for the one-insn-per-tb command. -ERST - { .name = "stop|s", .args_type = "", diff --git a/tests/qtest/test-hmp.c b/tests/qtest/test-hmp.c index fc9125f8bb..1b2e07522f 100644 --- a/tests/qtest/test-hmp.c +++ b/tests/qtest/test-hmp.c @@ -64,7 +64,6 @@ static const char *hmp_cmds[] = { "qom-get /machine initrd", "screendump /dev/null", "sendkey x", - "singlestep on", "wavcapture /dev/null", "stopcapture 0", "sum 0 512", From c61a0d31f8db4cb6c54e473e9a44dca616969414 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Wed, 17 Jan 2024 16:14:30 +0100 Subject: [PATCH 10/11] cli: Remove deprecated '-singlestep' command line option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This option has been deprecated before the 8.1 release, in commit 12fd0f41d0 ("Document that -singlestep command line option is deprecated"). Time to drop it. Inspired-by: Thomas Huth Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Reviewed-by: Markus Armbruster Message-ID: <20240117151430.29235-4-philmd@linaro.org> Signed-off-by: Thomas Huth --- bsd-user/main.c | 3 +-- docs/about/deprecated.rst | 17 ----------------- docs/about/removed-features.rst | 18 ++++++++++++++++++ docs/user/main.rst | 6 ------ linux-user/main.c | 2 -- qemu-options.hx | 8 -------- system/vl.c | 18 +----------------- 7 files changed, 20 insertions(+), 52 deletions(-) diff --git a/bsd-user/main.c b/bsd-user/main.c index 4de226d211..e5efb7b845 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -163,7 +163,6 @@ static void usage(void) " (use '-d help' for a list of log items)\n" "-D logfile write logs to 'logfile' (default stderr)\n" "-one-insn-per-tb run with one guest instruction per emulated TB\n" - "-singlestep deprecated synonym for -one-insn-per-tb\n" "-strace log system calls\n" "-trace [[enable=]][,events=][,file=]\n" " specify tracing options\n" @@ -391,7 +390,7 @@ int main(int argc, char **argv) (void) envlist_unsetenv(envlist, "LD_PRELOAD"); } else if (!strcmp(r, "seed")) { seed_optarg = optarg; - } else if (!strcmp(r, "singlestep") || !strcmp(r, "one-insn-per-tb")) { + } else if (!strcmp(r, "one-insn-per-tb")) { opt_one_insn_per_tb = true; } else if (!strcmp(r, "strace")) { do_strace = 1; diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 316a26a82c..f47446c079 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -63,23 +63,6 @@ as short-form boolean values, and passed to plugins as ``arg_name=on``. However, short-form booleans are deprecated and full explicit ``arg_name=on`` form is preferred. -``-singlestep`` (since 8.1) -''''''''''''''''''''''''''' - -The ``-singlestep`` option has been turned into an accelerator property, -and given a name that better reflects what it actually does. -Use ``-accel tcg,one-insn-per-tb=on`` instead. - -User-mode emulator command line arguments ------------------------------------------ - -``-singlestep`` (since 8.1) -''''''''''''''''''''''''''' - -The ``-singlestep`` option has been given a name that better reflects -what it actually does. For both linux-user and bsd-user, use the -new ``-one-insn-per-tb`` option instead. - QEMU Machine Protocol (QMP) commands ------------------------------------ diff --git a/docs/about/removed-features.rst b/docs/about/removed-features.rst index 855d788259..54081a6c19 100644 --- a/docs/about/removed-features.rst +++ b/docs/about/removed-features.rst @@ -482,6 +482,24 @@ Use ``-run-with async-teardown=on`` instead. Use ``-run-with chroot=dir`` instead. +``-singlestep`` (removed in 9.0) +'''''''''''''''''''''''''''''''' + +The ``-singlestep`` option has been turned into an accelerator property, +and given a name that better reflects what it actually does. +Use ``-accel tcg,one-insn-per-tb=on`` instead. + + +User-mode emulator command line arguments +----------------------------------------- + +``-singlestep`` (removed in 9.0) +'''''''''''''''''''''''''''''''' + +The ``-singlestep`` option has been given a name that better reflects +what it actually does. For both linux-user and bsd-user, use the +``-one-insn-per-tb`` option instead. + QEMU Machine Protocol (QMP) commands ------------------------------------ diff --git a/docs/user/main.rst b/docs/user/main.rst index f478635396..7e7ad07409 100644 --- a/docs/user/main.rst +++ b/docs/user/main.rst @@ -98,9 +98,6 @@ Debug options: This slows down emulation a lot, but can be useful in some situations, such as when trying to analyse the logs produced by the ``-d`` option. -``-singlestep`` - This is a deprecated synonym for the ``-one-insn-per-tb`` option. - Environment variables: QEMU_STRACE @@ -251,6 +248,3 @@ Debug options: Run the emulation with one guest instruction per translation block. This slows down emulation a lot, but can be useful in some situations, such as when trying to analyse the logs produced by the ``-d`` option. - -``-singlestep`` - This is a deprecated synonym for the ``-one-insn-per-tb`` option. diff --git a/linux-user/main.c b/linux-user/main.c index 0cdaf30d34..c9470eeccf 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -500,8 +500,6 @@ static const struct qemu_argument arg_table[] = { {"one-insn-per-tb", "QEMU_ONE_INSN_PER_TB", false, handle_arg_one_insn_per_tb, "", "run with one guest instruction per emulated TB"}, - {"singlestep", "QEMU_SINGLESTEP", false, handle_arg_one_insn_per_tb, - "", "deprecated synonym for -one-insn-per-tb"}, {"strace", "QEMU_STRACE", false, handle_arg_strace, "", "log system calls"}, {"seed", "QEMU_RAND_SEED", true, handle_arg_seed, diff --git a/qemu-options.hx b/qemu-options.hx index 42d813474b..24706ae109 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -4359,14 +4359,6 @@ SRST from a script. ERST -DEF("singlestep", 0, QEMU_OPTION_singlestep, \ - "-singlestep deprecated synonym for -accel tcg,one-insn-per-tb=on\n", QEMU_ARCH_ALL) -SRST -``-singlestep`` - This is a deprecated synonym for the TCG accelerator property - ``one-insn-per-tb``. -ERST - DEF("preconfig", 0, QEMU_OPTION_preconfig, \ "--preconfig pause QEMU before machine is initialized (experimental)\n", QEMU_ARCH_ALL) diff --git a/system/vl.c b/system/vl.c index c125fb9079..809f867bcc 100644 --- a/system/vl.c +++ b/system/vl.c @@ -181,7 +181,6 @@ static const char *log_file; static bool list_data_dirs; static const char *qtest_chrdev; static const char *qtest_log; -static bool opt_one_insn_per_tb; static int has_defaults = 1; static int default_audio = 1; @@ -2308,19 +2307,7 @@ static int do_configure_accelerator(void *opaque, QemuOpts *opts, Error **errp) qemu_opt_foreach(opts, accelerator_set_property, accel, &error_fatal); - /* - * If legacy -singlestep option is set, honour it for TCG and - * silently ignore for any other accelerator (which is how this - * option has always behaved). - */ - if (opt_one_insn_per_tb) { - /* - * This will always succeed for TCG, and we want to ignore - * the error from trying to set a nonexistent property - * on any other accelerator. - */ - object_property_set_bool(OBJECT(accel), "one-insn-per-tb", true, NULL); - } + ret = accel_init_machine(accel, current_machine); if (ret < 0) { if (!qtest_with_kvm || ret != -ENOENT) { @@ -3057,9 +3044,6 @@ void qemu_init(int argc, char **argv) case QEMU_OPTION_bios: qdict_put_str(machine_opts_dict, "firmware", optarg); break; - case QEMU_OPTION_singlestep: - opt_one_insn_per_tb = true; - break; case QEMU_OPTION_S: autostart = 0; break; From 4a27d97c80b90215b33a092a1c3a5efcc987b582 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Wed, 17 Jan 2024 15:07:46 +0100 Subject: [PATCH 11/11] tests/vm/netbsd: Remove missing py311-expat package MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since the pkgsrc-2023Q3 release [*], the py-expat package has been merged into the base 'python' package: - Several packages have been folded into base packages. While the result is simpler, those updating may need to force-remove the secondary packages, depending on the update method. When doing make replace, one has to pkg_delete -f the secondary packages. pkgin handles at least the python packages correctly, removing the split package when updating python. Specific packages and the former packages now included: * cairo: cairo-gobject * python: py-cElementTree py-curses py-cursespanel py-expat py-readline py-sqlite3 Remove py311-expat from the package list in order to avoid: ### Installing packages ... processing remote summary (http://cdn.NetBSD.org/pub/pkgsrc/packages/NetBSD/amd64/9.3/All)... database for http://cdn.NetBSD.org/pub/pkgsrc/packages/NetBSD/amd64/9.3/All is up-to-date py311-expat is not available in the repository ... calculating dependencies.../py311-expat is not available in the repository pkg_install error log can be found in /var/db/pkgin/pkg_install-err.log [*] https://mail-index.netbsd.org/netbsd-announce/2024/01/01/msg000360.html Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2109 Tested-by: Thomas Huth Reviewed-by: Thomas Huth Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20240117140746.23511-1-philmd@linaro.org> Signed-off-by: Thomas Huth --- tests/vm/netbsd | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/vm/netbsd b/tests/vm/netbsd index 649fcad353..a3f6dd6b3c 100755 --- a/tests/vm/netbsd +++ b/tests/vm/netbsd @@ -31,7 +31,6 @@ class NetBSDVM(basevm.BaseVM): "pkgconf", "xz", "python311", - "py311-expat", "ninja-build", # gnu tools