Commit 82915fae authored by Peter Maydell's avatar Peter Maydell
Browse files

Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging



virtio, pci, pc: bugfixes, checkpatch, maintainers

Bugfixes all over the place.
Add a new balloon maintainer.
A checkpatch enhancement to enforce ACPI change rules.

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

# gpg: Signature made Tue 31 Mar 2020 15:54:36 BST
# 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

* remotes/mst/tags/for_upstream:
  vhost-vsock: fix double close() in the realize() error path
  acpi: add acpi=OnOffAuto machine property to x86 and arm virt
  fix vhost_user_blk_watch crash
  hw/i386/amd_iommu.c: Fix corruption of log events passed to guest
  virtio-iommu: avoid memleak in the unrealize
  virtio-blk: delete vqs on the error path in realize()
  acpi: pcihp: fix left shift undefined behavior in acpi_pcihp_eject_slot()
  virtio-serial-bus: Plug memory leak on realize() error paths
  MAINTAINERS: Add myself as virtio-balloon co-maintainer
  checkpatch: enforce process for expected files

Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
parents 17083d6d e82cdba3
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -1634,6 +1634,15 @@ F: hw/virtio/trace-events
F: net/vhost-user.c
F: include/hw/virtio/

virtio-balloon
M: Michael S. Tsirkin <mst@redhat.com>
M: David Hildenbrand <david@redhat.com>
S: Maintained
F: hw/virtio/virtio-balloon*.c
F: include/hw/virtio/virtio-balloon.h
F: balloon.c
F: include/sysemu/balloon.h

virtio-9p
M: Greg Kurz <groug@kaod.org>
R: Christian Schoenebeck <qemu_oss@crudebyte.com>
+1 −1
Original line number Diff line number Diff line
@@ -154,7 +154,7 @@ static void acpi_pcihp_eject_slot(AcpiPciHpState *s, unsigned bsel, unsigned slo

    trace_acpi_pci_eject_slot(bsel, slot);

    if (!bus) {
    if (!bus || slot > 31) {
        return;
    }

+1 −1
Original line number Diff line number Diff line
@@ -910,7 +910,7 @@ void virt_acpi_setup(VirtMachineState *vms)
        return;
    }

    if (!acpi_enabled) {
    if (!virt_is_acpi_enabled(vms)) {
        trace_virt_acpi_setup();
        return;
    }
+34 −2
Original line number Diff line number Diff line
@@ -67,6 +67,7 @@
#include "kvm_arm.h"
#include "hw/firmware/smbios.h"
#include "qapi/visitor.h"
#include "qapi/qapi-visit-common.h"
#include "standard-headers/linux/input.h"
#include "hw/arm/smmuv3.h"
#include "hw/acpi/acpi.h"
@@ -1844,7 +1845,7 @@ static void machvirt_init(MachineState *machine)

    create_pcie(vms);

    if (has_ged && aarch64 && firmware_loaded && acpi_enabled) {
    if (has_ged && aarch64 && firmware_loaded && virt_is_acpi_enabled(vms)) {
        vms->acpi_dev = create_acpi_ged(vms);
    } else {
        create_gpio(vms);
@@ -1934,6 +1935,31 @@ static void virt_set_its(Object *obj, bool value, Error **errp)
    vms->its = value;
}

bool virt_is_acpi_enabled(VirtMachineState *vms)
{
    if (vms->acpi == ON_OFF_AUTO_OFF) {
        return false;
    }
    return true;
}

static void virt_get_acpi(Object *obj, Visitor *v, const char *name,
                          void *opaque, Error **errp)
{
    VirtMachineState *vms = VIRT_MACHINE(obj);
    OnOffAuto acpi = vms->acpi;

    visit_type_OnOffAuto(v, name, &acpi, errp);
}

static void virt_set_acpi(Object *obj, Visitor *v, const char *name,
                          void *opaque, Error **errp)
{
    VirtMachineState *vms = VIRT_MACHINE(obj);

    visit_type_OnOffAuto(v, name, &vms->acpi, errp);
}

static char *virt_get_gic_version(Object *obj, Error **errp)
{
    VirtMachineState *vms = VIRT_MACHINE(obj);
@@ -2113,7 +2139,7 @@ static HotplugHandler *virt_machine_get_hotplug_handler(MachineState *machine,
    if (object_dynamic_cast(OBJECT(dev), TYPE_VIRTIO_IOMMU_PCI)) {
        VirtMachineState *vms = VIRT_MACHINE(machine);

        if (!vms->bootinfo.firmware_loaded || !acpi_enabled) {
        if (!vms->bootinfo.firmware_loaded || !virt_is_acpi_enabled(vms)) {
            return HOTPLUG_HANDLER(machine);
        }
    }
@@ -2184,6 +2210,12 @@ static void virt_machine_class_init(ObjectClass *oc, void *data)
    mc->numa_mem_supported = true;
    mc->auto_enable_numa_with_memhp = true;
    mc->default_ram_id = "mach-virt.ram";

    object_class_property_add(oc, "acpi", "OnOffAuto",
        virt_get_acpi, virt_set_acpi,
        NULL, NULL, &error_abort);
    object_class_property_set_description(oc, "acpi",
        "Enable ACPI", &error_abort);
}

static void virt_instance_init(Object *obj)
+0 −19
Original line number Diff line number Diff line
@@ -349,18 +349,6 @@ static void vhost_user_blk_disconnect(DeviceState *dev)
    vhost_dev_cleanup(&s->dev);
}

static gboolean vhost_user_blk_watch(GIOChannel *chan, GIOCondition cond,
                                     void *opaque)
{
    DeviceState *dev = opaque;
    VirtIODevice *vdev = VIRTIO_DEVICE(dev);
    VHostUserBlk *s = VHOST_USER_BLK(vdev);

    qemu_chr_fe_disconnect(&s->chardev);

    return true;
}

static void vhost_user_blk_event(void *opaque, QEMUChrEvent event)
{
    DeviceState *dev = opaque;
@@ -373,15 +361,9 @@ static void vhost_user_blk_event(void *opaque, QEMUChrEvent event)
            qemu_chr_fe_disconnect(&s->chardev);
            return;
        }
        s->watch = qemu_chr_fe_add_watch(&s->chardev, G_IO_HUP,
                                         vhost_user_blk_watch, dev);
        break;
    case CHR_EVENT_CLOSED:
        vhost_user_blk_disconnect(dev);
        if (s->watch) {
            g_source_remove(s->watch);
            s->watch = 0;
        }
        break;
    case CHR_EVENT_BREAK:
    case CHR_EVENT_MUX_IN:
@@ -428,7 +410,6 @@ 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);
    s->watch = 0;
    s->connected = false;

    qemu_chr_fe_set_handlers(&s->chardev,  NULL, NULL, vhost_user_blk_event,
Loading