Skip to content

Commit

Permalink
Merge tag 'for_upstream' of https://git.kernel.org/pub/scm/virt/kvm/m…
Browse files Browse the repository at this point in the history
…st/qemu into staging

virtio,pc,pci: features, cleanups

infrastructure for vhost-vdpa shadow work
piix south bridge rework
reconnect for vhost-user-scsi
dummy ACPI QTG DSM for cxl

tests, cleanups, fixes all over the place

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

# -----BEGIN PGP SIGNATURE-----
#
# iQFDBAABCAAtFiEEXQn9CHHI+FuUyooNKB8NuNKNVGkFAmUxc1IPHG1zdEByZWRo
# YXQuY29tAAoJECgfDbjSjVRpzWIIALmlIbyPg6QxvijWn3ldkeDzePMweGSL28Bs
# PeKqd+kZjGAEu0wE9rmF/c6q1pyX2G0TiwOwC4tbb60s8ocLI71d1gu4wVirW33j
# H087hnu3lrBggDvctVJOPGzmD1lzVlkWMLgaKrrBSfpoQc6lhqB9RfiLUrm+NxMG
# gBU/b87EfyKGwTI7SQRVTIAdKDYmcjkyiFIRJ19XTnET/BsqFT7f3YW1T3gUaYQD
# WvaazBlC2+JeZZz/wtGn0tkpE/oflAvEiMnxJ8P6XswldGqPk58wGeyvUVwLbHBQ
# TXWC22AmchlcsUfajg/lajCARtW46HXU5q5R9Ib1Ls3MQdliA6U=
# =NV0t
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 19 Oct 2023 11:20:02 PDT
# gpg:                using RSA key 5D09FD0871C8F85B94CA8A0D281F0DB8D28D5469
# gpg:                issuer "mst@redhat.com"
# gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" [full]
# gpg:                 aka "Michael S. Tsirkin <mst@redhat.com>" [full]
# Primary key fingerprint: 0270 606B 6F3C DF3D 0B17  0970 C350 3912 AFBE 8E67
#      Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA  8A0D 281F 0DB8 D28D 5469

* tag 'for_upstream' of https://git.kernel.org/pub/scm/virt/kvm/mst/qemu: (78 commits)
  intel-iommu: Report interrupt remapping faults, fix return value
  MAINTAINERS: Add include/hw/intc/i8259.h to the PC chip section
  vhost-user: Fix protocol feature bit conflict
  tests/acpi: Update DSDT.cxl with QTG DSM
  hw/cxl: Add QTG _DSM support for ACPI0017 device
  tests/acpi: Allow update of DSDT.cxl
  hw/i386/cxl: ensure maxram is greater than ram size for calculating cxl range
  vhost-user: fix lost reconnect
  vhost-user-scsi: start vhost when guest kicks
  vhost-user-scsi: support reconnect to backend
  vhost: move and rename the conn retry times
  vhost-user-common: send get_inflight_fd once
  hw/i386/pc_piix: Make PIIX4 south bridge usable in PC machine
  hw/isa/piix: Implement multi-process QEMU support also for PIIX4
  hw/isa/piix: Resolve duplicate code regarding PCI interrupt wiring
  hw/isa/piix: Reuse PIIX3's PCI interrupt triggering in PIIX4
  hw/isa/piix: Rename functions to be shared for PCI interrupt triggering
  hw/isa/piix: Reuse PIIX3 base class' realize method in PIIX4
  hw/isa/piix: Share PIIX3's base class with PIIX4
  hw/isa/piix: Harmonize names of reset control memory regions
  ...

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
  • Loading branch information
stefanhaRH committed Oct 20, 2023
2 parents fc00b60 + 16ef005 commit ae56ad4
Show file tree
Hide file tree
Showing 59 changed files with 1,383 additions and 849 deletions.
7 changes: 4 additions & 3 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -1302,7 +1302,7 @@ Malta
M: Philippe Mathieu-Daudé <philmd@linaro.org>
R: Aurelien Jarno <aurelien@aurel32.net>
S: Odd Fixes
F: hw/isa/piix4.c
F: hw/isa/piix.c
F: hw/acpi/piix4.c
F: hw/mips/malta.c
F: hw/pci-host/gt64120.c
Expand Down Expand Up @@ -1724,7 +1724,7 @@ F: hw/pci-host/pam.c
F: include/hw/pci-host/i440fx.h
F: include/hw/pci-host/q35.h
F: include/hw/pci-host/pam.h
F: hw/isa/piix3.c
F: hw/isa/piix.c
F: hw/isa/lpc_ich9.c
F: hw/i2c/smbus_ich9.c
F: hw/acpi/piix4.c
Expand Down Expand Up @@ -1764,6 +1764,7 @@ F: include/hw/dma/i8257.h
F: include/hw/i2c/pm_smbus.h
F: include/hw/input/i8042.h
F: include/hw/intc/ioapic*
F: include/hw/intc/i8259.h
F: include/hw/isa/i8259_internal.h
F: include/hw/isa/superio.h
F: include/hw/timer/hpet.h
Expand Down Expand Up @@ -2478,7 +2479,7 @@ PIIX4 South Bridge (i82371AB)
M: Hervé Poussineau <hpoussin@reactos.org>
M: Philippe Mathieu-Daudé <philmd@linaro.org>
S: Maintained
F: hw/isa/piix4.c
F: hw/isa/piix.c
F: include/hw/southbridge/piix.h

Firmware configuration (fw_cfg)
Expand Down
11 changes: 11 additions & 0 deletions docs/interop/vhost-user.rst
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,16 @@ Inflight description

:queue size: a 16-bit size of virtqueues

VhostUserShared
^^^^^^^^^^^^^^^

+------+
| UUID |
+------+

:UUID: 16 bytes UUID, whose first three components (a 32-bit value, then
two 16-bit values) are stored in big endian.

C structure
-----------

Expand Down Expand Up @@ -885,6 +895,7 @@ Protocol features
#define VHOST_USER_PROTOCOL_F_CONFIGURE_MEM_SLOTS 15
#define VHOST_USER_PROTOCOL_F_STATUS 16
#define VHOST_USER_PROTOCOL_F_XEN_MMAP 17
#define VHOST_USER_PROTOCOL_F_SHARED_OBJECT 18
Front-end message types
-----------------------
Expand Down
8 changes: 8 additions & 0 deletions docs/system/target-i386-desc.rst.inc
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,11 @@ machine property, i.e.
|qemu_system_x86| some.img \
-audiodev <backend>,id=<name> \
-machine pcspk-audiodev=<name>

Machine-specific options
~~~~~~~~~~~~~~~~~~~~~~~~

It supports the following machine-specific options:

- ``x-south-bridge=PIIX3|piix4-isa`` (Experimental option to select a particular
south bridge. Default: ``PIIX3``)
69 changes: 69 additions & 0 deletions hw/acpi/cxl.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,75 @@
#include "qapi/error.h"
#include "qemu/uuid.h"

void build_cxl_dsm_method(Aml *dev)
{
Aml *method, *ifctx, *ifctx2;

method = aml_method("_DSM", 4, AML_SERIALIZED);
{
Aml *function, *uuid;

uuid = aml_arg(0);
function = aml_arg(2);
/* CXL spec v3.0 9.17.3.1 _DSM Function for Retrieving QTG ID */
ifctx = aml_if(aml_equal(
uuid, aml_touuid("F365F9A6-A7DE-4071-A66A-B40C0B4F8E52")));

/* Function 0, standard DSM query function */
ifctx2 = aml_if(aml_equal(function, aml_int(0)));
{
uint8_t byte_list[1] = { 0x01 }; /* function 1 only */

aml_append(ifctx2,
aml_return(aml_buffer(sizeof(byte_list), byte_list)));
}
aml_append(ifctx, ifctx2);

/*
* Function 1
* Creating a package with static values. The max supported QTG ID will
* be 1 and recommended QTG IDs are 0 and then 1.
* The values here are statically created to simplify emulation. Values
* from a real BIOS would be determined by the performance of all the
* present CXL memory and then assigned.
*/
ifctx2 = aml_if(aml_equal(function, aml_int(1)));
{
Aml *pak, *pak1;

/*
* Return: A package containing two elements - a WORD that returns
* the maximum throttling group that the platform supports, and a
* package containing the QTG ID(s) that the platform recommends.
* Package {
* Max Supported QTG ID
* Package {QTG Recommendations}
* }
*
* While the SPEC specified WORD that hints at the value being
* 16bit, the ACPI dump of BIOS DSDT table showed that the values
* are integers with no specific size specification. aml_int() will
* be used for the values.
*/
pak1 = aml_package(2);
/* Set QTG ID of 0 */
aml_append(pak1, aml_int(0));
/* Set QTG ID of 1 */
aml_append(pak1, aml_int(1));

pak = aml_package(2);
/* Set Max QTG 1 */
aml_append(pak, aml_int(1));
aml_append(pak, pak1);

aml_append(ifctx2, aml_return(pak));
}
aml_append(ifctx, ifctx2);
}
aml_append(method, ifctx);
aml_append(dev, method);
}

static void cedt_build_chbs(GArray *table_data, PXBCXLDev *cxl)
{
PXBDev *pxb = PXB_DEV(cxl);
Expand Down
6 changes: 2 additions & 4 deletions hw/block/vhost-user-blk.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
#include "sysemu/sysemu.h"
#include "sysemu/runstate.h"

#define REALIZE_CONNECTION_RETRIES 3

static const int user_feature_bits[] = {
VIRTIO_BLK_F_SIZE_MAX,
VIRTIO_BLK_F_SEG_MAX,
Expand Down Expand Up @@ -393,7 +391,7 @@ static void vhost_user_blk_event(void *opaque, QEMUChrEvent event)
case CHR_EVENT_CLOSED:
/* defer close until later to avoid circular close */
vhost_user_async_close(dev, &s->chardev, &s->dev,
vhost_user_blk_disconnect);
vhost_user_blk_disconnect, vhost_user_blk_event);
break;
case CHR_EVENT_BREAK:
case CHR_EVENT_MUX_IN:
Expand Down Expand Up @@ -482,7 +480,7 @@ static void vhost_user_blk_device_realize(DeviceState *dev, Error **errp)
s->inflight = g_new0(struct vhost_inflight, 1);
s->vhost_vqs = g_new0(struct vhost_virtqueue, s->num_queues);

retries = REALIZE_CONNECTION_RETRIES;
retries = VU_REALIZE_CONN_RETRIES;
assert(!*errp);
do {
if (*errp) {
Expand Down
12 changes: 10 additions & 2 deletions hw/display/virtio-dmabuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ static int uuid_equal_func(const void *lhv, const void *rhv)

static bool virtio_add_resource(QemuUUID *uuid, VirtioSharedObject *value)
{
bool result = false;
bool result = true;

g_mutex_lock(&lock);
if (resource_uuids == NULL) {
Expand All @@ -39,7 +39,9 @@ static bool virtio_add_resource(QemuUUID *uuid, VirtioSharedObject *value)
g_free);
}
if (g_hash_table_lookup(resource_uuids, uuid) == NULL) {
result = g_hash_table_insert(resource_uuids, uuid, value);
g_hash_table_insert(resource_uuids, uuid, value);
} else {
result = false;
}
g_mutex_unlock(&lock);

Expand All @@ -57,6 +59,9 @@ bool virtio_add_dmabuf(QemuUUID *uuid, int udmabuf_fd)
vso->type = TYPE_DMABUF;
vso->value = GINT_TO_POINTER(udmabuf_fd);
result = virtio_add_resource(uuid, vso);
if (!result) {
g_free(vso);
}

return result;
}
Expand All @@ -72,6 +77,9 @@ bool virtio_add_vhost_device(QemuUUID *uuid, struct vhost_dev *dev)
vso->type = TYPE_VHOST_DEV;
vso->value = dev;
result = virtio_add_resource(uuid, vso);
if (!result) {
g_free(vso);
}

return result;
}
Expand Down
3 changes: 1 addition & 2 deletions hw/i386/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ config I440FX
select PC_PCI
select PC_ACPI
select PCI_I440FX
select PIIX3
select IDE_PIIX
select PIIX
select DIMM
select SMBIOS
select FW_CFG_DMA
Expand Down
6 changes: 1 addition & 5 deletions hw/i386/acpi-build.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@

/* Supported chipsets: */
#include "hw/southbridge/ich9.h"
#include "hw/southbridge/piix.h"
#include "hw/acpi/pcihp.h"
#include "hw/i386/fw_cfg.h"
#include "hw/i386/pc.h"
Expand Down Expand Up @@ -242,10 +241,6 @@ static void acpi_get_pm_info(MachineState *machine, AcpiPmInfo *pm)
pm->pcihp_io_len =
object_property_get_uint(obj, ACPI_PCIHP_IO_LEN_PROP, NULL);

/* The above need not be conditional on machine type because the reset port
* happens to be the same on PIIX (pc) and ICH9 (q35). */
QEMU_BUILD_BUG_ON(ICH9_RST_CNT_IOPORT != PIIX_RCR_IOPORT);

/* Fill in optional s3/s4 related properties */
o = object_property_get_qobject(obj, ACPI_PM_PROP_S3_DISABLED, NULL);
if (o) {
Expand Down Expand Up @@ -1422,6 +1417,7 @@ static void build_acpi0017(Aml *table)
method = aml_method("_STA", 0, AML_NOTSERIALIZED);
aml_append(method, aml_return(aml_int(0x01)));
aml_append(dev, method);
build_cxl_dsm_method(dev);

aml_append(scope, dev);
aml_append(table, scope);
Expand Down

0 comments on commit ae56ad4

Please sign in to comment.