All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL for-2.2 0/3] Misc fixes for 2014-11-26
@ 2014-11-26 11:30 Paolo Bonzini
  2014-11-26 11:30 ` [Qemu-devel] [PULL 1/3] -machine vmport=auto: Fix handling of VMWare ioport emulation for xen Paolo Bonzini
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Paolo Bonzini @ 2014-11-26 11:30 UTC (permalink / raw)
  To: qemu-devel

The following changes since commit 2528043f1f299e0e88cb026f1ca7c40bbb4e1f80:

  Update version for v2.2.0-rc3 release (2014-11-25 18:23:54 +0000)

are available in the git repository at:

  git://github.com/bonzini/qemu.git tags/for-upstream

for you to fetch changes up to dc622deb2d49aac6afa485f9025be8fed440ef3d:

  s390x/kvm: Fix compile error (2014-11-26 12:11:27 +0100)

----------------------------------------------------------------
The final 2.2 patches from me.

----------------------------------------------------------------
Christian Borntraeger (1):
      s390x/kvm: Fix compile error

Don Slutz (1):
      -machine vmport=auto: Fix handling of VMWare ioport emulation for xen

Gonglei (1):
      fw_cfg: fix boot order bug when dynamically modified via QOM

 hw/i386/pc.c         | 22 +++++++++++++---------
 hw/i386/pc_piix.c    |  7 ++++++-
 hw/i386/pc_q35.c     |  7 ++++++-
 hw/nvram/fw_cfg.c    |  7 +++++--
 include/hw/i386/pc.h |  2 +-
 qapi/common.json     | 15 +++++++++++++++
 qemu-options.hx      |  8 +++++---
 target-s390x/kvm.c   |  4 ++--
 vl.c                 |  2 +-
 9 files changed, 54 insertions(+), 20 deletions(-)
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 1/3] -machine vmport=auto: Fix handling of VMWare ioport emulation for xen
  2014-11-26 11:30 [Qemu-devel] [PULL for-2.2 0/3] Misc fixes for 2014-11-26 Paolo Bonzini
@ 2014-11-26 11:30 ` Paolo Bonzini
  2014-11-26 11:30 ` [Qemu-devel] [PULL 2/3] fw_cfg: fix boot order bug when dynamically modified via QOM Paolo Bonzini
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Paolo Bonzini @ 2014-11-26 11:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: Don Slutz

From: Don Slutz <dslutz@verizon.com>

c/s 9b23cfb76b3a5e9eb5cc899eaf2f46bc46d33ba4

or

c/s b154537ad07598377ebf98252fb7d2aff127983b

moved the testing of xen_enabled() from pc_init1() to
pc_machine_initfn().

xen_enabled() does not return the correct value in
pc_machine_initfn().

Changed vmport from a bool to an enum.  Added the value "auto" to do
the old way.  Move check of xen_enabled() back to pc_init1().

Acked-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Don Slutz <dslutz@verizon.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/i386/pc.c         | 22 +++++++++++++---------
 hw/i386/pc_piix.c    |  7 ++++++-
 hw/i386/pc_q35.c     |  7 ++++++-
 include/hw/i386/pc.h |  2 +-
 qapi/common.json     | 15 +++++++++++++++
 qemu-options.hx      |  8 +++++---
 vl.c                 |  2 +-
 7 files changed, 47 insertions(+), 16 deletions(-)

diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 8be50a4..f31d55e 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -61,6 +61,7 @@
 #include "hw/mem/pc-dimm.h"
 #include "trace.h"
 #include "qapi/visitor.h"
+#include "qapi-visit.h"
 
 /* debug PC/ISA interrupts */
 //#define DEBUG_IRQ
@@ -1772,18 +1773,21 @@ static void pc_machine_set_max_ram_below_4g(Object *obj, Visitor *v,
     pcms->max_ram_below_4g = value;
 }
 
-static bool pc_machine_get_vmport(Object *obj, Error **errp)
+static void pc_machine_get_vmport(Object *obj, Visitor *v, void *opaque,
+                                  const char *name, Error **errp)
 {
     PCMachineState *pcms = PC_MACHINE(obj);
+    OnOffAuto vmport = pcms->vmport;
 
-    return pcms->vmport;
+    visit_type_OnOffAuto(v, &vmport, name, errp);
 }
 
-static void pc_machine_set_vmport(Object *obj, bool value, Error **errp)
+static void pc_machine_set_vmport(Object *obj, Visitor *v, void *opaque,
+                                  const char *name, Error **errp)
 {
     PCMachineState *pcms = PC_MACHINE(obj);
 
-    pcms->vmport = value;
+    visit_type_OnOffAuto(v, &pcms->vmport, name, errp);
 }
 
 static bool pc_machine_get_aligned_dimm(Object *obj, Error **errp)
@@ -1806,11 +1810,11 @@ static void pc_machine_initfn(Object *obj)
                         pc_machine_set_max_ram_below_4g,
                         NULL, NULL, NULL);
 
-    pcms->vmport = !xen_enabled();
-    object_property_add_bool(obj, PC_MACHINE_VMPORT,
-                             pc_machine_get_vmport,
-                             pc_machine_set_vmport,
-                             NULL);
+    pcms->vmport = ON_OFF_AUTO_AUTO;
+    object_property_add(obj, PC_MACHINE_VMPORT, "OnOffAuto",
+                        pc_machine_get_vmport,
+                        pc_machine_set_vmport,
+                        NULL, NULL, NULL);
 
     pcms->enforce_aligned_dimm = true;
     object_property_add_bool(obj, PC_MACHINE_ENFORCE_ALIGNED_DIMM,
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 741dffd..85ed3c8 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -234,9 +234,14 @@ static void pc_init1(MachineState *machine,
 
     pc_vga_init(isa_bus, pci_enabled ? pci_bus : NULL);
 
+    assert(pc_machine->vmport != ON_OFF_AUTO_MAX);
+    if (pc_machine->vmport == ON_OFF_AUTO_AUTO) {
+        pc_machine->vmport = xen_enabled() ? ON_OFF_AUTO_OFF : ON_OFF_AUTO_ON;
+    }
+
     /* init basic PC hardware */
     pc_basic_device_init(isa_bus, gsi, &rtc_state, &floppy,
-                         !pc_machine->vmport, 0x4);
+                         (pc_machine->vmport != ON_OFF_AUTO_ON), 0x4);
 
     pc_nic_init(isa_bus, pci_bus);
 
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index e9ba1a2..0262b5e 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -242,9 +242,14 @@ static void pc_q35_init(MachineState *machine)
 
     pc_register_ferr_irq(gsi[13]);
 
+    assert(pc_machine->vmport != ON_OFF_AUTO_MAX);
+    if (pc_machine->vmport == ON_OFF_AUTO_AUTO) {
+        pc_machine->vmport = xen_enabled() ? ON_OFF_AUTO_OFF : ON_OFF_AUTO_ON;
+    }
+
     /* init basic PC hardware */
     pc_basic_device_init(isa_bus, gsi, &rtc_state, &floppy,
-                         !pc_machine->vmport, 0xff0104);
+                         (pc_machine->vmport != ON_OFF_AUTO_ON), 0xff0104);
 
     /* connect pm stuff to lpc */
     ich9_lpc_pm_init(lpc);
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 9d85b89..69d9cf8 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -39,7 +39,7 @@ struct PCMachineState {
     ISADevice *rtc;
 
     uint64_t max_ram_below_4g;
-    bool vmport;
+    OnOffAuto vmport;
     bool enforce_aligned_dimm;
 };
 
diff --git a/qapi/common.json b/qapi/common.json
index 4e9a21f..63ef3b4 100644
--- a/qapi/common.json
+++ b/qapi/common.json
@@ -87,3 +87,18 @@
 ##
 { 'command': 'query-commands', 'returns': ['CommandInfo'] }
 
+##
+# @OnOffAuto
+#
+# An enumeration of three options: on, off, and auto
+#
+# @auto: QEMU selects the value between on and off
+#
+# @on: Enabled
+#
+# @off: Disabled
+#
+# Since: 2.2
+##
+{ 'enum': 'OnOffAuto',
+  'data': [ 'auto', 'on', 'off' ] }
diff --git a/qemu-options.hx b/qemu-options.hx
index da9851d..64af16d 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -33,7 +33,7 @@ DEF("machine", HAS_ARG, QEMU_OPTION_machine, \
     "                property accel=accel1[:accel2[:...]] selects accelerator\n"
     "                supported accelerators are kvm, xen, tcg (default: tcg)\n"
     "                kernel_irqchip=on|off controls accelerated irqchip support\n"
-    "                vmport=on|off controls emulation of vmport (default: on)\n"
+    "                vmport=on|off|auto controls emulation of vmport (default: auto)\n"
     "                kvm_shadow_mem=size of KVM shadow MMU\n"
     "                dump-guest-core=on|off include guest memory in a core dump (default=on)\n"
     "                mem-merge=on|off controls memory merge support (default: on)\n"
@@ -52,8 +52,10 @@ than one accelerator specified, the next one is used if the previous one fails
 to initialize.
 @item kernel_irqchip=on|off
 Enables in-kernel irqchip support for the chosen accelerator when available.
-@item vmport=on|off
-Enables emulation of VMWare IO port, for vmmouse etc. (enabled by default)
+@item vmport=on|off|auto
+Enables emulation of VMWare IO port, for vmmouse etc. auto says to select the
+value based on accel. For accel=xen the default is off otherwise the default
+is on.
 @item kvm_shadow_mem=size
 Defines the size of the KVM shadow MMU.
 @item dump-guest-core=on|off
diff --git a/vl.c b/vl.c
index f4a6e5e..eb89d62 100644
--- a/vl.c
+++ b/vl.c
@@ -381,7 +381,7 @@ static QemuOptsList qemu_machine_opts = {
             .help = "maximum ram below the 4G boundary (32bit boundary)",
         }, {
             .name = PC_MACHINE_VMPORT,
-            .type = QEMU_OPT_BOOL,
+            .type = QEMU_OPT_STRING,
             .help = "Enable vmport (pc & q35)",
         },{
             .name = "iommu",
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 2/3] fw_cfg: fix boot order bug when dynamically modified via QOM
  2014-11-26 11:30 [Qemu-devel] [PULL for-2.2 0/3] Misc fixes for 2014-11-26 Paolo Bonzini
  2014-11-26 11:30 ` [Qemu-devel] [PULL 1/3] -machine vmport=auto: Fix handling of VMWare ioport emulation for xen Paolo Bonzini
@ 2014-11-26 11:30 ` Paolo Bonzini
  2014-11-26 11:30 ` [Qemu-devel] [PULL 3/3] s390x/kvm: Fix compile error Paolo Bonzini
  2014-11-26 14:32 ` [Qemu-devel] [PULL for-2.2 0/3] Misc fixes for 2014-11-26 Peter Maydell
  3 siblings, 0 replies; 5+ messages in thread
From: Paolo Bonzini @ 2014-11-26 11:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gonglei, Gerd Hoffmann

From: Gonglei <arei.gonglei@huawei.com>

When we dynamically modify boot order, the length of
boot order will be changed, but we don't update
s->files->f[i].size with new length. This casuse
seabios read a wrong vale of qemu cfg file about
bootorder.

Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/nvram/fw_cfg.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
index e7ed27e..a7122ee 100644
--- a/hw/nvram/fw_cfg.c
+++ b/hw/nvram/fw_cfg.c
@@ -523,6 +523,7 @@ void *fw_cfg_modify_file(FWCfgState *s, const char *filename,
                         void *data, size_t len)
 {
     int i, index;
+    void *ptr = NULL;
 
     assert(s->files);
 
@@ -531,8 +532,10 @@ void *fw_cfg_modify_file(FWCfgState *s, const char *filename,
 
     for (i = 0; i < index; i++) {
         if (strcmp(filename, s->files->f[i].name) == 0) {
-            return fw_cfg_modify_bytes_read(s, FW_CFG_FILE_FIRST + i,
-                                     data, len);
+            ptr = fw_cfg_modify_bytes_read(s, FW_CFG_FILE_FIRST + i,
+                                           data, len);
+            s->files->f[i].size   = cpu_to_be32(len);
+            return ptr;
         }
     }
     /* add new one */
-- 
1.8.3.1

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

* [Qemu-devel] [PULL 3/3] s390x/kvm: Fix compile error
  2014-11-26 11:30 [Qemu-devel] [PULL for-2.2 0/3] Misc fixes for 2014-11-26 Paolo Bonzini
  2014-11-26 11:30 ` [Qemu-devel] [PULL 1/3] -machine vmport=auto: Fix handling of VMWare ioport emulation for xen Paolo Bonzini
  2014-11-26 11:30 ` [Qemu-devel] [PULL 2/3] fw_cfg: fix boot order bug when dynamically modified via QOM Paolo Bonzini
@ 2014-11-26 11:30 ` Paolo Bonzini
  2014-11-26 14:32 ` [Qemu-devel] [PULL for-2.2 0/3] Misc fixes for 2014-11-26 Peter Maydell
  3 siblings, 0 replies; 5+ messages in thread
From: Paolo Bonzini @ 2014-11-26 11:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: Christian Borntraeger, Michael S. Tsirkin, Igor Mammedov

From: Christian Borntraeger <borntraeger@de.ibm.com>

commit a2b257d6212a "memory: expose alignment used for allocating RAM
as MemoryRegion API" triggered a compile error on KVM/s390x.

Fix the prototype and the implementation of legacy_s390_alloc.

Cc: Igor Mammedov <imammedo@redhat.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 target-s390x/kvm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c
index 50709ba..2c638ab 100644
--- a/target-s390x/kvm.c
+++ b/target-s390x/kvm.c
@@ -106,7 +106,7 @@ const KVMCapabilityInfo kvm_arch_required_capabilities[] = {
 static int cap_sync_regs;
 static int cap_async_pf;
 
-static void *legacy_s390_alloc(size_t size);
+static void *legacy_s390_alloc(size_t size, uint64_t *align);
 
 static int kvm_s390_check_clear_cmma(KVMState *s)
 {
@@ -404,7 +404,7 @@ int kvm_arch_get_registers(CPUState *cs)
  * to grow. We also have to use MAP parameters that avoid
  * read-only mapping of guest pages.
  */
-static void *legacy_s390_alloc(size_t size, , uint64_t *align)
+static void *legacy_s390_alloc(size_t size, uint64_t *align)
 {
     void *mem;
 
-- 
1.8.3.1

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

* Re: [Qemu-devel] [PULL for-2.2 0/3] Misc fixes for 2014-11-26
  2014-11-26 11:30 [Qemu-devel] [PULL for-2.2 0/3] Misc fixes for 2014-11-26 Paolo Bonzini
                   ` (2 preceding siblings ...)
  2014-11-26 11:30 ` [Qemu-devel] [PULL 3/3] s390x/kvm: Fix compile error Paolo Bonzini
@ 2014-11-26 14:32 ` Peter Maydell
  3 siblings, 0 replies; 5+ messages in thread
From: Peter Maydell @ 2014-11-26 14:32 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: QEMU Developers

On 26 November 2014 at 11:30, Paolo Bonzini <pbonzini@redhat.com> wrote:
> The following changes since commit 2528043f1f299e0e88cb026f1ca7c40bbb4e1f80:
>
>   Update version for v2.2.0-rc3 release (2014-11-25 18:23:54 +0000)
>
> are available in the git repository at:
>
>   git://github.com/bonzini/qemu.git tags/for-upstream
>
> for you to fetch changes up to dc622deb2d49aac6afa485f9025be8fed440ef3d:
>
>   s390x/kvm: Fix compile error (2014-11-26 12:11:27 +0100)
>
> ----------------------------------------------------------------
> The final 2.2 patches from me.
>
> ----------------------------------------------------------------
> Christian Borntraeger (1):
>       s390x/kvm: Fix compile error
>
> Don Slutz (1):
>       -machine vmport=auto: Fix handling of VMWare ioport emulation for xen
>
> Gonglei (1):
>       fw_cfg: fix boot order bug when dynamically modified via QOM

Applied, thanks.

-- PMM

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

end of thread, other threads:[~2014-11-26 14:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-26 11:30 [Qemu-devel] [PULL for-2.2 0/3] Misc fixes for 2014-11-26 Paolo Bonzini
2014-11-26 11:30 ` [Qemu-devel] [PULL 1/3] -machine vmport=auto: Fix handling of VMWare ioport emulation for xen Paolo Bonzini
2014-11-26 11:30 ` [Qemu-devel] [PULL 2/3] fw_cfg: fix boot order bug when dynamically modified via QOM Paolo Bonzini
2014-11-26 11:30 ` [Qemu-devel] [PULL 3/3] s390x/kvm: Fix compile error Paolo Bonzini
2014-11-26 14:32 ` [Qemu-devel] [PULL for-2.2 0/3] Misc fixes for 2014-11-26 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.