Commit 5d0e5694 authored by Peter Maydell's avatar Peter Maydell
Browse files

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



virtio, acpi: fixes, cleanups

A bunch of minor fixes all over the place.

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

# gpg: Signature made Sun 16 Jun 2019 21:46:31 BST
# gpg:                using RSA key 281F0DB8D28D5469
# 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:
  tests/rebuild-expected-aml.sh: blow out difflist
  q35: update DSDT
  q35: fix mmconfig and PCI0._CRS
  hw/acpi: extract acpi_add_rom_blob()
  vhost: fix vhost_log size overflow during migration
  docs/vhost-user.json: some firmware.json copy leftovers
  vhost-user-gpu: initialize msghdr & iov at declaration
  vhost-user-input: check ioctl(EVIOCGNAME) return value
  vhost-user: improve error report
  vhost-user: check unix_listen() return value
  vhost-user-gpu: do not send scanout update if no GPU socket

Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
parents 53defa05 5f6b3561
Loading
Loading
Loading
Loading
+14 −15
Original line number Diff line number Diff line
@@ -138,22 +138,20 @@ static int
vg_sock_fd_write(int sock, const void *buf, ssize_t buflen, int fd)
{
    ssize_t ret;
    struct msghdr msg;
    struct iovec iov;
    struct iovec iov = {
        .iov_base = (void *)buf,
        .iov_len = buflen,
    };
    struct msghdr msg = {
        .msg_iov = &iov,
        .msg_iovlen = 1,
    };
    union {
        struct cmsghdr cmsghdr;
        char control[CMSG_SPACE(sizeof(int))];
    } cmsgu;
    struct cmsghdr *cmsg;

    iov.iov_base = (void *)buf;
    iov.iov_len = buflen;

    msg.msg_name = NULL;
    msg.msg_namelen = 0;
    msg.msg_iov = &iov;
    msg.msg_iovlen = 1;

    if (fd != -1) {
        msg.msg_control = cmsgu.control;
        msg.msg_controllen = sizeof(cmsgu.control);
@@ -164,9 +162,6 @@ vg_sock_fd_write(int sock, const void *buf, ssize_t buflen, int fd)
        cmsg->cmsg_type = SCM_RIGHTS;

        *((int *)CMSG_DATA(cmsg)) = fd;
    } else {
        msg.msg_control = NULL;
        msg.msg_controllen = 0;
    }

    do {
@@ -354,7 +349,7 @@ vg_disable_scanout(VuGpu *g, int scanout_id)
    scanout->width = 0;
    scanout->height = 0;

    {
    if (g->sock_fd >= 0) {
        VhostUserGpuMsg msg = {
            .request = VHOST_USER_GPU_SCANOUT,
            .size = sizeof(VhostUserGpuScanout),
@@ -1160,13 +1155,17 @@ main(int argc, char *argv[])

    if (opt_socket_path) {
        int lsock = unix_listen(opt_socket_path, &error_fatal);
        if (lsock < 0) {
            g_printerr("Failed to listen on %s.\n", opt_socket_path);
            exit(EXIT_FAILURE);
        }
        fd = accept(lsock, NULL, NULL);
        close(lsock);
    } else {
        fd = opt_fdnum;
    }
    if (fd == -1) {
        g_printerr("Invalid socket");
        g_printerr("Invalid vhost-user socket.\n");
        exit(EXIT_FAILURE);
    }

+10 −2
Original line number Diff line number Diff line
@@ -342,7 +342,11 @@ main(int argc, char *argv[])

    vi.config = g_array_new(false, false, sizeof(virtio_input_config));
    memset(&id, 0, sizeof(id));
    ioctl(vi.evdevfd, EVIOCGNAME(sizeof(id.u.string) - 1), id.u.string);
    if (ioctl(vi.evdevfd, EVIOCGNAME(sizeof(id.u.string) - 1),
              id.u.string) < 0) {
        g_printerr("Failed to get evdev name: %s\n", g_strerror(errno));
        exit(EXIT_FAILURE);
    }
    id.select = VIRTIO_INPUT_CFG_ID_NAME;
    id.size = strlen(id.u.string);
    g_array_append_val(vi.config, id);
@@ -367,13 +371,17 @@ main(int argc, char *argv[])

    if (opt_socket_path) {
        int lsock = unix_listen(opt_socket_path, &error_fatal);
        if (lsock < 0) {
            g_printerr("Failed to listen on %s.\n", opt_socket_path);
            exit(EXIT_FAILURE);
        }
        fd = accept(lsock, NULL, NULL);
        close(lsock);
    } else {
        fd = opt_fdnum;
    }
    if (fd == -1) {
        g_printerr("Invalid socket");
        g_printerr("Invalid vhost-user socket.\n");
        exit(EXIT_FAILURE);
    }
    vug_init(&vi.dev, fd, vi_panic, &vuiface);
+3 −3
Original line number Diff line number Diff line
@@ -178,11 +178,11 @@
#
#   - /usr/share/qemu/vhost-user/50-crosvm-gpu.json
#
# then the sysadmin can prevent the default QEMU being used at all with
# then the sysadmin can prevent the default QEMU GPU being used at all with
#
#   $ touch /etc/qemu/vhost-user/50-qemu-gpu.json
#
# The sysadmin can replace/alter the distro default OVMF with
# The sysadmin can replace/alter the distro default QEMU GPU with
#
#   $ vim /etc/qemu/vhost-user/50-qemu-gpu.json
#
@@ -190,7 +190,7 @@
#
#   $ vim /etc/qemu/vhost-user/10-qemu-gpu.json
#
# or they can provide a parallel OVMF with lower priority
# or they can provide a parallel QEMU GPU with lower priority
#
#   $ vim /etc/qemu/vhost-user/99-qemu-gpu.json
#
+1 −1
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ common-obj-$(call lnot,$(CONFIG_ACPI_X86)) += acpi-stub.o

common-obj-y += acpi_interface.o
common-obj-y += bios-linker-loader.o
common-obj-y += aml-build.o
common-obj-y += aml-build.o utils.o
common-obj-$(CONFIG_ACPI_PCI) += pci.o
common-obj-$(CONFIG_TPM) += tpm.o

hw/acpi/utils.c

0 → 100644
+35 −0
Original line number Diff line number Diff line
/*
 * Utilities for generating ACPI tables and passing them to Guests
 *
 * Copyright (C) 2019 Intel Corporation
 * Copyright (C) 2019 Red Hat Inc
 *
 * Author: Wei Yang <richardw.yang@linux.intel.com>
 * Author: Michael S. Tsirkin <mst@redhat.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.

 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License along
 * with this program; if not, see <http://www.gnu.org/licenses/>.
 */

#include "qemu/osdep.h"
#include "hw/acpi/aml-build.h"
#include "hw/acpi/utils.h"
#include "hw/loader.h"

MemoryRegion *acpi_add_rom_blob(FWCfgCallback update, void *opaque,
                                GArray *blob, const char *name,
                                uint64_t max_size)
{
    return rom_add_blob(name, blob->data, acpi_data_len(blob), max_size, -1,
                        name, update, opaque, NULL, true);
}
Loading