sdk/emulator/qemu.git
11 years agoMerge remote-tracking branch 'afaerber/tags/qom-cpu-for-anthony' into staging
Anthony Liguori [Tue, 23 Jul 2013 15:57:04 +0000 (10:57 -0500)]
Merge remote-tracking branch 'afaerber/tags/qom-cpu-for-anthony' into staging

QOM CPUState refactorings

* Fix NULL pointer dereference in gdbstub
* Introduce vaddr type
* Introduce CPUClass::set_pc()
* Introduce CPUClass::synchronize_from_tb()
* Introduce CPUClass::get_phys_page_debug()
* Introduce CPUClass::memory_rw_debug()
* Move singlestep_enabled and gdb_regs fields out of CPU_COMMON
* Adopt CPUState in more APIs
* Propagate CPUState in gdbstub

# gpg: Signature made Mon 22 Jul 2013 07:50:17 PM CDT using RSA key ID 3E7E013F
# gpg: Can't check signature: public key not found

# By Andreas Färber (21) and others
# Via Andreas Färber
* afaerber/tags/qom-cpu-for-anthony: (24 commits)
  linux-user: Use X86CPU property to retrieve CPUID family
  gdbstub: Change gdb_register_coprocessor() argument to CPUState
  cpu: Move gdb_regs field from CPU_COMMON to CPUState
  gdbstub: Change GDBState::{c,g}_cpu and find_cpu() to CPUState
  cpu: Introduce CPUClass::memory_rw_debug() for target_memory_rw_debug()
  exec: Change cpu_memory_rw_debug() argument to CPUState
  cpu: Turn cpu_get_phys_page_debug() into a CPUClass hook
  gdbstub: Change gdb_{read,write}_register() argument to CPUState
  gdbstub: Change gdb_handlesig() argument to CPUState
  gdbstub: Change syscall callback argument to CPUState
  kvm: Change kvm_{insert,remove}_breakpoint() argument to CPUState
  cpu: Change cpu_single_step() argument to CPUState
  gdbstub: Update gdb_handlesig() and gdb_signalled() Coding Style
  cpu: Move singlestep_enabled field from CPU_COMMON to CPUState
  target-alpha: Copy implver to DisasContext
  target-alpha: Copy singlestep_enabled to DisasContext
  cpu: Introduce CPUClass::synchronize_from_tb() for cpu_pc_from_tb()
  target-unicore32: Implement CPUClass::set_pc()
  target-moxie: Implement CPUClass::set_pc()
  target-m68k: Implement CPUClass::set_pc()
  ...

11 years agoMerge remote-tracking branch 'afaerber/tags/qom-devices-for-anthony' into staging
Anthony Liguori [Tue, 23 Jul 2013 15:56:55 +0000 (10:56 -0500)]
Merge remote-tracking branch 'afaerber/tags/qom-devices-for-anthony' into staging

QOM device refactorings

* Avoid TYPE_* in VMStateDescription name
* Replace some DO_UPCAST()s and FROM_SYSBUS()s with QOM casts
* Limit legacy SCSI command line handling to non-hotplugged devices
* Replace some SysBusDeviceClass::init with DeviceClass::realize

# gpg: Signature made Mon 22 Jul 2013 06:31:42 PM CDT using RSA key ID 3E7E013F
# gpg: Can't check signature: public key not found

# By Hu Tao (26) and others
# Via Andreas Färber
* afaerber/tags/qom-devices-for-anthony: (55 commits)
  isa-bus: Drop isabus_bridge_init() since it does nothing
  ioapic: Use QOM realize for ioapic
  kvmvapic: Use QOM realize
  kvm/clock: Use QOM realize for kvmclock
  hpet: Use QOM realize for hpet
  scsi: Improve error propagation for scsi_bus_legacy_handle_cmdline()
  megasas: Legacy command line handling fix
  scsi/esp: Use QOM realize for scsi esp
  fw_cfg: Use QOM realize for fw_cfg
  ahci: Use QOM realize for ahci
  pflash_cfi02: Use QOM realize for pflash_cfi02
  pflash_cfi01: Use QOM realize for pflash_cfi01
  fdc: Improve error propagation for QOM realize
  fdc: Use QOM realize for fdc
  kvm/clock: QOM'ify some more
  hpet: QOM'ify some more
  scsi/esp: QOM'ify some more
  fwcfg: QOM'ify some more
  ahci: QOM'ify some more
  pflash-cfi02: QOM'ify some more
  ...

11 years agolinux-user: Use X86CPU property to retrieve CPUID family
Andreas Färber [Thu, 17 May 2012 22:01:58 +0000 (00:01 +0200)]
linux-user: Use X86CPU property to retrieve CPUID family

Avoids duplicating the calculation.

Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agogdbstub: Change gdb_register_coprocessor() argument to CPUState
Andreas Färber [Fri, 28 Jun 2013 19:27:39 +0000 (21:27 +0200)]
gdbstub: Change gdb_register_coprocessor() argument to CPUState

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agocpu: Move gdb_regs field from CPU_COMMON to CPUState
Andreas Färber [Fri, 28 Jun 2013 19:11:37 +0000 (21:11 +0200)]
cpu: Move gdb_regs field from CPU_COMMON to CPUState

Prepares for changing gdb_register_coprocessor() argument to CPUState.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agogdbstub: Change GDBState::{c,g}_cpu and find_cpu() to CPUState
Andreas Färber [Thu, 27 Jun 2013 17:19:39 +0000 (19:19 +0200)]
gdbstub: Change GDBState::{c,g}_cpu and find_cpu() to CPUState

Use CPUState::env_ptr where still needed.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agocpu: Introduce CPUClass::memory_rw_debug() for target_memory_rw_debug()
Andreas Färber [Thu, 27 Jun 2013 17:09:09 +0000 (19:09 +0200)]
cpu: Introduce CPUClass::memory_rw_debug() for target_memory_rw_debug()

Make inline target_memory_rw_debug() always available and change its
argument to CPUState. Let it check if CPUClass::memory_rw_debug provides
a specialized callback and fall back to cpu_memory_rw_debug() otherwise.

The only overriding implementation is for 32-bit sparc.

This prepares for changing GDBState::g_cpu to CPUState.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoexec: Change cpu_memory_rw_debug() argument to CPUState
Andreas Färber [Sat, 29 Jun 2013 17:40:58 +0000 (19:40 +0200)]
exec: Change cpu_memory_rw_debug() argument to CPUState

Propagate X86CPU in kvmvapic for simplicity.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agocpu: Turn cpu_get_phys_page_debug() into a CPUClass hook
Andreas Färber [Sat, 29 Jun 2013 16:55:54 +0000 (18:55 +0200)]
cpu: Turn cpu_get_phys_page_debug() into a CPUClass hook

Change breakpoint_invalidate() argument to CPUState alongside.

Since all targets now assign a softmmu-only field, we can drop helpers
cpu_class_set_{do_unassigned_access,vmsd}() and device_class_set_vmsd().

Prepares for changing cpu_memory_rw_debug() argument to CPUState.

Acked-by: Max Filippov <jcmvbkbc@gmail.com> (for xtensa)
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agogdbstub: Change gdb_{read,write}_register() argument to CPUState
Andreas Färber [Thu, 27 Jun 2013 16:25:36 +0000 (18:25 +0200)]
gdbstub: Change gdb_{read,write}_register() argument to CPUState

Use CPUState::env_ptr for now.

Prepares for changing GDBState::g_cpu to CPUState.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agogdbstub: Change gdb_handlesig() argument to CPUState
Andreas Färber [Thu, 27 Jun 2013 17:49:31 +0000 (19:49 +0200)]
gdbstub: Change gdb_handlesig() argument to CPUState

Prepares for changing GDBState::c_cpu to CPUState.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agogdbstub: Change syscall callback argument to CPUState
Andreas Färber [Thu, 27 Jun 2013 15:45:01 +0000 (17:45 +0200)]
gdbstub: Change syscall callback argument to CPUState

Callback implementations were specific to arm and m68k, so can easily
cast to ARMCPU and M68kCPU respectively.

Prepares for changing GDBState::c_cpu to CPUState.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agokvm: Change kvm_{insert,remove}_breakpoint() argument to CPUState
Andreas Färber [Thu, 27 Jun 2013 15:12:06 +0000 (17:12 +0200)]
kvm: Change kvm_{insert,remove}_breakpoint() argument to CPUState

CPUArchState is no longer directly used since converting CPU loops to
CPUState.

Prepares for changing GDBState::c_cpu to CPUState.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agocpu: Change cpu_single_step() argument to CPUState
Andreas Färber [Mon, 24 Jun 2013 16:41:06 +0000 (18:41 +0200)]
cpu: Change cpu_single_step() argument to CPUState

Use CPUState::env_ptr for now.

Needed for GdbState::c_cpu.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agogdbstub: Update gdb_handlesig() and gdb_signalled() Coding Style
Andreas Färber [Mon, 24 Jun 2013 17:20:57 +0000 (19:20 +0200)]
gdbstub: Update gdb_handlesig() and gdb_signalled() Coding Style

In particular reindent to 4 instead of 2 spaces.

Prepares for changing cpu_single_step() argument in gdb_handlesig().

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agocpu: Move singlestep_enabled field from CPU_COMMON to CPUState
Andreas Färber [Fri, 21 Jun 2013 18:20:45 +0000 (20:20 +0200)]
cpu: Move singlestep_enabled field from CPU_COMMON to CPUState

Prepares for changing cpu_single_step() argument to CPUState.

Acked-by: Michael Walle <michael@walle.cc> (for lm32)
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-alpha: Copy implver to DisasContext
Richard Henderson [Mon, 1 Jul 2013 20:19:30 +0000 (13:19 -0700)]
target-alpha: Copy implver to DisasContext

Which allows removing env from DisasContext.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-alpha: Copy singlestep_enabled to DisasContext
Richard Henderson [Mon, 1 Jul 2013 20:19:29 +0000 (13:19 -0700)]
target-alpha: Copy singlestep_enabled to DisasContext

Prepare for removing env from DisasContext.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agocpu: Introduce CPUClass::synchronize_from_tb() for cpu_pc_from_tb()
Andreas Färber [Fri, 28 Jun 2013 17:31:32 +0000 (19:31 +0200)]
cpu: Introduce CPUClass::synchronize_from_tb() for cpu_pc_from_tb()

Where no extra implementation is needed, fall back to CPUClass::set_pc().

Acked-by: Michael Walle <michael@walle.cc> (for lm32)
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-unicore32: Implement CPUClass::set_pc()
Andreas Färber [Fri, 28 Jun 2013 17:41:07 +0000 (19:41 +0200)]
target-unicore32: Implement CPUClass::set_pc()

This adds support for GDB's c addr (Continue) and s addr (Single Step).

Prepares for dropping cpu_pc_from_tb().

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-moxie: Implement CPUClass::set_pc()
Andreas Färber [Fri, 28 Jun 2013 18:43:26 +0000 (20:43 +0200)]
target-moxie: Implement CPUClass::set_pc()

This adds support for GDB's c addr (Continue) and s addr (Single Step).

Prepares for dropping cpu_pc_from_tb().

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotarget-m68k: Implement CPUClass::set_pc()
Andreas Färber [Fri, 28 Jun 2013 18:35:01 +0000 (20:35 +0200)]
target-m68k: Implement CPUClass::set_pc()

This adds support for GDB's c addr (Continue) and s addr (Single Step).

Prepares for dropping cpu_pc_from_tb().

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agocpu: Introduce CPUClass::set_pc() for gdb_set_cpu_pc()
Andreas Färber [Fri, 21 Jun 2013 17:09:18 +0000 (19:09 +0200)]
cpu: Introduce CPUClass::set_pc() for gdb_set_cpu_pc()

This moves setting the Program Counter from gdbstub into target code.
Use vaddr type as upper-bound replacement for target_ulong.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoHACKING: Document vaddr type usage
Peter Maydell [Mon, 22 Jul 2013 16:34:35 +0000 (18:34 +0200)]
HACKING: Document vaddr type usage

Also extend documentation of target_ulong and abi_ulong.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agocpu: Introduce vaddr type
Andreas Färber [Sat, 6 Jul 2013 01:14:52 +0000 (03:14 +0200)]
cpu: Introduce vaddr type

vaddr is to target_ulong what uintmax_t is to unsigned int.

Its purpose is to allow turning per-target functions with target_ulong
arguments into CPUClass hooks.

Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agogdbstub: Change GDBState::query_cpu to CPUState
Andreas Färber [Thu, 27 Jun 2013 11:44:40 +0000 (13:44 +0200)]
gdbstub: Change GDBState::query_cpu to CPUState

Since first_cpu/next_cpu are CPUState, CPUArchState is no longer needed.

This resolves a NULL pointer dereference of query_cpu, introduced
with commit 182735efaf956ccab50b6d74a4fed163e0f35660 and reported by
TeLeMan and Max Filippov.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoisa-bus: Drop isabus_bridge_init() since it does nothing
Hu Tao [Mon, 1 Jul 2013 10:18:42 +0000 (18:18 +0800)]
isa-bus: Drop isabus_bridge_init() since it does nothing

This works since commit 4ce5dae88ecf2bafa0cd663de7e923728b1b3672.

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
[AF: Edited]
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoioapic: Use QOM realize for ioapic
Hu Tao [Mon, 1 Jul 2013 10:18:41 +0000 (18:18 +0800)]
ioapic: Use QOM realize for ioapic

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
[AF: Tweaked error message]
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agokvmvapic: Use QOM realize
Hu Tao [Mon, 1 Jul 2013 10:18:40 +0000 (18:18 +0800)]
kvmvapic: Use QOM realize

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
[AF: Renamed variable]
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agokvm/clock: Use QOM realize for kvmclock
Hu Tao [Mon, 1 Jul 2013 10:18:39 +0000 (18:18 +0800)]
kvm/clock: Use QOM realize for kvmclock

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agohpet: Use QOM realize for hpet
Hu Tao [Mon, 1 Jul 2013 10:18:37 +0000 (18:18 +0800)]
hpet: Use QOM realize for hpet

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
[AF: Avoided SYS_BUS_DEVICE() in loop]
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoscsi: Improve error propagation for scsi_bus_legacy_handle_cmdline()
Andreas Färber [Sun, 21 Jul 2013 10:16:34 +0000 (12:16 +0200)]
scsi: Improve error propagation for scsi_bus_legacy_handle_cmdline()

Let scsi_bus_legacy_add_drive() and scsi_bus_legacy_handle_cmdline()
return an Error**. Prepare qdev initfns for QOM realize error model.

Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agomegasas: Legacy command line handling fix
Andreas Färber [Sun, 21 Jul 2013 10:20:15 +0000 (12:20 +0200)]
megasas: Legacy command line handling fix

Only apply legacy command line handling when the device has not been
hot-plugged. Propagate failure of legacy command line handling.

Cc: qemu-stable@nongnu.org
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoscsi/esp: Use QOM realize for scsi esp
Hu Tao [Mon, 1 Jul 2013 10:18:35 +0000 (18:18 +0800)]
scsi/esp: Use QOM realize for scsi esp

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
[AF: Drop sysbus_esp_init()]
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agofw_cfg: Use QOM realize for fw_cfg
Hu Tao [Mon, 1 Jul 2013 10:18:33 +0000 (18:18 +0800)]
fw_cfg: Use QOM realize for fw_cfg

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
[AF: Moved sysbus_init_mmio() to instance_init, renamed variable]
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoahci: Use QOM realize for ahci
Hu Tao [Mon, 1 Jul 2013 10:18:31 +0000 (18:18 +0800)]
ahci: Use QOM realize for ahci

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
[AF: Avoided repeated SYS_BUS_DEVICE() casts]
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agopflash_cfi02: Use QOM realize for pflash_cfi02
Hu Tao [Mon, 1 Jul 2013 10:18:29 +0000 (18:18 +0800)]
pflash_cfi02: Use QOM realize for pflash_cfi02

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agopflash_cfi01: Use QOM realize for pflash_cfi01
Hu Tao [Mon, 1 Jul 2013 10:18:27 +0000 (18:18 +0800)]
pflash_cfi01: Use QOM realize for pflash_cfi01

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
[AF: Renamed argument]
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agofdc: Improve error propagation for QOM realize
Andreas Färber [Wed, 17 Jul 2013 12:14:41 +0000 (14:14 +0200)]
fdc: Improve error propagation for QOM realize

Rename fdctrl_init_common() to fdctrl_realize_common() and let
fdctrl_connect_drives() propagate an Error through it.

Reviewed-by: Hu Tao <hutao@cn.fujitsu.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agofdc: Use QOM realize for fdc
Hu Tao [Mon, 1 Jul 2013 10:18:25 +0000 (18:18 +0800)]
fdc: Use QOM realize for fdc

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
[AF: Renamed SysBusDevice variable]
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agokvm/clock: QOM'ify some more
Hu Tao [Mon, 1 Jul 2013 10:18:38 +0000 (18:18 +0800)]
kvm/clock: QOM'ify some more

Introduce type constant and avoid FROM_SYSBUS().

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
[AF: Renamed parent field]
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agohpet: QOM'ify some more
Hu Tao [Mon, 1 Jul 2013 10:18:36 +0000 (18:18 +0800)]
hpet: QOM'ify some more

Introduce type constant, avoid FROM_SYSBUS().

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
[AF: Renamed parent field and renamed variable]
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoscsi/esp: QOM'ify some more
Hu Tao [Mon, 1 Jul 2013 10:18:34 +0000 (18:18 +0800)]
scsi/esp: QOM'ify some more

Introduce type constant and avoid DO_UPCAST().

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
[AF: Renamed parent field]
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agofwcfg: QOM'ify some more
Hu Tao [Mon, 1 Jul 2013 10:18:32 +0000 (18:18 +0800)]
fwcfg: QOM'ify some more

Use type constant if possible and avoid DO_UPCAST().

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
[AF: Renamed parent field]
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoahci: QOM'ify some more
Hu Tao [Mon, 1 Jul 2013 10:18:30 +0000 (18:18 +0800)]
ahci: QOM'ify some more

Introduce type constant and avoid DO_UPCAST().

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
[AF: Renamed parent field]
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agopflash-cfi02: QOM'ify some more
Hu Tao [Mon, 1 Jul 2013 10:18:28 +0000 (18:18 +0800)]
pflash-cfi02: QOM'ify some more

Introduce type constant and replace FROM_SYSBUS().

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
[AF: Renamed parent field]
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agopflash-cfi01: QOM'ify some more
Hu Tao [Mon, 1 Jul 2013 10:18:26 +0000 (18:18 +0800)]
pflash-cfi01: QOM'ify some more

Introduce type constant and replace FROM_SYSBUS().

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
[AF: Renamed parent field]
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agofdc: QOM'ify some more
Hu Tao [Mon, 1 Jul 2013 10:18:24 +0000 (18:18 +0800)]
fdc: QOM'ify some more

Introduce type constant and avoid DO_UPCAST(), container_of(),
and use DEVICE() to avoid accessing parent qdev directly.

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
[AF: Renamed parent field and avoided repeated SYS_BUS_DEVICE() casts]
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoq35: Use QOM realize for q35 host bridge
Hu Tao [Mon, 1 Jul 2013 10:18:23 +0000 (18:18 +0800)]
q35: Use QOM realize for q35 host bridge

And split off MemoryRegion initialization into instance_init.

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoq35: Use type-safe cast instead of direct access of parent dev
Hu Tao [Mon, 1 Jul 2013 10:18:22 +0000 (18:18 +0800)]
q35: Use type-safe cast instead of direct access of parent dev

And remove variables if possible.

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
[AF: Converted remaining access and renamed to parent_obj]
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoi440fx-pcihost: Use QOM realize for i440fx-pcihost
Hu Tao [Mon, 1 Jul 2013 10:18:20 +0000 (18:18 +0800)]
i440fx-pcihost: Use QOM realize for i440fx-pcihost

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoi440fx: Use type-safe cast instead of direct access of parent dev
Hu Tao [Mon, 1 Jul 2013 10:18:21 +0000 (18:18 +0800)]
i440fx: Use type-safe cast instead of direct access of parent dev

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
[AF: Converted remaining accesses and renamed to parent_obj]
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoohci: Use QOM realize for OHCI
Hu Tao [Mon, 1 Jul 2013 10:18:19 +0000 (18:18 +0800)]
ohci: Use QOM realize for OHCI

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoohci: QOM'ify some more
Hu Tao [Mon, 1 Jul 2013 10:18:18 +0000 (18:18 +0800)]
ohci: QOM'ify some more

Introduce type constant and avoid DO_UPCAST().

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
[AF: Avoid remaining OHCIPCIState::pci_dev uses, rename parent fields]
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agosysbus: Document SysBusDeviceClass::init and realize semantics
Hu Tao [Mon, 1 Jul 2013 10:18:17 +0000 (18:18 +0800)]
sysbus: Document SysBusDeviceClass::init and realize semantics

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
[AF: Syntax and wording changes]
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoxen/xen_platform: QOM parent field cleanup
Andreas Färber [Sun, 30 Jun 2013 13:20:05 +0000 (15:20 +0200)]
xen/xen_platform: QOM parent field cleanup

Replace direct uses of PCIXenPlatformState::pci_dev field with QOM casts
and rename it to parent_obj.

Acked-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoxen/xen_platform: QOM casting sweep
Peter Crosthwaite [Mon, 24 Jun 2013 07:00:14 +0000 (17:00 +1000)]
xen/xen_platform: QOM casting sweep

Define and use standard QOM cast macro. Remove usages of DO_UPCAST()
and direct -> style upcasting.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
[AF: Dropped opaque casts]
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agomisc/ivshmem: QOM parent field cleanup
Andreas Färber [Sun, 30 Jun 2013 13:15:15 +0000 (15:15 +0200)]
misc/ivshmem: QOM parent field cleanup

Replace direct uses of IVShmemState::dev with QOM casts and rename it to
parent_obj.

Acked-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agomisc/ivshmem: QOM Upcast Sweep
Peter Crosthwaite [Mon, 24 Jun 2013 06:59:29 +0000 (16:59 +1000)]
misc/ivshmem: QOM Upcast Sweep

Define and use standard QOM cast macro. Remove usages of DO_UPCAST()
and direct -> style upcasting.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
[AF: Simplified casts and converted two more DO_UPCAST()s]
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agodisplay/vmware_vga: QOM parent field cleanup
Andreas Färber [Sun, 30 Jun 2013 13:01:36 +0000 (15:01 +0200)]
display/vmware_vga: QOM parent field cleanup

Replace direct uses of pci_vmsvga_state_s::card with QOM casts and
rename it to parent_obj.

Acked-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agodisplay/vmware_vga: QOM casting sweep
Peter Crosthwaite [Mon, 24 Jun 2013 06:58:45 +0000 (16:58 +1000)]
display/vmware_vga: QOM casting sweep

Define and use standard QOM cast macro. Remove usages of DO_UPCAST() and
direct -> style casting.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
[AF: Renamed to TYPE_VMWARE_VGA and VMWARE_VGA()]
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agomisc/pci-testdev: QOM parent field cleanup
Andreas Färber [Sun, 30 Jun 2013 12:48:56 +0000 (14:48 +0200)]
misc/pci-testdev: QOM parent field cleanup

Replace direct uses of PCITestDevState::dev with QOM casts and rename it
to parent_obj.

Acked-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agomisc/pci-testdev: QOM Upcast Sweep
Peter Crosthwaite [Mon, 24 Jun 2013 06:58:00 +0000 (16:58 +1000)]
misc/pci-testdev: QOM Upcast Sweep

Define and use standard QOM cast macro. Remove usages of DO_UPCAST()
and direct -> style upcasting.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
[AF: Replaced another DO_UPCAST()]
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoacpi/piix4: QOM parent field cleanup
Andreas Färber [Sun, 30 Jun 2013 12:40:37 +0000 (14:40 +0200)]
acpi/piix4: QOM parent field cleanup

Replace direct uses of PIIX4PMState::dev with QOM casts and rename it to
parent_obj.

Acked-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoacpi/piix4: QOM Upcast Sweep
Peter Crosthwaite [Mon, 24 Jun 2013 06:57:14 +0000 (16:57 +1000)]
acpi/piix4: QOM Upcast Sweep

Define and use standard QOM cast macro. Remove usages of DO_UPCAST()
and direct -> style upcasting.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoide/ich: QOM parent field cleanup
Andreas Färber [Sun, 30 Jun 2013 12:19:24 +0000 (14:19 +0200)]
ide/ich: QOM parent field cleanup

Replace direct uses of AHCIPCIState::card with QOM casts and rename it
to parent_obj.

Acked-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoide/ich: QOM Upcast Sweep
Peter Crosthwaite [Mon, 24 Jun 2013 06:55:45 +0000 (16:55 +1000)]
ide/ich: QOM Upcast Sweep

Define and use standard QOM cast macro. Remove usages of DO_UPCAST()
and direct -> style upcasting.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
[AF: Renamed to TYPE_ICH9_AHCI and used typedef in pci_ich9_reset()]
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoscsi/esp-pci: QOM parent field cleanup
Andreas Färber [Sun, 30 Jun 2013 12:07:49 +0000 (14:07 +0200)]
scsi/esp-pci: QOM parent field cleanup

Replace direct uses of PCIESPState::dev with QOM casts and rename it to
parent_obj.

Acked-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoscsi/esp-pci: QOM Upcast Sweep
Peter Crosthwaite [Mon, 24 Jun 2013 06:55:00 +0000 (16:55 +1000)]
scsi/esp-pci: QOM Upcast Sweep

Define and use standard QOM cast macro. Remove usages of DO_UPCAST()
and direct -> style upcasting.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoscsi/megasas: QOM parent field cleanup
Andreas Färber [Sun, 30 Jun 2013 12:02:53 +0000 (14:02 +0200)]
scsi/megasas: QOM parent field cleanup

Replace direct uses of MegasasState::dev with QOM casts and rename it to
parent_obj.

Acked-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoscsi/megasas: QOM Upcast Sweep
Peter Crosthwaite [Mon, 24 Jun 2013 06:54:15 +0000 (16:54 +1000)]
scsi/megasas: QOM Upcast Sweep

Define and use standard QOM cast macro. Remove usages of DO_UPCAST()
and direct -> style upcasting.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoscsi/lsi53c895a: QOM parent field cleanup
Andreas Färber [Sun, 30 Jun 2013 11:52:22 +0000 (13:52 +0200)]
scsi/lsi53c895a: QOM parent field cleanup

Replace direct uses of LSIState::dev with QOM casts and rename it to
parent_obj.

Acked-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agoscsi/lsi53c895a: QOM Upcast Sweep
Peter Crosthwaite [Mon, 24 Jun 2013 06:53:30 +0000 (16:53 +1000)]
scsi/lsi53c895a: QOM Upcast Sweep

Define and use standard QOM cast macro. Remove usages of DO_UPCAST()
and direct -> style upcasting.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agousb/hcd-xhci: QOM parent field cleanup
Andreas Färber [Sun, 30 Jun 2013 11:38:41 +0000 (13:38 +0200)]
usb/hcd-xhci: QOM parent field cleanup

Replace direct uses of XHCIState::pci_dev with QOM casts and rename it
to parent_obj.

Acked-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agousb/hcd-xhci: QOM Upcast Sweep
Peter Crosthwaite [Mon, 24 Jun 2013 06:52:45 +0000 (16:52 +1000)]
usb/hcd-xhci: QOM Upcast Sweep

Define and use standard QOM cast macro. Remove usages of DO_UPCAST()
and direct -> style upcasting.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
[AF: Dropped usb_xhci_init() DeviceState argument and renamed variable]
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agonet/pcnet-pci: QOM Upcast Sweep
Peter Crosthwaite [Mon, 24 Jun 2013 06:52:00 +0000 (16:52 +1000)]
net/pcnet-pci: QOM Upcast Sweep

Define and use standard QOM cast macro. Remove usages of DO_UPCAST()
and direct -> style upcasting.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
[AF: Renamed parent field, renamed from PC_NET to PCNET]
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agonet/rtl8139: QOM parent field cleanup
Andreas Färber [Sun, 30 Jun 2013 11:09:00 +0000 (13:09 +0200)]
net/rtl8139: QOM parent field cleanup

Replace direct uses of RTL8139State::dev with QOM casts and rename it to
parent_obj.

Acked-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agonet/rtl8139: QOM Upcast Sweep
Peter Crosthwaite [Mon, 24 Jun 2013 06:51:15 +0000 (16:51 +1000)]
net/rtl8139: QOM Upcast Sweep

Define and use standard QOM cast macro. Remove usages of DO_UPCAST()
and direct -> style upcasting.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agonet/e1000: QOM parent field cleanup
Andreas Färber [Sun, 30 Jun 2013 10:55:52 +0000 (12:55 +0200)]
net/e1000: QOM parent field cleanup

Replace direct uses of E1000State::dev field with QOM casts and rename
it to parent_obj.

Acked-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agonet/e1000: QOM Upcast Sweep
Peter Crosthwaite [Mon, 24 Jun 2013 06:50:30 +0000 (16:50 +1000)]
net/e1000: QOM Upcast Sweep

Define and use standard QOM cast macro. Remove usages of DO_UPCAST()
and direct -> style upcasting.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agohw: Avoid use of QOM type name macros in VMStateDescriptions
Peter Maydell [Thu, 27 Jun 2013 11:03:44 +0000 (12:03 +0100)]
hw: Avoid use of QOM type name macros in VMStateDescriptions

The name field in a VMStateDescription is part of the migration state
versioning, so changing it will break migration.  It's therefore a
bad idea to use a QOM typename macro to initialize it, because in
general we're free to rename QOM types as part of code refactoring
and cleanup.  For the handful of devices that were doing this by
mistake, replace the QOM typenames with the corresponding literal
strings.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
[AF: Use TYPE_PVSCSI for TypeInfo instead]
Signed-off-by: Andreas Färber <afaerber@suse.de>
11 years agotests: Add test-bitops.c with some sextract tests
Peter Maydell [Fri, 28 Jun 2013 11:40:32 +0000 (12:40 +0100)]
tests: Add test-bitops.c with some sextract tests

Add some simple test cases for the new sextract32
and sextract64 functions.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Message-id: 1372419632-5521-3-git-send-email-peter.maydell@linaro.org
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agobitops: Provide sextract32() and sextract64()
Peter Maydell [Fri, 28 Jun 2013 11:40:31 +0000 (12:40 +0100)]
bitops: Provide sextract32() and sextract64()

A common operation in instruction decoding is to take a field
from an instruction that represents a signed integer in some
arbitrary number of bits, and sign extend it into a C signed
integer type for manipulation. Provide new functions sextract32()
and sextract64() which perform this operation; they are like
the existing extract32() and extract64() except that the field
is sign-extended into the returned result.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Message-id: 1372419632-5521-2-git-send-email-peter.maydell@linaro.org
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agomemory: Fix zero-sized memory region print
Alex Williamson [Fri, 19 Jul 2013 18:42:12 +0000 (12:42 -0600)]
memory: Fix zero-sized memory region print

if mr->size == 0, then

int128_get64(int128_sub(mr->size, int128_make64(1))) => assert(!a.hi)

Also, use int128_one().

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 20130719184124.15864.20803.stgit@bling.home
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoconfigure: Remove ldscripts
Richard Henderson [Sun, 21 Jul 2013 23:39:26 +0000 (15:39 -0800)]
configure: Remove ldscripts

Since 964c6fa16f50a607f9da5068d6bf15ccc93872c0, these files are unused.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Message-id: 1374449966-12926-1-git-send-email-rth@twiddle.net
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agogtk: Fix accelerator filtering
Jan Kiszka [Mon, 22 Jul 2013 07:04:32 +0000 (09:04 +0200)]
gtk: Fix accelerator filtering

This is in fact very simply: When the input in grabbed, everything
should be exclusively passed to the guest - except it has our magic
CTRL-ALT modifier set. Then let GTK filter out those accels that are in
use. When checking the modifier state, we just need to filter out NUM
and CAPS lock.

Note: Filtering based on hard-coded modifiers breaks overriding
accelerators. Needs to be fixed at a later point.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'pmaydell/tags/pull-arm-devs-20130722' into staging
Anthony Liguori [Mon, 22 Jul 2013 15:14:24 +0000 (10:14 -0500)]
Merge remote-tracking branch 'pmaydell/tags/pull-arm-devs-20130722' into staging

arm-devs queue

# gpg: Signature made Mon 22 Jul 2013 06:38:52 AM CDT using RSA key ID 14360CDE
# gpg: Can't check signature: public key not found

# By Peter Maydell (8) and Soren Brinkmann (2)
# Via Peter Maydell
* pmaydell/tags/pull-arm-devs-20130722:
  hw/arm: Use 'load_ramdisk()' for loading ramdisks w/ U-Boot header
  hw/loader: Support ramdisk with u-boot header
  vexpress: Add virtio-mmio transports
  vexpress: Make VEDBoardInfo extend arm_boot_info
  arm/boot: Allow boards to modify the FDT blob
  virtio: Implement MMIO based virtio transport
  virtio: Support transports which can specify the vring alignment
  virtio: Add support for guest setting of queue size
  arm/boot: Use qemu_devtree_setprop_sized_cells()
  device_tree: Add qemu_devtree_setprop_sized_cells() utility functions

Message-id: 1374493427-3254-1-git-send-email-peter.maydell@linaro.org
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'bonzini/iommu-for-anthony' into staging
Anthony Liguori [Mon, 22 Jul 2013 15:14:18 +0000 (10:14 -0500)]
Merge remote-tracking branch 'bonzini/iommu-for-anthony' into staging

# By Paolo Bonzini (2) and others
# Via Paolo Bonzini
* bonzini/iommu-for-anthony:
  exec: fix incorrect assumptions in memory_access_size
  memory: Return -1 again on reads from unsigned regions
  memory: actually set the owner
  exec.c: Pass correct pointer type to qemu_ram_ptr_length

Message-id: 1374264478-23913-1-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'mjt/trivial-patches' into staging
Anthony Liguori [Mon, 22 Jul 2013 15:13:49 +0000 (10:13 -0500)]
Merge remote-tracking branch 'mjt/trivial-patches' into staging

# By Michael Tokarev (2) and others
# Via Michael Tokarev
* mjt/trivial-patches:
  doc: monitor multiplexing rewording
  block/m25p80: Update Micron entries
  Fix command example in qemu.sasl
  slirp: remove mbuf(m_hdr,m_dat) indirection
  linux-user: declare sys_futex to have 6 arguments

Message-id: 1374225073-12959-1-git-send-email-mjt@msgid.tls.msk.ru
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'stefanha/block' into staging
Anthony Liguori [Mon, 22 Jul 2013 15:13:34 +0000 (10:13 -0500)]
Merge remote-tracking branch 'stefanha/block' into staging

# By Peter Lieven (5) and others
# Via Stefan Hajnoczi
* stefanha/block:
  block/raw: add .bdrv_get_info
  block: fix bdrv_read_unthrottled()
  cpus: Let vm_stop[_force_state]() always flush block devices
  block-migration: efficiently encode zero blocks
  block/raw: add bdrv_co_write_zeroes
  block: add bdrv_write_zeroes()
  block: fix vvfat error path for enable_write_target
  QEMUBH: make AioContext's bh re-entrant
  dataplane: sync virtio.c and vring.c virtqueue state
  gluster: Add discard support for GlusterFS block driver.
  gluster: Use pkg-config to configure GlusterFS block driver

Message-id: 1374223132-29107-1-git-send-email-stefanha@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'rth/axp-next' into staging
Anthony Liguori [Mon, 22 Jul 2013 15:13:27 +0000 (10:13 -0500)]
Merge remote-tracking branch 'rth/axp-next' into staging

# By Richard Henderson
# Via Richard Henderson
* rth/axp-next:
  pc-bios: Update palcode-clipper
  target-alpha: Move alarm to vm_clock

Message-id: 1374161033-11449-1-git-send-email-rth@twiddle.net
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'stefanha/tracing' into staging
Anthony Liguori [Mon, 22 Jul 2013 15:13:15 +0000 (10:13 -0500)]
Merge remote-tracking branch 'stefanha/tracing' into staging

# By Markus Armbruster
# Via Stefan Hajnoczi
* stefanha/tracing:
  trace-events: Fix up source file comments
  trace-events: Drop unused events
  milkymist-minimac2: Fix minimac2_read/_write tracepoints
  slavio_misc: Fix slavio_led_mem_readw/_writew tracepoints
  cleanup-trace-events.pl: New

Message-id: 1374119369-26496-1-git-send-email-stefanha@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agohw/arm: Use 'load_ramdisk()' for loading ramdisks w/ U-Boot header
Soren Brinkmann [Mon, 8 Jul 2013 22:40:02 +0000 (15:40 -0700)]
hw/arm: Use 'load_ramdisk()' for loading ramdisks w/ U-Boot header

The load_ramdisk function is used to load ramdisk featuring a U-Boot
header.

Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1373323202-17083-3-git-send-email-soren.brinkmann@xilinx.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
11 years agohw/loader: Support ramdisk with u-boot header
Soren Brinkmann [Mon, 8 Jul 2013 22:40:01 +0000 (15:40 -0700)]
hw/loader: Support ramdisk with u-boot header

Introduce 'load_ramdisk()' which can load "normal" ramdisks and ramdisks
with a u-boot header.
To enable this and leverage synergies 'load_uimage()' is refactored to
accomodate this additional use case.

Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1373323202-17083-2-git-send-email-soren.brinkmann@xilinx.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
11 years agovexpress: Add virtio-mmio transports
Peter Maydell [Tue, 16 Jul 2013 12:25:12 +0000 (13:25 +0100)]
vexpress: Add virtio-mmio transports

Add some virtio-mmio transports to the vexpress board model,
together with a modify_dtb hook which adds them to the device
tree so that the kernel will probe for them. We put them
in a reserved area of the address map.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1373977512-28932-9-git-send-email-peter.maydell@linaro.org

11 years agovexpress: Make VEDBoardInfo extend arm_boot_info
Peter Maydell [Tue, 16 Jul 2013 12:25:11 +0000 (13:25 +0100)]
vexpress: Make VEDBoardInfo extend arm_boot_info

Make the VEDBoardInfo struct extend arm_boot_info; this will
allow us to get at the VEDBoardInfo information inside callbacks
from arm/boot code.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1373977512-28932-8-git-send-email-peter.maydell@linaro.org

11 years agoarm/boot: Allow boards to modify the FDT blob
Peter Maydell [Tue, 16 Jul 2013 12:25:10 +0000 (13:25 +0100)]
arm/boot: Allow boards to modify the FDT blob

Add a callback hook in arm_boot_info to allow board models to
modify the device tree blob if they need to. (The major expected
use case is to add virtio-mmio nodes for virtio-mmio transports
that exist in QEMU but not in the hardware.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1373977512-28932-7-git-send-email-peter.maydell@linaro.org

11 years agovirtio: Implement MMIO based virtio transport
Peter Maydell [Tue, 16 Jul 2013 12:25:09 +0000 (13:25 +0100)]
virtio: Implement MMIO based virtio transport

Add support for the generic MMIO based virtio transport.

This patch includes some fixes for bugs spotted by
Ying-Shiuan Pan <yspan@itri.org.tw>.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Message-id: 1373977512-28932-6-git-send-email-peter.maydell@linaro.org
[Fred changes: updated to new virtio-bus mechanisms]
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
[PMM changes:
 * fixed trivial makefile conflict
 * removed unused int_enable
 * host_features doesn't need migrating
 * reset guest accessible state in the reset function
 * minor style fixes like extra blank lines
 * RAZ/WI if there's no backend
 * made transport size 0x200, in line with kvmtool
 * set has_variable_vring_alignment
]

11 years agovirtio: Support transports which can specify the vring alignment
Peter Maydell [Tue, 16 Jul 2013 12:25:08 +0000 (13:25 +0100)]
virtio: Support transports which can specify the vring alignment

Support virtio transports which can specify the vring alignment
(ie where the guest communicates this to the host) by providing
a new virtio_queue_set_align() function. (The default alignment
remains as before.)

Transports which wish to make use of this must set the
has_variable_vring_alignment field in their VirtioBusClass
struct to true; they can then change the alignment via
virtio_queue_set_align().

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1373977512-28932-5-git-send-email-peter.maydell@linaro.org

11 years agovirtio: Add support for guest setting of queue size
Peter Maydell [Tue, 16 Jul 2013 12:25:07 +0000 (13:25 +0100)]
virtio: Add support for guest setting of queue size

The MMIO virtio transport spec allows the guest to tell the host how
large the queue size is. Add virtio_queue_set_num() function which
implements this in the QEMU common virtio support code.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1373977512-28932-4-git-send-email-peter.maydell@linaro.org