Skip to content

Commit

Permalink
Merge tag 'pull-request-2024-01-19' of https://gitlab.com/thuth/qemu
Browse files Browse the repository at this point in the history
…into staging

- Fix s390x ISM reset
- Remove deprecated CLI options -no-hpet, -no-acpi, -async-teardown,
  -chroot and -singlestep
- Fix installation of the netbsd VM

# -----BEGIN PGP SIGNATURE-----
#
# iQJFBAABCAAvFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAmWqk40RHHRodXRoQHJl
# ZGhhdC5jb20ACgkQLtnXdP5wLbVb+w//XuWdXzDDof0CsOMhMzBaKLznJ+Qbo4Wr
# S5vNJsiJe3KfI3DJa/ZSO2+lwyFpMPjp3aRSm9rAaw2ErejtfGZMSHj5/BGYuHVM
# x0VlHWnTEe/7NpG2mRwlxntPyYOtFCQ+xCo4YS9fpLLYSQFNhGMyOyfCobVZc1/A
# TDFrS5v1Su1HgYNL6GuyXK8k56ytidBxhuYtfLkR01liUDU1rmTWFcLxrXUwI7Hr
# nfamp/W6G9OJ3co0ysYChM8SvXQzCGPBxzGQjrcHpaL7otTW5yliJcNPwyzGdyLU
# G+5AcdJ8wT+ONonf3KkUTbxS2J2OHzIGCZpqVWGU0h5Yv43zMpNATUmbUPM0H0l4
# mqtUf4bSyhNwClKdkEWJyvEwNRTIHxWerMgaNp9ntEM3Ac0/3HiOXV/DZOKL04Im
# hRHRySSMlyo6Pnnn2fHj3naalKHNVikbvPVR3i8wdYuQ423D35cU8M+yJpJ3Bllt
# 5YgScDkVjifan5SmWVdtQ9bgyrdeQHFa9V1iUjxQx5JfAv8w4RBmats8UYrYm/mF
# Zrx/zdpL5wneslWwPqLp/gOb5lt8tF4vt0sLgpNa6SxI9Pgz/GhPvuhmfheML17l
# znbGEx5q3vqivszZkm8penydut4rbpp6GcoftbI9sIgqfNuuY1d/FZRlb32RTdxH
# 1TUiQfGQqbA=
# =ytHA
# -----END PGP SIGNATURE-----
# gpg: Signature made Fri 19 Jan 2024 15:21:49 GMT
# gpg:                using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5
# gpg:                issuer "thuth@redhat.com"
# gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full]
# gpg:                 aka "Thomas Huth <thuth@redhat.com>" [full]
# gpg:                 aka "Thomas Huth <huth@tuxfamily.org>" [full]
# gpg:                 aka "Thomas Huth <th.huth@posteo.de>" [unknown]
# Primary key fingerprint: 27B8 8847 EEE0 2501 18F3  EAB9 2ED9 D774 FE70 2DB5

* tag 'pull-request-2024-01-19' of https://gitlab.com/thuth/qemu:
  tests/vm/netbsd: Remove missing py311-expat package
  cli: Remove deprecated '-singlestep' command line option
  hmp: Remove deprecated 'singlestep' command
  qapi: Remove deprecated 'singlestep' member of StatusInfo
  qemu-options: Remove the deprecated -chroot option
  qemu-options: Remove the deprecated -async-teardown option
  qemu-options: Remove the deprecated -no-acpi option
  qemu-options: Remove the deprecated -no-hpet option
  s390x/pci: drive ISM reset from subsystem reset
  s390x/pci: refresh fh before disabling aif
  s390x/pci: avoid double enable/disable of aif

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
pm215 committed Jan 20, 2024
2 parents 3f2a357 + 4a27d97 commit 313aa10
Show file tree
Hide file tree
Showing 22 changed files with 121 additions and 212 deletions.
3 changes: 1 addition & 2 deletions bsd-user/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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=]<pattern>][,events=<file>][,file=<file>]\n"
" specify tracing options\n"
Expand Down Expand Up @@ -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;
Expand Down
62 changes: 0 additions & 62 deletions docs/about/deprecated.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,45 +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)
''''''''''''''''''''''''

The ``-no-acpi`` setting has been turned into a machine property.
Use ``-machine acpi=off`` instead.

``-async-teardown`` (since 8.1)
'''''''''''''''''''''''''''''''

Use ``-run-with async-teardown=on`` instead.

``-chroot`` (since 8.1)
'''''''''''''''''''''''

Use ``-run-with chroot=dir`` instead.

``-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
------------------------------------

Expand Down Expand Up @@ -173,20 +134,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
----------------------------------

Expand All @@ -203,15 +150,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
------------------

Expand Down
47 changes: 47 additions & 0 deletions docs/about/removed-features.rst
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,47 @@ 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.

``-no-acpi`` (removed in 9.0)
'''''''''''''''''''''''''''''

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.

``-chroot`` (removed in 9.0)
''''''''''''''''''''''''''''

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
------------------------------------

Expand Down Expand Up @@ -612,6 +653,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
-------------------

Expand Down
4 changes: 2 additions & 2 deletions docs/specs/tpm.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
6 changes: 0 additions & 6 deletions docs/user/main.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
13 changes: 0 additions & 13 deletions hmp-commands.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "",
Expand Down
4 changes: 2 additions & 2 deletions hw/i386/pc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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.
*/
Expand Down
26 changes: 17 additions & 9 deletions hw/s390x/s390-pci-bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
34 changes: 32 additions & 2 deletions hw/s390x/s390-pci-kvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -27,6 +28,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,
Expand All @@ -38,15 +40,43 @@ 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;
}

/*
* 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;
}

return rc;
}
8 changes: 8 additions & 0 deletions hw/s390x/s390-virtio-ccw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 2 additions & 0 deletions include/hw/s390x/s390-pci-bus.h
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ struct S390PCIBusDevice {
bool unplug_requested;
bool interp;
bool forwarding_assist;
bool aif;
QTAILQ_ENTRY(S390PCIBusDevice) link;
};

Expand Down Expand Up @@ -400,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
2 changes: 0 additions & 2 deletions linux-user/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 313aa10

Please sign in to comment.