aboutsummaryrefslogtreecommitdiff
path: root/hw
AgeCommit message (Collapse)Author
2010-06-22scsi-bus: Add MAINTENANCE_IN and MAINTENANCE_OUT SCSIRequest xfer and mode ↵Nicholas Bellinger
assignments This patch updates hw/scsi-bus.c to add MAINTENANCE_IN and MAINTENANCE_OUT case in scsi_req_length() for TYPE_ROM with MMC commands. It also adds the MAINTENANCE_OUT case in scsi_req_xfer_mode() to set SCSI_XFER_TO_DEV for outgoing write data. Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-06-22scsi-bus: Add PERSISTENT_RESERVE_OUT SCSIRequest->cmd.mode setupNicholas Bellinger
This patch updates hw/scsi-bus.c to add the PERSISTENT_RESERVE_OUT cdb case in scsi_req_xfer_mode() to set SCSI_XFER_TO_DEV for outgoing WRITE data. Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-06-19apic: qdev conversion cleanupBlue Swirl
Make APICState completely private to apic.c by using DeviceState in external APIs. Move apic_init() to pc.c. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-06-19apic: convert to qdevBlue Swirl
Convert to qdev. Use an opaque CPUState pointer because of missing VMState implementation for CPUState. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-06-19apic: avoid using CPUState internalsBlue Swirl
Move the actual CPUState contents handling to cpu.h and cpuid.c. Handle CPU reset and set env->halted in pc.c. Add a function to get the local APIC state of the current CPU for the MMIO. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-06-19apic: avoid passing CPUState from CPU codeBlue Swirl
Pass only APICState when accessing APIC from CPU code. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-06-19apic: avoid passing CPUState from devicesBlue Swirl
Pass only APICState from pc.c. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-06-19ioapic: convert to qdevBlue Swirl
Convert to qdev. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-06-17ioapic: unexport ioapic_set_irqBlue Swirl
There's no need to use ioapic_set_irq() outside of ioapic.c, so make it static. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-06-16Fix comparison which always returned falseStefan Weil
Comparing an 8 bit value with ~0 does not work as expected. Replace ~0 by UINT8_MAX in comparison and also in assignment (and fix coding style, too). Cc: Gleb Natapov <gleb@redhat.com> Cc: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: malc <av1474@comtv.ru>
2010-06-15xen: Fix build error due to missing includeJan Kiszka
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-06-15Correct definitions for FD_CMD_SAVE and FD_CMD_RESTOREJes Sorensen
Correct definitions for FD_CMD_SAVE and FD_CMD_RESTORE in hw/fdc.c Per https://bugs.launchpad.net/qemu/+bug/424453 the correct values for FD_CMD_SAVE is 0x2e and FD_CMD_RESTORE is 0x4e. Verified against the Intel 82078 manual which can be found at: http://wiki.qemu.org/Documentation/HardwareManuals page 22. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-06-15block: Move error actions from DriveInfo to BlockDriverStateMarkus Armbruster
That's where they belong semantically (block device host part), even though the actions are actually executed by guest device code. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-06-14acpi_piix4: save gpe and pci hotplug slot statusAlex Williamson
PCI hotplug currently doesn't work after a migration because we don't migrate the enable bits of the GPE state. Pull hotplug structs into vmstate. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-06-14qdev: Revert the hack to let -net nic and pci_add set qdev IDMarkus Armbruster
Setting the ID in pci_nic_init() is a blatant violation of the DeviceState abstraction. Which even carries a comment advising against this: /* This structure should not be accessed directly. We declare it here so that it can be embedded in individual device state structures. */ What's worse, it bypasses the code ensuring unique qdev IDs: "-device virtio-net-pci,id=foo -net nic,id=foo -net nic,name=foo" happily creates three qdevs with ID "foo". That's because qdev relies on qemu_opts_create() to ensure unique IDs, but -net nic uses a different QemuOptsList, which means id is in a different namespace. And its name is not checked for uniqueness at all. -net nic and pci_add are legacy. Use -device and device_add if you want a NIC with a qdev ID. This reverts what's still left of commit eb54b6dc "qdev: add id= support for pci nics." Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-06-14Clarify error message when a PCI slot is already in use (v2)Daniel P. Berrange
When mistakenly configuring two devices in the same PCI slot, QEMU gives a not entirely obvious message about a 'devfn' being in use: $ qemu -device rtl8139 -device virtio-balloon-pci,bus=pci.0,addr=0x3 qemu-kvm: -device virtio-balloon-pci,bus=pci.0,addr=0x3: PCI: devfn 24 not available for virtio-balloon-pci, in use by rtl8139 The user does not configure 'devfn' numbers, they use slot+function. Thus the error messages should be reported back to the user with that same terminology rather than the internal QEMU terminology. This patch makes it report: $ qemu -device rtl8139 -device virtio-balloon-pci,bus=pci.0,addr=0x3 qemu: -device virtio-balloon-pci,bus=pci.0,addr=0x3.7: PCI: slot 3 function 0 not available for virtio-balloon-pci, in use by rtl8139 Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-06-14virtio-blk: simplify multiwrite calling conventionsChristoph Hellwig
Pass the MultiReqBuffer structure down all the way to the I/O submission instead of takin it apart. Also mark num_writes unsigned as it can't go negative, and take the check for any pending I/O requests into the submission function. Last but not least rename do_multiwrite to virtio_submit_multiwrite to fit the general naming scheme and make clear what it does. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-06-14virtio-blk: stop tracking old_bsChristoph Hellwig
There is a 1:1 relation between VirtIOBlock and BlockDriverState instances, no need to track it because it won't change. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-06-14un-register kbd driver in case of USB kbd unplug.Jes Sorensen
If a USB keyboard is unplugged, the keyboard eventhandler is never removed, and events will continue to be passed through to the device, causing crashes or memory corruption. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-06-14etrax-ser: Support the uart rx fifo.Edgar E. Iglesias
Add support for the rx fifo to speed up bulk transfers. Signed-off-by: Edgar E. Iglesias <edgar.iglesias@axis.com>
2010-06-14pass info about hpets to seabios.]Gleb Natapov
Currently HPET ACPI table is created regardless of whether qemu actually created hpet device. This may confuse some guests that don't check that hpet is functional before using it. Solve this by passing info about hpets in qemu to seabios via fw config interface. Additional benefit is that seabios no longer uses hard coded hpet configuration. Proposed interface supports up to 8 hpets. This is the number defined by hpet spec. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-06-14hpet: Init capability register only onceJan Kiszka
The capability register is read-only from guest POV, so we do not need to update it on reset. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-06-14Change #define DEBUG to #define E1000_DEBUG in hw/e1000.cJes Sorensen
Change #define DEBUG to #define E1000_DEBUG in hw/e1000.c to make it possible to build QEMU with -DDEBUG Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-06-14Remove unused DEBUG defines from hw/msix.cJes Sorensen
Remove unused DEBUG defines from hw/msix.c to avoid having anything define the word DEBUG without any additions such as MSIX_DEBUG. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2010-06-14Merge remote branch 'kwolf/for-anthony' into stagingAnthony Liguori
Conflicts: hw/pc.c
2010-06-13OHCI address decoding fixPaul Brook
Ignore high address bits when PCI memory window is not mapped on a page boundary. Signed-off-by: Paul Brook <paul@codesourcery.com>
2010-06-13Move stdbool.hPaul Brook
Move inclusion of stdbool.h to common header files, instead of including in an ad-hoc manner. Signed-off-by: Paul Brook <paul@codesourcery.com>
2010-06-13hpet: Add MSI supportJan Kiszka
This implements the HPET capability of routing IRQs to the front-side bus, aka MSI support. This feature can be enabled via the qdev property "msi" and is off by default. Note that switching it on can cause guests (at least Linux) to use the HPET as timer instead of the LAPIC. KVM users should recall that only the latter is currently available as fast in-kernel model. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-06-13hpet: Make number of timers configurableJan Kiszka
One HPET block supports up to 32 timers. Allow to instantiate more than the recommended and implemented minimum of 3. The number is configured via the qdev property "timers". It is also saved/restored so that it need not match between migration peers. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-06-13vmstate: Add VMSTATE_STRUCT_VARRAY_UINT8Jan Kiszka
Required for hpet. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-06-13hpet: Add support for level-triggered interruptsJan Kiszka
By implementing this feature we can also remove a nasty way to kill qemu (by trying to enable level-triggered hpet interrupts). Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-06-13hpet: Drop static stateJan Kiszka
Instead of keeping a static reference around, pass the state to hpet_enabled and hpet_get_ticks. All callers now have it at hand. Will once allow to instantiate the HPET more than a single time. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-06-13hpet/rtc: Rework RTC IRQ replacement by HPETJan Kiszka
Allow the intercept the RTC IRQ for the HPET legacy mode. Then push routing to IRQ8 completely into the HPET. This allows to turn hpet_in_legacy_mode() into a private function. Furthermore, this stops the RTC from clearing IRQ8 even if the HPET is in control. This patch comes with a side effect: The RTC timers will no longer be stoppend when there is no IRQ consumer, possibly causing a minor performance degration. But as the guest may want to redirect the RTC to the SCI in that mode, it should normally disable unused IRQ source anyway. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-06-13hpet: Start/stop timer when HPET_TN_ENABLE is modifiedJan Kiszka
We have to update the qemu timer when the per-timer enable bit is toggled, just like for HPET_CFG_ENABLE changes. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-06-13hpet: Convert to qdevJan Kiszka
Register the HPET as a sysbus device and create it that way. As it can route its IRQs to any ISA IRQ, we need to connect it to all 24 of them. Once converted to qdev, we can move reset handler and vmstate registration into its hands as well. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-06-13hpet: Move static timer field initializationJan Kiszka
Properly initialize HPETTimer::tn and HPETTimer::state once during hpet_init instead of (re-)writing them on every reset. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-06-13hpet: Silence warning on write to running main counterJan Kiszka
Setting the main counter while the HPET is enabled may not be a good idea of the guest, but it is supported and should, thus, not spam the host console with warnings. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-06-13hpet: Coding style cleanups and some refactoringsJan Kiszka
This moves the private HPET structures into the C module, simplifies some helper functions and fixes most coding style issues (biggest chunk was improper switch-case indention). No functional changes. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-06-13hpet: Catch out-of-bounds timer accessJan Kiszka
Also prevent out-of-bounds write access to the timers but don't spam the host console if it triggers. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-06-10esp: lower IRQ on soft resetBlue Swirl
42f1ced228c9b616cfa2b69846025271618e4ef5 removed irq lowering during reset. However, for chip reset command and DMA reset signal, its actually the correct thing to do. Lower IRQ on soft reset only. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-06-10qbus: fix memory leak in qbus_free()Isaku Yamahata
BusState::name is allocated in qbus_create_inplace(). So it should be freed by qbus_free(). Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-06-10multiboot: compilation fix with DEBUG_MULTIBOOT enabled.Isaku Yamahata
This patch fixes the following compilation errors in multiboot.c when DEBUG_MULTIBOOT is defined. Use TARGET_FMT_plx instead of %x for target_phys_addr_t. CC i386-softmmu/multiboot.o cc1: warnings being treated as errors qemu/hw/multiboot.c: In function 'mb_add_mod': qemu/hw/multiboot.c:121: error: format '%08x' expects type 'unsigned int', but argument 4 has type 'target_phys_addr_t' qemu/hw/multiboot.c:121: error: format '%08x' expects type 'unsigned int', but argument 5 has type 'target_phys_addr_t' qemu/hw/multiboot.c: In function 'load_multiboot': qemu/hw/multiboot.c:279: error: format '%#x' expects type 'unsigned int', but argument 5 has type 'target_phys_addr_t' qemu/hw/multiboot.c:307: error: format '%x' expects type 'unsigned int', but argument 3 has type 'target_phys_addr_t' qemu/hw/multiboot.c:308: error: format '%x' expects type 'unsigned int', but argument 3 has type 'target_phys_addr_t' make[1]: *** [multiboot.o] Error 1 Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-06-10vga-isa-mm: remove one #ifdef CONFIG_BOCHS_VBE.Isaku Yamahata
remove one #ifdef CONFIG_BOCHS_VBE. Call vga_init_vbe() instead. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2010-06-10Merge remote branch 'mst/for_anthony' into stagingAnthony Liguori
2010-06-10cris: Break out image loading to hw/cris-boot.c.Edgar E. Iglesias
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@axis.com>
2010-06-09hw: honor low bit in mipssim machineNathan Froyd
Signed-off-by: Nathan Froyd <froydnj@codesourcery.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2010-06-07virtio-net: truncating packetMichael S. Tsirkin
virtio net attempts to peek into virtio queue to determine that we have enough space for the complete packet to fit. However, it fails to account for space consumed by virtio net header when it does this, under stress this results in a failure with the message 'truncating packet'. redhat bz 591494. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2010-06-07petlogix-3adsp: Tweak displacement of cmdline and fdt blob.Edgar E. Iglesias
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
2010-06-04blockdev: Collect block device code in new blockdev.cMarkus Armbruster
Anything that moves hundreds of lines out of vl.c can't be all bad. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-06-04qdev: Move declaration of qdev_init_bdrv() into qdev.hMarkus Armbruster
Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>