All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 00/28] pc, virtio enhancements
@ 2015-05-11 12:46 Michael S. Tsirkin
  2015-05-11 12:46 ` [Qemu-devel] [PULL 01/28] acpi-build: close } in comment Michael S. Tsirkin
                   ` (28 more replies)
  0 siblings, 29 replies; 32+ messages in thread
From: Michael S. Tsirkin @ 2015-05-11 12:46 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell

The following changes since commit 0d81cdddaa40a1988b24657aeac19959cfad0fde:

  Merge remote-tracking branch 'remotes/qmp-unstable/tags/for-upstream' into staging (2015-04-27 17:28:41 +0100)

are available in the git repository at:

  git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream

for you to fetch changes up to bc1f7c4c915a7c727741c4d27a2795e1039eacd3:

  acpi: update expected files for memory unplug (2015-05-11 09:21:37 +0200)

----------------------------------------------------------------
pc, virtio enhancements

Memory hot-unplug support for pc, MSI-X
mapping update speedup for virtio-pci,
misc refactorings and bugfixes.

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

----------------------------------------------------------------
Gal Hammer (1):
      acpi: add a missing backslash to the \_SB scope.

Jason Wang (10):
      virtio-net: fix the upper bound when trying to delete queues
      pc: add 2.4 machine types
      spapr: add machine type specific instance init function
      ppc: spapr: add 2.4 machine type
      monitor: replace the magic number 255 with MAX_QUEUE_NUM
      monitor: check return value of qemu_find_net_clients_except()
      virtio-ccw: using VIRTIO_NO_VECTOR instead of 0 for invalid virtqueue
      virtio: introduce vector to virtqueues mapping
      virtio-pci: speedup MSI-X masking and unmasking
      pci: remove hard-coded bar size in msix_init_exclusive_bar()

Luke Gorrie (1):
      vhost-user: Send VHOST_RESET_OWNER on vhost stop

Michael S. Tsirkin (3):
      acpi-build: close } in comment
      virtio: coding style tweak
      acpi: update expected files for memory unplug

Shannon Zhao (4):
      hw/i386: Move ACPI header definitions in an arch-independent location
      hw/i386/acpi-build: move generic acpi building helpers into dedictated file
      virtio-net: Move DEFINE_VIRTIO_NET_FEATURES to virtio-net
      virtio-scsi: Move DEFINE_VIRTIO_SCSI_FEATURES to virtio-scsi

Tang Chen (3):
      acpi, mem-hotplug: add acpi_memory_slot_status() to get MemStatus
      acpi, mem-hotplug: add unplug request cb for memory device
      acpi, mem-hotplug: add unplug cb for memory device

Thomas Huth (1):
      pci: Merge pci_nic_init() into pci_nic_init_nofail()

Zhu Guihua (5):
      docs: update documentation for memory hot unplug
      acpi: extend aml_field() to support UpdateRule
      acpi: fix "Memory device control fields" register
      acpi: add hardware implementation for memory hot unplug
      qmp-event: add event notification for memory hot unplug error

 qapi/event.json                          |  14 ++++
 {hw/i386 => include/hw/acpi}/acpi-defs.h |   0
 include/hw/acpi/aml-build.h              |  41 +++++++++++-
 include/hw/acpi/memory_hotplug.h         |  12 ++++
 include/hw/acpi/pc-hotplug.h             |   3 +
 include/hw/qdev-core.h                   |   1 +
 include/hw/virtio/virtio-bus.h           |   1 +
 include/hw/virtio/virtio-net.h           |   2 +-
 include/hw/virtio/virtio-scsi.h          |   1 +
 include/hw/virtio/virtio.h               |   3 +
 hw/acpi/aml-build.c                      |  62 +++++++++++++++++-
 hw/acpi/ich9.c                           |  19 ++++--
 hw/acpi/memory_hotplug.c                 |  96 +++++++++++++++++++++++++--
 hw/acpi/piix4.c                          |  17 ++++-
 hw/core/qdev.c                           |   2 +-
 hw/i386/acpi-build.c                     | 108 +++++++------------------------
 hw/i386/pc.c                             |  62 ++++++++++++++++--
 hw/i386/pc_piix.c                        |  29 +++++++--
 hw/i386/pc_q35.c                         |  26 +++++++-
 hw/net/vhost_net.c                       |   7 ++
 hw/net/virtio-net.c                      |   9 ++-
 hw/pci/msix.c                            |  30 +++++----
 hw/pci/pci.c                             |  43 ++++--------
 hw/ppc/spapr.c                           |  54 +++++++++++++++-
 hw/s390x/s390-virtio-bus.c               |   3 -
 hw/s390x/virtio-ccw.c                    |   5 +-
 hw/scsi/virtio-scsi.c                    |   5 ++
 hw/virtio/virtio-pci.c                   |  51 ++++++++-------
 hw/virtio/virtio.c                       |  36 ++++++++++-
 monitor.c                                |  25 +++----
 tests/bios-tables-test.c                 |   2 +-
 docs/memory-hotplug.txt                  |  23 ++++++-
 docs/qmp/qmp-events.txt                  |  17 +++++
 docs/specs/acpi_mem_hotplug.txt          |  58 +++++++++++++++--
 hw/i386/acpi-dsdt-mem-hotplug.dsl        |  13 +++-
 tests/acpi-test-data/pc/DSDT             | Bin 2970 -> 3028 bytes
 tests/acpi-test-data/pc/SSDT             | Bin 2475 -> 2486 bytes
 tests/acpi-test-data/pc/SSDT.bridge      | Bin 4334 -> 4345 bytes
 tests/acpi-test-data/q35/DSDT            | Bin 7608 -> 7666 bytes
 tests/acpi-test-data/q35/SSDT            | Bin 680 -> 691 bytes
 tests/acpi-test-data/q35/SSDT.bridge     | Bin 697 -> 708 bytes
 trace-events                             |   4 ++
 42 files changed, 673 insertions(+), 211 deletions(-)
 rename {hw/i386 => include/hw/acpi}/acpi-defs.h (100%)

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [Qemu-devel] [PULL 01/28] acpi-build: close } in comment
  2015-05-11 12:46 [Qemu-devel] [PULL 00/28] pc, virtio enhancements Michael S. Tsirkin
@ 2015-05-11 12:46 ` Michael S. Tsirkin
  2015-05-11 12:47 ` [Qemu-devel] [PULL 02/28] hw/i386: Move ACPI header definitions in an arch-independent location Michael S. Tsirkin
                   ` (27 subsequent siblings)
  28 siblings, 0 replies; 32+ messages in thread
From: Michael S. Tsirkin @ 2015-05-11 12:46 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Richard Henderson, Paolo Bonzini

missing } confuses editors

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/i386/acpi-build.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index e761005..1cfe265 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -976,7 +976,7 @@ build_ssdt(GArray *table_data, GArray *linker,
         }
 
         /* build Method(MEMORY_SLOT_NOTIFY_METHOD, 2) {
-         *     If (LEqual(Arg0, 0x00)) {Notify(MP00, Arg1)} ...
+         *     If (LEqual(Arg0, 0x00)) {Notify(MP00, Arg1)} ... }
          */
         method = aml_method(stringify(MEMORY_SLOT_NOTIFY_METHOD), 2);
         for (i = 0; i < nr_mem; i++) {
-- 
MST

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Qemu-devel] [PULL 02/28] hw/i386: Move ACPI header definitions in an arch-independent location
  2015-05-11 12:46 [Qemu-devel] [PULL 00/28] pc, virtio enhancements Michael S. Tsirkin
  2015-05-11 12:46 ` [Qemu-devel] [PULL 01/28] acpi-build: close } in comment Michael S. Tsirkin
@ 2015-05-11 12:47 ` Michael S. Tsirkin
  2015-05-11 12:47 ` [Qemu-devel] [PULL 03/28] hw/i386/acpi-build: move generic acpi building helpers into dedictated file Michael S. Tsirkin
                   ` (26 subsequent siblings)
  28 siblings, 0 replies; 32+ messages in thread
From: Michael S. Tsirkin @ 2015-05-11 12:47 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Alvise Rigo, Shannon Zhao, Shannon Zhao,
	Paolo Bonzini, Richard Henderson

From: Shannon Zhao <shannon.zhao@linaro.org>

The ACPI related header file acpi-defs.h, includes definitions that
apply on other architectures as well. Move it in `include/hw/acpi/`
to sanely include it from other architectures.

Signed-off-by: Alvise Rigo <a.rigo@virtualopensystems.com>
Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com>
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 {hw/i386 => include/hw/acpi}/acpi-defs.h | 0
 hw/i386/acpi-build.c                     | 2 +-
 tests/bios-tables-test.c                 | 2 +-
 3 files changed, 2 insertions(+), 2 deletions(-)
 rename {hw/i386 => include/hw/acpi}/acpi-defs.h (100%)

diff --git a/hw/i386/acpi-defs.h b/include/hw/acpi/acpi-defs.h
similarity index 100%
rename from hw/i386/acpi-defs.h
rename to include/hw/acpi/acpi-defs.h
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 1cfe265..c6c0b72 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -33,7 +33,7 @@
 #include "hw/i386/pc.h"
 #include "target-i386/cpu.h"
 #include "hw/timer/hpet.h"
-#include "hw/i386/acpi-defs.h"
+#include "hw/acpi/acpi-defs.h"
 #include "hw/acpi/acpi.h"
 #include "hw/nvram/fw_cfg.h"
 #include "hw/acpi/bios-linker-loader.h"
diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c
index 735ac61..7e85dc4 100644
--- a/tests/bios-tables-test.c
+++ b/tests/bios-tables-test.c
@@ -17,7 +17,7 @@
 #include "qemu-common.h"
 #include "libqtest.h"
 #include "qemu/compiler.h"
-#include "hw/i386/acpi-defs.h"
+#include "hw/acpi/acpi-defs.h"
 #include "hw/i386/smbios.h"
 #include "qemu/bitmap.h"
 
-- 
MST

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Qemu-devel] [PULL 03/28] hw/i386/acpi-build: move generic acpi building helpers into dedictated file
  2015-05-11 12:46 [Qemu-devel] [PULL 00/28] pc, virtio enhancements Michael S. Tsirkin
  2015-05-11 12:46 ` [Qemu-devel] [PULL 01/28] acpi-build: close } in comment Michael S. Tsirkin
  2015-05-11 12:47 ` [Qemu-devel] [PULL 02/28] hw/i386: Move ACPI header definitions in an arch-independent location Michael S. Tsirkin
@ 2015-05-11 12:47 ` Michael S. Tsirkin
  2015-05-11 12:47 ` [Qemu-devel] [PULL 04/28] vhost-user: Send VHOST_RESET_OWNER on vhost stop Michael S. Tsirkin
                   ` (25 subsequent siblings)
  28 siblings, 0 replies; 32+ messages in thread
From: Michael S. Tsirkin @ 2015-05-11 12:47 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Richard Henderson, Paolo Bonzini, Shannon Zhao,
	Shannon Zhao

From: Shannon Zhao <shannon.zhao@linaro.org>

Move generic acpi building helpers into dedictated file and this
can be shared with other machines.

Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com>
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 include/hw/acpi/aml-build.h | 29 +++++++++++++++++
 hw/acpi/aml-build.c         | 58 ++++++++++++++++++++++++++++++++++
 hw/i386/acpi-build.c        | 77 ---------------------------------------------
 3 files changed, 87 insertions(+), 77 deletions(-)

diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h
index 17d3beb..1705001 100644
--- a/include/hw/acpi/aml-build.h
+++ b/include/hw/acpi/aml-build.h
@@ -4,6 +4,18 @@
 #include <stdint.h>
 #include <glib.h>
 #include "qemu/compiler.h"
+#include "hw/acpi/acpi-defs.h"
+
+/* Reserve RAM space for tables: add another order of magnitude. */
+#define ACPI_BUILD_TABLE_MAX_SIZE         0x200000
+
+#define ACPI_BUILD_APPNAME  "Bochs"
+#define ACPI_BUILD_APPNAME6 "BOCHS "
+#define ACPI_BUILD_APPNAME4 "BXPC"
+
+#define ACPI_BUILD_TABLE_FILE "etc/acpi/tables"
+#define ACPI_BUILD_RSDP_FILE "etc/acpi/rsdp"
+#define ACPI_BUILD_TPMLOG_FILE "etc/tpm/log"
 
 typedef enum {
     AML_NO_OPCODE = 0,/* has only data */
@@ -93,6 +105,14 @@ typedef enum {
     aml_ReadWrite = 1,
 } AmlReadAndWrite;
 
+typedef
+struct AcpiBuildTables {
+    GArray *table_data;
+    GArray *rsdp;
+    GArray *tcpalog;
+    GArray *linker;
+} AcpiBuildTables;
+
 /**
  * init_aml_allocator:
  *
@@ -188,4 +208,13 @@ Aml *aml_resource_template(void);
 Aml *aml_field(const char *name, AmlFieldFlags flags);
 Aml *aml_varpackage(uint32_t num_elements);
 
+void
+build_header(GArray *linker, GArray *table_data,
+             AcpiTableHeader *h, const char *sig, int len, uint8_t rev);
+void *acpi_data_push(GArray *table_data, unsigned size);
+unsigned acpi_data_len(GArray *table);
+void acpi_add_table(GArray *table_offsets, GArray *table_data);
+void acpi_build_tables_init(AcpiBuildTables *tables);
+void acpi_build_tables_cleanup(AcpiBuildTables *tables, bool mfre);
+
 #endif
diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
index d7945f6..8d01959 100644
--- a/hw/acpi/aml-build.c
+++ b/hw/acpi/aml-build.c
@@ -26,6 +26,7 @@
 #include <string.h>
 #include "hw/acpi/aml-build.h"
 #include "qemu/bswap.h"
+#include "hw/acpi/bios-linker-loader.h"
 
 static GArray *build_alloc_array(void)
 {
@@ -891,3 +892,60 @@ Aml *aml_qword_memory(AmlDecode dec, AmlMinFixed min_fixed,
                              dec, addr_gran, addr_min, addr_max,
                              addr_trans, len, flags);
 }
+
+void
+build_header(GArray *linker, GArray *table_data,
+             AcpiTableHeader *h, const char *sig, int len, uint8_t rev)
+{
+    memcpy(&h->signature, sig, 4);
+    h->length = cpu_to_le32(len);
+    h->revision = rev;
+    memcpy(h->oem_id, ACPI_BUILD_APPNAME6, 6);
+    memcpy(h->oem_table_id, ACPI_BUILD_APPNAME4, 4);
+    memcpy(h->oem_table_id + 4, sig, 4);
+    h->oem_revision = cpu_to_le32(1);
+    memcpy(h->asl_compiler_id, ACPI_BUILD_APPNAME4, 4);
+    h->asl_compiler_revision = cpu_to_le32(1);
+    h->checksum = 0;
+    /* Checksum to be filled in by Guest linker */
+    bios_linker_loader_add_checksum(linker, ACPI_BUILD_TABLE_FILE,
+                                    table_data->data, h, len, &h->checksum);
+}
+
+void *acpi_data_push(GArray *table_data, unsigned size)
+{
+    unsigned off = table_data->len;
+    g_array_set_size(table_data, off + size);
+    return table_data->data + off;
+}
+
+unsigned acpi_data_len(GArray *table)
+{
+#if GLIB_CHECK_VERSION(2, 22, 0)
+    assert(g_array_get_element_size(table) == 1);
+#endif
+    return table->len;
+}
+
+void acpi_add_table(GArray *table_offsets, GArray *table_data)
+{
+    uint32_t offset = cpu_to_le32(table_data->len);
+    g_array_append_val(table_offsets, offset);
+}
+
+void acpi_build_tables_init(AcpiBuildTables *tables)
+{
+    tables->rsdp = g_array_new(false, true /* clear */, 1);
+    tables->table_data = g_array_new(false, true /* clear */, 1);
+    tables->tcpalog = g_array_new(false, true /* clear */, 1);
+    tables->linker = bios_linker_loader_init();
+}
+
+void acpi_build_tables_cleanup(AcpiBuildTables *tables, bool mfre)
+{
+    void *linker_data = bios_linker_loader_cleanup(tables->linker);
+    g_free(linker_data);
+    g_array_free(tables->rsdp, true);
+    g_array_free(tables->table_data, true);
+    g_array_free(tables->tcpalog, mfre);
+}
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index c6c0b72..c193ca5 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -70,9 +70,6 @@
 
 #define ACPI_BUILD_TABLE_SIZE             0x20000
 
-/* Reserve RAM space for tables: add another order of magnitude. */
-#define ACPI_BUILD_TABLE_MAX_SIZE         0x200000
-
 /* #define DEBUG_ACPI_BUILD */
 #ifdef DEBUG_ACPI_BUILD
 #define ACPI_BUILD_DPRINTF(fmt, ...)        \
@@ -267,51 +264,8 @@ static void acpi_get_pci_info(PcPciInfo *info)
                                             NULL);
 }
 
-#define ACPI_BUILD_APPNAME  "Bochs"
-#define ACPI_BUILD_APPNAME6 "BOCHS "
-#define ACPI_BUILD_APPNAME4 "BXPC"
-
-#define ACPI_BUILD_TABLE_FILE "etc/acpi/tables"
-#define ACPI_BUILD_RSDP_FILE "etc/acpi/rsdp"
-#define ACPI_BUILD_TPMLOG_FILE "etc/tpm/log"
-
-static void
-build_header(GArray *linker, GArray *table_data,
-             AcpiTableHeader *h, const char *sig, int len, uint8_t rev)
-{
-    memcpy(&h->signature, sig, 4);
-    h->length = cpu_to_le32(len);
-    h->revision = rev;
-    memcpy(h->oem_id, ACPI_BUILD_APPNAME6, 6);
-    memcpy(h->oem_table_id, ACPI_BUILD_APPNAME4, 4);
-    memcpy(h->oem_table_id + 4, sig, 4);
-    h->oem_revision = cpu_to_le32(1);
-    memcpy(h->asl_compiler_id, ACPI_BUILD_APPNAME4, 4);
-    h->asl_compiler_revision = cpu_to_le32(1);
-    h->checksum = 0;
-    /* Checksum to be filled in by Guest linker */
-    bios_linker_loader_add_checksum(linker, ACPI_BUILD_TABLE_FILE,
-                                    table_data->data, h, len, &h->checksum);
-}
-
-/* End here */
 #define ACPI_PORT_SMI_CMD           0x00b2 /* TODO: this is APM_CNT_IOPORT */
 
-static inline void *acpi_data_push(GArray *table_data, unsigned size)
-{
-    unsigned off = table_data->len;
-    g_array_set_size(table_data, off + size);
-    return table_data->data + off;
-}
-
-static unsigned acpi_data_len(GArray *table)
-{
-#if GLIB_CHECK_VERSION(2, 22, 0)
-    assert(g_array_get_element_size(table) == 1);
-#endif
-    return table->len;
-}
-
 static void acpi_align_size(GArray *blob, unsigned align)
 {
     /* Align size to multiple of given size. This reduces the chance
@@ -320,12 +274,6 @@ static void acpi_align_size(GArray *blob, unsigned align)
     g_array_set_size(blob, ROUND_UP(acpi_data_len(blob), align));
 }
 
-static inline void acpi_add_table(GArray *table_offsets, GArray *table_data)
-{
-    uint32_t offset = cpu_to_le32(table_data->len);
-    g_array_append_val(table_offsets, offset);
-}
-
 /* FACS */
 static void
 build_facs(GArray *table_data, GArray *linker, PcGuestInfo *guest_info)
@@ -1296,31 +1244,6 @@ build_rsdp(GArray *rsdp_table, GArray *linker, unsigned rsdt)
 }
 
 typedef
-struct AcpiBuildTables {
-    GArray *table_data;
-    GArray *rsdp;
-    GArray *tcpalog;
-    GArray *linker;
-} AcpiBuildTables;
-
-static inline void acpi_build_tables_init(AcpiBuildTables *tables)
-{
-    tables->rsdp = g_array_new(false, true /* clear */, 1);
-    tables->table_data = g_array_new(false, true /* clear */, 1);
-    tables->tcpalog = g_array_new(false, true /* clear */, 1);
-    tables->linker = bios_linker_loader_init();
-}
-
-static inline void acpi_build_tables_cleanup(AcpiBuildTables *tables, bool mfre)
-{
-    void *linker_data = bios_linker_loader_cleanup(tables->linker);
-    g_free(linker_data);
-    g_array_free(tables->rsdp, true);
-    g_array_free(tables->table_data, true);
-    g_array_free(tables->tcpalog, mfre);
-}
-
-typedef
 struct AcpiBuildState {
     /* Copy of table in RAM (for patching). */
     ram_addr_t table_ram;
-- 
MST

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Qemu-devel] [PULL 04/28] vhost-user: Send VHOST_RESET_OWNER on vhost stop
  2015-05-11 12:46 [Qemu-devel] [PULL 00/28] pc, virtio enhancements Michael S. Tsirkin
                   ` (2 preceding siblings ...)
  2015-05-11 12:47 ` [Qemu-devel] [PULL 03/28] hw/i386/acpi-build: move generic acpi building helpers into dedictated file Michael S. Tsirkin
@ 2015-05-11 12:47 ` Michael S. Tsirkin
  2015-05-11 12:47 ` [Qemu-devel] [PULL 05/28] virtio-net: fix the upper bound when trying to delete queues Michael S. Tsirkin
                   ` (24 subsequent siblings)
  28 siblings, 0 replies; 32+ messages in thread
From: Michael S. Tsirkin @ 2015-05-11 12:47 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Luke Gorrie

From: Luke Gorrie <luke@snabb.co>

Ensure that the vhost-user slave knows when the vrings are valid and
when they are invalid, for example during a guest reboot.

The vhost-user protocol says this of VHOST_RESET_OWNER:

      Issued when a new connection is about to be closed. The Master
      will no longer own this connection (and will usually close it).

Send this message to tell the vhost-user slave that the vhost session
has ended and that session state (e.g. vrings) is no longer valid.

Signed-off-by: Luke Gorrie <luke@snabb.co>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/net/vhost_net.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
index cf23335..47f8b89 100644
--- a/hw/net/vhost_net.c
+++ b/hw/net/vhost_net.c
@@ -263,6 +263,13 @@ static void vhost_net_stop_one(struct vhost_net *net,
                                           &file);
             assert(r >= 0);
         }
+    } else if (net->nc->info->type == NET_CLIENT_OPTIONS_KIND_VHOST_USER) {
+        for (file.index = 0; file.index < net->dev.nvqs; ++file.index) {
+            const VhostOps *vhost_ops = net->dev.vhost_ops;
+            int r = vhost_ops->vhost_call(&net->dev, VHOST_RESET_OWNER,
+                                          NULL);
+            assert(r >= 0);
+        }
     }
     if (net->nc->info->poll) {
         net->nc->info->poll(net->nc, true);
-- 
MST

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Qemu-devel] [PULL 05/28] virtio-net: fix the upper bound when trying to delete queues
  2015-05-11 12:46 [Qemu-devel] [PULL 00/28] pc, virtio enhancements Michael S. Tsirkin
                   ` (3 preceding siblings ...)
  2015-05-11 12:47 ` [Qemu-devel] [PULL 04/28] vhost-user: Send VHOST_RESET_OWNER on vhost stop Michael S. Tsirkin
@ 2015-05-11 12:47 ` Michael S. Tsirkin
  2015-05-11 12:47 ` [Qemu-devel] [PULL 06/28] pc: add 2.4 machine types Michael S. Tsirkin
                   ` (23 subsequent siblings)
  28 siblings, 0 replies; 32+ messages in thread
From: Michael S. Tsirkin @ 2015-05-11 12:47 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Jason Wang, qemu-stable

From: Jason Wang <jasowang@redhat.com>

Virtqueue were indexed from zero, so don't delete virtqueue whose
index is n->max_queues * 2 + 1.

Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: qemu-stable <qemu-stable@nongnu.org>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/net/virtio-net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 59f76bc..b6fac9c 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -1309,7 +1309,7 @@ static void virtio_net_set_multiqueue(VirtIONet *n, int multiqueue)
 
     n->multiqueue = multiqueue;
 
-    for (i = 2; i <= n->max_queues * 2 + 1; i++) {
+    for (i = 2; i < n->max_queues * 2 + 1; i++) {
         virtio_del_queue(vdev, i);
     }
 
-- 
MST

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Qemu-devel] [PULL 06/28] pc: add 2.4 machine types
  2015-05-11 12:46 [Qemu-devel] [PULL 00/28] pc, virtio enhancements Michael S. Tsirkin
                   ` (4 preceding siblings ...)
  2015-05-11 12:47 ` [Qemu-devel] [PULL 05/28] virtio-net: fix the upper bound when trying to delete queues Michael S. Tsirkin
@ 2015-05-11 12:47 ` Michael S. Tsirkin
  2015-05-11 12:47 ` [Qemu-devel] [PULL 07/28] spapr: add machine type specific instance init function Michael S. Tsirkin
                   ` (22 subsequent siblings)
  28 siblings, 0 replies; 32+ messages in thread
From: Michael S. Tsirkin @ 2015-05-11 12:47 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Jason Wang, Richard Henderson, Paolo Bonzini

From: Jason Wang <jasowang@redhat.com>

The following patches will limit the following things to legacy
machine type:

- maximum number of virtqueues for virtio-pci were limited to 64
- auto msix bar size for virtio-net-pci were disabled by default

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/i386/pc_piix.c | 29 +++++++++++++++++++++++++----
 hw/i386/pc_q35.c  | 26 +++++++++++++++++++++++---
 2 files changed, 48 insertions(+), 7 deletions(-)

diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 1fe7bfb..212e263 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -310,8 +310,13 @@ static void pc_init_pci(MachineState *machine)
     pc_init1(machine, 1, 1);
 }
 
+static void pc_compat_2_3(MachineState *machine)
+{
+}
+
 static void pc_compat_2_2(MachineState *machine)
 {
+    pc_compat_2_3(machine);
     rsdp_in_ram = false;
     x86_cpu_compat_set_features("kvm64", FEAT_1_EDX, 0, CPUID_VME);
     x86_cpu_compat_set_features("kvm32", FEAT_1_EDX, 0, CPUID_VME);
@@ -413,6 +418,12 @@ static void pc_compat_1_2(MachineState *machine)
     x86_cpu_compat_kvm_no_autoenable(FEAT_KVM, 1 << KVM_FEATURE_PV_EOI);
 }
 
+static void pc_init_pci_2_3(MachineState *machine)
+{
+    pc_compat_2_3(machine);
+    pc_init_pci(machine);
+}
+
 static void pc_init_pci_2_2(MachineState *machine)
 {
     pc_compat_2_2(machine);
@@ -512,19 +523,28 @@ static void pc_xen_hvm_init(MachineState *machine)
     .desc = "Standard PC (i440FX + PIIX, 1996)", \
     .hot_add_cpu = pc_hot_add_cpu
 
-#define PC_I440FX_2_3_MACHINE_OPTIONS                           \
+#define PC_I440FX_2_4_MACHINE_OPTIONS                           \
     PC_I440FX_MACHINE_OPTIONS,                                  \
     .default_machine_opts = "firmware=bios-256k.bin",           \
     .default_display = "std"
 
-static QEMUMachine pc_i440fx_machine_v2_3 = {
-    PC_I440FX_2_3_MACHINE_OPTIONS,
-    .name = "pc-i440fx-2.3",
+
+static QEMUMachine pc_i440fx_machine_v2_4 = {
+    PC_I440FX_2_4_MACHINE_OPTIONS,
+    .name = "pc-i440fx-2.4",
     .alias = "pc",
     .init = pc_init_pci,
     .is_default = 1,
 };
 
+#define PC_I440FX_2_3_MACHINE_OPTIONS PC_I440FX_2_4_MACHINE_OPTIONS
+
+static QEMUMachine pc_i440fx_machine_v2_3 = {
+    PC_I440FX_2_3_MACHINE_OPTIONS,
+    .name = "pc-i440fx-2.3",
+    .init = pc_init_pci_2_3,
+};
+
 #define PC_I440FX_2_2_MACHINE_OPTIONS PC_I440FX_2_3_MACHINE_OPTIONS
 
 static QEMUMachine pc_i440fx_machine_v2_2 = {
@@ -970,6 +990,7 @@ static QEMUMachine xenfv_machine = {
 
 static void pc_machine_init(void)
 {
+    qemu_register_pc_machine(&pc_i440fx_machine_v2_4);
     qemu_register_pc_machine(&pc_i440fx_machine_v2_3);
     qemu_register_pc_machine(&pc_i440fx_machine_v2_2);
     qemu_register_pc_machine(&pc_i440fx_machine_v2_1);
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index dcc17c0..e67f2de 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -289,8 +289,13 @@ static void pc_q35_init(MachineState *machine)
     }
 }
 
+static void pc_compat_2_3(MachineState *machine)
+{
+}
+
 static void pc_compat_2_2(MachineState *machine)
 {
+    pc_compat_2_3(machine);
     rsdp_in_ram = false;
     x86_cpu_compat_set_features("kvm64", FEAT_1_EDX, 0, CPUID_VME);
     x86_cpu_compat_set_features("kvm32", FEAT_1_EDX, 0, CPUID_VME);
@@ -361,6 +366,12 @@ static void pc_compat_1_4(MachineState *machine)
     x86_cpu_compat_set_features("Westmere", FEAT_1_ECX, 0, CPUID_EXT_PCLMULQDQ);
 }
 
+static void pc_q35_init_2_3(MachineState *machine)
+{
+    pc_compat_2_3(machine);
+    pc_q35_init(machine);
+}
+
 static void pc_q35_init_2_2(MachineState *machine)
 {
     pc_compat_2_2(machine);
@@ -410,16 +421,24 @@ static void pc_q35_init_1_4(MachineState *machine)
     .hot_add_cpu = pc_hot_add_cpu, \
     .units_per_default_bus = 1
 
-#define PC_Q35_2_3_MACHINE_OPTIONS                      \
+#define PC_Q35_2_4_MACHINE_OPTIONS                      \
     PC_Q35_MACHINE_OPTIONS,                             \
     .default_machine_opts = "firmware=bios-256k.bin",   \
     .default_display = "std"
 
+static QEMUMachine pc_q35_machine_v2_4 = {
+    PC_Q35_2_4_MACHINE_OPTIONS,
+    .name = "pc-q35-2.4",
+    .alias = "q35",
+    .init = pc_q35_init,
+};
+
+#define PC_Q35_2_3_MACHINE_OPTIONS PC_Q35_2_4_MACHINE_OPTIONS
+
 static QEMUMachine pc_q35_machine_v2_3 = {
     PC_Q35_2_3_MACHINE_OPTIONS,
     .name = "pc-q35-2.3",
-    .alias = "q35",
-    .init = pc_q35_init,
+    .init = pc_q35_init_2_3,
 };
 
 #define PC_Q35_2_2_MACHINE_OPTIONS PC_Q35_2_3_MACHINE_OPTIONS
@@ -506,6 +525,7 @@ static QEMUMachine pc_q35_machine_v1_4 = {
 
 static void pc_q35_machine_init(void)
 {
+    qemu_register_pc_machine(&pc_q35_machine_v2_4);
     qemu_register_pc_machine(&pc_q35_machine_v2_3);
     qemu_register_pc_machine(&pc_q35_machine_v2_2);
     qemu_register_pc_machine(&pc_q35_machine_v2_1);
-- 
MST

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Qemu-devel] [PULL 07/28] spapr: add machine type specific instance init function
  2015-05-11 12:46 [Qemu-devel] [PULL 00/28] pc, virtio enhancements Michael S. Tsirkin
                   ` (5 preceding siblings ...)
  2015-05-11 12:47 ` [Qemu-devel] [PULL 06/28] pc: add 2.4 machine types Michael S. Tsirkin
@ 2015-05-11 12:47 ` Michael S. Tsirkin
  2015-05-11 12:47 ` [Qemu-devel] [PULL 08/28] ppc: spapr: add 2.4 machine type Michael S. Tsirkin
                   ` (21 subsequent siblings)
  28 siblings, 0 replies; 32+ messages in thread
From: Michael S. Tsirkin @ 2015-05-11 12:47 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Jason Wang, qemu-ppc, Alexander Graf

From: Jason Wang <jasowang@redhat.com>

This patches adds machine type specific instance initialization
functions. Those functions will be used by following patches to compat
class properties for legacy machine types.

Cc: Alexander Graf <agraf@suse.de>
Cc: qemu-ppc@nongnu.org
Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/ppc/spapr.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 61ddc79..9e676ef 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -1825,6 +1825,27 @@ static const TypeInfo spapr_machine_info = {
 #define SPAPR_COMPAT_2_1 \
         SPAPR_COMPAT_2_2
 
+static void spapr_compat_2_2(Object *obj)
+{
+}
+
+static void spapr_compat_2_1(Object *obj)
+{
+    spapr_compat_2_2(obj);
+}
+
+static void spapr_machine_2_2_instance_init(Object *obj)
+{
+    spapr_compat_2_2(obj);
+    spapr_machine_initfn(obj);
+}
+
+static void spapr_machine_2_1_instance_init(Object *obj)
+{
+    spapr_compat_2_1(obj);
+    spapr_machine_initfn(obj);
+}
+
 static void spapr_machine_2_1_class_init(ObjectClass *oc, void *data)
 {
     MachineClass *mc = MACHINE_CLASS(oc);
@@ -1843,6 +1864,7 @@ static const TypeInfo spapr_machine_2_1_info = {
     .name          = TYPE_SPAPR_MACHINE "2.1",
     .parent        = TYPE_SPAPR_MACHINE,
     .class_init    = spapr_machine_2_1_class_init,
+    .instance_init = spapr_machine_2_1_instance_init,
 };
 
 static void spapr_machine_2_2_class_init(ObjectClass *oc, void *data)
@@ -1862,6 +1884,7 @@ static const TypeInfo spapr_machine_2_2_info = {
     .name          = TYPE_SPAPR_MACHINE "2.2",
     .parent        = TYPE_SPAPR_MACHINE,
     .class_init    = spapr_machine_2_2_class_init,
+    .instance_init = spapr_machine_2_2_instance_init,
 };
 
 static void spapr_machine_2_3_class_init(ObjectClass *oc, void *data)
-- 
MST

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Qemu-devel] [PULL 08/28] ppc: spapr: add 2.4 machine type
  2015-05-11 12:46 [Qemu-devel] [PULL 00/28] pc, virtio enhancements Michael S. Tsirkin
                   ` (6 preceding siblings ...)
  2015-05-11 12:47 ` [Qemu-devel] [PULL 07/28] spapr: add machine type specific instance init function Michael S. Tsirkin
@ 2015-05-11 12:47 ` Michael S. Tsirkin
  2015-05-11 12:47 ` [Qemu-devel] [PULL 09/28] monitor: replace the magic number 255 with MAX_QUEUE_NUM Michael S. Tsirkin
                   ` (20 subsequent siblings)
  28 siblings, 0 replies; 32+ messages in thread
From: Michael S. Tsirkin @ 2015-05-11 12:47 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Jason Wang, qemu-ppc, Alexander Graf

From: Jason Wang <jasowang@redhat.com>

The following patches will limit the following things to legacy
machine type:

- maximum number of virtqueues for virtio-pci were limited to 64

Cc: Alexander Graf <agraf@suse.de>
Cc: qemu-ppc@nongnu.org

Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

Reviewed-by: Alexander Graf <agraf@suse.de>
---
 hw/ppc/spapr.c | 31 +++++++++++++++++++++++++++++--
 1 file changed, 29 insertions(+), 2 deletions(-)

diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 9e676ef..8e43aa2 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -1825,8 +1825,13 @@ static const TypeInfo spapr_machine_info = {
 #define SPAPR_COMPAT_2_1 \
         SPAPR_COMPAT_2_2
 
+static void spapr_compat_2_3(Object *obj)
+{
+}
+
 static void spapr_compat_2_2(Object *obj)
 {
+    spapr_compat_2_3(obj);
 }
 
 static void spapr_compat_2_1(Object *obj)
@@ -1834,6 +1839,12 @@ static void spapr_compat_2_1(Object *obj)
     spapr_compat_2_2(obj);
 }
 
+static void spapr_machine_2_3_instance_init(Object *obj)
+{
+    spapr_compat_2_3(obj);
+    spapr_machine_initfn(obj);
+}
+
 static void spapr_machine_2_2_instance_init(Object *obj)
 {
     spapr_compat_2_2(obj);
@@ -1893,14 +1904,29 @@ static void spapr_machine_2_3_class_init(ObjectClass *oc, void *data)
 
     mc->name = "pseries-2.3";
     mc->desc = "pSeries Logical Partition (PAPR compliant) v2.3";
-    mc->alias = "pseries";
-    mc->is_default = 1;
 }
 
 static const TypeInfo spapr_machine_2_3_info = {
     .name          = TYPE_SPAPR_MACHINE "2.3",
     .parent        = TYPE_SPAPR_MACHINE,
     .class_init    = spapr_machine_2_3_class_init,
+    .instance_init = spapr_machine_2_3_instance_init,
+};
+
+static void spapr_machine_2_4_class_init(ObjectClass *oc, void *data)
+{
+    MachineClass *mc = MACHINE_CLASS(oc);
+
+    mc->name = "pseries-2.4";
+    mc->desc = "pSeries Logical Partition (PAPR compliant) v2.4";
+    mc->alias = "pseries";
+    mc->is_default = 1;
+}
+
+static const TypeInfo spapr_machine_2_4_info = {
+    .name          = TYPE_SPAPR_MACHINE "2.4",
+    .parent        = TYPE_SPAPR_MACHINE,
+    .class_init    = spapr_machine_2_4_class_init,
 };
 
 static void spapr_machine_register_types(void)
@@ -1909,6 +1935,7 @@ static void spapr_machine_register_types(void)
     type_register_static(&spapr_machine_2_1_info);
     type_register_static(&spapr_machine_2_2_info);
     type_register_static(&spapr_machine_2_3_info);
+    type_register_static(&spapr_machine_2_4_info);
 }
 
 type_init(spapr_machine_register_types)
-- 
MST

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Qemu-devel] [PULL 09/28] monitor: replace the magic number 255 with MAX_QUEUE_NUM
  2015-05-11 12:46 [Qemu-devel] [PULL 00/28] pc, virtio enhancements Michael S. Tsirkin
                   ` (7 preceding siblings ...)
  2015-05-11 12:47 ` [Qemu-devel] [PULL 08/28] ppc: spapr: add 2.4 machine type Michael S. Tsirkin
@ 2015-05-11 12:47 ` Michael S. Tsirkin
  2015-05-11 12:47 ` [Qemu-devel] [PULL 10/28] monitor: check return value of qemu_find_net_clients_except() Michael S. Tsirkin
                   ` (19 subsequent siblings)
  28 siblings, 0 replies; 32+ messages in thread
From: Michael S. Tsirkin @ 2015-05-11 12:47 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Jason Wang, Luiz Capitulino

From: Jason Wang <jasowang@redhat.com>

This patch replace the magic number 255, and increase it to
MAX_QUEUE_NUM which is maximum number of queues supported by a nic.

Cc: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 monitor.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/monitor.c b/monitor.c
index 9f37700..9d18b7f 100644
--- a/monitor.c
+++ b/monitor.c
@@ -4472,10 +4472,11 @@ void set_link_completion(ReadLineState *rs, int nb_args, const char *str)
     len = strlen(str);
     readline_set_completion_index(rs, len);
     if (nb_args == 2) {
-        NetClientState *ncs[255];
+        NetClientState *ncs[MAX_QUEUE_NUM];
         int count, i;
         count = qemu_find_net_clients_except(NULL, ncs,
-                                             NET_CLIENT_OPTIONS_KIND_NONE, 255);
+                                             NET_CLIENT_OPTIONS_KIND_NONE,
+                                             MAX_QUEUE_NUM);
         for (i = 0; i < count; i++) {
             const char *name = ncs[i]->name;
             if (!strncmp(str, name, len)) {
@@ -4491,7 +4492,7 @@ void set_link_completion(ReadLineState *rs, int nb_args, const char *str)
 void netdev_del_completion(ReadLineState *rs, int nb_args, const char *str)
 {
     int len, count, i;
-    NetClientState *ncs[255];
+    NetClientState *ncs[MAX_QUEUE_NUM];
 
     if (nb_args != 2) {
         return;
@@ -4500,7 +4501,7 @@ void netdev_del_completion(ReadLineState *rs, int nb_args, const char *str)
     len = strlen(str);
     readline_set_completion_index(rs, len);
     count = qemu_find_net_clients_except(NULL, ncs, NET_CLIENT_OPTIONS_KIND_NIC,
-                                         255);
+                                         MAX_QUEUE_NUM);
     for (i = 0; i < count; i++) {
         QemuOpts *opts;
         const char *name = ncs[i]->name;
@@ -4566,14 +4567,15 @@ void host_net_add_completion(ReadLineState *rs, int nb_args, const char *str)
 
 void host_net_remove_completion(ReadLineState *rs, int nb_args, const char *str)
 {
-    NetClientState *ncs[255];
+    NetClientState *ncs[MAX_QUEUE_NUM];
     int count, i, len;
 
     len = strlen(str);
     readline_set_completion_index(rs, len);
     if (nb_args == 2) {
         count = qemu_find_net_clients_except(NULL, ncs,
-                                             NET_CLIENT_OPTIONS_KIND_NONE, 255);
+                                             NET_CLIENT_OPTIONS_KIND_NONE,
+                                             MAX_QUEUE_NUM);
         for (i = 0; i < count; i++) {
             int id;
             char name[16];
@@ -4589,7 +4591,8 @@ void host_net_remove_completion(ReadLineState *rs, int nb_args, const char *str)
         return;
     } else if (nb_args == 3) {
         count = qemu_find_net_clients_except(NULL, ncs,
-                                             NET_CLIENT_OPTIONS_KIND_NIC, 255);
+                                             NET_CLIENT_OPTIONS_KIND_NIC,
+                                             MAX_QUEUE_NUM);
         for (i = 0; i < count; i++) {
             int id;
             const char *name;
-- 
MST

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Qemu-devel] [PULL 10/28] monitor: check return value of qemu_find_net_clients_except()
  2015-05-11 12:46 [Qemu-devel] [PULL 00/28] pc, virtio enhancements Michael S. Tsirkin
                   ` (8 preceding siblings ...)
  2015-05-11 12:47 ` [Qemu-devel] [PULL 09/28] monitor: replace the magic number 255 with MAX_QUEUE_NUM Michael S. Tsirkin
@ 2015-05-11 12:47 ` Michael S. Tsirkin
  2015-05-11 12:47 ` [Qemu-devel] [PULL 11/28] virtio-ccw: using VIRTIO_NO_VECTOR instead of 0 for invalid virtqueue Michael S. Tsirkin
                   ` (18 subsequent siblings)
  28 siblings, 0 replies; 32+ messages in thread
From: Michael S. Tsirkin @ 2015-05-11 12:47 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Jason Wang, Luiz Capitulino

From: Jason Wang <jasowang@redhat.com>

qemu_find_net_clients_except() may return a value which is greater
than the size of array we provided. So we should check this value
before using it, otherwise this may cause unexpected memory access.

This patch fixes the net related command completion when we have a
virtio-net nic with more than 255 queues.

Cc: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 monitor.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/monitor.c b/monitor.c
index 9d18b7f..c902412 100644
--- a/monitor.c
+++ b/monitor.c
@@ -4477,7 +4477,7 @@ void set_link_completion(ReadLineState *rs, int nb_args, const char *str)
         count = qemu_find_net_clients_except(NULL, ncs,
                                              NET_CLIENT_OPTIONS_KIND_NONE,
                                              MAX_QUEUE_NUM);
-        for (i = 0; i < count; i++) {
+        for (i = 0; i < MIN(count, MAX_QUEUE_NUM); i++) {
             const char *name = ncs[i]->name;
             if (!strncmp(str, name, len)) {
                 readline_add_completion(rs, name);
@@ -4502,7 +4502,7 @@ void netdev_del_completion(ReadLineState *rs, int nb_args, const char *str)
     readline_set_completion_index(rs, len);
     count = qemu_find_net_clients_except(NULL, ncs, NET_CLIENT_OPTIONS_KIND_NIC,
                                          MAX_QUEUE_NUM);
-    for (i = 0; i < count; i++) {
+    for (i = 0; i < MIN(count, MAX_QUEUE_NUM); i++) {
         QemuOpts *opts;
         const char *name = ncs[i]->name;
         if (strncmp(str, name, len)) {
@@ -4576,7 +4576,7 @@ void host_net_remove_completion(ReadLineState *rs, int nb_args, const char *str)
         count = qemu_find_net_clients_except(NULL, ncs,
                                              NET_CLIENT_OPTIONS_KIND_NONE,
                                              MAX_QUEUE_NUM);
-        for (i = 0; i < count; i++) {
+        for (i = 0; i < MIN(count, MAX_QUEUE_NUM); i++) {
             int id;
             char name[16];
 
@@ -4593,7 +4593,7 @@ void host_net_remove_completion(ReadLineState *rs, int nb_args, const char *str)
         count = qemu_find_net_clients_except(NULL, ncs,
                                              NET_CLIENT_OPTIONS_KIND_NIC,
                                              MAX_QUEUE_NUM);
-        for (i = 0; i < count; i++) {
+        for (i = 0; i < MIN(count, MAX_QUEUE_NUM); i++) {
             int id;
             const char *name;
 
-- 
MST

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Qemu-devel] [PULL 11/28] virtio-ccw: using VIRTIO_NO_VECTOR instead of 0 for invalid virtqueue
  2015-05-11 12:46 [Qemu-devel] [PULL 00/28] pc, virtio enhancements Michael S. Tsirkin
                   ` (9 preceding siblings ...)
  2015-05-11 12:47 ` [Qemu-devel] [PULL 10/28] monitor: check return value of qemu_find_net_clients_except() Michael S. Tsirkin
@ 2015-05-11 12:47 ` Michael S. Tsirkin
  2015-05-11 12:47 ` [Qemu-devel] [PULL 12/28] virtio: introduce vector to virtqueues mapping Michael S. Tsirkin
                   ` (17 subsequent siblings)
  28 siblings, 0 replies; 32+ messages in thread
From: Michael S. Tsirkin @ 2015-05-11 12:47 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Jason Wang, Alexander Graf, Christian Borntraeger,
	Cornelia Huck, Richard Henderson

From: Jason Wang <jasowang@redhat.com>

It's a bad idea to need to use vector 0 for invalid virtqueue. So this patch
changes to using VIRTIO_NO_VECTOR instead.

Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
CC: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Alexander Graf <agraf@suse.de>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/s390x/virtio-ccw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
index d32ecaf..0434f56 100644
--- a/hw/s390x/virtio-ccw.c
+++ b/hw/s390x/virtio-ccw.c
@@ -281,7 +281,7 @@ static int virtio_ccw_set_vqs(SubchDev *sch, uint64_t addr, uint32_t align,
 
     virtio_queue_set_addr(vdev, index, addr);
     if (!addr) {
-        virtio_queue_set_vector(vdev, index, 0);
+        virtio_queue_set_vector(vdev, index, VIRTIO_NO_VECTOR);
     } else {
         /* Fail if we don't have a big enough queue. */
         /* TODO: Add interface to handle vring.num changing */
-- 
MST

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Qemu-devel] [PULL 12/28] virtio: introduce vector to virtqueues mapping
  2015-05-11 12:46 [Qemu-devel] [PULL 00/28] pc, virtio enhancements Michael S. Tsirkin
                   ` (10 preceding siblings ...)
  2015-05-11 12:47 ` [Qemu-devel] [PULL 11/28] virtio-ccw: using VIRTIO_NO_VECTOR instead of 0 for invalid virtqueue Michael S. Tsirkin
@ 2015-05-11 12:47 ` Michael S. Tsirkin
  2015-05-11 12:47 ` [Qemu-devel] [PULL 13/28] virtio-pci: speedup MSI-X masking and unmasking Michael S. Tsirkin
                   ` (16 subsequent siblings)
  28 siblings, 0 replies; 32+ messages in thread
From: Michael S. Tsirkin @ 2015-05-11 12:47 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Jason Wang

From: Jason Wang <jasowang@redhat.com>

Currently we will try to traverse all virtqueues to find a subset that
using a specific vector. This is sub optimal when we will support
hundreds or even thousands of virtqueues. So this patch introduces a
method which could be used by transport to get all virtqueues that
using a same vector. This is done through QLISTs and the number of
QLISTs was queried through a transport specific method. When guest
setting vectors, the virtqueue will be linked and helpers for traverse
the list was also introduced.

The first user will be virtio pci which will use this to speed up
MSI-X masking and unmasking handling.

Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 include/hw/virtio/virtio-bus.h |  1 +
 include/hw/virtio/virtio.h     |  3 +++
 hw/virtio/virtio-pci.c         |  8 ++++++++
 hw/virtio/virtio.c             | 36 ++++++++++++++++++++++++++++++++++--
 4 files changed, 46 insertions(+), 2 deletions(-)

diff --git a/include/hw/virtio/virtio-bus.h b/include/hw/virtio/virtio-bus.h
index 0d2e7b4..a4588ca 100644
--- a/include/hw/virtio/virtio-bus.h
+++ b/include/hw/virtio/virtio-bus.h
@@ -62,6 +62,7 @@ typedef struct VirtioBusClass {
      * This is called by virtio-bus just before the device is unplugged.
      */
     void (*device_unplugged)(DeviceState *d);
+    int (*query_nvectors)(DeviceState *d);
     /*
      * Does the transport have variable vring alignment?
      * (ie can it ever call virtio_queue_set_align()?)
diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
index d95f8b6..9706c29 100644
--- a/include/hw/virtio/virtio.h
+++ b/include/hw/virtio/virtio.h
@@ -84,6 +84,7 @@ struct VirtIODevice
     VMChangeStateEntry *vmstate;
     char *bus_name;
     uint8_t device_endian;
+    QLIST_HEAD(, VirtQueue) * vector_queues;
 };
 
 typedef struct VirtioDeviceClass {
@@ -218,6 +219,8 @@ void virtio_queue_set_host_notifier_fd_handler(VirtQueue *vq, bool assign,
                                                bool set_handler);
 void virtio_queue_notify_vq(VirtQueue *vq);
 void virtio_irq(VirtQueue *vq);
+VirtQueue *virtio_vector_first_queue(VirtIODevice *vdev, uint16_t vector);
+VirtQueue *virtio_vector_next_queue(VirtQueue *vq);
 
 static inline void virtio_add_feature(uint32_t *features, unsigned int fbit)
 {
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index c7c3f72..6ae24a0 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -908,6 +908,13 @@ static const TypeInfo virtio_9p_pci_info = {
  * virtio-pci: This is the PCIDevice which has a virtio-pci-bus.
  */
 
+static int virtio_pci_query_nvectors(DeviceState *d)
+{
+    VirtIOPCIProxy *proxy = VIRTIO_PCI(d);
+
+    return proxy->nvectors;
+}
+
 /* This is called by virtio-bus just after the device is plugged. */
 static void virtio_pci_device_plugged(DeviceState *d)
 {
@@ -1498,6 +1505,7 @@ static void virtio_pci_bus_class_init(ObjectClass *klass, void *data)
     k->vmstate_change = virtio_pci_vmstate_change;
     k->device_plugged = virtio_pci_device_plugged;
     k->device_unplugged = virtio_pci_device_unplugged;
+    k->query_nvectors = virtio_pci_query_nvectors;
 }
 
 static const TypeInfo virtio_pci_bus_info = {
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 17c1260..6985e76 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -89,6 +89,7 @@ struct VirtQueue
     VirtIODevice *vdev;
     EventNotifier guest_notifier;
     EventNotifier host_notifier;
+    QLIST_ENTRY(VirtQueue) node;
 };
 
 /* virt queue functions */
@@ -605,7 +606,7 @@ void virtio_reset(void *opaque)
         vdev->vq[i].vring.used = 0;
         vdev->vq[i].last_avail_idx = 0;
         vdev->vq[i].pa = 0;
-        vdev->vq[i].vector = VIRTIO_NO_VECTOR;
+        virtio_queue_set_vector(vdev, i, VIRTIO_NO_VECTOR);
         vdev->vq[i].signalled_used = 0;
         vdev->vq[i].signalled_used_valid = false;
         vdev->vq[i].notification = true;
@@ -730,6 +731,16 @@ void virtio_queue_set_num(VirtIODevice *vdev, int n, int num)
     virtqueue_init(&vdev->vq[n]);
 }
 
+VirtQueue *virtio_vector_first_queue(VirtIODevice *vdev, uint16_t vector)
+{
+    return QLIST_FIRST(&vdev->vector_queues[vector]);
+}
+
+VirtQueue *virtio_vector_next_queue(VirtQueue *vq)
+{
+    return QLIST_NEXT(vq, node);
+}
+
 int virtio_queue_get_num(VirtIODevice *vdev, int n)
 {
     return vdev->vq[n].vring.num;
@@ -780,8 +791,19 @@ uint16_t virtio_queue_vector(VirtIODevice *vdev, int n)
 
 void virtio_queue_set_vector(VirtIODevice *vdev, int n, uint16_t vector)
 {
-    if (n < VIRTIO_PCI_QUEUE_MAX)
+    VirtQueue *vq = &vdev->vq[n];
+
+    if (n < VIRTIO_PCI_QUEUE_MAX) {
+        if (vdev->vector_queues &&
+            vdev->vq[n].vector != VIRTIO_NO_VECTOR) {
+            QLIST_REMOVE(vq, node);
+        }
         vdev->vq[n].vector = vector;
+        if (vdev->vector_queues &&
+            vector != VIRTIO_NO_VECTOR) {
+            QLIST_INSERT_HEAD(&vdev->vector_queues[vector], vq, node);
+        }
+    }
 }
 
 VirtQueue *virtio_add_queue(VirtIODevice *vdev, int queue_size,
@@ -1088,6 +1110,7 @@ void virtio_cleanup(VirtIODevice *vdev)
     qemu_del_vm_change_state_handler(vdev->vmstate);
     g_free(vdev->config);
     g_free(vdev->vq);
+    g_free(vdev->vector_queues);
 }
 
 static void virtio_vmstate_change(void *opaque, int running, RunState state)
@@ -1125,7 +1148,16 @@ void virtio_instance_init_common(Object *proxy_obj, void *data,
 void virtio_init(VirtIODevice *vdev, const char *name,
                  uint16_t device_id, size_t config_size)
 {
+    BusState *qbus = qdev_get_parent_bus(DEVICE(vdev));
+    VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(qbus);
     int i;
+    int nvectors = k->query_nvectors ? k->query_nvectors(qbus->parent) : 0;
+
+    if (nvectors) {
+        vdev->vector_queues =
+            g_malloc0(sizeof(*vdev->vector_queues) * nvectors);
+    }
+
     vdev->device_id = device_id;
     vdev->status = 0;
     vdev->isr = 0;
-- 
MST

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Qemu-devel] [PULL 13/28] virtio-pci: speedup MSI-X masking and unmasking
  2015-05-11 12:46 [Qemu-devel] [PULL 00/28] pc, virtio enhancements Michael S. Tsirkin
                   ` (11 preceding siblings ...)
  2015-05-11 12:47 ` [Qemu-devel] [PULL 12/28] virtio: introduce vector to virtqueues mapping Michael S. Tsirkin
@ 2015-05-11 12:47 ` Michael S. Tsirkin
  2015-05-11 12:47 ` [Qemu-devel] [PULL 14/28] pci: remove hard-coded bar size in msix_init_exclusive_bar() Michael S. Tsirkin
                   ` (15 subsequent siblings)
  28 siblings, 0 replies; 32+ messages in thread
From: Michael S. Tsirkin @ 2015-05-11 12:47 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Jason Wang

From: Jason Wang <jasowang@redhat.com>

This patch tries to speed up the MSI-X masking and unmasking through
the mapping between vector and queues. With this patch it will there's
no need to go through all possible virtqueues, which may help to
reduce the time spent when doing MSI-X masking/unmasking a single
vector when more than hundreds or even thousands of virtqueues were
supported.

Tested with 80 queue pairs virito-net-pci by changing the smp affinity
in the background and doing netperf in the same time:

Before the patch:
5711.70 Gbits/sec
After the patch:
6830.98 Gbits/sec

About 19.6% improvements in throughput.

Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/virtio/virtio-pci.c | 40 +++++++++++++++++++++-------------------
 1 file changed, 21 insertions(+), 19 deletions(-)

diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 6ae24a0..5ea4656 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -630,28 +630,30 @@ static int virtio_pci_vector_unmask(PCIDevice *dev, unsigned vector,
 {
     VirtIOPCIProxy *proxy = container_of(dev, VirtIOPCIProxy, pci_dev);
     VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus);
-    int ret, queue_no;
+    VirtQueue *vq = virtio_vector_first_queue(vdev, vector);
+    int ret, index, unmasked = 0;
 
-    for (queue_no = 0; queue_no < proxy->nvqs_with_notifiers; queue_no++) {
-        if (!virtio_queue_get_num(vdev, queue_no)) {
+    while (vq) {
+        index = virtio_get_queue_index(vq);
+        if (!virtio_queue_get_num(vdev, index)) {
             break;
         }
-        if (virtio_queue_vector(vdev, queue_no) != vector) {
-            continue;
-        }
-        ret = virtio_pci_vq_vector_unmask(proxy, queue_no, vector, msg);
+        ret = virtio_pci_vq_vector_unmask(proxy, index, vector, msg);
         if (ret < 0) {
             goto undo;
         }
+        vq = virtio_vector_next_queue(vq);
+        ++unmasked;
     }
+
     return 0;
 
 undo:
-    while (--queue_no >= 0) {
-        if (virtio_queue_vector(vdev, queue_no) != vector) {
-            continue;
-        }
-        virtio_pci_vq_vector_mask(proxy, queue_no, vector);
+    vq = virtio_vector_first_queue(vdev, vector);
+    while (vq && --unmasked >= 0) {
+        index = virtio_get_queue_index(vq);
+        virtio_pci_vq_vector_mask(proxy, index, vector);
+        vq = virtio_vector_next_queue(vq);
     }
     return ret;
 }
@@ -660,16 +662,16 @@ static void virtio_pci_vector_mask(PCIDevice *dev, unsigned vector)
 {
     VirtIOPCIProxy *proxy = container_of(dev, VirtIOPCIProxy, pci_dev);
     VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus);
-    int queue_no;
+    VirtQueue *vq = virtio_vector_first_queue(vdev, vector);
+    int index;
 
-    for (queue_no = 0; queue_no < proxy->nvqs_with_notifiers; queue_no++) {
-        if (!virtio_queue_get_num(vdev, queue_no)) {
+    while (vq) {
+        index = virtio_get_queue_index(vq);
+        if (!virtio_queue_get_num(vdev, index)) {
             break;
         }
-        if (virtio_queue_vector(vdev, queue_no) != vector) {
-            continue;
-        }
-        virtio_pci_vq_vector_mask(proxy, queue_no, vector);
+        virtio_pci_vq_vector_mask(proxy, index, vector);
+        vq = virtio_vector_next_queue(vq);
     }
 }
 
-- 
MST

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Qemu-devel] [PULL 14/28] pci: remove hard-coded bar size in msix_init_exclusive_bar()
  2015-05-11 12:46 [Qemu-devel] [PULL 00/28] pc, virtio enhancements Michael S. Tsirkin
                   ` (12 preceding siblings ...)
  2015-05-11 12:47 ` [Qemu-devel] [PULL 13/28] virtio-pci: speedup MSI-X masking and unmasking Michael S. Tsirkin
@ 2015-05-11 12:47 ` Michael S. Tsirkin
  2015-05-11 12:47 ` [Qemu-devel] [PULL 15/28] virtio: coding style tweak Michael S. Tsirkin
                   ` (14 subsequent siblings)
  28 siblings, 0 replies; 32+ messages in thread
From: Michael S. Tsirkin @ 2015-05-11 12:47 UTC (permalink / raw)
  To: qemu-devel
  Cc: Keith Busch, Peter Maydell, Jason Wang, Stefan Hajnoczi, Kevin Wolf

From: Jason Wang <jasowang@redhat.com>

This patch lets msix_init_exclusive_bar() can calculate the bar and
pba size based on the number of MSI-X vectors other than using a
hard-coded limit 4096. This is needed to allow device to have more
than 128 MSI_X vectors. To keep migration compatibility, keep using
4096 as bar size and 2048 for pba offset.

Notes: We don't care about the case that using vectors > 128 for
legacy machine type. Since we limit the queue max to 64, so vectors >=
65 is meaningless.

Virtio device will be the first user for this.

Cc: Keith Busch <keith.busch@intel.com>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/pci/msix.c | 30 +++++++++++++++++++-----------
 1 file changed, 19 insertions(+), 11 deletions(-)

diff --git a/hw/pci/msix.c b/hw/pci/msix.c
index 24de260..f8748cf 100644
--- a/hw/pci/msix.c
+++ b/hw/pci/msix.c
@@ -295,29 +295,37 @@ int msix_init_exclusive_bar(PCIDevice *dev, unsigned short nentries,
 {
     int ret;
     char *name;
+    uint32_t bar_size = 4096;
+    uint32_t bar_pba_offset = bar_size / 2;
+    uint32_t bar_pba_size = (nentries / 8 + 1) * 8;
 
     /*
      * Migration compatibility dictates that this remains a 4k
      * BAR with the vector table in the lower half and PBA in
-     * the upper half.  Do not use these elsewhere!
+     * the upper half for nentries which is lower or equal to 128.
+     * No need to care about using more than 65 entries for legacy
+     * machine types who has at most 64 queues.
      */
-#define MSIX_EXCLUSIVE_BAR_SIZE 4096
-#define MSIX_EXCLUSIVE_BAR_TABLE_OFFSET 0
-#define MSIX_EXCLUSIVE_BAR_PBA_OFFSET (MSIX_EXCLUSIVE_BAR_SIZE / 2)
-#define MSIX_EXCLUSIVE_CAP_OFFSET 0
+    if (nentries * PCI_MSIX_ENTRY_SIZE > bar_pba_offset) {
+        bar_pba_offset = nentries * PCI_MSIX_ENTRY_SIZE;
+    }
 
-    if (nentries * PCI_MSIX_ENTRY_SIZE > MSIX_EXCLUSIVE_BAR_PBA_OFFSET) {
-        return -EINVAL;
+    if (bar_pba_offset + bar_pba_size > 4096) {
+        bar_size = bar_pba_offset + bar_pba_size;
+    }
+
+    if (bar_size & (bar_size - 1)) {
+        bar_size = 1 << qemu_fls(bar_size);
     }
 
     name = g_strdup_printf("%s-msix", dev->name);
-    memory_region_init(&dev->msix_exclusive_bar, OBJECT(dev), name, MSIX_EXCLUSIVE_BAR_SIZE);
+    memory_region_init(&dev->msix_exclusive_bar, OBJECT(dev), name, bar_size);
     g_free(name);
 
     ret = msix_init(dev, nentries, &dev->msix_exclusive_bar, bar_nr,
-                    MSIX_EXCLUSIVE_BAR_TABLE_OFFSET, &dev->msix_exclusive_bar,
-                    bar_nr, MSIX_EXCLUSIVE_BAR_PBA_OFFSET,
-                    MSIX_EXCLUSIVE_CAP_OFFSET);
+                    0, &dev->msix_exclusive_bar,
+                    bar_nr, bar_pba_offset,
+                    0);
     if (ret) {
         return ret;
     }
-- 
MST

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Qemu-devel] [PULL 15/28] virtio: coding style tweak
  2015-05-11 12:46 [Qemu-devel] [PULL 00/28] pc, virtio enhancements Michael S. Tsirkin
                   ` (13 preceding siblings ...)
  2015-05-11 12:47 ` [Qemu-devel] [PULL 14/28] pci: remove hard-coded bar size in msix_init_exclusive_bar() Michael S. Tsirkin
@ 2015-05-11 12:47 ` Michael S. Tsirkin
  2015-05-11 12:48 ` [Qemu-devel] [PULL 16/28] docs: update documentation for memory hot unplug Michael S. Tsirkin
                   ` (13 subsequent siblings)
  28 siblings, 0 replies; 32+ messages in thread
From: Michael S. Tsirkin @ 2015-05-11 12:47 UTC (permalink / raw)
  To: qemu-devel; +Cc: Cornelia Huck, Peter Maydell, Gonglei, Thomas Huth

no space needed after *.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 include/hw/virtio/virtio.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
index 9706c29..8210cb3 100644
--- a/include/hw/virtio/virtio.h
+++ b/include/hw/virtio/virtio.h
@@ -84,7 +84,7 @@ struct VirtIODevice
     VMChangeStateEntry *vmstate;
     char *bus_name;
     uint8_t device_endian;
-    QLIST_HEAD(, VirtQueue) * vector_queues;
+    QLIST_HEAD(, VirtQueue) *vector_queues;
 };
 
 typedef struct VirtioDeviceClass {
-- 
MST

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Qemu-devel] [PULL 16/28] docs: update documentation for memory hot unplug
  2015-05-11 12:46 [Qemu-devel] [PULL 00/28] pc, virtio enhancements Michael S. Tsirkin
                   ` (14 preceding siblings ...)
  2015-05-11 12:47 ` [Qemu-devel] [PULL 15/28] virtio: coding style tweak Michael S. Tsirkin
@ 2015-05-11 12:48 ` Michael S. Tsirkin
  2015-05-11 12:48 ` [Qemu-devel] [PULL 17/28] acpi, mem-hotplug: add acpi_memory_slot_status() to get MemStatus Michael S. Tsirkin
                   ` (12 subsequent siblings)
  28 siblings, 0 replies; 32+ messages in thread
From: Michael S. Tsirkin @ 2015-05-11 12:48 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Zhu Guihua, Luiz Capitulino, Paulo Vital, Igor Mammedov

From: Zhu Guihua <zhugh.fnst@cn.fujitsu.com>

Add specification about how to use memory hot unplug, and add
a flow diagram to explain memory hot unplug process.

Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Zhu Guihua <zhugh.fnst@cn.fujitsu.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 docs/memory-hotplug.txt         | 23 +++++++++++++++++++---
 docs/specs/acpi_mem_hotplug.txt | 42 ++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 61 insertions(+), 4 deletions(-)

diff --git a/docs/memory-hotplug.txt b/docs/memory-hotplug.txt
index f70571d..56bdd0a 100644
--- a/docs/memory-hotplug.txt
+++ b/docs/memory-hotplug.txt
@@ -4,9 +4,7 @@ QEMU memory hotplug
 This document explains how to use the memory hotplug feature in QEMU,
 which is present since v2.1.0.
 
-Please, note that memory hotunplug is not supported yet. This means
-that you're able to add memory, but you're not able to remove it.
-Also, proper guest support is required for memory hotplug to work.
+Guest support is required for memory hotplug to work.
 
 Basic RAM hotplug
 -----------------
@@ -74,3 +72,22 @@ comes from regular RAM, 1GB is a 1GB hugepage page and 256MB is from
    -device pc-dimm,id=dimm1,memdev=mem1 \
    -object memory-backend-file,id=mem2,size=256M,mem-path=/mnt/hugepages-2MB \
    -device pc-dimm,id=dimm2,memdev=mem2
+
+
+RAM hot-unplug
+---------------
+
+In order to be able to hot unplug pc-dimm device, QEMU has to be told the ids
+of pc-dimm device and memory backend object. The ids were assigned when you hot
+plugged memory.
+
+Two monitor commands are used to hot unplug memory:
+
+ - "device_del": deletes a front-end pc-dimm device
+ - "object_del": deletes a memory backend object
+
+For example, assuming that the pc-dimm device with id "dimm1" exists, and its memory
+backend is "mem1", the following commands tries to remove it.
+
+  (qemu) device_del dimm1
+  (qemu) object_del mem1
diff --git a/docs/specs/acpi_mem_hotplug.txt b/docs/specs/acpi_mem_hotplug.txt
index 1290994..dcc4808 100644
--- a/docs/specs/acpi_mem_hotplug.txt
+++ b/docs/specs/acpi_mem_hotplug.txt
@@ -2,7 +2,7 @@ QEMU<->ACPI BIOS memory hotplug interface
 --------------------------------------
 
 ACPI BIOS GPE.3 handler is dedicated for notifying OS about memory hot-add
-events.
+and hot-remove events.
 
 Memory hot-plug interface (IO port 0xa00-0xa17, 1-4 byte access):
 ---------------------------------------------------------------
@@ -42,3 +42,43 @@ Selecting memory device slot beyond present range has no effect on platform:
      ignored
    - read accesses to memory hot-plug registers not documented above return
      all bits set to 1.
+
+Memory hot remove process diagram:
+----------------------------------
+ +-------------+     +-----------------------+      +------------------+     
+ |  1. QEMU    |     | 2. QEMU               |      |3. QEMU           |     
+ |  device_del +---->+ device unplug request +----->+Send SCI to guest,|     
+ |             |     |         cb            |      |return control to |     
+ +-------------+     +-----------------------+      |management        |     
+                                                    +------------------+     
+                                                                             
+ +---------------------------------------------------------------------+     
+                                                                             
+ +---------------------+              +-------------------------+            
+ | OSPM:               | remove event | OSPM:                   |            
+ | send Eject Request, |              | Scan memory devices     |            
+ | clear remove event  +<-------------+ for event flags         |            
+ |                     |              |                         |            
+ +---------------------+              +-------------------------+            
+           |                                                                 
+           |                                                                 
+ +---------v--------+            +-----------------------+                   
+ | Guest OS:        |  success   | OSPM:                 |                   
+ | process Ejection +----------->+ Execute _EJ0 method,  |                   
+ | request          |            | set eject bit in flags|                   
+ +------------------+            +-----------------------+                   
+           |failure                         |                                
+           v                                v                                
+ +------------------------+      +-----------------------+                   
+ | OSPM:                  |      | QEMU:                 |                   
+ | set OST event & status |      | call device unplug cb |                   
+ | fields                 |      |                       |                   
+ +------------------------+      +-----------------------+                   
+          |                                  |                               
+          v                                  v                               
+ +------------------+              +-------------------+                     
+ |QEMU:             |              |QEMU:              |                     
+ |Send OST QMP event|              |Send device deleted|                     
+ |                  |              |QMP event          |                     
+ +------------------+              |                   |                     
+                                   +-------------------+
-- 
MST

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Qemu-devel] [PULL 17/28] acpi, mem-hotplug: add acpi_memory_slot_status() to get MemStatus
  2015-05-11 12:46 [Qemu-devel] [PULL 00/28] pc, virtio enhancements Michael S. Tsirkin
                   ` (15 preceding siblings ...)
  2015-05-11 12:48 ` [Qemu-devel] [PULL 16/28] docs: update documentation for memory hot unplug Michael S. Tsirkin
@ 2015-05-11 12:48 ` Michael S. Tsirkin
  2015-05-11 12:48 ` [Qemu-devel] [PULL 18/28] acpi, mem-hotplug: add unplug request cb for memory device Michael S. Tsirkin
                   ` (11 subsequent siblings)
  28 siblings, 0 replies; 32+ messages in thread
From: Michael S. Tsirkin @ 2015-05-11 12:48 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Igor Mammedov, Zhu Guihua, Tang Chen

From: Tang Chen <tangchen@cn.fujitsu.com>

Add a new API named acpi_memory_slot_status() to obtain a single memory
slot status. Doing this is because this procedure will be used by other
functions in the next coming patches.

Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com>
Signed-off-by: Zhu Guihua <zhugh.fnst@cn.fujitsu.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/acpi/memory_hotplug.c | 34 ++++++++++++++++++++++++++++------
 1 file changed, 28 insertions(+), 6 deletions(-)

diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c
index c6580da..6af9303 100644
--- a/hw/acpi/memory_hotplug.c
+++ b/hw/acpi/memory_hotplug.c
@@ -163,29 +163,51 @@ void acpi_memory_hotplug_init(MemoryRegion *as, Object *owner,
     memory_region_add_subregion(as, ACPI_MEMORY_HOTPLUG_BASE, &state->io);
 }
 
-void acpi_memory_plug_cb(ACPIREGS *ar, qemu_irq irq, MemHotplugState *mem_st,
-                         DeviceState *dev, Error **errp)
+/**
+ * acpi_memory_slot_status:
+ * @mem_st: memory hotplug state
+ * @dev: device
+ * @errp: set in case of an error
+ *
+ * Obtain a single memory slot status.
+ *
+ * This function will be called by memory unplug request cb and unplug cb.
+ */
+static MemStatus *
+acpi_memory_slot_status(MemHotplugState *mem_st,
+                        DeviceState *dev, Error **errp)
 {
-    MemStatus *mdev;
     Error *local_err = NULL;
     int slot = object_property_get_int(OBJECT(dev), PC_DIMM_SLOT_PROP,
                                        &local_err);
 
     if (local_err) {
         error_propagate(errp, local_err);
-        return;
+        return NULL;
     }
 
     if (slot >= mem_st->dev_count) {
         char *dev_path = object_get_canonical_path(OBJECT(dev));
-        error_setg(errp, "acpi_memory_plug_cb: "
+        error_setg(errp, "acpi_memory_slot_status: "
                    "device [%s] returned invalid memory slot[%d]",
                     dev_path, slot);
         g_free(dev_path);
+        return NULL;
+    }
+
+    return &mem_st->devs[slot];
+}
+
+void acpi_memory_plug_cb(ACPIREGS *ar, qemu_irq irq, MemHotplugState *mem_st,
+                         DeviceState *dev, Error **errp)
+{
+    MemStatus *mdev;
+
+    mdev = acpi_memory_slot_status(mem_st, dev, errp);
+    if (!mdev) {
         return;
     }
 
-    mdev = &mem_st->devs[slot];
     mdev->dimm = dev;
     mdev->is_enabled = true;
     mdev->is_inserting = true;
-- 
MST

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Qemu-devel] [PULL 18/28] acpi, mem-hotplug: add unplug request cb for memory device
  2015-05-11 12:46 [Qemu-devel] [PULL 00/28] pc, virtio enhancements Michael S. Tsirkin
                   ` (16 preceding siblings ...)
  2015-05-11 12:48 ` [Qemu-devel] [PULL 17/28] acpi, mem-hotplug: add acpi_memory_slot_status() to get MemStatus Michael S. Tsirkin
@ 2015-05-11 12:48 ` Michael S. Tsirkin
  2015-05-11 12:48 ` [Qemu-devel] [PULL 19/28] acpi, mem-hotplug: add unplug " Michael S. Tsirkin
                   ` (10 subsequent siblings)
  28 siblings, 0 replies; 32+ messages in thread
From: Michael S. Tsirkin @ 2015-05-11 12:48 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Zhu Guihua, Tang Chen, Paolo Bonzini,
	Igor Mammedov, Richard Henderson

From: Tang Chen <tangchen@cn.fujitsu.com>

This patch adds unplug request cb for memory device, and adds the
is_removing boolean field to MemStatus. This field is used to indicate
whether the memory device in slot has been requested to be ejected.
This field is set to true in acpi_memory_unplug_request_cb().

Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com>
Signed-off-by: Zhu Guihua <zhugh.fnst@cn.fujitsu.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 include/hw/acpi/memory_hotplug.h | 10 ++++++++++
 hw/acpi/ich9.c                   | 10 ++++++++--
 hw/acpi/memory_hotplug.c         | 19 +++++++++++++++++++
 hw/acpi/piix4.c                  |  6 +++++-
 hw/i386/pc.c                     | 28 ++++++++++++++++++++++++++--
 5 files changed, 68 insertions(+), 5 deletions(-)

diff --git a/include/hw/acpi/memory_hotplug.h b/include/hw/acpi/memory_hotplug.h
index 7bbf8a0..9d7eee9 100644
--- a/include/hw/acpi/memory_hotplug.h
+++ b/include/hw/acpi/memory_hotplug.h
@@ -7,10 +7,17 @@
 
 #define ACPI_MEMORY_HOTPLUG_STATUS 8
 
+/**
+ * MemStatus:
+ * @is_removing: the memory device in slot has been requested to be ejected.
+ *
+ * This structure stores memory device's status.
+ */
 typedef struct MemStatus {
     DeviceState *dimm;
     bool is_enabled;
     bool is_inserting;
+    bool is_removing;
     uint32_t ost_event;
     uint32_t ost_status;
 } MemStatus;
@@ -28,6 +35,9 @@ void acpi_memory_hotplug_init(MemoryRegion *as, Object *owner,
 
 void acpi_memory_plug_cb(ACPIREGS *ar, qemu_irq irq, MemHotplugState *mem_st,
                          DeviceState *dev, Error **errp);
+void acpi_memory_unplug_request_cb(ACPIREGS *ar, qemu_irq irq,
+                                   MemHotplugState *mem_st,
+                                   DeviceState *dev, Error **errp);
 
 extern const VMStateDescription vmstate_memory_hotplug;
 #define VMSTATE_MEMORY_HOTPLUG(memhp, state) \
diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
index 5352e19..b85eed4 100644
--- a/hw/acpi/ich9.c
+++ b/hw/acpi/ich9.c
@@ -400,8 +400,14 @@ void ich9_pm_device_plug_cb(ICH9LPCPMRegs *pm, DeviceState *dev, Error **errp)
 void ich9_pm_device_unplug_request_cb(ICH9LPCPMRegs *pm, DeviceState *dev,
                                       Error **errp)
 {
-    error_setg(errp, "acpi: device unplug request for not supported device"
-               " type: %s", object_get_typename(OBJECT(dev)));
+    if (pm->acpi_memory_hotplug.is_enabled &&
+        object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM)) {
+        acpi_memory_unplug_request_cb(&pm->acpi_regs, pm->irq,
+                                      &pm->acpi_memory_hotplug, dev, errp);
+    } else {
+        error_setg(errp, "acpi: device unplug request for not supported device"
+                   " type: %s", object_get_typename(OBJECT(dev)));
+    }
 }
 
 void ich9_pm_device_unplug_cb(ICH9LPCPMRegs *pm, DeviceState *dev,
diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c
index 6af9303..42fe668 100644
--- a/hw/acpi/memory_hotplug.c
+++ b/hw/acpi/memory_hotplug.c
@@ -75,6 +75,7 @@ static uint64_t acpi_memory_hotplug_read(void *opaque, hwaddr addr,
     case 0x14: /* pack and return is_* fields */
         val |= mdev->is_enabled   ? 1 : 0;
         val |= mdev->is_inserting ? 2 : 0;
+        val |= mdev->is_removing  ? 4 : 0;
         trace_mhp_acpi_read_flags(mem_st->selector, val);
         break;
     default:
@@ -218,6 +219,24 @@ void acpi_memory_plug_cb(ACPIREGS *ar, qemu_irq irq, MemHotplugState *mem_st,
     return;
 }
 
+void acpi_memory_unplug_request_cb(ACPIREGS *ar, qemu_irq irq,
+                                   MemHotplugState *mem_st,
+                                   DeviceState *dev, Error **errp)
+{
+    MemStatus *mdev;
+
+    mdev = acpi_memory_slot_status(mem_st, dev, errp);
+    if (!mdev) {
+        return;
+    }
+
+    mdev->is_removing = true;
+
+    /* Do ACPI magic */
+    ar->gpe.sts[0] |= ACPI_MEMORY_HOTPLUG_STATUS;
+    acpi_update_sci(ar, irq);
+}
+
 static const VMStateDescription vmstate_memhp_sts = {
     .name = "memory hotplug device state",
     .version_id = 1,
diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
index d1f1179..f716e91 100644
--- a/hw/acpi/piix4.c
+++ b/hw/acpi/piix4.c
@@ -361,7 +361,11 @@ static void piix4_device_unplug_request_cb(HotplugHandler *hotplug_dev,
 {
     PIIX4PMState *s = PIIX4_PM(hotplug_dev);
 
-    if (object_dynamic_cast(OBJECT(dev), TYPE_PCI_DEVICE)) {
+    if (s->acpi_memory_hotplug.is_enabled &&
+        object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM)) {
+        acpi_memory_unplug_request_cb(&s->ar, s->irq, &s->acpi_memory_hotplug,
+                                      dev, errp);
+    } else if (object_dynamic_cast(OBJECT(dev), TYPE_PCI_DEVICE)) {
         acpi_pcihp_device_unplug_cb(&s->ar, s->irq, &s->acpi_pci_hotplug, dev,
                                     errp);
     } else {
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index a8e6be1..9b0859c 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1677,6 +1677,26 @@ out:
     error_propagate(errp, local_err);
 }
 
+static void pc_dimm_unplug_request(HotplugHandler *hotplug_dev,
+                                   DeviceState *dev, Error **errp)
+{
+    HotplugHandlerClass *hhc;
+    Error *local_err = NULL;
+    PCMachineState *pcms = PC_MACHINE(hotplug_dev);
+
+    if (!pcms->acpi_dev) {
+        error_setg(&local_err,
+                   "memory hotplug is not enabled: missing acpi device");
+        goto out;
+    }
+
+    hhc = HOTPLUG_HANDLER_GET_CLASS(pcms->acpi_dev);
+    hhc->unplug_request(HOTPLUG_HANDLER(pcms->acpi_dev), dev, &local_err);
+
+out:
+    error_propagate(errp, local_err);
+}
+
 static void pc_cpu_plug(HotplugHandler *hotplug_dev,
                         DeviceState *dev, Error **errp)
 {
@@ -1719,8 +1739,12 @@ static void pc_machine_device_plug_cb(HotplugHandler *hotplug_dev,
 static void pc_machine_device_unplug_request_cb(HotplugHandler *hotplug_dev,
                                                 DeviceState *dev, Error **errp)
 {
-    error_setg(errp, "acpi: device unplug request for not supported device"
-               " type: %s", object_get_typename(OBJECT(dev)));
+    if (object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM)) {
+        pc_dimm_unplug_request(hotplug_dev, dev, errp);
+    } else {
+        error_setg(errp, "acpi: device unplug request for not supported device"
+                   " type: %s", object_get_typename(OBJECT(dev)));
+    }
 }
 
 static void pc_machine_device_unplug_cb(HotplugHandler *hotplug_dev,
-- 
MST

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Qemu-devel] [PULL 19/28] acpi, mem-hotplug: add unplug cb for memory device
  2015-05-11 12:46 [Qemu-devel] [PULL 00/28] pc, virtio enhancements Michael S. Tsirkin
                   ` (17 preceding siblings ...)
  2015-05-11 12:48 ` [Qemu-devel] [PULL 18/28] acpi, mem-hotplug: add unplug request cb for memory device Michael S. Tsirkin
@ 2015-05-11 12:48 ` Michael S. Tsirkin
  2015-05-11 12:48 ` [Qemu-devel] [PULL 20/28] acpi: extend aml_field() to support UpdateRule Michael S. Tsirkin
                   ` (9 subsequent siblings)
  28 siblings, 0 replies; 32+ messages in thread
From: Michael S. Tsirkin @ 2015-05-11 12:48 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Zhu Guihua, Tang Chen, Paolo Bonzini,
	Igor Mammedov, Richard Henderson

From: Tang Chen <tangchen@cn.fujitsu.com>

This patch adds unplug cb for memory device. It resets memory status
"is_enabled" in acpi_memory_unplug_cb(), removes the corresponding
memory region, unregisters vmstate, and unparents the object.

Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com>
Signed-off-by: Zhu Guihua <zhugh.fnst@cn.fujitsu.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 include/hw/acpi/memory_hotplug.h |  2 ++
 hw/acpi/ich9.c                   |  9 +++++++--
 hw/acpi/memory_hotplug.c         | 14 ++++++++++++++
 hw/acpi/piix4.c                  | 11 +++++++++--
 hw/i386/pc.c                     | 34 ++++++++++++++++++++++++++++++++--
 5 files changed, 64 insertions(+), 6 deletions(-)

diff --git a/include/hw/acpi/memory_hotplug.h b/include/hw/acpi/memory_hotplug.h
index 9d7eee9..986223b 100644
--- a/include/hw/acpi/memory_hotplug.h
+++ b/include/hw/acpi/memory_hotplug.h
@@ -38,6 +38,8 @@ void acpi_memory_plug_cb(ACPIREGS *ar, qemu_irq irq, MemHotplugState *mem_st,
 void acpi_memory_unplug_request_cb(ACPIREGS *ar, qemu_irq irq,
                                    MemHotplugState *mem_st,
                                    DeviceState *dev, Error **errp);
+void acpi_memory_unplug_cb(MemHotplugState *mem_st,
+                           DeviceState *dev, Error **errp);
 
 extern const VMStateDescription vmstate_memory_hotplug;
 #define VMSTATE_MEMORY_HOTPLUG(memhp, state) \
diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
index b85eed4..84e5bb8 100644
--- a/hw/acpi/ich9.c
+++ b/hw/acpi/ich9.c
@@ -413,8 +413,13 @@ void ich9_pm_device_unplug_request_cb(ICH9LPCPMRegs *pm, DeviceState *dev,
 void ich9_pm_device_unplug_cb(ICH9LPCPMRegs *pm, DeviceState *dev,
                               Error **errp)
 {
-    error_setg(errp, "acpi: device unplug for not supported device"
-               " type: %s", object_get_typename(OBJECT(dev)));
+    if (pm->acpi_memory_hotplug.is_enabled &&
+        object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM)) {
+        acpi_memory_unplug_cb(&pm->acpi_memory_hotplug, dev, errp);
+    } else {
+        error_setg(errp, "acpi: device unplug for not supported device"
+                   " type: %s", object_get_typename(OBJECT(dev)));
+    }
 }
 
 void ich9_pm_ospm_status(AcpiDeviceIf *adev, ACPIOSTInfoList ***list)
diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c
index 42fe668..07e281f 100644
--- a/hw/acpi/memory_hotplug.c
+++ b/hw/acpi/memory_hotplug.c
@@ -237,6 +237,20 @@ void acpi_memory_unplug_request_cb(ACPIREGS *ar, qemu_irq irq,
     acpi_update_sci(ar, irq);
 }
 
+void acpi_memory_unplug_cb(MemHotplugState *mem_st,
+                           DeviceState *dev, Error **errp)
+{
+    MemStatus *mdev;
+
+    mdev = acpi_memory_slot_status(mem_st, dev, errp);
+    if (!mdev) {
+        return;
+    }
+
+    mdev->is_enabled = false;
+    mdev->dimm = NULL;
+}
+
 static const VMStateDescription vmstate_memhp_sts = {
     .name = "memory hotplug device state",
     .version_id = 1,
diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
index f716e91..1b28481 100644
--- a/hw/acpi/piix4.c
+++ b/hw/acpi/piix4.c
@@ -377,8 +377,15 @@ static void piix4_device_unplug_request_cb(HotplugHandler *hotplug_dev,
 static void piix4_device_unplug_cb(HotplugHandler *hotplug_dev,
                                    DeviceState *dev, Error **errp)
 {
-    error_setg(errp, "acpi: device unplug for not supported device"
-               " type: %s", object_get_typename(OBJECT(dev)));
+    PIIX4PMState *s = PIIX4_PM(hotplug_dev);
+
+    if (s->acpi_memory_hotplug.is_enabled &&
+        object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM)) {
+        acpi_memory_unplug_cb(&s->acpi_memory_hotplug, dev, errp);
+    } else {
+        error_setg(errp, "acpi: device unplug for not supported device"
+                   " type: %s", object_get_typename(OBJECT(dev)));
+    }
 }
 
 static void piix4_update_bus_hotplug(PCIBus *pci_bus, void *opaque)
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 9b0859c..769eb25 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1697,6 +1697,32 @@ out:
     error_propagate(errp, local_err);
 }
 
+static void pc_dimm_unplug(HotplugHandler *hotplug_dev,
+                           DeviceState *dev, Error **errp)
+{
+    PCMachineState *pcms = PC_MACHINE(hotplug_dev);
+    PCDIMMDevice *dimm = PC_DIMM(dev);
+    PCDIMMDeviceClass *ddc = PC_DIMM_GET_CLASS(dimm);
+    MemoryRegion *mr = ddc->get_memory_region(dimm);
+    HotplugHandlerClass *hhc;
+    Error *local_err = NULL;
+
+    hhc = HOTPLUG_HANDLER_GET_CLASS(pcms->acpi_dev);
+    hhc->unplug(HOTPLUG_HANDLER(pcms->acpi_dev), dev, &local_err);
+
+    if (local_err) {
+        goto out;
+    }
+
+    memory_region_del_subregion(&pcms->hotplug_memory, mr);
+    vmstate_unregister_ram(mr, dev);
+
+    object_unparent(OBJECT(dev));
+
+ out:
+    error_propagate(errp, local_err);
+}
+
 static void pc_cpu_plug(HotplugHandler *hotplug_dev,
                         DeviceState *dev, Error **errp)
 {
@@ -1750,8 +1776,12 @@ static void pc_machine_device_unplug_request_cb(HotplugHandler *hotplug_dev,
 static void pc_machine_device_unplug_cb(HotplugHandler *hotplug_dev,
                                         DeviceState *dev, Error **errp)
 {
-    error_setg(errp, "acpi: device unplug for not supported device"
-               " type: %s", object_get_typename(OBJECT(dev)));
+    if (object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM)) {
+        pc_dimm_unplug(hotplug_dev, dev, errp);
+    } else {
+        error_setg(errp, "acpi: device unplug for not supported device"
+                   " type: %s", object_get_typename(OBJECT(dev)));
+    }
 }
 
 static HotplugHandler *pc_get_hotpug_handler(MachineState *machine,
-- 
MST

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Qemu-devel] [PULL 20/28] acpi: extend aml_field() to support UpdateRule
  2015-05-11 12:46 [Qemu-devel] [PULL 00/28] pc, virtio enhancements Michael S. Tsirkin
                   ` (18 preceding siblings ...)
  2015-05-11 12:48 ` [Qemu-devel] [PULL 19/28] acpi, mem-hotplug: add unplug " Michael S. Tsirkin
@ 2015-05-11 12:48 ` Michael S. Tsirkin
  2015-05-11 12:48 ` [Qemu-devel] [PULL 21/28] acpi: fix "Memory device control fields" register Michael S. Tsirkin
                   ` (8 subsequent siblings)
  28 siblings, 0 replies; 32+ messages in thread
From: Michael S. Tsirkin @ 2015-05-11 12:48 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Zhu Guihua, Paolo Bonzini, Richard Henderson,
	Igor Mammedov

From: Zhu Guihua <zhugh.fnst@cn.fujitsu.com>

The flags field is declared with default update rule 'Preserve',
this patch extends aml_field() to support UpdateRule so that we
can specify different values per field.

Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Zhu Guihua <zhugh.fnst@cn.fujitsu.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 include/hw/acpi/aml-build.h | 10 ++++++++--
 hw/acpi/aml-build.c         |  4 +++-
 hw/i386/acpi-build.c        | 13 ++++++++-----
 3 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h
index 1705001..15579e6 100644
--- a/include/hw/acpi/aml-build.h
+++ b/include/hw/acpi/aml-build.h
@@ -47,7 +47,13 @@ typedef enum {
     aml_dword_acc = 3,
     aml_qword_acc = 4,
     aml_buffer_acc = 5,
-} AmlFieldFlags;
+} AmlAccessType;
+
+typedef enum {
+    aml_preserve = 0,
+    aml_write_as_ones = 1,
+    aml_write_as_zeros = 2,
+} AmlUpdateRule;
 
 typedef enum {
     aml_system_memory = 0x00,
@@ -205,7 +211,7 @@ Aml *aml_if(Aml *predicate);
 Aml *aml_package(uint8_t num_elements);
 Aml *aml_buffer(void);
 Aml *aml_resource_template(void);
-Aml *aml_field(const char *name, AmlFieldFlags flags);
+Aml *aml_field(const char *name, AmlAccessType type, AmlUpdateRule rule);
 Aml *aml_varpackage(uint32_t num_elements);
 
 void
diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
index 8d01959..77ce00b 100644
--- a/hw/acpi/aml-build.c
+++ b/hw/acpi/aml-build.c
@@ -636,9 +636,11 @@ Aml *aml_reserved_field(unsigned length)
 }
 
 /* ACPI 1.0b: 16.2.5.2 Named Objects Encoding: DefField */
-Aml *aml_field(const char *name, AmlFieldFlags flags)
+Aml *aml_field(const char *name, AmlAccessType type, AmlUpdateRule rule)
 {
     Aml *var = aml_bundle(0x81 /* FieldOp */, AML_EXT_PACKAGE);
+    uint8_t flags = rule << 5 | type;
+
     build_append_namestring(var->buf, "%s", name);
     build_append_byte(var->buf, flags);
     return var;
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index c193ca5..085dc6d 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -746,7 +746,7 @@ build_ssdt(GArray *table_data, GArray *linker,
 
         aml_append(dev, aml_operation_region("PEOR", aml_system_io,
                                               misc->pvpanic_port, 1));
-        field = aml_field("PEOR", aml_byte_acc);
+        field = aml_field("PEOR", aml_byte_acc, aml_preserve);
         aml_append(field, aml_named_field("PEPT", 8));
         aml_append(dev, field);
 
@@ -783,7 +783,7 @@ build_ssdt(GArray *table_data, GArray *linker,
         /* declare CPU hotplug MMIO region and PRS field to access it */
         aml_append(sb_scope, aml_operation_region(
             "PRST", aml_system_io, pm->cpu_hp_io_base, pm->cpu_hp_io_len));
-        field = aml_field("PRST", aml_byte_acc);
+        field = aml_field("PRST", aml_byte_acc, aml_preserve);
         aml_append(field, aml_named_field("PRS", 256));
         aml_append(sb_scope, field);
 
@@ -857,7 +857,8 @@ build_ssdt(GArray *table_data, GArray *linker,
             pm->mem_hp_io_base, pm->mem_hp_io_len)
         );
 
-        field = aml_field(stringify(MEMORY_HOTPLUG_IO_REGION), aml_dword_acc);
+        field = aml_field(stringify(MEMORY_HOTPLUG_IO_REGION), aml_dword_acc,
+                          aml_preserve);
         aml_append(field, /* read only */
             aml_named_field(stringify(MEMORY_SLOT_ADDR_LOW), 32));
         aml_append(field, /* read only */
@@ -870,7 +871,8 @@ build_ssdt(GArray *table_data, GArray *linker,
             aml_named_field(stringify(MEMORY_SLOT_PROXIMITY), 32));
         aml_append(scope, field);
 
-        field = aml_field(stringify(MEMORY_HOTPLUG_IO_REGION), aml_byte_acc);
+        field = aml_field(stringify(MEMORY_HOTPLUG_IO_REGION), aml_byte_acc,
+                          aml_preserve);
         aml_append(field, aml_reserved_field(160 /* bits, Offset(20) */));
         aml_append(field, /* 1 if enabled, read only */
             aml_named_field(stringify(MEMORY_SLOT_ENABLED), 1));
@@ -879,7 +881,8 @@ build_ssdt(GArray *table_data, GArray *linker,
             aml_named_field(stringify(MEMORY_SLOT_INSERT_EVENT), 1));
         aml_append(scope, field);
 
-        field = aml_field(stringify(MEMORY_HOTPLUG_IO_REGION), aml_dword_acc);
+        field = aml_field(stringify(MEMORY_HOTPLUG_IO_REGION), aml_dword_acc,
+                          aml_preserve);
         aml_append(field, /* DIMM selector, write only */
             aml_named_field(stringify(MEMORY_SLOT_SLECTOR), 32));
         aml_append(field, /* _OST event code, write only */
-- 
MST

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Qemu-devel] [PULL 21/28] acpi: fix "Memory device control fields" register
  2015-05-11 12:46 [Qemu-devel] [PULL 00/28] pc, virtio enhancements Michael S. Tsirkin
                   ` (19 preceding siblings ...)
  2015-05-11 12:48 ` [Qemu-devel] [PULL 20/28] acpi: extend aml_field() to support UpdateRule Michael S. Tsirkin
@ 2015-05-11 12:48 ` Michael S. Tsirkin
  2015-05-11 12:48 ` [Qemu-devel] [PULL 22/28] acpi: add hardware implementation for memory hot unplug Michael S. Tsirkin
                   ` (7 subsequent siblings)
  28 siblings, 0 replies; 32+ messages in thread
From: Michael S. Tsirkin @ 2015-05-11 12:48 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Zhu Guihua, Paolo Bonzini, Richard Henderson,
	Igor Mammedov

From: Zhu Guihua <zhugh.fnst@cn.fujitsu.com>

0 bit in Memory device control fields must be cleared before writing to
register. But now this field isn't cleared when other fields are written.

To solve this bug, This patch fixes UpdateRule to WriteAsZeros in "Memory
device control fields" register.

Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Zhu Guihua <zhugh.fnst@cn.fujitsu.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/i386/acpi-build.c            | 2 +-
 docs/specs/acpi_mem_hotplug.txt | 5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 085dc6d..4202d76 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -872,7 +872,7 @@ build_ssdt(GArray *table_data, GArray *linker,
         aml_append(scope, field);
 
         field = aml_field(stringify(MEMORY_HOTPLUG_IO_REGION), aml_byte_acc,
-                          aml_preserve);
+                          aml_write_as_zeros);
         aml_append(field, aml_reserved_field(160 /* bits, Offset(20) */));
         aml_append(field, /* 1 if enabled, read only */
             aml_named_field(stringify(MEMORY_SLOT_ENABLED), 1));
diff --git a/docs/specs/acpi_mem_hotplug.txt b/docs/specs/acpi_mem_hotplug.txt
index dcc4808..68daa14 100644
--- a/docs/specs/acpi_mem_hotplug.txt
+++ b/docs/specs/acpi_mem_hotplug.txt
@@ -31,7 +31,10 @@ Memory hot-plug interface (IO port 0xa00-0xa17, 1-4 byte access):
       [0xc-0x13] reserved, writes into it are ignored
       [0x14] Memory device control fields
           bits:
-              0: reserved, OSPM must clear it before writing to register
+              0: reserved, OSPM must clear it before writing to register.
+                 Due to BUG in versions prior 2.4 that field isn't cleared
+                 when other fields are written. Keep it reserved and don't
+                 try to reuse it.
               1: if set to 1 clears device insert event, set by OSPM
                  after it has emitted device check event for the
                  selected memory device
-- 
MST

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Qemu-devel] [PULL 22/28] acpi: add hardware implementation for memory hot unplug
  2015-05-11 12:46 [Qemu-devel] [PULL 00/28] pc, virtio enhancements Michael S. Tsirkin
                   ` (20 preceding siblings ...)
  2015-05-11 12:48 ` [Qemu-devel] [PULL 21/28] acpi: fix "Memory device control fields" register Michael S. Tsirkin
@ 2015-05-11 12:48 ` Michael S. Tsirkin
  2015-05-11 12:48 ` [Qemu-devel] [PULL 23/28] qmp-event: add event notification for memory hot unplug error Michael S. Tsirkin
                   ` (6 subsequent siblings)
  28 siblings, 0 replies; 32+ messages in thread
From: Michael S. Tsirkin @ 2015-05-11 12:48 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Zhu Guihua, Paolo Bonzini, Richard Henderson,
	Igor Mammedov

From: Zhu Guihua <zhugh.fnst@cn.fujitsu.com>

- implements QEMU hardware part of memory hot unplug protocol
  described at "docs/spec/acpi_mem_hotplug.txt"
- handles memory remove notification event
- handles device eject notification

Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Zhu Guihua <zhugh.fnst@cn.fujitsu.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 include/hw/acpi/pc-hotplug.h      |  3 +++
 include/hw/qdev-core.h            |  1 +
 hw/acpi/memory_hotplug.c          | 21 ++++++++++++++++++++-
 hw/core/qdev.c                    |  2 +-
 hw/i386/acpi-build.c              | 12 ++++++++++++
 docs/specs/acpi_mem_hotplug.txt   | 11 +++++++++--
 hw/i386/acpi-dsdt-mem-hotplug.dsl | 13 ++++++++++++-
 trace-events                      |  3 +++
 8 files changed, 61 insertions(+), 5 deletions(-)

diff --git a/include/hw/acpi/pc-hotplug.h b/include/hw/acpi/pc-hotplug.h
index efa6ed7..0513c1c 100644
--- a/include/hw/acpi/pc-hotplug.h
+++ b/include/hw/acpi/pc-hotplug.h
@@ -43,6 +43,8 @@
 #define MEMORY_SLOT_PROXIMITY        MPX
 #define MEMORY_SLOT_ENABLED          MES
 #define MEMORY_SLOT_INSERT_EVENT     MINS
+#define MEMORY_SLOT_REMOVE_EVENT     MRMV
+#define MEMORY_SLOT_EJECT            MEJ
 #define MEMORY_SLOT_SLECTOR          MSEL
 #define MEMORY_SLOT_OST_EVENT        MOEV
 #define MEMORY_SLOT_OST_STATUS       MOSC
@@ -51,6 +53,7 @@
 #define MEMORY_SLOT_CRS_METHOD       MCRS
 #define MEMORY_SLOT_OST_METHOD       MOST
 #define MEMORY_SLOT_PROXIMITY_METHOD MPXM
+#define MEMORY_SLOT_EJECT_METHOD     MEJ0
 #define MEMORY_SLOT_NOTIFY_METHOD    MTFY
 #define MEMORY_SLOT_SCAN_METHOD      MSCN
 
diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
index 4e673f9..5b7acf1 100644
--- a/include/hw/qdev-core.h
+++ b/include/hw/qdev-core.h
@@ -266,6 +266,7 @@ int qdev_init(DeviceState *dev) QEMU_WARN_UNUSED_RESULT;
 void qdev_init_nofail(DeviceState *dev);
 void qdev_set_legacy_instance_id(DeviceState *dev, int alias_id,
                                  int required_for_version);
+HotplugHandler *qdev_get_hotplug_handler(DeviceState *dev);
 void qdev_unplug(DeviceState *dev, Error **errp);
 void qdev_simple_device_unplug_cb(HotplugHandler *hotplug_dev,
                                   DeviceState *dev, Error **errp);
diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c
index 07e281f..35bbfeb 100644
--- a/hw/acpi/memory_hotplug.c
+++ b/hw/acpi/memory_hotplug.c
@@ -2,6 +2,7 @@
 #include "hw/acpi/pc-hotplug.h"
 #include "hw/mem/pc-dimm.h"
 #include "hw/boards.h"
+#include "hw/qdev-core.h"
 #include "trace.h"
 #include "qapi-event.h"
 
@@ -91,6 +92,8 @@ static void acpi_memory_hotplug_write(void *opaque, hwaddr addr, uint64_t data,
     MemHotplugState *mem_st = opaque;
     MemStatus *mdev;
     ACPIOSTInfo *info;
+    DeviceState *dev = NULL;
+    HotplugHandler *hotplug_ctrl = NULL;
 
     if (!mem_st->dev_count) {
         return;
@@ -128,13 +131,29 @@ static void acpi_memory_hotplug_write(void *opaque, hwaddr addr, uint64_t data,
         qapi_event_send_acpi_device_ost(info, &error_abort);
         qapi_free_ACPIOSTInfo(info);
         break;
-    case 0x14:
+    case 0x14: /* set is_* fields  */
         mdev = &mem_st->devs[mem_st->selector];
         if (data & 2) { /* clear insert event */
             mdev->is_inserting  = false;
             trace_mhp_acpi_clear_insert_evt(mem_st->selector);
+        } else if (data & 4) {
+            mdev->is_removing = false;
+            trace_mhp_acpi_clear_remove_evt(mem_st->selector);
+        } else if (data & 8) {
+            if (!mdev->is_enabled) {
+                trace_mhp_acpi_ejecting_invalid_slot(mem_st->selector);
+                break;
+            }
+
+            dev = DEVICE(mdev->dimm);
+            hotplug_ctrl = qdev_get_hotplug_handler(dev);
+            /* call pc-dimm unplug cb */
+            hotplug_handler_unplug(hotplug_ctrl, dev, NULL);
+            trace_mhp_acpi_pc_dimm_deleted(mem_st->selector);
         }
         break;
+    default:
+        break;
     }
 
 }
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 6e6a65d..b0f0f84 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -273,7 +273,7 @@ void qdev_set_legacy_instance_id(DeviceState *dev, int alias_id,
     dev->alias_required_for_version = required_for_version;
 }
 
-static HotplugHandler *qdev_get_hotplug_handler(DeviceState *dev)
+HotplugHandler *qdev_get_hotplug_handler(DeviceState *dev)
 {
     HotplugHandler *hotplug_ctrl = NULL;
 
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 4202d76..967448a 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -879,6 +879,12 @@ build_ssdt(GArray *table_data, GArray *linker,
         aml_append(field,
             /*(read) 1 if has a insert event. (write) 1 to clear event */
             aml_named_field(stringify(MEMORY_SLOT_INSERT_EVENT), 1));
+        aml_append(field,
+            /* (read) 1 if has a remove event. (write) 1 to clear event */
+            aml_named_field(stringify(MEMORY_SLOT_REMOVE_EVENT), 1));
+        aml_append(field,
+            /* initiates device eject, write only */
+            aml_named_field(stringify(MEMORY_SLOT_EJECT), 1));
         aml_append(scope, field);
 
         field = aml_field(stringify(MEMORY_HOTPLUG_IO_REGION), aml_dword_acc,
@@ -923,6 +929,12 @@ build_ssdt(GArray *table_data, GArray *linker,
             )));
             aml_append(dev, method);
 
+            method = aml_method("_EJ0", 1);
+            s = BASEPATH stringify(MEMORY_SLOT_EJECT_METHOD);
+            aml_append(method, aml_return(aml_call2(
+                       s, aml_name("_UID"), aml_arg(0))));
+            aml_append(dev, method);
+
             aml_append(sb_scope, dev);
         }
 
diff --git a/docs/specs/acpi_mem_hotplug.txt b/docs/specs/acpi_mem_hotplug.txt
index 68daa14..3df3620 100644
--- a/docs/specs/acpi_mem_hotplug.txt
+++ b/docs/specs/acpi_mem_hotplug.txt
@@ -19,7 +19,9 @@ Memory hot-plug interface (IO port 0xa00-0xa17, 1-4 byte access):
               1: Device insert event, used to distinguish device for which
                  no device check event to OSPM was issued.
                  It's valid only when bit 1 is set.
-              2-7: reserved and should be ignored by OSPM
+              2: Device remove event, used to distinguish device for which
+                 no device eject request to OSPM was issued.
+              3-7: reserved and should be ignored by OSPM
       [0x15-0x17] reserved
 
   write access:
@@ -38,7 +40,12 @@ Memory hot-plug interface (IO port 0xa00-0xa17, 1-4 byte access):
               1: if set to 1 clears device insert event, set by OSPM
                  after it has emitted device check event for the
                  selected memory device
-              2-7: reserved, OSPM must clear them before writing to register
+              2: if set to 1 clears device remove event, set by OSPM
+                 after it has emitted device eject request for the
+                 selected memory device
+              3: if set to 1 initiates device eject, set by OSPM when it
+                 triggers memory device removal and calls _EJ0 method
+              4-7: reserved, OSPM must clear them before writing to register
 
 Selecting memory device slot beyond present range has no effect on platform:
    - write accesses to memory hot-plug registers not documented above are
diff --git a/hw/i386/acpi-dsdt-mem-hotplug.dsl b/hw/i386/acpi-dsdt-mem-hotplug.dsl
index 1e9ec39..c2bb6a1 100644
--- a/hw/i386/acpi-dsdt-mem-hotplug.dsl
+++ b/hw/i386/acpi-dsdt-mem-hotplug.dsl
@@ -29,6 +29,8 @@
             External(MEMORY_SLOT_PROXIMITY, FieldUnitObj) // read only
             External(MEMORY_SLOT_ENABLED, FieldUnitObj) // 1 if enabled, read only
             External(MEMORY_SLOT_INSERT_EVENT, FieldUnitObj) // (read) 1 if has a insert event. (write) 1 to clear event
+            External(MEMORY_SLOT_REMOVE_EVENT, FieldUnitObj) // (read) 1 if has a remove event. (write) 1 to clear event
+            External(MEMORY_SLOT_EJECT, FieldUnitObj) // initiates device eject, write only
             External(MEMORY_SLOT_SLECTOR, FieldUnitObj) // DIMM selector, write only
             External(MEMORY_SLOT_OST_EVENT, FieldUnitObj) // _OST event code, write only
             External(MEMORY_SLOT_OST_STATUS, FieldUnitObj) // _OST status code, write only
@@ -55,8 +57,10 @@
                     If (LEqual(MEMORY_SLOT_INSERT_EVENT, One)) { // Memory device needs check
                         MEMORY_SLOT_NOTIFY_METHOD(Local0, 1)
                         Store(1, MEMORY_SLOT_INSERT_EVENT)
+                    } Elseif (LEqual(MEMORY_SLOT_REMOVE_EVENT, One)) { // Ejection request
+                        MEMORY_SLOT_NOTIFY_METHOD(Local0, 3)
+                        Store(1, MEMORY_SLOT_REMOVE_EVENT)
                     }
-                    // TODO: handle memory eject request
                     Add(Local0, One, Local0) // goto next DIMM
                 }
                 Release(MEMORY_SLOT_LOCK)
@@ -156,5 +160,12 @@
                 Store(Arg2, MEMORY_SLOT_OST_STATUS)
                 Release(MEMORY_SLOT_LOCK)
             }
+
+            Method(MEMORY_SLOT_EJECT_METHOD, 2) {
+                Acquire(MEMORY_SLOT_LOCK, 0xFFFF)
+                Store(ToInteger(Arg0), MEMORY_SLOT_SLECTOR) // select DIMM
+                Store(1, MEMORY_SLOT_EJECT)
+                Release(MEMORY_SLOT_LOCK)
+            }
         } // Device()
     } // Scope()
diff --git a/trace-events b/trace-events
index 30eba92..46f6ef0 100644
--- a/trace-events
+++ b/trace-events
@@ -1562,6 +1562,7 @@ vfio_put_base_device(int fd) "close vdev->fd=%d"
 
 #hw/acpi/memory_hotplug.c
 mhp_acpi_invalid_slot_selected(uint32_t slot) "0x%"PRIx32
+mhp_acpi_ejecting_invalid_slot(uint32_t slot) "0x%"PRIx32
 mhp_acpi_read_addr_lo(uint32_t slot, uint32_t addr) "slot[0x%"PRIx32"] addr lo: 0x%"PRIx32
 mhp_acpi_read_addr_hi(uint32_t slot, uint32_t addr) "slot[0x%"PRIx32"] addr hi: 0x%"PRIx32
 mhp_acpi_read_size_lo(uint32_t slot, uint32_t size) "slot[0x%"PRIx32"] size lo: 0x%"PRIx32
@@ -1572,6 +1573,8 @@ mhp_acpi_write_slot(uint32_t slot) "set active slot: 0x%"PRIx32
 mhp_acpi_write_ost_ev(uint32_t slot, uint32_t ev) "slot[0x%"PRIx32"] OST EVENT: 0x%"PRIx32
 mhp_acpi_write_ost_status(uint32_t slot, uint32_t st) "slot[0x%"PRIx32"] OST STATUS: 0x%"PRIx32
 mhp_acpi_clear_insert_evt(uint32_t slot) "slot[0x%"PRIx32"] clear insert event"
+mhp_acpi_clear_remove_evt(uint32_t slot) "slot[0x%"PRIx32"] clear remove event"
+mhp_acpi_pc_dimm_deleted(uint32_t slot) "slot[0x%"PRIx32"] pc-dimm deleted"
 
 # hw/i386/pc.c
 mhp_pc_dimm_assigned_slot(int slot) "0x%d"
-- 
MST

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Qemu-devel] [PULL 23/28] qmp-event: add event notification for memory hot unplug error
  2015-05-11 12:46 [Qemu-devel] [PULL 00/28] pc, virtio enhancements Michael S. Tsirkin
                   ` (21 preceding siblings ...)
  2015-05-11 12:48 ` [Qemu-devel] [PULL 22/28] acpi: add hardware implementation for memory hot unplug Michael S. Tsirkin
@ 2015-05-11 12:48 ` Michael S. Tsirkin
  2015-05-11 15:03   ` Eric Blake
  2015-05-11 12:48 ` [Qemu-devel] [PULL 24/28] acpi: add a missing backslash to the \_SB scope Michael S. Tsirkin
                   ` (5 subsequent siblings)
  28 siblings, 1 reply; 32+ messages in thread
From: Michael S. Tsirkin @ 2015-05-11 12:48 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Zhu Guihua, Luiz Capitulino, Michael Roth, Igor Mammedov

From: Zhu Guihua <zhugh.fnst@cn.fujitsu.com>

When memory hot unplug fails, this patch adds support to send
QMP event to notify mgmt about this failure.

Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Zhu Guihua <zhugh.fnst@cn.fujitsu.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 qapi/event.json          | 14 ++++++++++++++
 hw/acpi/memory_hotplug.c | 10 +++++++++-
 docs/qmp/qmp-events.txt  | 17 +++++++++++++++++
 trace-events             |  1 +
 4 files changed, 41 insertions(+), 1 deletion(-)

diff --git a/qapi/event.json b/qapi/event.json
index c51dc49..378dda5 100644
--- a/qapi/event.json
+++ b/qapi/event.json
@@ -330,3 +330,17 @@
 ##
 { 'event': 'VSERPORT_CHANGE',
   'data': { 'id': 'str', 'open': 'bool' } }
+
+##
+# @MEM_UNPLUG_ERROR
+#
+# Emitted when memory hot unplug error occurs.
+#
+# @device: device name
+#
+# @msg: Informative message
+#
+# Since: 2.4
+##
+{ 'event': 'MEM_UNPLUG_ERROR',
+  'data': { 'device': 'str', 'msg': 'str' } }
diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c
index 35bbfeb..34cef1e 100644
--- a/hw/acpi/memory_hotplug.c
+++ b/hw/acpi/memory_hotplug.c
@@ -94,6 +94,7 @@ static void acpi_memory_hotplug_write(void *opaque, hwaddr addr, uint64_t data,
     ACPIOSTInfo *info;
     DeviceState *dev = NULL;
     HotplugHandler *hotplug_ctrl = NULL;
+    Error *local_err = NULL;
 
     if (!mem_st->dev_count) {
         return;
@@ -148,7 +149,14 @@ static void acpi_memory_hotplug_write(void *opaque, hwaddr addr, uint64_t data,
             dev = DEVICE(mdev->dimm);
             hotplug_ctrl = qdev_get_hotplug_handler(dev);
             /* call pc-dimm unplug cb */
-            hotplug_handler_unplug(hotplug_ctrl, dev, NULL);
+            hotplug_handler_unplug(hotplug_ctrl, dev, &local_err);
+            if (local_err) {
+                trace_mhp_acpi_pc_dimm_delete_failed(mem_st->selector);
+                qapi_event_send_mem_unplug_error(dev->id,
+                                                 error_get_pretty(local_err),
+                                                 &error_abort);
+                break;
+            }
             trace_mhp_acpi_pc_dimm_deleted(mem_st->selector);
         }
         break;
diff --git a/docs/qmp/qmp-events.txt b/docs/qmp/qmp-events.txt
index d759d19..3be468f 100644
--- a/docs/qmp/qmp-events.txt
+++ b/docs/qmp/qmp-events.txt
@@ -226,6 +226,23 @@ Example:
 { "event": "GUEST_PANICKED",
      "data": { "action": "pause" } }
 
+MEM_HOT_UNPLUG_ERROR
+--------------------
+Emitted when memory hot unplug error occurs.
+
+Data:
+
+- "device": device name (json-string)
+- "msg": Informative message (e.g., reason for the error) (json-string)
+
+Example:
+
+{ "event": "MEM_HOT_UNPLUG_ERROR"
+  "data": { "device": "dimm1",
+            "msg": "acpi: device unplug for unsupported device"
+  },
+  "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
+
 NIC_RX_FILTER_CHANGED
 ---------------------
 
diff --git a/trace-events b/trace-events
index 46f6ef0..11387c3 100644
--- a/trace-events
+++ b/trace-events
@@ -1575,6 +1575,7 @@ mhp_acpi_write_ost_status(uint32_t slot, uint32_t st) "slot[0x%"PRIx32"] OST STA
 mhp_acpi_clear_insert_evt(uint32_t slot) "slot[0x%"PRIx32"] clear insert event"
 mhp_acpi_clear_remove_evt(uint32_t slot) "slot[0x%"PRIx32"] clear remove event"
 mhp_acpi_pc_dimm_deleted(uint32_t slot) "slot[0x%"PRIx32"] pc-dimm deleted"
+mhp_acpi_pc_dimm_delete_failed(uint32_t slot) "slot[0x%"PRIx32"] pc-dimm delete failed"
 
 # hw/i386/pc.c
 mhp_pc_dimm_assigned_slot(int slot) "0x%d"
-- 
MST

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Qemu-devel] [PULL 24/28] acpi: add a missing backslash to the \_SB scope.
  2015-05-11 12:46 [Qemu-devel] [PULL 00/28] pc, virtio enhancements Michael S. Tsirkin
                   ` (22 preceding siblings ...)
  2015-05-11 12:48 ` [Qemu-devel] [PULL 23/28] qmp-event: add event notification for memory hot unplug error Michael S. Tsirkin
@ 2015-05-11 12:48 ` Michael S. Tsirkin
  2015-05-11 12:48 ` [Qemu-devel] [PULL 25/28] pci: Merge pci_nic_init() into pci_nic_init_nofail() Michael S. Tsirkin
                   ` (4 subsequent siblings)
  28 siblings, 0 replies; 32+ messages in thread
From: Michael S. Tsirkin @ 2015-05-11 12:48 UTC (permalink / raw)
  To: qemu-devel
  Cc: Gal Hammer, Peter Maydell, Richard Henderson, Paolo Bonzini,
	Igor Mammedov

From: Gal Hammer <ghammer@redhat.com>

A predefined scope in the ACPI specs is precede with a backslash.

Signed-off-by: Gal Hammer <ghammer@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
---
 include/hw/acpi/aml-build.h | 2 +-
 hw/i386/acpi-build.c        | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h
index 15579e6..3947201 100644
--- a/include/hw/acpi/aml-build.h
+++ b/include/hw/acpi/aml-build.h
@@ -146,7 +146,7 @@ void free_aml_allocator(void);
  * Joins Aml elements together and helps to construct AML tables
  * Examle of usage:
  *   Aml *table = aml_def_block("SSDT", ...);
- *   Aml *sb = aml_scope("\_SB");
+ *   Aml *sb = aml_scope("\\_SB");
  *   Aml *dev = aml_device("PCI0");
  *
  *   aml_append(dev, aml_name_decl("HID", aml_eisaid("PNP0A03")));
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 967448a..02b2e0c 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -763,7 +763,7 @@ build_ssdt(GArray *table_data, GArray *linker,
         aml_append(ssdt, scope);
     }
 
-    sb_scope = aml_scope("_SB");
+    sb_scope = aml_scope("\\_SB");
     {
         /* create PCI0.PRES device and its _CRS to reserve CPU hotplug MMIO */
         dev = aml_device("PCI0." stringify(CPU_HOTPLUG_RESOURCE_DEVICE));
-- 
MST

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Qemu-devel] [PULL 25/28] pci: Merge pci_nic_init() into pci_nic_init_nofail()
  2015-05-11 12:46 [Qemu-devel] [PULL 00/28] pc, virtio enhancements Michael S. Tsirkin
                   ` (23 preceding siblings ...)
  2015-05-11 12:48 ` [Qemu-devel] [PULL 24/28] acpi: add a missing backslash to the \_SB scope Michael S. Tsirkin
@ 2015-05-11 12:48 ` Michael S. Tsirkin
  2015-05-11 12:48 ` [Qemu-devel] [PULL 26/28] virtio-net: Move DEFINE_VIRTIO_NET_FEATURES to virtio-net Michael S. Tsirkin
                   ` (3 subsequent siblings)
  28 siblings, 0 replies; 32+ messages in thread
From: Michael S. Tsirkin @ 2015-05-11 12:48 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Thomas Huth, Markus Armbruster

From: Thomas Huth <thuth@redhat.com>

The error reporting in pci_nic_init() is quite erratic: Some errors
are printed directly with error_report(), and some are passed back
to the caller pci_nic_init_nofail() via an Error pointer.
Since pci_nic_init() is only used by pci_nic_init_nofail(), the
functions can be simply merged to clean up this inconsistency.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
---
 hw/pci/pci.c | 43 ++++++++++++++-----------------------------
 1 file changed, 14 insertions(+), 29 deletions(-)

diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index b3d5100..56947ae 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -1611,28 +1611,32 @@ static const char * const pci_nic_names[] = {
 };
 
 /* Initialize a PCI NIC.  */
-static PCIDevice *pci_nic_init(NICInfo *nd, PCIBus *rootbus,
+PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
                                const char *default_model,
-                               const char *default_devaddr,
-                               Error **errp)
+                               const char *default_devaddr)
 {
     const char *devaddr = nd->devaddr ? nd->devaddr : default_devaddr;
     Error *err = NULL;
     PCIBus *bus;
-    int devfn;
     PCIDevice *pci_dev;
     DeviceState *dev;
+    int devfn;
     int i;
 
+    if (qemu_show_nic_models(nd->model, pci_nic_models)) {
+        exit(0);
+    }
+
     i = qemu_find_nic_model(nd, pci_nic_models, default_model);
-    if (i < 0)
-        return NULL;
+    if (i < 0) {
+        exit(1);
+    }
 
     bus = pci_get_bus_devfn(&devfn, rootbus, devaddr);
     if (!bus) {
         error_report("Invalid PCI device address %s for device %s",
                      devaddr, pci_nic_names[i]);
-        return NULL;
+        exit(1);
     }
 
     pci_dev = pci_create(bus, devfn, pci_nic_names[i]);
@@ -1641,31 +1645,12 @@ static PCIDevice *pci_nic_init(NICInfo *nd, PCIBus *rootbus,
 
     object_property_set_bool(OBJECT(dev), true, "realized", &err);
     if (err) {
-        error_propagate(errp, err);
+        error_report_err(err);
         object_unparent(OBJECT(dev));
-        return NULL;
-    }
-    return pci_dev;
-}
-
-PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus,
-                               const char *default_model,
-                               const char *default_devaddr)
-{
-    Error *err = NULL;
-    PCIDevice *res;
-
-    if (qemu_show_nic_models(nd->model, pci_nic_models))
-        exit(0);
-
-    res = pci_nic_init(nd, rootbus, default_model, default_devaddr, &err);
-    if (!res) {
-        if (err) {
-            error_report_err(err);
-        }
         exit(1);
     }
-    return res;
+
+    return pci_dev;
 }
 
 PCIDevice *pci_vga_init(PCIBus *bus)
-- 
MST

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Qemu-devel] [PULL 26/28] virtio-net: Move DEFINE_VIRTIO_NET_FEATURES to virtio-net
  2015-05-11 12:46 [Qemu-devel] [PULL 00/28] pc, virtio enhancements Michael S. Tsirkin
                   ` (24 preceding siblings ...)
  2015-05-11 12:48 ` [Qemu-devel] [PULL 25/28] pci: Merge pci_nic_init() into pci_nic_init_nofail() Michael S. Tsirkin
@ 2015-05-11 12:48 ` Michael S. Tsirkin
  2015-05-11 12:48 ` [Qemu-devel] [PULL 27/28] virtio-scsi: Move DEFINE_VIRTIO_SCSI_FEATURES to virtio-scsi Michael S. Tsirkin
                   ` (2 subsequent siblings)
  28 siblings, 0 replies; 32+ messages in thread
From: Michael S. Tsirkin @ 2015-05-11 12:48 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Alexander Graf, Christian Borntraeger,
	Shannon Zhao, Shannon Zhao, Cornelia Huck, Richard Henderson

From: Shannon Zhao <shannon.zhao@linaro.org>

So far virtio-net-device can't expose host features to guest while
using virtio-mmio because it doesn't set DEFINE_VIRTIO_NET_FEATURES on
backend or transport. So the performance is low.

The host features belong to the backend while virtio-net-pci,
virtio-net-s390 and virtio-net-ccw set the DEFINE_VIRTIO_NET_FEATURES
on transports. But they already have the ability to forward property
accesses to the backend child. So if we move the host features to
backends, it doesn't break the backwards compatibility for them and
make host features work while using virtio-mmio.

Here we move DEFINE_VIRTIO_NET_FEATURES to the backend virtio-net. The
transports just sync the host features from backend. Meanwhile move
virtio_net_set_config_size to virtio-net to make sure the config size
is correct and don't expose it.

Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com>
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
---
 include/hw/virtio/virtio-net.h | 2 +-
 hw/net/virtio-net.c            | 7 ++++++-
 hw/s390x/s390-virtio-bus.c     | 2 --
 hw/s390x/virtio-ccw.c          | 2 --
 hw/virtio/virtio-pci.c         | 2 --
 5 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/include/hw/virtio/virtio-net.h b/include/hw/virtio/virtio-net.h
index 4c2fe83..e0dbb41 100644
--- a/include/hw/virtio/virtio-net.h
+++ b/include/hw/virtio/virtio-net.h
@@ -68,6 +68,7 @@ typedef struct VirtIONet {
     uint32_t has_vnet_hdr;
     size_t host_hdr_len;
     size_t guest_hdr_len;
+    uint32_t host_features;
     uint8_t has_ufo;
     int mergeable_rx_bufs;
     uint8_t promisc;
@@ -137,7 +138,6 @@ typedef struct VirtIONet {
     DEFINE_PROP_INT32("x-txburst", _state, _field.txburst, TX_BURST),          \
     DEFINE_PROP_STRING("tx", _state, _field.tx)
 
-void virtio_net_set_config_size(VirtIONet *n, uint32_t host_features);
 void virtio_net_set_netclient_name(VirtIONet *n, const char *name,
                                    const char *type);
 
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index b6fac9c..c23284f 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -446,6 +446,9 @@ static uint32_t virtio_net_get_features(VirtIODevice *vdev, uint32_t features)
     VirtIONet *n = VIRTIO_NET(vdev);
     NetClientState *nc = qemu_get_queue(n->nic);
 
+    /* Firstly sync all virtio-net possible supported features */
+    features |= n->host_features;
+
     virtio_add_feature(&features, VIRTIO_NET_F_MAC);
 
     if (!peer_has_vnet_hdr(n)) {
@@ -1552,7 +1555,7 @@ static void virtio_net_guest_notifier_mask(VirtIODevice *vdev, int idx,
                              vdev, idx, mask);
 }
 
-void virtio_net_set_config_size(VirtIONet *n, uint32_t host_features)
+static void virtio_net_set_config_size(VirtIONet *n, uint32_t host_features)
 {
     int i, config_size = 0;
     virtio_add_feature(&host_features, VIRTIO_NET_F_MAC);
@@ -1585,6 +1588,7 @@ static void virtio_net_device_realize(DeviceState *dev, Error **errp)
     NetClientState *nc;
     int i;
 
+    virtio_net_set_config_size(n, n->host_features);
     virtio_init(vdev, "virtio-net", VIRTIO_ID_NET, n->config_size);
 
     n->max_queues = MAX(n->nic_conf.peers.queues, 1);
@@ -1721,6 +1725,7 @@ static void virtio_net_instance_init(Object *obj)
 }
 
 static Property virtio_net_properties[] = {
+    DEFINE_VIRTIO_NET_FEATURES(VirtIONet, host_features),
     DEFINE_NIC_PROPERTIES(VirtIONet, nic_conf),
     DEFINE_PROP_UINT32("x-txtimer", VirtIONet, net_conf.txtimer,
                                                TX_TIMER_INTERVAL),
diff --git a/hw/s390x/s390-virtio-bus.c b/hw/s390x/s390-virtio-bus.c
index 047c963..b893e02 100644
--- a/hw/s390x/s390-virtio-bus.c
+++ b/hw/s390x/s390-virtio-bus.c
@@ -145,7 +145,6 @@ static void s390_virtio_net_realize(VirtIOS390Device *s390_dev, Error **errp)
     DeviceState *vdev = DEVICE(&dev->vdev);
     Error *err = NULL;
 
-    virtio_net_set_config_size(&dev->vdev, s390_dev->host_features);
     virtio_net_set_netclient_name(&dev->vdev, qdev->id,
                                   object_get_typename(OBJECT(qdev)));
     qdev_set_parent_bus(vdev, BUS(&s390_dev->bus));
@@ -508,7 +507,6 @@ static unsigned virtio_s390_get_features(DeviceState *d)
 
 static Property s390_virtio_net_properties[] = {
     DEFINE_VIRTIO_COMMON_FEATURES(VirtIOS390Device, host_features),
-    DEFINE_VIRTIO_NET_FEATURES(VirtIOS390Device, host_features),
     DEFINE_PROP_END_OF_LIST(),
 };
 
diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
index 0434f56..e6e9f9d 100644
--- a/hw/s390x/virtio-ccw.c
+++ b/hw/s390x/virtio-ccw.c
@@ -779,7 +779,6 @@ static void virtio_ccw_net_realize(VirtioCcwDevice *ccw_dev, Error **errp)
     DeviceState *vdev = DEVICE(&dev->vdev);
     Error *err = NULL;
 
-    virtio_net_set_config_size(&dev->vdev, ccw_dev->host_features[0]);
     virtio_net_set_netclient_name(&dev->vdev, qdev->id,
                                   object_get_typename(OBJECT(qdev)));
     qdev_set_parent_bus(vdev, BUS(&ccw_dev->bus));
@@ -1403,7 +1402,6 @@ static int virtio_ccw_load_config(DeviceState *d, QEMUFile *f)
 
 static Property virtio_ccw_net_properties[] = {
     DEFINE_PROP_STRING("devno", VirtioCcwDevice, bus_id),
-    DEFINE_VIRTIO_NET_FEATURES(VirtioCcwDevice, host_features[0]),
     DEFINE_PROP_BIT("ioeventfd", VirtioCcwDevice, flags,
                     VIRTIO_CCW_FLAG_USE_IOEVENTFD_BIT, true),
     DEFINE_PROP_END_OF_LIST(),
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 5ea4656..07b2a67 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1369,7 +1369,6 @@ static Property virtio_net_properties[] = {
     DEFINE_PROP_BIT("ioeventfd", VirtIOPCIProxy, flags,
                     VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT, false),
     DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, 3),
-    DEFINE_VIRTIO_NET_FEATURES(VirtIOPCIProxy, host_features),
     DEFINE_PROP_END_OF_LIST(),
 };
 
@@ -1379,7 +1378,6 @@ static void virtio_net_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
     VirtIONetPCI *dev = VIRTIO_NET_PCI(vpci_dev);
     DeviceState *vdev = DEVICE(&dev->vdev);
 
-    virtio_net_set_config_size(&dev->vdev, vpci_dev->host_features);
     virtio_net_set_netclient_name(&dev->vdev, qdev->id,
                                   object_get_typename(OBJECT(qdev)));
     qdev_set_parent_bus(vdev, BUS(&vpci_dev->bus));
-- 
MST

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Qemu-devel] [PULL 27/28] virtio-scsi: Move DEFINE_VIRTIO_SCSI_FEATURES to virtio-scsi
  2015-05-11 12:46 [Qemu-devel] [PULL 00/28] pc, virtio enhancements Michael S. Tsirkin
                   ` (25 preceding siblings ...)
  2015-05-11 12:48 ` [Qemu-devel] [PULL 26/28] virtio-net: Move DEFINE_VIRTIO_NET_FEATURES to virtio-net Michael S. Tsirkin
@ 2015-05-11 12:48 ` Michael S. Tsirkin
  2015-05-11 12:48 ` [Qemu-devel] [PULL 28/28] acpi: update expected files for memory unplug Michael S. Tsirkin
  2015-05-12  7:49 ` [Qemu-devel] [PULL 00/28] pc, virtio enhancements Peter Maydell
  28 siblings, 0 replies; 32+ messages in thread
From: Michael S. Tsirkin @ 2015-05-11 12:48 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Alexander Graf, Christian Borntraeger,
	Shannon Zhao, Shannon Zhao, Cornelia Huck, Paolo Bonzini,
	Richard Henderson

From: Shannon Zhao <shannon.zhao@linaro.org>

So far virtio-scsi-device can't expose host features to guest while
using virtio-mmio because it doesn't set DEFINE_VIRTIO_SCSI_FEATURES on
backend or transport.

The host features belong to the backends while virtio-scsi-pci,
virtio-scsi-s390 and virtio-scsi-ccw set the DEFINE_VIRTIO_SCSI_FEATURES
on transports. But they already have the ability to forward property
accesses to the backend child. So if we move the host features to
backends, it doesn't break the backwards compatibility for them and
make host features work while using virtio-mmio.

Move DEFINE_VIRTIO_SCSI_FEATURES to the backend virtio-scsi. The
transports just sync the host features from backends.

Signed-off-by: Shannon Zhao <zhaoshenglong@huawei.com>
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
---
 include/hw/virtio/virtio-scsi.h | 1 +
 hw/s390x/s390-virtio-bus.c      | 1 -
 hw/s390x/virtio-ccw.c           | 1 -
 hw/scsi/virtio-scsi.c           | 5 +++++
 hw/virtio/virtio-pci.c          | 1 -
 5 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/include/hw/virtio/virtio-scsi.h b/include/hw/virtio/virtio-scsi.h
index f93b57d..b42e7f1 100644
--- a/include/hw/virtio/virtio-scsi.h
+++ b/include/hw/virtio/virtio-scsi.h
@@ -98,6 +98,7 @@ typedef struct VirtIOSCSI {
     bool dataplane_fenced;
     Error *blocker;
     Notifier migration_state_notifier;
+    uint32_t host_features;
 } VirtIOSCSI;
 
 typedef struct VirtIOSCSIReq {
diff --git a/hw/s390x/s390-virtio-bus.c b/hw/s390x/s390-virtio-bus.c
index b893e02..c8a78ba 100644
--- a/hw/s390x/s390-virtio-bus.c
+++ b/hw/s390x/s390-virtio-bus.c
@@ -622,7 +622,6 @@ static const TypeInfo virtio_s390_device_info = {
 
 static Property s390_virtio_scsi_properties[] = {
     DEFINE_VIRTIO_COMMON_FEATURES(VirtIOS390Device, host_features),
-    DEFINE_VIRTIO_SCSI_FEATURES(VirtIOS390Device, host_features),
     DEFINE_PROP_END_OF_LIST(),
 };
 
diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
index e6e9f9d..db798a8 100644
--- a/hw/s390x/virtio-ccw.c
+++ b/hw/s390x/virtio-ccw.c
@@ -1506,7 +1506,6 @@ static const TypeInfo virtio_ccw_balloon = {
 
 static Property virtio_ccw_scsi_properties[] = {
     DEFINE_PROP_STRING("devno", VirtioCcwDevice, bus_id),
-    DEFINE_VIRTIO_SCSI_FEATURES(VirtioCcwDevice, host_features[0]),
     DEFINE_PROP_BIT("ioeventfd", VirtioCcwDevice, flags,
                     VIRTIO_CCW_FLAG_USE_IOEVENTFD_BIT, true),
     DEFINE_PROP_END_OF_LIST(),
diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c
index c9bea06..e242fef 100644
--- a/hw/scsi/virtio-scsi.c
+++ b/hw/scsi/virtio-scsi.c
@@ -631,6 +631,10 @@ static void virtio_scsi_set_config(VirtIODevice *vdev,
 static uint32_t virtio_scsi_get_features(VirtIODevice *vdev,
                                          uint32_t requested_features)
 {
+    VirtIOSCSI *s = VIRTIO_SCSI(vdev);
+
+    /* Firstly sync all virtio-scsi possible supported features */
+    requested_features |= s->host_features;
     return requested_features;
 }
 
@@ -945,6 +949,7 @@ static void virtio_scsi_device_unrealize(DeviceState *dev, Error **errp)
 
 static Property virtio_scsi_properties[] = {
     DEFINE_VIRTIO_SCSI_PROPERTIES(VirtIOSCSI, parent_obj.conf),
+    DEFINE_VIRTIO_SCSI_FEATURES(VirtIOSCSI, host_features),
     DEFINE_PROP_END_OF_LIST(),
 };
 
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 07b2a67..867c9d1 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1087,7 +1087,6 @@ static Property virtio_scsi_pci_properties[] = {
                     VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT, true),
     DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors,
                        DEV_NVECTORS_UNSPECIFIED),
-    DEFINE_VIRTIO_SCSI_FEATURES(VirtIOPCIProxy, host_features),
     DEFINE_PROP_END_OF_LIST(),
 };
 
-- 
MST

^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [Qemu-devel] [PULL 28/28] acpi: update expected files for memory unplug
  2015-05-11 12:46 [Qemu-devel] [PULL 00/28] pc, virtio enhancements Michael S. Tsirkin
                   ` (26 preceding siblings ...)
  2015-05-11 12:48 ` [Qemu-devel] [PULL 27/28] virtio-scsi: Move DEFINE_VIRTIO_SCSI_FEATURES to virtio-scsi Michael S. Tsirkin
@ 2015-05-11 12:48 ` Michael S. Tsirkin
  2015-05-12  7:49 ` [Qemu-devel] [PULL 00/28] pc, virtio enhancements Peter Maydell
  28 siblings, 0 replies; 32+ messages in thread
From: Michael S. Tsirkin @ 2015-05-11 12:48 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell

commit c06b2ffb02bfcc642c67300d2c4dffd5aa54932b
    acpi: add hardware implementation for memory hot unplug

Changed both the DSDT and the SSDT. Update the expected files
accordingly.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 tests/acpi-test-data/pc/DSDT         | Bin 2970 -> 3028 bytes
 tests/acpi-test-data/pc/SSDT         | Bin 2475 -> 2486 bytes
 tests/acpi-test-data/pc/SSDT.bridge  | Bin 4334 -> 4345 bytes
 tests/acpi-test-data/q35/DSDT        | Bin 7608 -> 7666 bytes
 tests/acpi-test-data/q35/SSDT        | Bin 680 -> 691 bytes
 tests/acpi-test-data/q35/SSDT.bridge | Bin 697 -> 708 bytes
 6 files changed, 0 insertions(+), 0 deletions(-)

diff --git a/tests/acpi-test-data/pc/DSDT b/tests/acpi-test-data/pc/DSDT
index 1693c3783b34cfb5473e7ef65ba6f8deee390898..c658203db94a7e7db7c36fde99a7075a8d75498d 100644
GIT binary patch
delta 115
zcmbOwenp(iCD<k83O54-W6MS^F%Et|UA_2Vr}zM8PlM<tN8QQ#9KKABY?JFaq#11{
z&*D%JUnsUfWU_CNZy2L*h+AX=7jpq4h_`tc2N#p9h?1|XmjP3>vagS`_y7L|Gcy=`
RgI#@qN?g6-C-39B0{|B<Azc6f

delta 61
zcmca2K1-a-CD<io7B>R}W5h--F%EtgExq_)r}zM8PlM<tcg@NA9KK9mER*Xvq#0Ew
R&*D(ne365TY4Sg=YXIz|5hDNq

diff --git a/tests/acpi-test-data/pc/SSDT b/tests/acpi-test-data/pc/SSDT
index 59be315237a835d886965a069c4c19ef9c0b293f..210d6a71e58aa34ce8e94121d25bcf58c3bd503c 100644
GIT binary patch
delta 67
zcmZ22yiJ%ZIM^j*8z%z;<MoYP(TvQFtud3+8TT;yPF7)xkdgHW@C|ZgaNzQF4UT8@
X_4Es7^bPV2WAt_Pir?JFB+Cu}ez6i3

delta 56
zcmdlcyjqwmIM^j*H75fDBkxA8XhtTtmdP26dl;Q3t1?9h33~+i1~D=?aQV6h$20nR
M`UP*E$t24T0Gmt>7ytkO

diff --git a/tests/acpi-test-data/pc/SSDT.bridge b/tests/acpi-test-data/pc/SSDT.bridge
index fa6136935caa32981bc14879af3ae9378cf01bcf..6e6660b1fbe0bdb7fe0b257cb53c31fa9bb21a14 100644
GIT binary patch
delta 67
zcmaE-_*0Q9IM^lRrvL*3qryh6Xhvq2pD~lu8TT;yPF7)xkdgHW@C|ZgaNzQF4UT8@
X_4Es7^bPV2WAt_Pir?JFl)wi7sU;H(

delta 56
zcmeyV_)d{4IM^lRod5#^W7tNnXhtT_ACof}_b@t7R%MD167~r24Ps<);PQ11j%W1s
M^b6iRlPQ4@0O(v04gdfE

diff --git a/tests/acpi-test-data/q35/DSDT b/tests/acpi-test-data/q35/DSDT
index e9ac11c38ff98c36ba0c06abfd6b01fcb94b4452..4723e5954dccb00995ccaf521b7daf6bf15cf1d4 100644
GIT binary patch
delta 115
zcmdmC{mGikCD<k8lPm)R<DrdQ=~DcDx_a@!PVoWGo(9oPj=GZ@q<oni*(RTtl4i7-
z{8~yue4*F^k;%S6zF~~MA#RZgT+9WGAl_zfX)Y#N5hY(&F9W7%WnUj>@BjY`W@a$>
R2D|zImAHDvPv)0h2>{+FB5(iz

delta 61
zcmexly~CQzCD<iohb#jF<Ft)j=~DbIT6*!pPVoWGo(9oP?wXSuq<opYSSFvBl4ew$
R{8~z3vywCy(`0|y#Q;BF5;gz;

diff --git a/tests/acpi-test-data/q35/SSDT b/tests/acpi-test-data/q35/SSDT
index e87f5a35c15b9fc27dcab39f384b5c0f235ec93c..0970c67ddb1456707c0111f7e5e659ef385af408 100644
GIT binary patch
delta 66
zcmZ3%x|x+LIM^j*GZO;?W9>#Renw_5$(YH~jC&Y;C*NR<kdgHW@C|ZgaNzQF4UT8@
W_4Es7^bPV2WAt_Pil6Mnlm-AhN)a9a

delta 55
zcmdnYx`LG}IM^j*1rq}U<K~TA{ESTg5|d>Z_b@t7zR4INB<vC38^p-qz~$>29M9<M
L=@&fNmnjVZjwB8s

diff --git a/tests/acpi-test-data/q35/SSDT.bridge b/tests/acpi-test-data/q35/SSDT.bridge
index b3cac34d70f3ef158232b8d3574dbae5c51b8f69..a77868861754ce0b3333b2b7bc8091c03a53754d 100644
GIT binary patch
delta 66
zcmdnVdW4lLIM^lR2onPXqwGd5enw_*shG*qjC&Y;C*NR<kdgHW@C|ZgaNzQF4UT8@
W_4Es7^bPV2WAt_Pil6MnR1N?%p%DZC

delta 55
zcmX@Yx|5YFIM^j*Cldn$W70-0enut-smU^odl;Q3-(-vs67~r24Ps<);PQ11j%W1s
L^b4Ns%Tx{kiLDL>

-- 
MST

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [Qemu-devel] [PULL 23/28] qmp-event: add event notification for memory hot unplug error
  2015-05-11 12:48 ` [Qemu-devel] [PULL 23/28] qmp-event: add event notification for memory hot unplug error Michael S. Tsirkin
@ 2015-05-11 15:03   ` Eric Blake
  2015-05-11 15:17     ` Michael S. Tsirkin
  0 siblings, 1 reply; 32+ messages in thread
From: Eric Blake @ 2015-05-11 15:03 UTC (permalink / raw)
  To: Michael S. Tsirkin, qemu-devel
  Cc: Peter Maydell, Zhu Guihua, Michael Roth, Igor Mammedov, Luiz Capitulino

[-- Attachment #1: Type: text/plain, Size: 1363 bytes --]

On 05/11/2015 06:48 AM, Michael S. Tsirkin wrote:
> From: Zhu Guihua <zhugh.fnst@cn.fujitsu.com>
> 
> When memory hot unplug fails, this patch adds support to send
> QMP event to notify mgmt about this failure.
> 
> Reviewed-by: Igor Mammedov <imammedo@redhat.com>
> Signed-off-by: Zhu Guihua <zhugh.fnst@cn.fujitsu.com>
> Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
>  qapi/event.json          | 14 ++++++++++++++
>  hw/acpi/memory_hotplug.c | 10 +++++++++-
>  docs/qmp/qmp-events.txt  | 17 +++++++++++++++++
>  trace-events             |  1 +
>  4 files changed, 41 insertions(+), 1 deletion(-)

I missed reviewing this earlier; and since it is now in a PULL request,
you'll need a followup patch:


> +
> +##
> +# @MEM_UNPLUG_ERROR
> +#
> +# Emitted when memory hot unplug error occurs.
> +#
> +# @device: device name
> +#
> +# @msg: Informative message
> +#
> +# Since: 2.4
> +##
> +{ 'event': 'MEM_UNPLUG_ERROR',

The name here...


> +++ b/docs/qmp/qmp-events.txt
> @@ -226,6 +226,23 @@ Example:
>  { "event": "GUEST_PANICKED",
>       "data": { "action": "pause" } }
>  
> +MEM_HOT_UNPLUG_ERROR

...needs to be the same one used here.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [Qemu-devel] [PULL 23/28] qmp-event: add event notification for memory hot unplug error
  2015-05-11 15:03   ` Eric Blake
@ 2015-05-11 15:17     ` Michael S. Tsirkin
  0 siblings, 0 replies; 32+ messages in thread
From: Michael S. Tsirkin @ 2015-05-11 15:17 UTC (permalink / raw)
  To: Eric Blake
  Cc: Peter Maydell, Zhu Guihua, Michael Roth, qemu-devel,
	Igor Mammedov, Luiz Capitulino

On Mon, May 11, 2015 at 09:03:25AM -0600, Eric Blake wrote:
> On 05/11/2015 06:48 AM, Michael S. Tsirkin wrote:
> > From: Zhu Guihua <zhugh.fnst@cn.fujitsu.com>
> > 
> > When memory hot unplug fails, this patch adds support to send
> > QMP event to notify mgmt about this failure.
> > 
> > Reviewed-by: Igor Mammedov <imammedo@redhat.com>
> > Signed-off-by: Zhu Guihua <zhugh.fnst@cn.fujitsu.com>
> > Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
> > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> > ---
> >  qapi/event.json          | 14 ++++++++++++++
> >  hw/acpi/memory_hotplug.c | 10 +++++++++-
> >  docs/qmp/qmp-events.txt  | 17 +++++++++++++++++
> >  trace-events             |  1 +
> >  4 files changed, 41 insertions(+), 1 deletion(-)
> 
> I missed reviewing this earlier; and since it is now in a PULL request,
> you'll need a followup patch:
> 
> 
> > +
> > +##
> > +# @MEM_UNPLUG_ERROR
> > +#
> > +# Emitted when memory hot unplug error occurs.
> > +#
> > +# @device: device name
> > +#
> > +# @msg: Informative message
> > +#
> > +# Since: 2.4
> > +##
> > +{ 'event': 'MEM_UNPLUG_ERROR',
> 
> The name here...
> 
> 
> > +++ b/docs/qmp/qmp-events.txt
> > @@ -226,6 +226,23 @@ Example:
> >  { "event": "GUEST_PANICKED",
> >       "data": { "action": "pause" } }
> >  
> > +MEM_HOT_UNPLUG_ERROR
> 
> ...needs to be the same one used here.
> 
> -- 
> Eric Blake   eblake redhat com    +1-919-301-3266
> Libvirt virtualization library http://libvirt.org
> 


It's just a doc bug so I'll let it stand, we can
fix it by a follow-up patch.

-- 
MST

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [Qemu-devel] [PULL 00/28] pc, virtio enhancements
  2015-05-11 12:46 [Qemu-devel] [PULL 00/28] pc, virtio enhancements Michael S. Tsirkin
                   ` (27 preceding siblings ...)
  2015-05-11 12:48 ` [Qemu-devel] [PULL 28/28] acpi: update expected files for memory unplug Michael S. Tsirkin
@ 2015-05-12  7:49 ` Peter Maydell
  28 siblings, 0 replies; 32+ messages in thread
From: Peter Maydell @ 2015-05-12  7:49 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: QEMU Developers

On 11 May 2015 at 13:46, Michael S. Tsirkin <mst@redhat.com> wrote:
> The following changes since commit 0d81cdddaa40a1988b24657aeac19959cfad0fde:
>
>   Merge remote-tracking branch 'remotes/qmp-unstable/tags/for-upstream' into staging (2015-04-27 17:28:41 +0100)
>
> are available in the git repository at:
>
>   git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream
>
> for you to fetch changes up to bc1f7c4c915a7c727741c4d27a2795e1039eacd3:
>
>   acpi: update expected files for memory unplug (2015-05-11 09:21:37 +0200)
>
> ----------------------------------------------------------------
> pc, virtio enhancements
>
> Memory hot-unplug support for pc, MSI-X
> mapping update speedup for virtio-pci,
> misc refactorings and bugfixes.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
>

Applied, thanks (with a conflict resolution in s390 virtio).

-- PMM

^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2015-05-12  7:50 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-11 12:46 [Qemu-devel] [PULL 00/28] pc, virtio enhancements Michael S. Tsirkin
2015-05-11 12:46 ` [Qemu-devel] [PULL 01/28] acpi-build: close } in comment Michael S. Tsirkin
2015-05-11 12:47 ` [Qemu-devel] [PULL 02/28] hw/i386: Move ACPI header definitions in an arch-independent location Michael S. Tsirkin
2015-05-11 12:47 ` [Qemu-devel] [PULL 03/28] hw/i386/acpi-build: move generic acpi building helpers into dedictated file Michael S. Tsirkin
2015-05-11 12:47 ` [Qemu-devel] [PULL 04/28] vhost-user: Send VHOST_RESET_OWNER on vhost stop Michael S. Tsirkin
2015-05-11 12:47 ` [Qemu-devel] [PULL 05/28] virtio-net: fix the upper bound when trying to delete queues Michael S. Tsirkin
2015-05-11 12:47 ` [Qemu-devel] [PULL 06/28] pc: add 2.4 machine types Michael S. Tsirkin
2015-05-11 12:47 ` [Qemu-devel] [PULL 07/28] spapr: add machine type specific instance init function Michael S. Tsirkin
2015-05-11 12:47 ` [Qemu-devel] [PULL 08/28] ppc: spapr: add 2.4 machine type Michael S. Tsirkin
2015-05-11 12:47 ` [Qemu-devel] [PULL 09/28] monitor: replace the magic number 255 with MAX_QUEUE_NUM Michael S. Tsirkin
2015-05-11 12:47 ` [Qemu-devel] [PULL 10/28] monitor: check return value of qemu_find_net_clients_except() Michael S. Tsirkin
2015-05-11 12:47 ` [Qemu-devel] [PULL 11/28] virtio-ccw: using VIRTIO_NO_VECTOR instead of 0 for invalid virtqueue Michael S. Tsirkin
2015-05-11 12:47 ` [Qemu-devel] [PULL 12/28] virtio: introduce vector to virtqueues mapping Michael S. Tsirkin
2015-05-11 12:47 ` [Qemu-devel] [PULL 13/28] virtio-pci: speedup MSI-X masking and unmasking Michael S. Tsirkin
2015-05-11 12:47 ` [Qemu-devel] [PULL 14/28] pci: remove hard-coded bar size in msix_init_exclusive_bar() Michael S. Tsirkin
2015-05-11 12:47 ` [Qemu-devel] [PULL 15/28] virtio: coding style tweak Michael S. Tsirkin
2015-05-11 12:48 ` [Qemu-devel] [PULL 16/28] docs: update documentation for memory hot unplug Michael S. Tsirkin
2015-05-11 12:48 ` [Qemu-devel] [PULL 17/28] acpi, mem-hotplug: add acpi_memory_slot_status() to get MemStatus Michael S. Tsirkin
2015-05-11 12:48 ` [Qemu-devel] [PULL 18/28] acpi, mem-hotplug: add unplug request cb for memory device Michael S. Tsirkin
2015-05-11 12:48 ` [Qemu-devel] [PULL 19/28] acpi, mem-hotplug: add unplug " Michael S. Tsirkin
2015-05-11 12:48 ` [Qemu-devel] [PULL 20/28] acpi: extend aml_field() to support UpdateRule Michael S. Tsirkin
2015-05-11 12:48 ` [Qemu-devel] [PULL 21/28] acpi: fix "Memory device control fields" register Michael S. Tsirkin
2015-05-11 12:48 ` [Qemu-devel] [PULL 22/28] acpi: add hardware implementation for memory hot unplug Michael S. Tsirkin
2015-05-11 12:48 ` [Qemu-devel] [PULL 23/28] qmp-event: add event notification for memory hot unplug error Michael S. Tsirkin
2015-05-11 15:03   ` Eric Blake
2015-05-11 15:17     ` Michael S. Tsirkin
2015-05-11 12:48 ` [Qemu-devel] [PULL 24/28] acpi: add a missing backslash to the \_SB scope Michael S. Tsirkin
2015-05-11 12:48 ` [Qemu-devel] [PULL 25/28] pci: Merge pci_nic_init() into pci_nic_init_nofail() Michael S. Tsirkin
2015-05-11 12:48 ` [Qemu-devel] [PULL 26/28] virtio-net: Move DEFINE_VIRTIO_NET_FEATURES to virtio-net Michael S. Tsirkin
2015-05-11 12:48 ` [Qemu-devel] [PULL 27/28] virtio-scsi: Move DEFINE_VIRTIO_SCSI_FEATURES to virtio-scsi Michael S. Tsirkin
2015-05-11 12:48 ` [Qemu-devel] [PULL 28/28] acpi: update expected files for memory unplug Michael S. Tsirkin
2015-05-12  7:49 ` [Qemu-devel] [PULL 00/28] pc, virtio enhancements Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.