summaryrefslogtreecommitdiffstats
path: root/hw
Commit message (Collapse)AuthorAgeFilesLines
* aio: introduce AioContext, move bottom halves therePaolo Bonzini2012-10-301-0/+1
| | | | | | | | | | | | Start introducing AioContext, which will let us remove globals from aio.c/async.c, and introduce multiple I/O threads. The bottom half functions now take an additional AioContext argument. A bottom half is created with a specific AioContext that remains the same throughout the lifetime. qemu_bh_new is just a wrapper that uses a global context. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* Rename target_phys_addr_t to hwaddrAvi Kivity2012-10-23325-1719/+1719
| | | | | | | | | | | | | | | target_phys_addr_t is unwieldly, violates the C standard (_t suffixes are reserved) and its purpose doesn't match the name (most target_phys_addr_t addresses are not target specific). Replace it with a finger-friendly, standards conformant hwaddr. Outstanding patchsets can be fixed up with the command git rebase -i --exec 'find -name "*.[ch]" | xargs s/target_phys_addr_t/hwaddr/g' origin Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Merge remote-tracking branch 'qemu-kvm/memory/urgent' into stagingAnthony Liguori2012-10-221-34/+35
|\ | | | | | | | | | | | | * qemu-kvm/memory/urgent: memory: abort if a memory region is destroyed during a transaction i440fx: avoid destroying memory regions within a transaction memory: Make eventfd adhere to device endianness
| * i440fx: avoid destroying memory regions within a transactionAvi Kivity2012-10-171-34/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling memory_region_destroy() within a transaction is illegal, since the memory API is allowed to continue to dispatch to a region until the transaction commits. 440fx does that however when managing PAM registers. This bug is benign, since the regions are all aliases (which the memory core tends to throw anyway), and since we don't do concurrent dispatch yet, but instead of relying on that, tighten ship ahead of the coming concurrency storm. Fix by having a predefined set of regions, of which one will be enabled at any time. Signed-off-by: Avi Kivity <avi@redhat.com>
* | Merge remote-tracking branch 'awilliam/tags/vfio-pci-for-qemu-20121017.0' ↵Anthony Liguori2012-10-221-3/+8
|\ \ | | | | | | | | | | | | | | | | | | | | | into staging * awilliam/tags/vfio-pci-for-qemu-20121017.0: vfio-pci: Mark non-migratable vfio-pci: Fix debug build
| * | vfio-pci: Mark non-migratableAlex Williamson2012-10-171-0/+6
| | | | | | | | | | | | | | | | | | We haven't magically fixed this yet. Toss in a description too. Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
| * | vfio-pci: Fix debug buildAlex Williamson2012-10-171-3/+2
| |/ | | | | | | | | | | Stray variable from before MSI-X rework Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
* | usb-serial: only expose device in guest when the chardev is openGerd Hoffmann2012-10-221-2/+17
| | | | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | usb-serial: don't magically zap chardev on umplugGerd Hoffmann2012-10-221-1/+1
| | | | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | serial: add pci-serial documentationGerd Hoffmann2012-10-221-0/+2
| | | | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | serial: add 2x + 4x pci variantGerd Hoffmann2012-10-221-0/+149
| | | | | | | | | | | | | | | | Add multiport serial card implementation, with two variants, one featuring two and one featuring four ports. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | serial: add pci variantGerd Hoffmann2012-10-225-0/+110
| | | | | | | | | | | | | | So we get a hot-pluggable 16550 uart. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | serial: split serial.cGerd Hoffmann2012-10-2226-180/+257
| | | | | | | | | | | | | | | | | | | | Split serial.c into serial.c, serial.h and serial-isa.c. While being at creating a serial.h header file move the serial prototypes from pc.h to the new serial.h. The latter leads to s/pc.h/serial.h/ in tons of boards which just want the serial bits from pc.h Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | Merge remote-tracking branch 'quintela/migration-next-20121017' into stagingAnthony Liguori2012-10-221-1/+3
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * quintela/migration-next-20121017: (41 commits) cpus: create qemu_in_vcpu_thread() savevm: make qemu_file_put_notify() return errors savevm: un-export qemu_file_set_error() block-migration: handle errors with the return codes correctly block-migration: Switch meaning of return value block-migration: make flush_blks() return errors buffered_file: buffered_put_buffer() don't need to set last_error savevm: Only qemu_fflush() can generate errors savevm: make qemu_fill_buffer() be consistent savevm: unexport qemu_ftell() savevm: unfold qemu_fclose_internal() savevm: make qemu_fflush() return an error code savevm: Remove qemu_fseek() virtio-net: use qemu_get_buffer() in a temp buffer savevm: unexport qemu_fflush migration: make migrate_fd_wait_for_unfreeze() return errors buffered_file: make buffered_flush return the error code buffered_file: callers of buffered_flush() already check for errors buffered_file: We can access directly to bandwidth_limit buffered_file: unfold migrate_fd_close ...
| * | virtio-net: use qemu_get_buffer() in a temp bufferJuan Quintela2012-10-171-1/+3
| |/ | | | | | | | | | | | | | | | | | | qemu_fseek() is known to be wrong. Would be removed on the next commit. This code should never been used (value has been MAC_TABLE_ENTRIES since 2009). Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
* | Merge remote-tracking branch 'qemu-kvm/memory/dma' into stagingAnthony Liguori2012-10-227-64/+51
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qemu-kvm/memory/dma: (23 commits) pci: honor PCI_COMMAND_MASTER pci: give each device its own address space memory: add address_space_destroy() dma: make dma access its own address space memory: per-AddressSpace dispatch s390: avoid reaching into memory core internals memory: use AddressSpace for MemoryListener filtering memory: move tcg flush into a tcg memory listener memory: move address_space_memory and address_space_io out of memory core memory: manage coalesced mmio via a MemoryListener xen: drop no-op MemoryListener callbacks kvm: drop no-op MemoryListener callbacks xen_pt: drop no-op MemoryListener callbacks vfio: drop no-op MemoryListener callbacks memory: drop no-op MemoryListener callbacks memory: provide defaults for MemoryListener operations memory: maintain a list of address spaces memory: export AddressSpace memory: prepare AddressSpace for exporting xen_pt: use separate MemoryListeners for memory and I/O ...
| * | pci: honor PCI_COMMAND_MASTERAvi Kivity2012-10-222-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently we ignore PCI_COMMAND_MASTER completely: DMA succeeds even when the bit is clear. Honor PCI_COMMAND_MASTER by inserting a memory region into the device's bus master address space, and tying its enable status to PCI_COMMAND_MASTER. Tested using setpci -s 03 COMMAND=3 while a ping was running on a NIC in slot 3. The kernel (Linux) detected the stall and recovered after the command setpci -s 03 COMMAND=7 was issued. Signed-off-by: Avi Kivity <avi@redhat.com>
| * | pci: give each device its own address spaceAvi Kivity2012-10-222-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Accesses from different devices can resolve differently (depending on bridge settings, iommus, and PCI_COMMAND_MASTER), so set up an address space for each device. Currently iommus are expressed outside the memory API, so this doesn't work if an iommu is present. Signed-off-by: Avi Kivity <avi@redhat.com>
| * | dma: make dma access its own address spaceAvi Kivity2012-10-221-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of accessing the cpu address space, use an address space configured by the caller. Eventually all dma functionality will be folded into AddressSpace, but we have to start from something. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com>
| * | memory: use AddressSpace for MemoryListener filteringAvi Kivity2012-10-223-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | Using the AddressSpace type reduces confusion, as you can't accidentally supply the MemoryRegion you're interested in. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com>
| * | xen_pt: drop no-op MemoryListener callbacksAvi Kivity2012-10-151-45/+0
| | | | | | | | | | | | | | | | | | Removes quite a bit of useless code. Signed-off-by: Avi Kivity <avi@redhat.com>
| * | vfio: drop no-op MemoryListener callbacksAvi Kivity2012-10-151-29/+0
| | | | | | | | | | | | | | | | | | Removes quite a bit of useless code. Signed-off-by: Avi Kivity <avi@redhat.com>
| * | xen_pt: use separate MemoryListeners for memory and I/OAvi Kivity2012-10-152-1/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | Using an unfiltered memory listener will cause regions to be reported fails multiple times if we have more than two address spaces. Use a separate listener for memory and I/O, and utilize MemoryListener's address space filtering to fix this. Signed-off-by: Avi Kivity <avi@redhat.com>
| * | vhost: use MemoryListener filtering to only monitor RAM address spaceAvi Kivity2012-10-151-3/+2
| |/ | | | | | | | | | | | | Instead of checking manually, let the listener filter for us. This prepares us for DMA address spaces. Signed-off-by: Avi Kivity <avi@redhat.com>
* | hw/pl031: Use LOG_GUEST_ERRORPeter Maydell2012-10-201-6/+10
| | | | | | | | | | | | | | Use LOG_GUEST_ERROR rather than hw_error or direct fprintf. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | hw/pl022: Use LOG_UNIMP and LOG_GUEST_ERRORPeter Maydell2012-10-201-3/+5
| | | | | | | | | | | | | | | | Use LOG_UNIMP and LOG_GUEST_ERROR where appropriate rather than hw_error(). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | hw/pl011: Use LOG_UNIMP and LOG_GUEST_ERRORPeter Maydell2012-10-201-4/+7
| | | | | | | | | | | | | | | | Use the new LOG_UNIMP and LOG_GUEST_ERROR logging types rather than hw_error(). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | hw/pl190: Use LOG_GUEST_ERRORPeter Maydell2012-10-201-2/+4
| | | | | | | | | | | | | | | | If the guest attempts an offset to a nonexistent register, just log this via LOG_GUEST_ERROR rather than killing QEMU with a hw_error. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | hw/pl041: Use LOG_UNIMPPeter Maydell2012-10-201-2/+3
| | | | | | | | | | | | | | | | Use the new LOG_UNIMP tracing to report unimplemented features. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | hw/pl181: Use LOG_UNIMP and LOG_GUEST_ERRORPeter Maydell2012-10-201-8/+10
| | | | | | | | | | | | | | | | Rather than a mix of direct printing to stderr and aborting via hw_error(), use LOG_UNIMP and LOG_GUEST_ERROR. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | hw/hw.h: Add include of qemu-log.hPeter Maydell2012-10-201-0/+1
| | | | | | | | | | | | | | | | | | Add an include of qemu-log.h to hw.h, so that device model code has access to these logging functions without the need to directly include qemu-log.h. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | create struct for machine initialization argumentsEduardo Habkost2012-10-2056-412/+511
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This should help us to: - More easily add or remove machine initialization arguments without having to change every single machine init function; - More easily make mechanical changes involving the machine init functions in the future; - Let machine initialization forward the init arguments to other functions more easily. This change was half-mechanical process: first the struct was added with the local ram_size, boot_device, kernel_*, initrd_*, and cpu_model local variable initialization to all functions. Then the compiler helped me locate the local variables that are unused, so they could be removed. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | vga: remove CONFIG_BOCHS_VBEGerd Hoffmann2012-10-202-50/+12
| | | | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | vga: add specs for standard vgaGerd Hoffmann2012-10-202-0/+4
| | | | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | vga: add mmio bar to standard vgaGerd Hoffmann2012-10-204-3/+121
| | | | | | | | | | | | | | | | | | | | This patch adds a mmio bar to the qemu standard vga which allows to access the standard vga registers and bochs dispi interface registers via mmio. Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* | vga: fix indentionGerd Hoffmann2012-10-201-14/+14
|/ | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* sun4u: Pass SPARCCPU to cpu_set_ivec_irq()Andreas Färber2012-10-131-4/+3
| | | | | | | Needed for moving halted field to CPUState. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* sun4u: Pass SPARCCPU to cpu_kick_irq()Andreas Färber2012-10-131-4/+6
| | | | | | | Needed for changing qemu_cpu_kick() argument type to CPUState. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* sun4u: Pass SPARCCPU to {,s,hs}tick_irq() and cpu_timer_create()Andreas Färber2012-10-131-8/+11
| | | | | | | Needed for changing cpu_kick_irq() argument type to SPARCCPU. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* sun4m: Pass SPARCCPU to cpu_kick_irq()Andreas Färber2012-10-131-2/+4
| | | | | | | Needed for changing qemu_cpu_kick() argument type to CPUState. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* sun4m: Pass SPARCCPU to cpu_set_irq()Andreas Färber2012-10-131-2/+3
| | | | | | | Needed for changing cpu_kick_irq() argument type to SPARCCPU. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Merge remote-tracking branch 'pmaydell/arm-devs.for-upstream' into stagingAnthony Liguori2012-10-128-83/+137
|\ | | | | | | | | | | | | | | | | | | | | | | | | * pmaydell/arm-devs.for-upstream: arm_gic: Rename gic_state to GICState zynq_slcr: Fixed ResetValues enum versatilepb: add gpio pl061 support hw/ds1338: Implement state save/restore hw/ds1338: Remove 'now' field from state struct hw/ds1338: Recapture current time when register pointer wraps around hw/ds1338: Fix mishandling of register pointer hw/arm_gic.c: Fix improper DPRINTF output. cadence_ttc: Fix 'clear on read' behavior
| * arm_gic: Rename gic_state to GICStatePeter Maydell2012-10-124-43/+43
| | | | | | | | | | | | | | | | | | | | | | Rename the gic_state struct to match QEMU's coding style conventions for structure names, since the impending KVM-for-ARM patches will create another subclass of it. This patch was created using: sed -i 's/gic_state/GICState/g' hw/arm_gic.c hw/arm_gic_common.c \ hw/arm_gic_internal.h hw/armv7m_nvic.c Acked-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * zynq_slcr: Fixed ResetValues enumPeter A. G. Crosthwaite2012-10-121-1/+1
| | | | | | | | | | | | | | | | | | | | There is a gap in the reset region of the address space at offset 0x208. This throws out all these enum values by one when translating them to address offsets. Fixed by putting the corresponding gap in the enum as well. Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * versatilepb: add gpio pl061 supportJean-Christophe PLAGNIOL-VILLARD2012-10-121-0/+5
| | | | | | | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * hw/ds1338: Implement state save/restorePeter Maydell2012-10-121-5/+22
| | | | | | | | | | | | | | | | Implement state save/restore for the DS1338. This requires the usual minor adjustment of types in the state struct to get fixed-width ones with vmstate macros. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * hw/ds1338: Remove 'now' field from state structPeter Maydell2012-10-121-20/+21
| | | | | | | | | | | | | | | | | | The 'struct tm now' field in the state structure is in fact only ever used as a temporary (the actual RTC state is held in 'offset'). Remove it from the state structure in favour of using local variables to avoid confusion about whether it needs to be saved on migration. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * hw/ds1338: Recapture current time when register pointer wraps aroundPeter Maydell2012-10-121-17/+42
| | | | | | | | | | | | | | | | The DS1338 datasheet documents that the current time is captured into the secondary registers when the register pointer wraps round to zero as well as at a START condition. Implement this. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * hw/ds1338: Fix mishandling of register pointerPeter Maydell2012-10-121-7/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Correct several deficiencies in the handling of the register pointer: * it should wrap around after 0x3f, not 0xff * guard against the caller handing us an out of range pointer (on h/w this can never happen, because only a 7 bit value is transferred over the I2C bus) * there was confusion over whether nvram[] holds only the 56 bytes of guest-accessible NVRAM, or also the secondary registers which hold the value of the clock captured at the start of a multibyte read. Correct to consistently be the latter, by fixing the array size and the offset used for NVRAM writes. * ds1338_send was attempting to use 'data' as both the data and the register offset simultaneously, which meant that writes to any register were broken; fix to use the register pointer. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * hw/arm_gic.c: Fix improper DPRINTF output.Evgeny Voevodin2012-10-121-1/+1
| | | | | | | | | | | | | | | | s->cpu_enabled is an array, so s->cpu_enabled ? "En" : "Dis" returns "En" always. We should use s->cpu_enabled[cpu] here. Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
OpenPOWER on IntegriCloud