Skip to content

Commit 09be347

Browse files
committed
Merge tag 'pull-request-2024-01-19' of https://gitlab.com/thuth/qemu 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 "[email protected]" # gpg: Good signature from "Thomas Huth <[email protected]>" [full] # gpg: aka "Thomas Huth <[email protected]>" [full] # gpg: aka "Thomas Huth <[email protected]>" [full] # gpg: aka "Thomas Huth <[email protected]>" [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 <[email protected]>
2 parents 3f2a357 + 4a27d97 commit 09be347

File tree

22 files changed

+121
-212
lines changed

22 files changed

+121
-212
lines changed

bsd-user/main.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ static void usage(void)
163163
" (use '-d help' for a list of log items)\n"
164164
"-D logfile write logs to 'logfile' (default stderr)\n"
165165
"-one-insn-per-tb run with one guest instruction per emulated TB\n"
166-
"-singlestep deprecated synonym for -one-insn-per-tb\n"
167166
"-strace log system calls\n"
168167
"-trace [[enable=]<pattern>][,events=<file>][,file=<file>]\n"
169168
" specify tracing options\n"
@@ -391,7 +390,7 @@ int main(int argc, char **argv)
391390
(void) envlist_unsetenv(envlist, "LD_PRELOAD");
392391
} else if (!strcmp(r, "seed")) {
393392
seed_optarg = optarg;
394-
} else if (!strcmp(r, "singlestep") || !strcmp(r, "one-insn-per-tb")) {
393+
} else if (!strcmp(r, "one-insn-per-tb")) {
395394
opt_one_insn_per_tb = true;
396395
} else if (!strcmp(r, "strace")) {
397396
do_strace = 1;

docs/about/deprecated.rst

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -63,45 +63,6 @@ as short-form boolean values, and passed to plugins as ``arg_name=on``.
6363
However, short-form booleans are deprecated and full explicit ``arg_name=on``
6464
form is preferred.
6565

66-
``-no-hpet`` (since 8.0)
67-
''''''''''''''''''''''''
68-
69-
The HPET setting has been turned into a machine property.
70-
Use ``-machine hpet=off`` instead.
71-
72-
``-no-acpi`` (since 8.0)
73-
''''''''''''''''''''''''
74-
75-
The ``-no-acpi`` setting has been turned into a machine property.
76-
Use ``-machine acpi=off`` instead.
77-
78-
``-async-teardown`` (since 8.1)
79-
'''''''''''''''''''''''''''''''
80-
81-
Use ``-run-with async-teardown=on`` instead.
82-
83-
``-chroot`` (since 8.1)
84-
'''''''''''''''''''''''
85-
86-
Use ``-run-with chroot=dir`` instead.
87-
88-
``-singlestep`` (since 8.1)
89-
'''''''''''''''''''''''''''
90-
91-
The ``-singlestep`` option has been turned into an accelerator property,
92-
and given a name that better reflects what it actually does.
93-
Use ``-accel tcg,one-insn-per-tb=on`` instead.
94-
95-
User-mode emulator command line arguments
96-
-----------------------------------------
97-
98-
``-singlestep`` (since 8.1)
99-
'''''''''''''''''''''''''''
100-
101-
The ``-singlestep`` option has been given a name that better reflects
102-
what it actually does. For both linux-user and bsd-user, use the
103-
new ``-one-insn-per-tb`` option instead.
104-
10566
QEMU Machine Protocol (QMP) commands
10667
------------------------------------
10768

@@ -173,20 +134,6 @@ accepted incorrect commands will return an error. Users should make sure that
173134
all arguments passed to ``device_add`` are consistent with the documented
174135
property types.
175136

176-
``StatusInfo`` member ``singlestep`` (since 8.1)
177-
''''''''''''''''''''''''''''''''''''''''''''''''
178-
179-
The ``singlestep`` member of the ``StatusInfo`` returned from the
180-
``query-status`` command is deprecated. This member has a confusing
181-
name and it never did what the documentation claimed or what its name
182-
suggests. We do not believe that anybody is actually using the
183-
information provided in this member.
184-
185-
The information it reports is whether the TCG JIT is in "one
186-
instruction per translated block" mode (which can be set on the
187-
command line or via the HMP, but not via QMP). The information remains
188-
available via the HMP 'info jit' command.
189-
190137
QEMU Machine Protocol (QMP) events
191138
----------------------------------
192139

@@ -203,15 +150,6 @@ points was removed in 7.0. However QMP still exposed the vcpu
203150
parameter. This argument has now been deprecated and the remaining
204151
remaining trace points that used it are selected just by name.
205152

206-
Human Monitor Protocol (HMP) commands
207-
-------------------------------------
208-
209-
``singlestep`` (since 8.1)
210-
''''''''''''''''''''''''''
211-
212-
The ``singlestep`` command has been replaced by the ``one-insn-per-tb``
213-
command, which has the same behaviour but a less misleading name.
214-
215153
Host Architectures
216154
------------------
217155

docs/about/removed-features.rst

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,47 @@ in this case.
460460
Note that the default audio backend must be configured on the command
461461
line if the ``-nodefaults`` options is used.
462462

463+
``-no-hpet`` (removed in 9.0)
464+
'''''''''''''''''''''''''''''
465+
466+
The HPET setting has been turned into a machine property.
467+
Use ``-machine hpet=off`` instead.
468+
469+
``-no-acpi`` (removed in 9.0)
470+
'''''''''''''''''''''''''''''
471+
472+
The ``-no-acpi`` setting has been turned into a machine property.
473+
Use ``-machine acpi=off`` instead.
474+
475+
``-async-teardown`` (removed in 9.0)
476+
''''''''''''''''''''''''''''''''''''
477+
478+
Use ``-run-with async-teardown=on`` instead.
479+
480+
``-chroot`` (removed in 9.0)
481+
''''''''''''''''''''''''''''
482+
483+
Use ``-run-with chroot=dir`` instead.
484+
485+
``-singlestep`` (removed in 9.0)
486+
''''''''''''''''''''''''''''''''
487+
488+
The ``-singlestep`` option has been turned into an accelerator property,
489+
and given a name that better reflects what it actually does.
490+
Use ``-accel tcg,one-insn-per-tb=on`` instead.
491+
492+
493+
User-mode emulator command line arguments
494+
-----------------------------------------
495+
496+
``-singlestep`` (removed in 9.0)
497+
''''''''''''''''''''''''''''''''
498+
499+
The ``-singlestep`` option has been given a name that better reflects
500+
what it actually does. For both linux-user and bsd-user, use the
501+
``-one-insn-per-tb`` option instead.
502+
503+
463504
QEMU Machine Protocol (QMP) commands
464505
------------------------------------
465506

@@ -612,6 +653,12 @@ Use ``migrate-set-parameters`` instead.
612653

613654
This command didn't produce any output already. Removed with no replacement.
614655

656+
``singlestep`` (removed in 9.0)
657+
'''''''''''''''''''''''''''''''
658+
659+
The ``singlestep`` command has been replaced by the ``one-insn-per-tb``
660+
command, which has the same behaviour but a less misleading name.
661+
615662
Guest Emulator ISAs
616663
-------------------
617664

docs/specs/tpm.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,9 +343,9 @@ In case an Arm virt machine is emulated, use the following command line:
343343

344344
.. code-block:: console
345345
346-
qemu-system-aarch64 -machine virt,gic-version=3,accel=kvm \
346+
qemu-system-aarch64 -machine virt,gic-version=3,acpi=off \
347347
-cpu host -m 4G \
348-
-nographic -no-acpi \
348+
-nographic -accel kvm \
349349
-chardev socket,id=chrtpm,path=/tmp/mytpm1/swtpm-sock \
350350
-tpmdev emulator,id=tpm0,chardev=chrtpm \
351351
-device tpm-tis-device,tpmdev=tpm0 \

docs/user/main.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,6 @@ Debug options:
9898
This slows down emulation a lot, but can be useful in some situations,
9999
such as when trying to analyse the logs produced by the ``-d`` option.
100100

101-
``-singlestep``
102-
This is a deprecated synonym for the ``-one-insn-per-tb`` option.
103-
104101
Environment variables:
105102

106103
QEMU_STRACE
@@ -251,6 +248,3 @@ Debug options:
251248
Run the emulation with one guest instruction per translation block.
252249
This slows down emulation a lot, but can be useful in some situations,
253250
such as when trying to analyse the logs produced by the ``-d`` option.
254-
255-
``-singlestep``
256-
This is a deprecated synonym for the ``-one-insn-per-tb`` option.

hmp-commands.hx

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -398,19 +398,6 @@ SRST
398398
If called with option off, the emulation returns to normal mode.
399399
ERST
400400

401-
{
402-
.name = "singlestep",
403-
.args_type = "option:s?",
404-
.params = "[on|off]",
405-
.help = "deprecated synonym for one-insn-per-tb",
406-
.cmd = hmp_one_insn_per_tb,
407-
},
408-
409-
SRST
410-
``singlestep [off]``
411-
This is a deprecated synonym for the one-insn-per-tb command.
412-
ERST
413-
414401
{
415402
.name = "stop|s",
416403
.args_type = "",

hw/i386/pc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1348,7 +1348,7 @@ static void pc_memory_pre_plug(HotplugHandler *hotplug_dev, DeviceState *dev,
13481348
Error *local_err = NULL;
13491349

13501350
/*
1351-
* When -no-acpi is used with Q35 machine type, no ACPI is built,
1351+
* When "acpi=off" is used with the Q35 machine type, no ACPI is built,
13521352
* but pcms->acpi_dev is still created. Check !acpi_enabled in
13531353
* addition to cover this case.
13541354
*/
@@ -1396,7 +1396,7 @@ static void pc_memory_unplug_request(HotplugHandler *hotplug_dev,
13961396
X86MachineState *x86ms = X86_MACHINE(hotplug_dev);
13971397

13981398
/*
1399-
* When -no-acpi is used with Q35 machine type, no ACPI is built,
1399+
* When "acpi=off" is used with the Q35 machine type, no ACPI is built,
14001400
* but pcms->acpi_dev is still created. Check !acpi_enabled in
14011401
* addition to cover this case.
14021402
*/

hw/s390x/s390-pci-bus.c

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -151,20 +151,12 @@ static void s390_pci_shutdown_notifier(Notifier *n, void *opaque)
151151
pci_device_reset(pbdev->pdev);
152152
}
153153

154-
static void s390_pci_reset_cb(void *opaque)
155-
{
156-
S390PCIBusDevice *pbdev = opaque;
157-
158-
pci_device_reset(pbdev->pdev);
159-
}
160-
161154
static void s390_pci_perform_unplug(S390PCIBusDevice *pbdev)
162155
{
163156
HotplugHandler *hotplug_ctrl;
164157

165158
if (pbdev->pft == ZPCI_PFT_ISM) {
166159
notifier_remove(&pbdev->shutdown_notifier);
167-
qemu_unregister_reset(s390_pci_reset_cb, pbdev);
168160
}
169161

170162
/* Unplug the PCI device */
@@ -1132,7 +1124,6 @@ static void s390_pcihost_plug(HotplugHandler *hotplug_dev, DeviceState *dev,
11321124
if (pbdev->pft == ZPCI_PFT_ISM) {
11331125
pbdev->shutdown_notifier.notify = s390_pci_shutdown_notifier;
11341126
qemu_register_shutdown_notifier(&pbdev->shutdown_notifier);
1135-
qemu_register_reset(s390_pci_reset_cb, pbdev);
11361127
}
11371128
} else {
11381129
pbdev->fh |= FH_SHM_EMUL;
@@ -1279,6 +1270,23 @@ static void s390_pci_enumerate_bridge(PCIBus *bus, PCIDevice *pdev,
12791270
pci_default_write_config(pdev, PCI_SUBORDINATE_BUS, s->bus_no, 1);
12801271
}
12811272

1273+
void s390_pci_ism_reset(void)
1274+
{
1275+
S390pciState *s = s390_get_phb();
1276+
1277+
S390PCIBusDevice *pbdev, *next;
1278+
1279+
/* Trigger reset event for each passthrough ISM device currently in-use */
1280+
QTAILQ_FOREACH_SAFE(pbdev, &s->zpci_devs, link, next) {
1281+
if (pbdev->interp && pbdev->pft == ZPCI_PFT_ISM &&
1282+
pbdev->fh & FH_MASK_ENABLE) {
1283+
s390_pci_kvm_aif_disable(pbdev);
1284+
1285+
pci_device_reset(pbdev->pdev);
1286+
}
1287+
}
1288+
}
1289+
12821290
static void s390_pcihost_reset(DeviceState *dev)
12831291
{
12841292
S390pciState *s = S390_PCI_HOST_BRIDGE(dev);

hw/s390x/s390-pci-kvm.c

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "hw/s390x/s390-pci-bus.h"
1919
#include "hw/s390x/s390-pci-kvm.h"
2020
#include "hw/s390x/s390-pci-inst.h"
21+
#include "hw/s390x/s390-pci-vfio.h"
2122
#include "cpu_models.h"
2223

2324
bool s390_pci_kvm_interp_allowed(void)
@@ -27,6 +28,7 @@ bool s390_pci_kvm_interp_allowed(void)
2728

2829
int s390_pci_kvm_aif_enable(S390PCIBusDevice *pbdev, ZpciFib *fib, bool assist)
2930
{
31+
int rc;
3032
struct kvm_s390_zpci_op args = {
3133
.fh = pbdev->fh,
3234
.op = KVM_S390_ZPCIOP_REG_AEN,
@@ -38,15 +40,43 @@ int s390_pci_kvm_aif_enable(S390PCIBusDevice *pbdev, ZpciFib *fib, bool assist)
3840
.u.reg_aen.flags = (assist) ? 0 : KVM_S390_ZPCIOP_REGAEN_HOST
3941
};
4042

41-
return kvm_vm_ioctl(kvm_state, KVM_S390_ZPCI_OP, &args);
43+
if (pbdev->aif) {
44+
return -EINVAL;
45+
}
46+
47+
rc = kvm_vm_ioctl(kvm_state, KVM_S390_ZPCI_OP, &args);
48+
if (rc == 0) {
49+
pbdev->aif = true;
50+
}
51+
52+
return rc;
4253
}
4354

4455
int s390_pci_kvm_aif_disable(S390PCIBusDevice *pbdev)
4556
{
57+
int rc;
58+
4659
struct kvm_s390_zpci_op args = {
4760
.fh = pbdev->fh,
4861
.op = KVM_S390_ZPCIOP_DEREG_AEN
4962
};
5063

51-
return kvm_vm_ioctl(kvm_state, KVM_S390_ZPCI_OP, &args);
64+
if (!pbdev->aif) {
65+
return -EINVAL;
66+
}
67+
68+
/*
69+
* The device may have already been reset but we still want to relinquish
70+
* the guest ISC, so always be sure to use an up-to-date host fh.
71+
*/
72+
if (!s390_pci_get_host_fh(pbdev, &args.fh)) {
73+
return -EPERM;
74+
}
75+
76+
rc = kvm_vm_ioctl(kvm_state, KVM_S390_ZPCI_OP, &args);
77+
if (rc == 0) {
78+
pbdev->aif = false;
79+
}
80+
81+
return rc;
5282
}

hw/s390x/s390-virtio-ccw.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,14 @@ static void subsystem_reset(void)
118118
DeviceState *dev;
119119
int i;
120120

121+
/*
122+
* ISM firmware is sensitive to unexpected changes to the IOMMU, which can
123+
* occur during reset of the vfio-pci device (unmap of entire aperture).
124+
* Ensure any passthrough ISM devices are reset now, while CPUs are paused
125+
* but before vfio-pci cleanup occurs.
126+
*/
127+
s390_pci_ism_reset();
128+
121129
for (i = 0; i < ARRAY_SIZE(reset_dev_types); i++) {
122130
dev = DEVICE(object_resolve_path_type("", reset_dev_types[i], NULL));
123131
if (dev) {

0 commit comments

Comments
 (0)