summaryrefslogtreecommitdiff
path: root/hw
AgeCommit message (Collapse)AuthorFilesLines
2013-07-04memory: add owner argument to initialization functionsPaolo Bonzini313-739/+740
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-07-04vmport: Disentangle read handler type from portioJan Kiszka1-2/+2
In case the latter may vanish one day, make sure the vmport read handler type will remain unaffected. This is also conceptually cleaner. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-07-04xen: Mark fixed platform I/O as unalignedJan Kiszka1-0/+4
Before switching to the memory core dispatcher, we need to make sure that this pv-device will continue to receive unaligned portio accesses. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-07-04vmware-vga: Accept unaligned I/O accessesJan Kiszka1-0/+4
Before switching to the memory core dispatcher, we need to make sure that this pv-device will continue to receive unaligned portio accesses. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-07-04isa: implement isa_is_ioport_assigned via memory_region_findJan Kiszka2-8/+10
Open-code isa_is_ioport_assigned via a memory region lookup. As all IO ports are now directly or indirectly registered via the memory API, this becomes possible and will finally allow us to drop the ioport tables. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-07-04vt82c686: replace register_ioport*Jan Kiszka1-14/+26
Convert over to memory regions to obsolete register_ioport*. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-07-04prep: replace register_ioport*Jan Kiszka1-8/+15
Convert over to memory regions to obsolete register_ioport*. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-07-04i82374: replace register_ioport*Jan Kiszka1-5/+13
Convert over to memory regions to obsolete register_ioport*. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-07-04wdt_ib700: replace register_ioport*Jan Kiszka1-2/+10
Convert over to memory regions to obsolete register_ioport*. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-07-04applesmc: replace register_ioport*Jan Kiszka1-12/+38
Convert over to memory regions to obsolete register_ioport*. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-07-04adlib: replace register_ioport*Jan Kiszka1-8/+12
Convert over to memory regions to obsolete register_ioport*. CC: malc <av1474@comtv.ru> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-07-04dma: keep a device alive while it has SGListsPaolo Bonzini4-9/+16
Reviewed-by: Anthony Liguori <aliguori@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-07-04scsi: keep device alive while it has requestsPaolo Bonzini1-2/+10
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-07-01Merge remote-tracking branch 'agraf/ppc-for-upstream' into stagingAnthony Liguori18-119/+553
# By Alexander Graf (12) and others # Via Alexander Graf * agraf/ppc-for-upstream: (32 commits) PPC: Ignore writes to L2CR mac-io: Add escc-legacy memory alias region PPC: Newworld: Add second uninorth control register set PPC: Newworld: Add uninorth token register PPC: Add clock-frequency export for Mac machines PPC: Introduce an alias cache for faster lookups PPC: Fix GDB read on code area for PPC6xx PPC: Add dump_mmu() for 6xx target-ppc: Introduce unrealizefn for PowerPCCPU booke_ppc: limit booke timer to max when timeout overflow Graphics: Switch to 800x600x32 as default mode pseries: Update MAINTAINERS information target-ppc kvm: save cr register pseries: Fix compiler warning (conversion of pointer to integral value) spapr-rtas: add CPU argument to RTAS calls target-ppc: Change default machine for 64-bit ppc: do not register IABR SPR twice for 603e target-ppc: Drop redundant flags assignments from CPU families mpc8544_guts: Turn qdev initfn into instance_init mpc8544_guts: QOM'ify ... Message-id: 1372556709-23868-1-git-send-email-agraf@suse.de Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-07-01virtio-ccw: fix build breakage on windowsCornelia Huck1-4/+2
event_notifier_get_fd() is not available on windows hosts. Fix this by moving the calls to event_notifier_get_fd() to the kvm code. Reported-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
2013-07-01mac-io: Add escc-legacy memory alias regionAlexander Graf1-0/+47
Mac OS X's debugging serial driver accesses the ESCC through a different register layout, called "escc-legacy". This layout differs from the normal escc register layout purely by the location of the respective registers. This patch adds a memory alias region that takes normal escc registers and maps them into the escc-legacy register space. With this patch applied, a Mac OS X guest successfully emits debug output on the serial port when run with debug parameters set, for example by running: $ qemu-system-ppc -prom-env -'boot-args=-v debug=0x8 io=0xff serial=0x3' \ -cdrom 10.4.iso -boot d Signed-off-by: Alexander Graf <agraf@suse.de>
2013-07-01PPC: Newworld: Add second uninorth control register setAlexander Graf1-0/+4
Mac OS X requires a second uninorth register set to be mapped a few bytes above the first one. Let's just expose it to make it happy. Signed-off-by: Alexander Graf <agraf@suse.de>
2013-07-01PPC: Newworld: Add uninorth token registerAlexander Graf1-2/+11
Mac OS X expects the uninorth control register set to contain one register that always reads back what it writes in. Expose that. This is just a temporary hack. Eventually, we want to expose the uninorth (/uni-n in device tree) as a separate QOM device. Signed-off-by: Alexander Graf <agraf@suse.de>
2013-07-01PPC: Add clock-frequency export for Mac machinesAlexander Graf2-0/+4
Support in fwcfg has been around for exposure of the clock-frequency CPU property. OpenBIOS reads it, we just never exposed it. Since Mac OS X is very picky about its clock frequency values, let's just take a known good value and always expose that. Reported-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-07-01booke_ppc: limit booke timer to max when timeout overflowBharat Bhushan1-4/+20
Limit watchdog and fit timer to maximum timeout value which qemu timer can support (INT64_MAX). This maximum timeout will be hundreds of years, so limiting to max timeout is pretty safe. Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-07-01pseries: Fix compiler warning (conversion of pointer to integral value)Stefan Weil1-1/+1
This kind of type cast must use uintptr_t or target_ulong to be portable for hosts with sizeof(void *) != sizeof(long). Here the value is assigned to a variable of type target_ulong. Signed-off-by: Stefan Weil <sw@weilnetz.de> [agraf: fix compilation on 32bit hosts] Signed-off-by: Alexander Graf <agraf@suse.de>
2013-07-01spapr-rtas: add CPU argument to RTAS callsAnthony Liguori7-26/+34
RTAS is a hypervisor provided binary blob that a guest loads and calls into to execute certain functions. It's similar to the vsyscall page in Linux or the short lived VMCI paravirt interface from VMware. The QEMU implementation of the RTAS blob is simply a passthrough that proxies all RTAS calls to the hypervisor via an hypercall. While we pass a CPU argument for hypercall handling in QEMU, we don't pass it for RTAS calls. Since some RTAs calls require making hypercalls (normally RTAS is implemented as guest code) we have nasty hacks to allow that. Add a CPU argument to RTAS call handling so we can more easily invoke hypercalls just as guest code would. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-07-01target-ppc: Change default machine for 64-bitDavid Gibson2-3/+1
Currently, for qemu-system-ppc64, the default machine type is 'mac99'. The mac99 machine is not being actively maintained, and represents a bizarre hybrid of components that never actually existed as a real system. This patch changes the default machine to 'pseries', which is actively maintained and works well with most modern ppc64 Linux distributions as a guest. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> [agraf: adjust commit message] Signed-off-by: Alexander Graf <agraf@suse.de>
2013-07-01mpc8544_guts: Turn qdev initfn into instance_initAndreas Färber1-13/+5
SysBus can deal with NULL SysBusDeviceClass::init since 4ce5dae. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-07-01mpc8544_guts: QOM'ifyAndreas Färber1-5/+9
Introduce type constant, cast macro and rename parent field. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-07-01mpc8544_guts: Fix MemoryRegion nameAndreas Färber1-1/+1
6544 -> 8544 Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-07-01intc/openpic_kvm: Fix QOM and build issuesAndreas Färber2-22/+34
Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-07-01intc/openpic: Convert to QOM realizeAndreas Färber1-15/+19
Split qdev initfn into instance_init and realize functions. Change one occurrence of "klass" while at it. Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-07-01intc/openpic: QOM'ifyAndreas Färber3-8/+13
Introduce type constant and cast macro. Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-07-01kvm/openpic: in-kernel mpic supportScott Wood3-5/+327
Enables support for the in-kernel MPIC that thas been merged into the KVM next branch. This includes irqfd/KVM_IRQ_LINE support from Alex Graf (along with some other improvements). Note from Alex regarding kvm_irqchip_create(): On x86, one would call kvm_irqchip_create() to initialize an in-kernel interrupt controller. That function then goes ahead and initializes global capability variables as well as the default irq routing table. On ppc, we can't call kvm_irqchip_create() because we can have different types of interrupt controllers. So we want to do all the things that function would do for us in the in-kernel device init handler. Signed-off-by: Scott Wood <scottwood@freescale.com> [agraf: squash in kvm_irqchip_commit_routes patch, fix non-kvm build, fix ppcemb] Signed-off-by: Alexander Graf <agraf@suse.de>
2013-07-01KVM: PIC: Only commit irq routing when necessaryAlexander Graf1-0/+1
The current logic updates KVM's view of our interrupt map every time we change it. While this is nice and bullet proof, it slows things down badly for me. QEMU spends about 3 seconds on every start telling KVM what news it has on its routing maps. Instead, let's just synchronize the whole irq routing map as a whole when we're done constructing it. For things that change during runtime, we can still update the routing table on demand. Signed-off-by: Alexander Graf <agraf@suse.de>
2013-07-01PPC: e500: factor out mpic init codeScott Wood1-22/+34
KVM in-kernel MPIC support is going to expand this even more, so let's keep it contained. Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-07-01openpic: factor out some common defines into openpic.hScott Wood1-22/+18
...for use by the KVM in-kernel irqchip stub. Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-06-28multiboot: Calculate upper_mem in the ROMKevin Wolf1-2/+0
The upper_mem field of the Multiboot information struct doesn't really contain the RAM size - 1 MB like we used to calculate it, but only the memory from 1 MB up to the first (upper) memory hole. In order to correctly retrieve this information, the multiboot ROM now looks at the mmap it creates anyway and tries to find the size of contiguous usable memory from 1 MB. Drop the multiboot.c definition of lower_mem and upper_mem because both are queried at runtime now. Signed-off-by: Kevin Wolf <mail@kevin-wolf.de> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Message-id: 1372018066-21822-3-git-send-email-mail@kevin-wolf.de Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-06-28Merge remote-tracking branch 'afaerber/qom-cpu' into stagingAnthony Liguori11-15/+21
# By Andreas Färber # Via Andreas Färber * afaerber/qom-cpu: (24 commits) cpu: Turn cpu_unassigned_access() into a CPUState hook hwaddr: Make hwaddr type usable beyond softmmu cpu: Change qemu_init_vcpu() argument to CPUState cpus: Change qemu_dummy_start_vcpu() argument to CPUState cpus: Change qemu_kvm_start_vcpu() argument to CPUState cpus: Change cpu_handle_guest_debug() argument to CPUState gdbstub: Set gdb_set_stop_cpu() argument to CPUState kvm: Change kvm_cpu_exec() argument to CPUState kvm: Change kvm_handle_internal_error() argument to CPUState cpu: Turn cpu_dump_{state,statistics}() into CPUState hooks cpus: Change qemu_kvm_init_cpu_signals() argument to CPUState kvm: Change kvm_set_signal_mask() argument to CPUState cpus: Change qemu_kvm_wait_io_event() argument to CPUState cpus: Change cpu_thread_is_idle() argument to CPUState cpu: Change cpu_exit() argument to CPUState kvm: Change cpu_synchronize_state() argument to CPUState kvm: Change kvm_cpu_synchronize_state() argument to CPUState gdbstub: Simplify find_cpu() cpu: Guard cpu_{save,load}() definitions target-openrisc: Register VMStateDescription for OpenRISCCPU ...
2013-06-28cmd646: fix build when DEBUG_IDE is enabled.Mark Cave-Ayland1-2/+2
Make sure we use the correct TARGET/PRI macros in the debug statements. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> CC: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2013-06-28cpu: Turn cpu_unassigned_access() into a CPUState hookAndreas Färber1-4/+10
Use it for all targets, but be careful not to pass invalid CPUState. cpu_single_env can be NULL, e.g. on Xen. Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-06-28cpu: Change cpu_exit() argument to CPUStateAndreas Färber5-5/+5
It no longer depends on CPUArchState, so move it to qom/cpu.c. Prepares for changing GDBState::c_cpu to CPUState. Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-06-28kvm: Change cpu_synchronize_state() argument to CPUStateAndreas Färber4-5/+5
Change Monitor::mon_cpu to CPUState as well. Reviewed-by: liguang <lig.fnst@cn.fujitsu.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-06-28kvm: Change kvm_cpu_synchronize_state() argument to CPUStateAndreas Färber1-1/+1
It no longer relies on CPUArchState since 20d695a. Reviewed-by: liguang <lig.fnst@cn.fujitsu.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-06-25Merge remote-tracking branch 'pmaydell/arm-devs.for-upstream' into stagingAnthony Liguori4-260/+369
# By Peter Crosthwaite (3) and others # Via Peter Maydell * pmaydell/arm-devs.for-upstream: nand: Don't inherit from Sysbus block/nand: Convert Sysbus::init to Device::realize block/nand: QOM casting sweep i.MX31: Fix PRCS bit test arm/boot: Free dtb blob memory after use i.MX: Rework functions/types name and use new style initialization i.MX: Implement a more complete version of the GPT timer. ARM: Allow dumping of device tree Message-id: 1372184516-32397-1-git-send-email-peter.maydell@linaro.org Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-06-25Merge remote-tracking branch 'cohuck/virtio-ccw-upstr' into stagingAnthony Liguori4-1/+217
# By Cornelia Huck (2) and Christian Borntraeger (1) # Via Cornelia Huck * cohuck/virtio-ccw-upstr: virtio-ccw: Wire up guest and host notifies. virtio-ccw: Wire up ioeventfd. s390/virtio-ccw: Fix virtio reset Message-id: 1372177538-9812-1-git-send-email-cornelia.huck@de.ibm.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-06-25nand: Don't inherit from SysbusPeter Crosthwaite1-3/+4
Nand chips are not sysbus devices - they do not have any sense of MMIO, nor interrupts. Re-parent to TYPE_DEVICE accordingly. Cc: afaerber@suse.de Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2013-06-25block/nand: Convert Sysbus::init to Device::realizePeter Crosthwaite1-9/+7
The prescribed transition from Sysbus::init function to a Device::realize. Cc: afaerber@suse.de Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2013-06-25block/nand: QOM casting sweepPeter Crosthwaite1-9/+16
Define and use standard QOM cast macro. Remove usages of DO_UPCAST and direct -> style casting. Cc: afaerber@suse.de Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2013-06-25i.MX31: Fix PRCS bit testStefan Weil1-1/+1
cppcheck detected a condition which was always false. According to the MCIMX31 Reference Manual, the PRCS bits have to be 01 to select the Frequency Pre-Multiplier (FPM). PRCS uses bits 1 and 2, so we have to test for 2. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Peter Chubb <peter.chubb@nicta.com.au> Message-id: 1370810662-32320-1-git-send-email-sw@weilnetz.de Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2013-06-25arm/boot: Free dtb blob memory after usePeter Maydell1-5/+15
The dtb blob returned by load_device_tree() is in memory allocated with g_malloc(). Free it accordingly once we have copied its contents into the guest memory. To make this easy, we need also to clean up the error handling in load_dtb() so that we consistently handle errors in the same way (by printing a message and then returning -1, rather than either plowing on or exiting immediately). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Andreas Färber <afaerber@suse.de> Message-id: 1371209256-11408-1-git-send-email-peter.maydell@linaro.org
2013-06-25i.MX: Rework functions/types name and use new style initializationJean-Christophe DUBOIS1-87/+84
* use dynamic cast whenever possible * Change function names to some more meaningful prefix * Change type names to a more meaningful one * use new style device initialization Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net> Message-id: 1369898943-1993-3-git-send-email-jcd@tribudubois.net Reviewed-by: Peter Chubb <peter.chubb@nicta.com.au> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2013-06-25i.MX: Implement a more complete version of the GPT timer.Jean-Christophe DUBOIS1-174/+269
* implement compare 1 2 and 3 registers * simplify Debug printf Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net> Message-id: 1369898943-1993-2-git-send-email-jcd@tribudubois.net Reviewed-by: Peter Chubb <peter.chubb@nicta.com.au> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2013-06-25ARM: Allow dumping of device treeJohn Rigby1-0/+1
By calling qemu_devtree_dumpdtb near the end of load_dtb. Signed-off-by: John Rigby <john.rigby@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>