aboutsummaryrefslogtreecommitdiff
path: root/hw
AgeCommit message (Collapse)AuthorFilesLines
2012-12-13atapi: reset cdrom tray statuses on ide_resetPavel Hrdina1-0/+2
Tray statuses should be also reseted. Some guests may lock the tray and after reset before any kernel is loaded the tray should be unlocked. Also if you reset the real computer the tray is closed. We should do the same in qemu. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-12-11use qemu_opts_create_nofailDong Xu Wang1-1/+1
We will use qemu_opts_create_nofail function, it can make code more readable. Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-12-11Support default block interfaces per QEMUMachineChristian Borntraeger14-44/+30
There are QEMUMachines that have neither IF_IDE nor IF_SCSI as a default/standard interface to their block devices / drives. Therefore, this patch introduces a new field default_block_type per QEMUMachine struct. The prior use_scsi field becomes thereby obsolete and is replaced through .default_block_type = IF_SCSI. This patch also changes the default for s390x to IF_VIRTIO and removes an early hack that converts IF_IDE drives. Other parties have already claimed interest (e.g. IF_SD for exynos) To create a sane default, for machines that dont specify a default_block_type, this patch makes IF_IDE = 0 and IF_NONE = 1. I checked all users of IF_NONE (blockdev.c and ww/device-hotplug.c) as well as IF_IDE and it seems that it is ok to change the defines - in other words, I found no obvious (to me) assumption in the code regarding IF_NONE==0. IF_NONE is only set if there is an explicit if=none. Without if=* the interface becomes IF_DEFAULT. I would suggest to have some additional care, e.g. by letting this patch sit some days in the block tree. Based on an initial patch from Einar Lueck <elelueck@de.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> CC: Igor Mitsyanko <i.mitsyanko@samsung.com> CC: Markus Armbruster <armbru@redhat.com> CC: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Alexander Graf <agraf@suse.de> Acked-by: Igor Mitsyanko <i.mitsyanko@samsung.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2012-12-11virtio-blk: Remove duplicate property definitionDavid Gibson2-2/+0
For the virtio-blk device (via virtio-pci) the property "config-wce" is defined in two places. First, it's defined from the DEFINE_VIRTIO_BLK_FEATURES macro, second it's defined directly in virtio-pci, just two lines above the call to that macro. The direct definition in virtio-pci.c is broken, since it operates on the 'config_wce' field of VirtIOBlkConf, which is never used anywhere else. Therefore, this patch removes both the extra property definition and the redundant field it works on. Cc: Kevin Wolf <kwolf@redhat.com> Cc: Anthony Liguori <aliguori@us.ibm.com> Cc: Paul 'Rusty' Russell <rusty@rustcorp.com.au> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2012-12-10Merge remote-tracking branch 'afaerber/qom-cpu' into stagingAnthony Liguori2-13/+6
* afaerber/qom-cpu: target-i386: Postpone cpuid_level update to realize time target-i386: Use define for cpuid vendor string size target-i386: Separate feature string parsing from CPU model lookup target-i386/cpu.c: Coding style fixes qdev: qdev_create(): use error_report() instead of hw_error() sysemu.h: Include qemu-types.h instead of qemu-common.h Create qemu-types.h for struct typedefs qlist.h: Do not include qemu-common.h qga/channel-posix.c: Include headers it needs qapi/qmp-registry.c: Include headers it needs ui/vnc-palette.c: Include headers it needs user: Rename qemu-types.h to qemu-user-types.h user: Move *-user/qemu-types.h to main directory Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-12-10Merge remote-tracking branch 'stefanha/trivial-patches' into stagingAnthony Liguori8-22/+19
* stefanha/trivial-patches: pc_sysfw: Plug memory leak on pc_fw_add_pflash_drv() error path qemu-options: Fix space at EOL Fix spelling in comments and documentation Clean up pci_drive_hot_add()'s use of BlockInterfaceType arm: a9mpcore: remove un-used ptimer_iomem field target-sparc: Remove t0, t1 from CPUSPARCState target-m68k: Remove t1 from CPUM68KState target-alpha: Remove t0, t1 from CPUAlphaState s390x: Spelling fixes (endianess -> endianness, occured -> occurred) Fix comments (adress -> address, layed -> laid, wierd -> weird) Fix spelling (prefered -> preferred) configure: Remove stray debug output sd: Send debug printfery to stderr not stdout Conflicts: configure Resolve spelling conflict in configure. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-12-10Merge remote-tracking branch 'kraxel/acpi.1' into stagingAnthony Liguori11-415/+317
* kraxel/acpi.1: acpi: drop debug port q35: update lpc pci config space according to configured devices apci: switch piix4 pci hotplug to memory api acpi: remove acpi_gpe_blk apci: switch piix4 gpe to memory api acpi: fix piix4 smbus mapping acpi: switch smbus to memory api acpi: cleanup ich9 memory region apci: switch ich9 smi to memory api apci: switch ich9 gpe to memory api acpi: cleanup vt82c686 memory region acpi: cleanup piix4 memory region apci: switch evt to memory api apci: switch cnt to memory api apci: switch timer to memory api apci: switch vt82c686 to memory api apci: switch ich9 to memory api apci: switch piix4 to memory api Conflicts: hw/lpc_ich9.c Resolved merge conflict due to apm_init adding an argument. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-12-10Merge remote-tracking branch 'kraxel/usb.74' into stagingAnthony Liguori13-9/+168
* kraxel/usb.74: usb-tablet: Allow connecting to ehci ehci: Lower timer freq when the periodic schedule is idle usb: Allow overriding of usb_desc at the device level usb: Don't allow USB_RET_ASYNC for interrupt packets usb: Call wakeup when data becomes available for all devices with int eps add pc-1.4 Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-12-08Merge branch 'master' of git.qemu-project.org:/pub/git/qemuBlue Swirl2-5/+6
* 'master' of git.qemu-project.org:/pub/git/qemu: target-mips: Fix incorrect shift for SHILO and SHILOV target-mips: Fix incorrect code and test for INSV xilinx_uartlite: Accept input after rx FIFO pop xilinx_uartlite: suppress "cannot receive message" xilinx_axienet: Implement R_IS behaviour
2012-12-07pc_sysfw: Plug memory leak on pc_fw_add_pflash_drv() error pathMarkus Armbruster1-1/+3
Harmless, because we the error inevitably leads to another, fatal one in pc_system_flash_init(): PC system firmware (pflash) not available. Fix it anyway. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2012-12-07Fix spelling in comments and documentationStefan Weil1-3/+3
These spelling bugs were found by codespell: supressing -> suppressing transfered -> transferred Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2012-12-07Clean up pci_drive_hot_add()'s use of BlockInterfaceTypeMarkus Armbruster2-11/+7
pci_drive_hot_add() parameter type has the wrong type: int instead of BlockInterfaceType. It's actually redundant, so we can just drop it. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2012-12-07arm: a9mpcore: remove un-used ptimer_iomem fieldPeter Crosthwaite1-1/+0
I'm guessing this is a hangover from a previous coreification of the mptimer sub-module. This field is completely unused - removed. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2012-12-07s390x: Spelling fixes (endianess -> endianness, occured -> occurred)Stefan Weil2-4/+4
Replace also "write into" by "write to". Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2012-12-07sd: Send debug printfery to stderr not stdoutPeter Crosthwaite1-2/+2
Some debug printfs for SD are coming up in stdout. Redirected them to stderr instead. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2012-12-06qdev: qdev_create(): use error_report() instead of hw_error()Eduardo Habkost1-3/+5
hw_error() is specific for fatal hardware emulation errors, not for internal errors related to the qdev object/class abstraction or object initialization. Replace it with an error_report() call, followed by abort(). This will also help reduce dependencies of the qdev code (as hw_error() is from cpus.o, and depends on the CPU list from exec.o). Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-12-06Create qemu-types.h for struct typedefsEduardo Habkost1-10/+1
Instead of keeping all those struct typedefs in qemu-common.h, move it to a header that can be safely included by other headers, containing only the struct typedefs and not pulling in other dependencies. Also, move some of the qdev-core.h typedefs to the new file, too, so other headers don't need to include qdev-core.h only because of DeviceState and other typedefs. This will help us remove qemu-common.h dependencies from some headers later. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-12-05xilinx_uartlite: Accept input after rx FIFO popPeter Crosthwaite1-0/+1
The device return false from the can receive function when the FIFO is full. This mean the device should check for buffered input whenever a byte is popped from the FIFO. Reported-by: Jason Wu <huanyu@xilinx.com> Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2012-12-05xilinx_uartlite: suppress "cannot receive message"Peter Crosthwaite1-5/+1
This message is not an error condition, its just informing the user that the device is corking the uart traffic to not drop characters. Reported-by: Jason Wu <huanyu@xilinx.com> Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2012-12-05xilinx_axienet: Implement R_IS behaviourPeter Crosthwaite1-0/+4
The interrupt status register R_IS is the standard clear-on-write behaviour. This was unimplemented and defaulting to updating the register to the written value. Implemented clear-on-write. Reported-by: Jason Wu <huanyu@xilinx.com> Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2012-12-04hw/dma.c: Replace register_ioport_*Julien Grall1-36/+70
Replace all register_ioport_*() with the new Memory API functions. This permits to use the new Memory stuff like listeners. Signed-off-by: Julien Grall <julien.grall@citrix.com> Acked-by: Avi Kivity <avi@redhat.com> [AF: Rebased onto hwaddr] Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-12-04hw/pc.c: Replace register_ioport_*Julien Grall1-9/+40
Replace all register_ioport_*() with portio_*() or a MemoryRegion. This permits to use the new Memory stuff like listeners. Signed-off-by: Julien Grall <julien.grall@citrix.com> Acked-by: Avi Kivity <avi@redhat.com> [AF: Rebased onto hwaddr] Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-12-04serial: Replace register_ioport_*Julien Grall3-4/+5
Replace all register_ioport_*() with a MemoryRegion. This permits to use the new Memory stuff like listeners. For more flexibility, the IO address space is passed as an argument. Signed-off-by: Julien Grall <julien.grall@citrix.com> Acked-by: Avi Kivity <avi@redhat.com> [AF: Rebased onto serial split] Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-12-04hw/cirrus_vga.c: Replace register_ioport_*Julien Grall1-20/+28
Replace all register_ioport_*() with the new Memory API. This permits to use the new Memory stuff like listeners. Signed-off-by: Julien Grall <julien.grall@citrix.com> Acked-by: Avi Kivity <avi@redhat.com> [AF: Rebased onto hwaddr] Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-12-04hw/apm.c: Replace register_ioport_*Julien Grall5-9/+25
Replace all register_ioport_*() with a MemoryRegion. This permits to use the new Memory stuff like listeners. Moreover, the PCI device is added as an argument for apm_init(), so we can register IO inside the PCI IO address space. Signed-off-by: Julien Grall <julien.grall@citrix.com> Acked-by: Avi Kivity <avi@redhat.com> [AF: Rebased onto hwaddr and q35] Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-12-04isa: Add isa_address_space_io()Julien Grall2-0/+10
This function permits to retrieve ISA IO address space. It will be usefull when we need to pass IO address space as argument. Signed-off-by: Julien Grall <julien.grall@citrix.com> Acked-by: Avi Kivity <avi@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
2012-12-04usb-tablet: Allow connecting to ehciHans de Goede2-1/+93
Our ehci code has is capable of significantly lowering the wakeup rate for the hcd emulation while the device is idle. It is possible to add similar code ot the uhci emulation, but that simply is not there atm, and there is no reason why a (virtual) usb-tablet can not be a USB-2 device. Making usb-hid devices connect to the emulated ehci controller instead of the emulated uhci controller on vms which have both lowers the cpuload for a fully idle vm from 20% to 2-3% (on my laptop). An alternative implementation to using a property to select the tablet type, would be simply making it a new device type, ie usb-tablet2, but the downside of that is that this will require libvirt changes to be available through libvirt at all, and then management tools changes to become the default for new vms, where as using a property will automatically get any pc-1.3 type vms the lower cpuload. [ kraxel: adapt compat property for post-1.3 merge ] Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> tablet compat fixup Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-12-04ehci: Lower timer freq when the periodic schedule is idleHans de Goede2-6/+34
Lower the timer freq if no iso schedule packets complete for 64 frames in a row. We can safely do this, without adding latency, because: 1) If there is isoc traffic this will never trigger 2) For async handled interrupt packets (only usb-host), the completion handler will immediately schedule the frame_timer from a bh 3) All devices using NAK to signal no data for interrupt endpoints now use wakeup, which will immediately schedule the frame_timer from a bh The advantage of this is that when we only have interrupt packets in the periodic schedule, async_stepdown can do its work and significantly lower the frequency at which the frame_timer runs. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-12-04usb: Allow overriding of usb_desc at the device levelHans de Goede2-0/+4
This allows devices to present a different set of descriptors based on device properties. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-12-04usb: Don't allow USB_RET_ASYNC for interrupt packetsHans de Goede4-0/+7
It is tempting to use USB_RET_ASYNC for interrupt packets, rather then the current NAK + polling approach, but this causes issues for migration, as an async completed packet will not getting written back to guest memory until the next poll time, and if a migration happens in between it will get lost! Make an exception for host devices, because: 1) host-linux actually uses async completion for interrupt endpoints 2) host devices don't migrate anyways Ideally we would convert host-linux.c to handle (input) interrupt endpoints in a buffered manner like it does for isoc endpoints, keeping multiple urbs submitted to ensure the devices timing requirements are met, as well as making its interrupt ep handling the same as other usb-devices. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-12-04usb: Call wakeup when data becomes available for all devices with int epsHans de Goede4-0/+17
This is necessary for proper interaction with the xhci controller, and it will allow other hcds to lower there frame timer while waiting for interrupt data. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-12-04add pc-1.4Gerd Hoffmann1-2/+13
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-12-04acpi: drop debug portGerd Hoffmann1-9/+0
I'm pretty sure this isn't needed any more. I think this predates the switch to seabios, and the seabios DSDT table has a DBUG() aml macro which writes stuff to the seabios debug port (0x402). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-12-04q35: update lpc pci config space according to configured devicesGerd Hoffmann3-12/+30
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-12-04apci: switch piix4 pci hotplug to memory apiGerd Hoffmann1-8/+29
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-12-04acpi: remove acpi_gpe_blkGerd Hoffmann4-11/+0
With gpe being switched to memory api this is no longer needed. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-12-04apci: switch piix4 gpe to memory apiGerd Hoffmann1-6/+18
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-12-04acpi: fix piix4 smbus mappingGerd Hoffmann1-1/+19
Make write to the smbus base register and enable bit actually work. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-12-04acpi: switch smbus to memory apiGerd Hoffmann5-50/+33
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-12-04acpi: cleanup ich9 memory regionGerd Hoffmann1-124/+1
Nothing left to do, everything handled by subregions, we can zap the reaw/write handlers now. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-12-04apci: switch ich9 smi to memory apiGerd Hoffmann2-10/+37
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-12-04apci: switch ich9 gpe to memory apiGerd Hoffmann2-10/+29
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-12-04acpi: cleanup vt82c686 memory regionGerd Hoffmann1-60/+1
Nothing left to do, everything handled by subregions, we can zap the reaw/write handlers now. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-12-04acpi: cleanup piix4 memory regionGerd Hoffmann1-40/+1
Nothing left to do, everything handled by subregions, we can zap the reaw/write handlers now. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-12-04apci: switch evt to memory apiGerd Hoffmann5-55/+54
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-12-04apci: switch cnt to memory apiGerd Hoffmann5-31/+36
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-12-04apci: switch timer to memory apiGerd Hoffmann5-17/+23
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-12-04apci: switch vt82c686 to memory apiGerd Hoffmann1-10/+27
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-12-04apci: switch ich9 to memory apiGerd Hoffmann2-17/+28
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-12-04apci: switch piix4 to memory apiGerd Hoffmann1-17/+24
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>