summaryrefslogtreecommitdiff
path: root/hw
AgeCommit message (Collapse)AuthorFilesLines
2012-04-10petalogix_s3adsp1800: deleted bad FIXME commentPeter A. G. Crosthwaite1-1/+0
This FIXME has already been actioned. Deleted comment. Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2012-04-07Replace Qemu by QEMU in commentsStefan Weil6-11/+11
The official spelling is QEMU. Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Andreas Färber <afaerber@suse.de> [blauwirbel@gmail.com: fixed comment style in hw/sun4m.c] Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-04-04Improve interrupt handling priorityArtyom Tarasenko1-1/+6
The vector interrupt has higher priority than interrupt_level_n. Also check only interrupt_level_n concurency when TL > 0, the traps of other types may be nested. Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-04-04Fix vector interrupt handlingArtyom Tarasenko1-13/+16
Don't produce stray irq 5, don't overwrite ivec_data if still busy with processing of the previous interrupt. Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-04-02qdev: put all devices under /machinePaolo Bonzini5-5/+18
Avoid cluttering too much the QOM root. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-04-02qdev: give all devices a canonical pathPaolo Bonzini1-3/+13
A strong limitation of QOM right now is that unconverted ports (e.g. all...) do not give a canonical path to devices that are part of the board. This in turn makes it impossible to replace PROP_PTR with a QOM link for example. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-04-02qdev: add children before qdev_initPaolo Bonzini4-24/+7
We want the composition tree to to be in order by the time we call qdev_init, so that a single set of the toplevel realize property can propagate all the way down the composition tree. This is not the case so far. Unfortunately, this is incompatible with calling qdev_init in the constructor wrappers for devices, so for now we need to unattach some devices that are created through those wrappers. This will be fixed by removing qdev_init and instead setting the toplevel realize property after machine init. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-04-02qom: add container_getPaolo Bonzini1-6/+2
This is QOM "mkdir -p". It is useful when referring to container objects such as "/machine". Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-04-02serial: clear LSR.TEMT when populating the TSRAnthony Liguori1-0/+1
We never actually clear the TEMT (transmit sending register empty) flag when populating the TSR. We set the flag, but since it's never cleared, setting it is sort of pointless.. I found this with a unit test case. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-04-02serial: fix retry logicAnthony Liguori1-1/+3
I'm not sure if the retry logic has ever worked when not using FIFO mode. I found this while writing a test case although code inspection confirms it is definitely broken. The TSR retry logic will never actually happen because it is guarded by an 'if (s->tsr_rety > 0)' but this is the only place that can ever make the variable greater than zero. That effectively makes the retry logic an 'if (0)'. I believe this is a typo and the intention was >= 0. Once this is fixed though, I see double transmits with my test case. This is because in the non FIFO case, serial_xmit may get invoked while LSR.THRE is still high because the character was processed but the retransmit timer was still active. We can handle this by simply checking for LSR.THRE and returning early. It's possible that the FIFO paths also need some attention. Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-04-01milkymist-vgafb: add missing registerMichael Walle1-1/+4
This bug existed since the first commit. Fortunately, the affected registers have no functionality in qemu. This will only prevent the following warning: milkymist_vgafb: write access to unknown register 0x00000034 Signed-off-by: Michael Walle <michael@walle.cc>
2012-03-31milkymist-sysctl: support for new core versionMichael Walle1-9/+17
The new version introduces the following new registers: - SoC clock frequency: read-only of system clock used on the SoC - debug scratchpad: 8 bit scratchpad register - debug write lock: write once register, without any function on QEMU Signed-off-by: Michael Walle <michael@walle.cc>
2012-03-31Merge branch 'arm-devs.for-upstream' of ↵Blue Swirl5-54/+78
git://git.linaro.org/people/pmaydell/qemu-arm * 'arm-devs.for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm: pl031: switch clock base to rtc_clock pl031: rearm alarm timer upon load arm: switch real-time clocks to rtc_clock omap: switch omap_lpg to vm_clock rtc: add -rtc clock=rt
2012-03-30rtc: split out macros into a header file and use in test caseAnthony Liguori3-35/+63
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-03-30qtest: IRQ interception infrastructurePaolo Bonzini3-0/+25
Since /i440fx/piix3 is being removed from the composition tree, the IO-APIC is placed under /i440fx. This is wrong and should be changed as soon as the /i440fx/piix3 path is put back. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-03-30pl031: switch clock base to rtc_clockPaolo Bonzini1-12/+26
This lets the user specify the desired semantics. By default, the RTC will follow adjustments from the host's NTP client, and will remain in sync when the virtual machine is stopped. The previous behavior, which provides determinism with both icount and qtest, remains available with "-rtc clock=vm". pl031 supports migration, so we need to convert the time base from rtc_clock to vm_clock and back for backwards compatibility. (The rtc_clock may not be synchronized on the two machines, especially with savevm/loadvm, so the conversion is needed anyway. And since any time base will do, why not pick the one base that is backwards compatible). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-03-30pl031: rearm alarm timer upon loadPaolo Bonzini1-15/+24
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-03-30arm: switch real-time clocks to rtc_clockPaolo Bonzini4-25/+26
This lets the user specify the desired semantics. By default, the RTC will follow adjustments from the host's NTP client. "-rtc clock=vm" will improve determinism with both icount and qtest. Finally, the previous behavior is available with "-rtc clock=rt". Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-03-30omap: switch omap_lpg to vm_clockPaolo Bonzini1-3/+3
The output of the pulse generator needs to be deterministic when running in -icount mode, and to remain constant whenever the VM is stopped. So the right clock to use is vm_clock. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-03-28Merge remote-tracking branch 'sstabellini/disk_io' into stagingAnthony Liguori1-5/+5
* sstabellini/disk_io: xen_disk: when using AIO flush after the operation is completed xen_disk: open disk with BDRV_O_NOCACHE | BDRV_O_CACHE_WB | BDRV_O_NATIVE_AIO
2012-03-27xen_disk: detach the blkdev before bdrv_deleteStefano Stabellini1-0/+1
We need to detach the blkdev from the BlockDriverState before calling bdrv_delete. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2012-03-27xen_console: ignore console disconnect events from console/0Stefano Stabellini1-0/+3
The first console has a different location compared to other PV devices (console, rather than device/console/0) and doesn't obey the xenstore state protocol. We already special case the first console in con_init and con_initialise, we should also do it in con_disconnect. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2012-03-24fix screendumpGerd Hoffmann3-7/+4
Commit 45efb16124efef51de5157afc31984b5a47700f9 optimized a bit too much. We can skip the vga_invalidate_display() in case no console switch happened because we don't need a full redraw then. We can *not* skip vga_hw_update() though, because the screen content will be stale then in case nobody else calls vga_hw_update(). Trigger: vga textmode with vnc display and no client connected. Reported-by: Avi Kivity <avi@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Alon Levy <alevy@redhat.com> Tested-by: Avi Kivity <avi@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-03-23xen_disk: when using AIO flush after the operation is completedStefano Stabellini1-3/+3
If ioreq->postsync call bdrv_flush when the AIO operation is actually completed. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2012-03-23xen_disk: open disk with BDRV_O_NOCACHE | BDRV_O_CACHE_WB | BDRV_O_NATIVE_AIOStefano Stabellini1-2/+2
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2012-03-19Merge remote-tracking branch 'sstabellini/saverestore-8' into stagingAnthony Liguori1-4/+0
* sstabellini/saverestore-8: xen: do not allocate RAM during INMIGRATE runstate xen mapcache: check if memory region has moved. xen: record physmap changes to xenstore Set runstate to INMIGRATE earlier Introduce "xen-save-devices-state" cirrus_vga: do not reset videoram Conflicts: qapi-schema.json Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-03-19Merge remote-tracking branch 'stefanha/trivial-patches' into stagingAnthony Liguori2-1/+2
* stefanha/trivial-patches: qemu-ga: for w32, fix leaked handle ov.hEvent in ga_channel_write() ioapic: fix build with DEBUG_IOAPIC .gitignore: add qemu-bridge-helper and option rom build products cleanup obsolete typedef monitor: Remove unused bool field 'qapi' in mon_cmd_t struct ds1338: Add missing break statement vnc: Fix packed boolean struct members Remove type field in ModuleEntry as it's not used
2012-03-19Merge remote-tracking branch 'spice/spice.v50' into stagingAnthony Liguori2-98/+91
* spice/spice.v50: spice: fix broken initialization hw/qxl.c: Fix compilation failures on 32 bit hosts qxl/qxl_render.c: add trace events qxl: switch qxl.c to trace-events qxl: init_pipe_signaling: exit on failure monitor: fix client_migrate_info error handling spice: set spice uuid and name
2012-03-19Merge remote-tracking branch 'bonzini/scsi-next' into stagingAnthony Liguori3-16/+53
* bonzini/scsi-next: scsi: add get_dev_path virtio-scsi: call unregister_savevm properly scsi: copy serial number into VPD page 0x83 scsi-cd: check ready condition before processing several commands get rid of CONFIG_VIRTIO_SCSI
2012-03-19scsi: add get_dev_pathPaolo Bonzini1-0/+18
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-03-19virtio-scsi: call unregister_savevm properlyPaolo Bonzini1-0/+2
This fixes a use-after-free when migrating after hot-unplug. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-03-19scsi: copy serial number into VPD page 0x83Paolo Bonzini1-3/+4
Currently QEMU passes the qdev device id to the guest in an ASCII-string designator in page 0x83. While this is fine, it does not match what real hardware does; usually the ASCII-string designator there hosts another copy of the serial number (there can be other designators, for example with a world-wide name). Do the same for QEMU SCSI disks. ATAPI does not support VPD pages, so it does not matter there. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-03-19scsi-cd: check ready condition before processing several commandsPaolo Bonzini1-13/+29
This commit is more or less obvious. What it caused is less obvious: SCSI CD drives failed to eject under Linux, though for example the "change" command worked okay. This happens because of the autoclose option in the Linux CD-ROM driver. The actual chain of events is quite complex and somehow involves udev helpers; the actual command that matters is READ TOC, though honestly it's not really clear to me how because it should always be invoked after autoclose, not before. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-03-19Merge remote-tracking branch 'qemu-kvm/memory/urgent' into stagingAnthony Liguori25-333/+445
* qemu-kvm/memory/urgent: (42 commits) memory: check for watchpoints when getting code ram_addr exec: fix write tlb entry misused as iotlb Sparc: avoid AREG0 wrappers for memory access helpers Sparc: avoid AREG0 for memory access helpers TCG: add 5 arg helpers to def-helper.h softmmu templates: optionally pass CPUState to memory access functions i386: Remove REGPARM sparc64: implement PCI and ISA irqs sparc: reset CPU state on reset apb: use normal PCI device header for PBM device w64: Fix data type of next_tb and tcg_qemu_tb_exec softfloat: fix for C99 vmstate: fix varrays with uint32_t indexes Fix large memory chunks allocation with tcg_malloc. hw/pxa2xx.c: Fix handling of pxa2xx_i2c variable offset within region hw/pxa2xx_lcd.c: drop target_phys_addr_t usage in device state hw/pxa2xx_dma.c: drop target_phys_addr_t usage in device state ARM: Remove unnecessary subpage workarounds malta: Fix display for LED array malta: Use symbolic hardware addresses ...
2012-03-19hw/qxl.c: Fix compilation failures on 32 bit hostsPeter Maydell1-8/+8
Fix compilation failures on 32 bit hosts (cast from pointer to integer of different size; %ld expects 'long int' not uint64_t). Reported-by: Steve Langasek <steve.langasek@canonical.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-03-19qxl/qxl_render.c: add trace eventsAlon Levy1-9/+4
Signed-off-by: Alon Levy <alevy@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-03-19qxl: switch qxl.c to trace-eventsAlon Levy1-72/+69
dprint is still used for qxl_init_common one time prints. also switched parts of spice-display.c over, mainly all the callbacks to spice server. All qxl device trace events start with the qxl device id. Signed-off-by: Alon Levy <alevy@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-03-19qxl: init_pipe_signaling: exit on failureAlon Levy1-10/+11
If pipe creation fails, exit, don't log and continue. Fix indentation at the same time. Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-03-19ioapic: fix build with DEBUG_IOAPICJason Wang1-1/+1
ioapic.c:198: error: format ‘%08x’ expects type ‘unsigned int’, but argument 3 has type ‘uint64_t’ Signed-off-by: Jason Wang <jasowang@redhat.com> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-03-19ds1338: Add missing break statementStefan Weil1-0/+1
Without the break statement, case 5 sets month and year from the same data. This does not look correct. The missing break was reported by splint. Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-03-17sparc64: implement PCI and ISA irqsBlue Swirl3-32/+76
Generate correct trap for external interrupts. Map PCI and ISA IRQs to RIC/UltraSPARC-IIi interrupt vectors. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-03-17apb: use normal PCI device header for PBM deviceBlue Swirl1-1/+0
PBM has a normal PCI device header, fix. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-03-17Merge branch 'arm-devs.for-upstream' of ↵Blue Swirl11-101/+118
git://git.linaro.org/people/pmaydell/qemu-arm * 'arm-devs.for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm: hw/pxa2xx.c: Fix handling of pxa2xx_i2c variable offset within region hw/pxa2xx_lcd.c: drop target_phys_addr_t usage in device state hw/pxa2xx_dma.c: drop target_phys_addr_t usage in device state ARM: Remove unnecessary subpage workarounds hw/omap_i2c: Convert to qdev
2012-03-17Merge branch 'malta' of git://qemu.weilnetz.de/qemuBlue Swirl1-48/+36
* 'malta' of git://qemu.weilnetz.de/qemu: malta: Fix display for LED array malta: Use symbolic hardware addresses malta: Always allocate flash memory malta: Clean allocation of bios region alias
2012-03-16pci: fix double free of romfile propertyAnthony Liguori1-1/+0
The qdev property release function frees any string properties. This was resulting in a double free during hot unplug. It manifests in network devices because block devices have a NULL romfile property by default. Cc: Michael Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-03-16hw/pxa2xx.c: Fix handling of pxa2xx_i2c variable offset within regionPeter Maydell1-2/+1
The pxa2xx I2C controller can have its registers at an arbitrary offset within the MemoryRegion it creates. We use this to create two controllers, one which covers a region of size 0x10000 with registers starting at an offset 0x1600 into that region, and a second one which covers a region of size just 0x100 with the registers starting at the base of the region. The implementation of this offsetting uses two qdev properties, "offset" (which sets the offset which must be subtracted from the address to get the offset into the actual register bank) and "size", which is the size of the MemoryRegion. We were actually using "offset" for two purposes: firstly the required one of handling the registers not being at the base of the MemoryRegion, and secondly as a workaround for a deficiency of QEMU. Until commit 5312bd8b3, if a MemoryRegion was mapped at a non-page boundary, the address passed into the read and write functions would be the offset from the start of the page, not the offset from the start of the MemoryRegion. So when calculating the value to set the "offset" qdev property we included a rounding to a page boundary. Following commit 5312bd8b3 MemoryRegion read/write functions are now correctly passed the offset from the base of the region, and our workaround now means we're subtracting too much from addresses, resulting in warnings like "pxa2xx_i2c_read: Bad register 0xffffff90". The fix for this is simply to remove the rounding to a page boundary; this allows us to slightly simplify the expression since base - (base & (~region_size)) == base & region_size The qdev property "offset" itself must remain because it is still performing its primary job of handling register banks not being at the base of the MemoryRegion. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Andreas Färber <afaerber@suse.de>
2012-03-16hw/pxa2xx_lcd.c: drop target_phys_addr_t usage in device stateMitsyanko Igor1-6/+6
Pxa2xx LCD controller is intended to work with 32-bit bus and it has no knowledge of system's physical address size, so it should not use target_phys_addr_t in it's state. Convert three variables in DMAChannel state from target_phys_addr_t to uint32_t, use VMSTATE_UINT32 instead of VMSTATE_UINTTL for these variables. We can do this safely because: 1) pxa2xx has 32-bit physical address; 2) rest of the code in file never assumes converted variables to have any size different from uint32_t; 3) we shouldn't have used VMSTATE_UINTTL in the first place because this macro is for target_ulong type (which can be different from target_phys_addr_t). Signed-off-by: Igor Mitsyanko <i.mitsyanko@samsung.com> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-03-16hw/pxa2xx_dma.c: drop target_phys_addr_t usage in device stateMitsyanko Igor1-6/+6
Pxa2xx DMA controller is a 32-bit device and it has no knowledge of system's physical address size, so it should not use target_phys_addr_t in it's state. Convert variables descr, src and dest from type target_phys_addr_t to uint32_t, use VMSTATE_UINT32 instead of VMSTATE_UINTTL for these variables. We can do this safely because: 1) pxa2xx actually has 32-bit physical address size; 2) rest of the code in file never assumes descr, src and dest variables to have size different from uint32_t; 3) we shouldn't have used VMSTATE_UINTTL in the first place because this macro is for target_ulong type (which can be different from target_phys_addr_t). Signed-off-by: Igor Mitsyanko <i.mitsyanko@samsung.com> Reviewed-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-03-16ARM: Remove unnecessary subpage workaroundsPeter Maydell3-8/+4
In the ARM per-CPU peripherals (GIC, private timers, SCU, etc), remove workarounds for subpage memory region read/write functions being passed offsets from the start of the page rather than the start of the region. Following commit 5312bd8b3 the masking off of high bits of the address offset is now harmless but unnecessary. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Andreas Färber <afaerber@suse.de>
2012-03-15malta: Fix display for LED arrayStefan Weil1-1/+1
The 8-LED array was already implemented in the first commit to Malta, but this implementation was incomplete. Signed-off-by: Stefan Weil <sw@weilnetz.de>