Skip to content

Commit

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

* Add compat machines for QEMU 8.2
* Convert some DPRINTFs in s390x code into trace events
* Fix VFMIN/VFMAX, VSTL, VREP and VSTRS s390x instructions
* Fix virtio-gpu on big endian (i.e. s390x) hosts

# -----BEGIN PGP SIGNATURE-----
#
# iQJFBAABCAAvFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAmTl8McRHHRodXRoQHJl
# ZGhhdC5jb20ACgkQLtnXdP5wLbVXTQ/+OLnw+5+rCA/WbVWfWwEragtmSZuo5302
# ByARdgv8BdD7AobUdSLkWbz9fgU7TAGPnv4aRXBs1K1HE77e63sg6ZfmGUJQllx8
# T/86LPB0dPHZHPt39t3zv/ZTfj+yoXF+7+MIzhSbgV9sumKRqIW/w/BsTI3Rkkwd
# yp1mpkNvYzCkO66nZWYDgKYLTvSmSJx+GUC6dgWswwXSmGP9UU+jutX62lDQS4k4
# l3VjHHhl5V9LENQAvHQ1x48tMIjR4vra8T4fhYLAr1nVsHhsBONRX9qxUHhpy0c3
# zrWA95kO0CPoJLqMNdY9CSyBRgrH/BCmM6Z5+GvBI0RWo+bdgYzF5QpNW6Sbfb/L
# NfE7PK0EYRFk8Q1LK+pYQ0wCjw/a5tOj3NtwZQUUMqqiNL6zmaQpOXujw3PTtIDN
# 6qS9aiAVlL+taIsk9av1So5Mgrr97BsptPKhe22BCYxv832Vj8mPOhjkbiTs8OYD
# PCr+sfJvpwcDBdDhQ1xi4M5tkxg26CPtntVDJdl/pXM3dmpxQ/D8ciok+f2/EeWU
# VeiJ4/tbelm3u0zfGqYfRGSxvPYZM9aJJCLloXuffeT+UEJXUVze6MgMbSuf4vji
# f+hWxA38WUAaoZjoBguMgwLOp/hvBtbHF+Hdk+iT0yE5uc3Ajo619YRVAspJbNi4
# qSYIMAJoGqM=
# =cIfC
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 23 Aug 2023 07:43:03 EDT
# 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-2023-08-23' of https://gitlab.com/thuth/qemu:
  tests/tcg/s390x: Test VSTRS
  target/s390x: Fix the "ignored match" case in VSTRS
  linux-user/elfload: Enable vxe2 on s390x
  include/hw/virtio/virtio-gpu: Fix virtio-gpu with blob on big endian hosts
  hw/s390x/s390-virtio-ccw: Remove superfluous code to set the NIC model
  tests/tcg/s390x: Test VREP
  target/s390x: Use a 16-bit immediate in VREP
  tests/tcg/s390x: Test VSTL
  target/s390x: Fix VSTL with a large length
  target/s390x: Check reserved bits of VFMIN/VFMAX's M5
  s390x: Convert DPRINTF to trace events
  hw: Add compat machines for 8.2

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
  • Loading branch information
stefanhaRH committed Aug 23, 2023
2 parents 09a3fff + 6c49f68 commit 92e1d39
Show file tree
Hide file tree
Showing 24 changed files with 375 additions and 123 deletions.
9 changes: 8 additions & 1 deletion hw/arm/virt.c
Original file line number Diff line number Diff line change
Expand Up @@ -3170,10 +3170,17 @@ static void machvirt_machine_init(void)
}
type_init(machvirt_machine_init);

static void virt_machine_8_2_options(MachineClass *mc)
{
}
DEFINE_VIRT_MACHINE_AS_LATEST(8, 2)

static void virt_machine_8_1_options(MachineClass *mc)
{
virt_machine_8_2_options(mc);
compat_props_add(mc->compat_props, hw_compat_8_1, hw_compat_8_1_len);
}
DEFINE_VIRT_MACHINE_AS_LATEST(8, 1)
DEFINE_VIRT_MACHINE(8, 1)

static void virt_machine_8_0_options(MachineClass *mc)
{
Expand Down
3 changes: 3 additions & 0 deletions hw/core/machine.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
#include "hw/virtio/virtio.h"
#include "hw/virtio/virtio-pci.h"

GlobalProperty hw_compat_8_1[] = {};
const size_t hw_compat_8_1_len = G_N_ELEMENTS(hw_compat_8_1);

GlobalProperty hw_compat_8_0[] = {
{ "migration", "multifd-flush-after-each-section", "on"},
{ TYPE_PCI_DEVICE, "x-pcie-ari-nextfn-1", "on" },
Expand Down
3 changes: 3 additions & 0 deletions hw/i386/pc.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@
{ "qemu64-" TYPE_X86_CPU, "model-id", "QEMU Virtual CPU version " v, },\
{ "athlon-" TYPE_X86_CPU, "model-id", "QEMU Virtual CPU version " v, },

GlobalProperty pc_compat_8_1[] = {};
const size_t pc_compat_8_1_len = G_N_ELEMENTS(pc_compat_8_1);

GlobalProperty pc_compat_8_0[] = {
{ "virtio-mem", "unplugged-inaccessible", "auto" },
};
Expand Down
16 changes: 13 additions & 3 deletions hw/i386/pc_piix.c
Original file line number Diff line number Diff line change
Expand Up @@ -504,13 +504,25 @@ static void pc_i440fx_machine_options(MachineClass *m)
machine_class_allow_dynamic_sysbus_dev(m, TYPE_VMBUS_BRIDGE);
}

static void pc_i440fx_8_1_machine_options(MachineClass *m)
static void pc_i440fx_8_2_machine_options(MachineClass *m)
{
pc_i440fx_machine_options(m);
m->alias = "pc";
m->is_default = true;
}

DEFINE_I440FX_MACHINE(v8_2, "pc-i440fx-8.2", NULL,
pc_i440fx_8_2_machine_options);

static void pc_i440fx_8_1_machine_options(MachineClass *m)
{
pc_i440fx_8_2_machine_options(m);
m->alias = NULL;
m->is_default = false;
compat_props_add(m->compat_props, hw_compat_8_1, hw_compat_8_1_len);
compat_props_add(m->compat_props, pc_compat_8_1, pc_compat_8_1_len);
}

DEFINE_I440FX_MACHINE(v8_1, "pc-i440fx-8.1", NULL,
pc_i440fx_8_1_machine_options);

Expand All @@ -519,8 +531,6 @@ static void pc_i440fx_8_0_machine_options(MachineClass *m)
PCMachineClass *pcmc = PC_MACHINE_CLASS(m);

pc_i440fx_8_1_machine_options(m);
m->alias = NULL;
m->is_default = false;
compat_props_add(m->compat_props, hw_compat_8_0, hw_compat_8_0_len);
compat_props_add(m->compat_props, pc_compat_8_0, pc_compat_8_0_len);

Expand Down
14 changes: 12 additions & 2 deletions hw/i386/pc_q35.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,12 +379,23 @@ static void pc_q35_machine_options(MachineClass *m)
machine_class_allow_dynamic_sysbus_dev(m, TYPE_VMBUS_BRIDGE);
}

static void pc_q35_8_1_machine_options(MachineClass *m)
static void pc_q35_8_2_machine_options(MachineClass *m)
{
pc_q35_machine_options(m);
m->alias = "q35";
}

DEFINE_Q35_MACHINE(v8_2, "pc-q35-8.2", NULL,
pc_q35_8_2_machine_options);

static void pc_q35_8_1_machine_options(MachineClass *m)
{
pc_q35_8_2_machine_options(m);
m->alias = NULL;
compat_props_add(m->compat_props, hw_compat_8_1, hw_compat_8_1_len);
compat_props_add(m->compat_props, pc_compat_8_1, pc_compat_8_1_len);
}

DEFINE_Q35_MACHINE(v8_1, "pc-q35-8.1", NULL,
pc_q35_8_1_machine_options);

Expand All @@ -393,7 +404,6 @@ static void pc_q35_8_0_machine_options(MachineClass *m)
PCMachineClass *pcmc = PC_MACHINE_CLASS(m);

pc_q35_8_1_machine_options(m);
m->alias = NULL;
compat_props_add(m->compat_props, hw_compat_8_0, hw_compat_8_0_len);
compat_props_add(m->compat_props, pc_compat_8_0, pc_compat_8_0_len);

Expand Down
9 changes: 8 additions & 1 deletion hw/m68k/virt.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,10 +347,17 @@ type_init(virt_machine_register_types)
} \
type_init(machvirt_machine_##major##_##minor##_init);

static void virt_machine_8_2_options(MachineClass *mc)
{
}
DEFINE_VIRT_MACHINE(8, 2, true)

static void virt_machine_8_1_options(MachineClass *mc)
{
virt_machine_8_2_options(mc);
compat_props_add(mc->compat_props, hw_compat_8_1, hw_compat_8_1_len);
}
DEFINE_VIRT_MACHINE(8, 1, true)
DEFINE_VIRT_MACHINE(8, 1, false)

static void virt_machine_8_0_options(MachineClass *mc)
{
Expand Down
15 changes: 13 additions & 2 deletions hw/ppc/spapr.c
Original file line number Diff line number Diff line change
Expand Up @@ -4752,15 +4752,26 @@ static void spapr_machine_latest_class_options(MachineClass *mc)
} \
type_init(spapr_machine_register_##suffix)

/*
* pseries-8.2
*/
static void spapr_machine_8_2_class_options(MachineClass *mc)
{
/* Defaults for the latest behaviour inherited from the base class */
}

DEFINE_SPAPR_MACHINE(8_2, "8.2", true);

/*
* pseries-8.1
*/
static void spapr_machine_8_1_class_options(MachineClass *mc)
{
/* Defaults for the latest behaviour inherited from the base class */
spapr_machine_8_2_class_options(mc);
compat_props_add(mc->compat_props, hw_compat_8_1, hw_compat_8_1_len);
}

DEFINE_SPAPR_MACHINE(8_1, "8.1", true);
DEFINE_SPAPR_MACHINE(8_1, "8.1", false);

/*
* pseries-8.0
Expand Down
25 changes: 8 additions & 17 deletions hw/s390x/s390-pci-bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,7 @@
#include "sysemu/reset.h"
#include "sysemu/runstate.h"

#ifndef DEBUG_S390PCI_BUS
#define DEBUG_S390PCI_BUS 0
#endif

#define DPRINTF(fmt, ...) \
do { \
if (DEBUG_S390PCI_BUS) { \
fprintf(stderr, "S390pci-bus: " fmt, ## __VA_ARGS__); \
} \
} while (0)
#include "trace.h"

S390pciState *s390_get_phb(void)
{
Expand Down Expand Up @@ -132,7 +123,7 @@ void s390_pci_sclp_configure(SCCB *sccb)
uint16_t rc;

if (!pbdev) {
DPRINTF("sclp config no dev found\n");
trace_s390_pci_sclp_nodev("configure", be32_to_cpu(psccb->aid));
rc = SCLP_RC_ADAPTER_ID_NOT_RECOGNIZED;
goto out;
}
Expand Down Expand Up @@ -199,7 +190,7 @@ void s390_pci_sclp_deconfigure(SCCB *sccb)
uint16_t rc;

if (!pbdev) {
DPRINTF("sclp deconfig no dev found\n");
trace_s390_pci_sclp_nodev("deconfigure", be32_to_cpu(psccb->aid));
rc = SCLP_RC_ADAPTER_ID_NOT_RECOGNIZED;
goto out;
}
Expand Down Expand Up @@ -573,7 +564,7 @@ static IOMMUTLBEntry s390_translate_iommu(IOMMUMemoryRegion *mr, hwaddr addr,
return ret;
}

DPRINTF("iommu trans addr 0x%" PRIx64 "\n", addr);
trace_s390_pci_iommu_xlate(addr);

if (addr < iommu->pba || addr > iommu->pal) {
error = ERR_EVENT_OORANGE;
Expand Down Expand Up @@ -692,8 +683,8 @@ static void s390_msi_ctrl_write(void *opaque, hwaddr addr, uint64_t data,
uint32_t sum_bit;

assert(pbdev);
DPRINTF("write_msix data 0x%" PRIx64 " idx %d vec 0x%x\n", data,
pbdev->idx, vec);

trace_s390_pci_msi_ctrl_write(data, pbdev->idx, vec);

if (pbdev->state != ZPCI_FS_ENABLED) {
return;
Expand Down Expand Up @@ -843,7 +834,7 @@ static void s390_pcihost_realize(DeviceState *dev, Error **errp)
PCIHostState *phb = PCI_HOST_BRIDGE(dev);
S390pciState *s = S390_PCI_HOST_BRIDGE(dev);

DPRINTF("host_init\n");
trace_s390_pcihost("realize");

b = pci_register_root_bus(dev, NULL, s390_pci_set_irq, s390_pci_map_irq,
NULL, get_system_memory(), get_system_io(), 0,
Expand Down Expand Up @@ -1120,7 +1111,7 @@ static void s390_pcihost_plug(HotplugHandler *hotplug_dev, DeviceState *dev,
return;
}
} else {
DPRINTF("zPCI interpretation facilities missing.\n");
trace_s390_pcihost("zPCI interpretation missing");
pbdev->interp = false;
pbdev->forwarding_assist = false;
}
Expand Down

0 comments on commit 92e1d39

Please sign in to comment.