Commit b821cbe2 authored by Peter Maydell's avatar Peter Maydell
Browse files

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



pc, pci, tpm, virtio, vhost enhancements and fixes

A bunch of cleanups and fixes all over the place,
enhancements in TPM, virtio and vhost.

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

# gpg: Signature made Mon Jun  1 13:19:48 2015 BST using RSA key ID D28D5469
# gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>"
# gpg:                 aka "Michael S. Tsirkin <mst@redhat.com>"

* remotes/mst/tags/for_upstream: (60 commits)
  vhost-user: add multi queue support
  virtio: make features 64bit wide
  qdev: add 64bit properties
  virtio-mmio: ioeventfd support
  hw/acpi/aml-build: Fix memory leak
  acpi: add aml_while() term
  acpi: add aml_increment() term
  acpi: add aml_shiftright() term
  acpi: add aml_shiftleft() term
  acpi: add aml_index() term
  acpi: add aml_lless() term
  acpi: add aml_add() term
  TPM2 ACPI table support
  tpm: Probe for connected TPM 1.2 or TPM 2
  Extend TPM TIS interface to support TPM 2
  Add stream ID to MSI write
  acpi: Simplify printing to dynamic string
  i386: drop FDC in pc-q35-2.4+ if neither it nor floppy drives are wanted
  i386/pc_q35: don't insist on board FDC if there's no default floppy
  i386/pc: '-drive if=floppy' should imply a board-default FDC
  ...

Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
parents 9657cafc 830d70db
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -96,6 +96,20 @@ bool tpm_backend_get_tpm_established_flag(TPMBackend *s)
    return k->ops->get_tpm_established_flag(s);
}

int tpm_backend_reset_tpm_established_flag(TPMBackend *s, uint8_t locty)
{
    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);

    return k->ops->reset_tpm_established_flag(s, locty);
}

TPMVersion tpm_backend_get_tpm_version(TPMBackend *s)
{
    TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);

    return k->ops->get_tpm_version(s);
}

static bool tpm_backend_prop_get_opened(Object *obj, Error **errp)
{
    TPMBackend *s = TPM_BACKEND(obj);
+5 −0
Original line number Diff line number Diff line
@@ -127,6 +127,11 @@ in the ancillary data:
If Master is unable to send the full message or receives a wrong reply it will
close the connection. An optional reconnection mechanism can be implemented.

Multi queue support
-------------------
The protocol supports multiple queues by setting all index fields in the sent
messages to a properly calculated value.

Message types
-------------

+1 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@
#include "virtio-9p-coth.h"
#include "hw/virtio/virtio-access.h"

static uint32_t virtio_9p_get_features(VirtIODevice *vdev, uint32_t features)
static uint64_t virtio_9p_get_features(VirtIODevice *vdev, uint64_t features)
{
    virtio_add_feature(&features, VIRTIO_9P_MOUNT_TAG);
    return features;
+63 −22
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
 * with this program; if not, see <http://www.gnu.org/licenses/>.
 */

#include <glib/gprintf.h>
#include <stdio.h>
#include <stdarg.h>
#include <assert.h>
@@ -59,7 +60,6 @@ static void build_append_array(GArray *array, GArray *val)
static void
build_append_nameseg(GArray *array, const char *seg)
{
    /* It would be nicer to use g_string_vprintf but it's only there in 2.22 */
    int len;

    len = strlen(seg);
@@ -73,22 +73,12 @@ build_append_nameseg(GArray *array, const char *seg)
static void GCC_FMT_ATTR(2, 0)
build_append_namestringv(GArray *array, const char *format, va_list ap)
{
    /* It would be nicer to use g_string_vprintf but it's only there in 2.22 */
    char *s;
    int len;
    va_list va_len;
    char **segs;
    char **segs_iter;
    int seg_count = 0;

    va_copy(va_len, ap);
    len = vsnprintf(NULL, 0, format, va_len);
    va_end(va_len);
    len += 1;
    s = g_new(typeof(*s), len);

    len = vsnprintf(s, len, format, ap);

    s = g_strdup_vprintf(format, ap);
    segs = g_strsplit(s, ".", 0);
    g_free(s);

@@ -306,6 +296,7 @@ static void aml_free(gpointer data, gpointer user_data)
{
    Aml *var = data;
    build_free_array(var->buf);
    g_free(var);
}

Aml *init_aml_allocator(void)
@@ -465,6 +456,63 @@ Aml *aml_or(Aml *arg1, Aml *arg2)
    return var;
}

/* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefShiftLeft */
Aml *aml_shiftleft(Aml *arg1, Aml *count)
{
    Aml *var = aml_opcode(0x79 /* ShiftLeftOp */);
    aml_append(var, arg1);
    aml_append(var, count);
    build_append_byte(var->buf, 0x00); /* NullNameOp */
    return var;
}

/* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefShiftRight */
Aml *aml_shiftright(Aml *arg1, Aml *count)
{
    Aml *var = aml_opcode(0x7A /* ShiftRightOp */);
    aml_append(var, arg1);
    aml_append(var, count);
    build_append_byte(var->buf, 0x00); /* NullNameOp */
    return var;
}

/* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefLLess */
Aml *aml_lless(Aml *arg1, Aml *arg2)
{
    Aml *var = aml_opcode(0x95 /* LLessOp */);
    aml_append(var, arg1);
    aml_append(var, arg2);
    return var;
}

/* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefAdd */
Aml *aml_add(Aml *arg1, Aml *arg2)
{
    Aml *var = aml_opcode(0x72 /* AddOp */);
    aml_append(var, arg1);
    aml_append(var, arg2);
    build_append_byte(var->buf, 0x00 /* NullNameOp */);
    return var;
}

/* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefIncrement */
Aml *aml_increment(Aml *arg)
{
    Aml *var = aml_opcode(0x75 /* IncrementOp */);
    aml_append(var, arg);
    return var;
}

/* ACPI 1.0b: 16.2.5.4 Type 2 Opcodes Encoding: DefIndex */
Aml *aml_index(Aml *arg1, Aml *idx)
{
    Aml *var = aml_opcode(0x88 /* IndexOp */);
    aml_append(var, arg1);
    aml_append(var, idx);
    build_append_byte(var->buf, 0x00 /* NullNameOp */);
    return var;
}

/* ACPI 1.0b: 16.2.5.3 Type 1 Opcodes Encoding: DefNotify */
Aml *aml_notify(Aml *arg1, Aml *arg2)
{
@@ -753,22 +801,15 @@ Aml *aml_create_dword_field(Aml *srcbuf, Aml *index, const char *name)
Aml *aml_string(const char *name_format, ...)
{
    Aml *var = aml_opcode(0x0D /* StringPrefix */);
    va_list ap, va_len;
    va_list ap;
    char *s;
    int len;

    va_start(ap, name_format);
    va_copy(va_len, ap);
    len = vsnprintf(NULL, 0, name_format, va_len);
    va_end(va_len);
    len += 1;
    s = g_new0(typeof(*s), len);

    len = vsnprintf(s, len, name_format, ap);
    len = g_vasprintf(&s, name_format, ap);
    va_end(ap);

    g_array_append_vals(var->buf, s, len);
    build_append_byte(var->buf, 0x0); /* NullChar */
    g_array_append_vals(var->buf, s, len + 1);
    g_free(s);

    return var;
+1 −1
Original line number Diff line number Diff line
@@ -718,7 +718,7 @@ static void virtio_blk_set_config(VirtIODevice *vdev, const uint8_t *config)
    aio_context_release(blk_get_aio_context(s->blk));
}

static uint32_t virtio_blk_get_features(VirtIODevice *vdev, uint32_t features)
static uint64_t virtio_blk_get_features(VirtIODevice *vdev, uint64_t features)
{
    VirtIOBlock *s = VIRTIO_BLK(vdev);

Loading