Commit 3ef4ebcc authored by Peter Maydell's avatar Peter Maydell

Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging

The final 2.2 patches from me.

# gpg: Signature made Wed 26 Nov 2014 11:12:25 GMT using RSA key ID 78C7AE83
# gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>"
# gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>"
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg:          It is not certain that the signature belongs to the owner.
# Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
#      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83

* remotes/bonzini/tags/for-upstream:
  s390x/kvm: Fix compile error
  fw_cfg: fix boot order bug when dynamically modified via QOM
  -machine vmport=auto: Fix handling of VMWare ioport emulation for xen
Signed-off-by: 's avatarPeter Maydell <peter.maydell@linaro.org>
parents 2528043f dc622deb
...@@ -61,6 +61,7 @@ ...@@ -61,6 +61,7 @@
#include "hw/mem/pc-dimm.h" #include "hw/mem/pc-dimm.h"
#include "trace.h" #include "trace.h"
#include "qapi/visitor.h" #include "qapi/visitor.h"
#include "qapi-visit.h"
/* debug PC/ISA interrupts */ /* debug PC/ISA interrupts */
//#define DEBUG_IRQ //#define DEBUG_IRQ
...@@ -1772,18 +1773,21 @@ static void pc_machine_set_max_ram_below_4g(Object *obj, Visitor *v, ...@@ -1772,18 +1773,21 @@ static void pc_machine_set_max_ram_below_4g(Object *obj, Visitor *v,
pcms->max_ram_below_4g = value; 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); 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); 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) static bool pc_machine_get_aligned_dimm(Object *obj, Error **errp)
...@@ -1806,11 +1810,11 @@ static void pc_machine_initfn(Object *obj) ...@@ -1806,11 +1810,11 @@ static void pc_machine_initfn(Object *obj)
pc_machine_set_max_ram_below_4g, pc_machine_set_max_ram_below_4g,
NULL, NULL, NULL); NULL, NULL, NULL);
pcms->vmport = !xen_enabled(); pcms->vmport = ON_OFF_AUTO_AUTO;
object_property_add_bool(obj, PC_MACHINE_VMPORT, object_property_add(obj, PC_MACHINE_VMPORT, "OnOffAuto",
pc_machine_get_vmport, pc_machine_get_vmport,
pc_machine_set_vmport, pc_machine_set_vmport,
NULL); NULL, NULL, NULL);
pcms->enforce_aligned_dimm = true; pcms->enforce_aligned_dimm = true;
object_property_add_bool(obj, PC_MACHINE_ENFORCE_ALIGNED_DIMM, object_property_add_bool(obj, PC_MACHINE_ENFORCE_ALIGNED_DIMM,
......
...@@ -234,9 +234,14 @@ static void pc_init1(MachineState *machine, ...@@ -234,9 +234,14 @@ static void pc_init1(MachineState *machine,
pc_vga_init(isa_bus, pci_enabled ? pci_bus : NULL); 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 */ /* init basic PC hardware */
pc_basic_device_init(isa_bus, gsi, &rtc_state, &floppy, 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); pc_nic_init(isa_bus, pci_bus);
......
...@@ -242,9 +242,14 @@ static void pc_q35_init(MachineState *machine) ...@@ -242,9 +242,14 @@ static void pc_q35_init(MachineState *machine)
pc_register_ferr_irq(gsi[13]); 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 */ /* init basic PC hardware */
pc_basic_device_init(isa_bus, gsi, &rtc_state, &floppy, 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 */ /* connect pm stuff to lpc */
ich9_lpc_pm_init(lpc); ich9_lpc_pm_init(lpc);
......
...@@ -523,6 +523,7 @@ void *fw_cfg_modify_file(FWCfgState *s, const char *filename, ...@@ -523,6 +523,7 @@ void *fw_cfg_modify_file(FWCfgState *s, const char *filename,
void *data, size_t len) void *data, size_t len)
{ {
int i, index; int i, index;
void *ptr = NULL;
assert(s->files); assert(s->files);
...@@ -531,8 +532,10 @@ void *fw_cfg_modify_file(FWCfgState *s, const char *filename, ...@@ -531,8 +532,10 @@ void *fw_cfg_modify_file(FWCfgState *s, const char *filename,
for (i = 0; i < index; i++) { for (i = 0; i < index; i++) {
if (strcmp(filename, s->files->f[i].name) == 0) { if (strcmp(filename, s->files->f[i].name) == 0) {
return fw_cfg_modify_bytes_read(s, FW_CFG_FILE_FIRST + i, ptr = fw_cfg_modify_bytes_read(s, FW_CFG_FILE_FIRST + i,
data, len); data, len);
s->files->f[i].size = cpu_to_be32(len);
return ptr;
} }
} }
/* add new one */ /* add new one */
......
...@@ -39,7 +39,7 @@ struct PCMachineState { ...@@ -39,7 +39,7 @@ struct PCMachineState {
ISADevice *rtc; ISADevice *rtc;
uint64_t max_ram_below_4g; uint64_t max_ram_below_4g;
bool vmport; OnOffAuto vmport;
bool enforce_aligned_dimm; bool enforce_aligned_dimm;
}; };
......
...@@ -87,3 +87,18 @@ ...@@ -87,3 +87,18 @@
## ##
{ 'command': 'query-commands', 'returns': ['CommandInfo'] } { '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' ] }
...@@ -33,7 +33,7 @@ DEF("machine", HAS_ARG, QEMU_OPTION_machine, \ ...@@ -33,7 +33,7 @@ DEF("machine", HAS_ARG, QEMU_OPTION_machine, \
" property accel=accel1[:accel2[:...]] selects accelerator\n" " property accel=accel1[:accel2[:...]] selects accelerator\n"
" supported accelerators are kvm, xen, tcg (default: tcg)\n" " supported accelerators are kvm, xen, tcg (default: tcg)\n"
" kernel_irqchip=on|off controls accelerated irqchip support\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" " kvm_shadow_mem=size of KVM shadow MMU\n"
" dump-guest-core=on|off include guest memory in a core dump (default=on)\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" " 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 ...@@ -52,8 +52,10 @@ than one accelerator specified, the next one is used if the previous one fails
to initialize. to initialize.
@item kernel_irqchip=on|off @item kernel_irqchip=on|off
Enables in-kernel irqchip support for the chosen accelerator when available. Enables in-kernel irqchip support for the chosen accelerator when available.
@item vmport=on|off @item vmport=on|off|auto
Enables emulation of VMWare IO port, for vmmouse etc. (enabled by default) 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 @item kvm_shadow_mem=size
Defines the size of the KVM shadow MMU. Defines the size of the KVM shadow MMU.
@item dump-guest-core=on|off @item dump-guest-core=on|off
......
...@@ -106,7 +106,7 @@ const KVMCapabilityInfo kvm_arch_required_capabilities[] = { ...@@ -106,7 +106,7 @@ const KVMCapabilityInfo kvm_arch_required_capabilities[] = {
static int cap_sync_regs; static int cap_sync_regs;
static int cap_async_pf; 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) static int kvm_s390_check_clear_cmma(KVMState *s)
{ {
...@@ -404,7 +404,7 @@ int kvm_arch_get_registers(CPUState *cs) ...@@ -404,7 +404,7 @@ int kvm_arch_get_registers(CPUState *cs)
* to grow. We also have to use MAP parameters that avoid * to grow. We also have to use MAP parameters that avoid
* read-only mapping of guest pages. * 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; void *mem;
......
...@@ -381,7 +381,7 @@ static QemuOptsList qemu_machine_opts = { ...@@ -381,7 +381,7 @@ static QemuOptsList qemu_machine_opts = {
.help = "maximum ram below the 4G boundary (32bit boundary)", .help = "maximum ram below the 4G boundary (32bit boundary)",
}, { }, {
.name = PC_MACHINE_VMPORT, .name = PC_MACHINE_VMPORT,
.type = QEMU_OPT_BOOL, .type = QEMU_OPT_STRING,
.help = "Enable vmport (pc & q35)", .help = "Enable vmport (pc & q35)",
},{ },{
.name = "iommu", .name = "iommu",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment