aboutsummaryrefslogtreecommitdiff
path: root/hw
AgeCommit message (Collapse)AuthorFilesLines
2012-01-17usb/debug: add usb_ep_dumpGerd Hoffmann2-0/+41
Add function to dump endpoint data, for debugging purposes. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-01-17usb-desc: USBEndpoint supportGerd Hoffmann1-0/+22
Initialize USBEndpoint structs from USBDesc* data. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-01-17usb: add ifnum to USBEndpointGerd Hoffmann2-0/+17
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-01-17usb: add USBEndpointGerd Hoffmann3-0/+45
Start maintaining endpoint state at USBDevice level. Add USBEndpoint struct and some helper functions to deal with it. For now it contains the endpoint type only. Moved over some bits from usb-linux.c Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-01-17xhci: Initial xHCI implementationHector Martin2-0/+2752
Based on the implementation from Hector Martin <hector@marcansoft.com> Hectors's implementation completely sidestepped the qemu usb system and used libusb directly for usb device pass through. So I've ripped out the libusb bits (or left them in disabled, as reference for further coding) and hooked up the qemu subsystem instead. That work is not complete yet though, partly due to limitations of the qemu usb subsystem. Nevertheless I think it is better to continue development in-tree, especially as the qemu usb bits need a bunch of improvements too for decent usb 3.0 support. Current state: - usb-storage emulation should work ok. - Devices which need constant polling (HID emulation like usb-tablet) are known to not work. - ISO xfers are not implemented yet. - superspeed ports are not implemented yet. - usb pass-through is completely untested so far. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-01-17pxa2xx_keypad: fix unbalanced parenthesis.Andrzej Zaborowski1-1/+1
Breakage introduced by me when ammending a previous patch, sorry.
2012-01-17hw/arm_boot.c: Make SMP boards specify address to poll in bootup loopEvgeny Voevodin4-8/+15
The secondary CPU bootloader in arm_boot.c holds secondary CPUs in a pen until the primary CPU releases them. Make boards specify the address to be polled to determine whether to leave the pen (it was previously hardcoded to 0x10000030, which is a Versatile Express/ Realview specific system register address). Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2012-01-17hw/sysbus.h: Increase maximum number of device IRQs.Evgeny Voevodin1-1/+1
Samsung exynos4210 Interrupt Combiner needs 512 IRQ sources. Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2012-01-17pxa2xx_keypad: make single automatic scans workVasily Khoruzhick1-36/+36
u-boot uses single automatic scans and polling in pxa2xx_keypad driver, so clear KPC_AS bit immediately and update keys state even if KPC_AS and KPC_ASACT are cleared. Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2012-01-17pxa2xx_lcd: fix palette parserVasily Khoruzhick1-23/+28
Pallete entry size for 16bpp format is 2 bytes, not 4 Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2012-01-15isapc: Fix segfault during initializationJan Kiszka1-11/+11
Obviously, linking the RTC device state to the PIIX does not belong into the common path that is shared with the isapc. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2012-01-13prepare for future GPLv2+ relicensingPaolo Bonzini45-0/+131
All files under GPLv2 will get GPLv2+ changes starting tomorrow. event_notifier.c and exec-obsolete.h were only ever touched by Red Hat employees and can be relicensed now. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-13virtio-console: no need to remove char handlers explicitlyAmit Shah1-17/+0
qdev is now equipped (thanks to the last commit) to disassociate chardevs from the qdev devices on the devices going away. So doing it in the virtio-console driver is not necessary. Since that was the only thing being done in the qdev exit method, drop it entirely. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-13qdev: Add a 'free' method to disassociate chardev from qdev deviceAmit Shah1-0/+11
When a device is removed, remove the association with a chardev, if any, so that the chardev can be re-used later for other devices. Reported-by: Qunfang Zhang <qzhang@redhat.com> Fix-suggested-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-13virtio-blk: refuse SG_IO requests with scsi=offPaolo Bonzini1-0/+6
QEMU does have a "scsi" option (to be used like -device virtio-blk-pci,drive=foo,scsi=off). However, it only masks the feature bit, and does not reject the command if a malicious guest disregards the feature bits and issues a request. Without this patch, using scsi=off does not protect you from CVE-2011-4127. Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-13vmstate: extract declarations out of hw/hw.hPaolo Bonzini7-891/+88
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-13ptimer: move declarations to ptimer.hPaolo Bonzini17-0/+43
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-13rtc: clear non-PF bits when reinjecting on ackPaolo Bonzini1-3/+3
When an rtc interrupt is reinjected immediately after being acked, other interrupts should not be reinjected, so do clear their bits. Also, if the periodic interrupts have been disabled before acking, do not reinject, as the guest might get very confused! Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-13rtc: raise PF bit when the periodic timer triggers but PIE=0Paolo Bonzini1-1/+2
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-13rtc: raise AF bit when the alarm is encountered but AIE=0Paolo Bonzini1-9/+10
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-13rtc: fix 12-hour modePaolo Bonzini1-4/+7
Hours in 12-hour mode are in the 1-12 range, not 0-11. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-13qdev: fix device_del by refactoring reference countingAnthony Liguori1-6/+39
Commit 8eb0283 broken device_del by having too overzealous reference counting checks. Move the reference count checks to qdev_free(), make sure to remove the parent link on free, and decrement the reference count on property removal. Reported-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-13Add 'fall through' comments to case statements without breakStefan Weil1-0/+1
These comments are used by static code analysis tools and in code reviews to avoid false warnings because of missing break statements. The case statements handled here were reported by coverity. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-01-13omap_dss: correct chip[1] index in RFBI_READ/RFBI_STATUSStefan Hajnoczi1-2/+2
The RFBI_READ/RFBI_STATUS code incorrectly uses chip[0] when it should be using chip[1]. Andrzej Zaborowski <balrog@zabor.org> confirmed this bug since I don't know this code well. Reported-by: Dr David Alan Gilbert <davidagilbert@uk.ibm.com> Reviewed-by: Andrzej Zaborowski <andrew.zaborowski@intel.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-01-13usb: add audio device modelH. Peter Anvin3-3/+711
This brings a usb audio device to qemu. Output only, fixed at 16bit stereo @ 480000 Hz. Based on a patch from H. Peter Anvin <hpa@linux.intel.com> Usage: add '-device usb-audio' to your qemu command line. Works sorta ok on a idle machine. Known issues: * Is *very* sensitive to latencies. * Burns quite some CPU due to usb polling. In short: It brings the qemu usb emulation to its limits. Enjoy! Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-01-13usb-desc: audio endpoint supportGerd Hoffmann2-3/+16
Add support for audio endpoints which have two more fields in the descriptor. Also add support for extra class specific endpoint descriptors. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-01-13usb: track altsetting in USBDeviceGerd Hoffmann10-79/+79
Also handle {GET,SET}_INTERFACE in common code (usb-desc.c). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-01-13usb: track configuration and interface count in USBDevice.Gerd Hoffmann2-8/+29
Move fields from USBHostDevice to USBDevice. Add bits to usb-desc.c to fill them for emulated devices too. Also allow to set configuration 0 (== None) for emulated devices. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-01-12vga: optimize ppm_save() divisionsAvi Kivity1-6/+4
ppm_save() spends upwards of 50% of its time doing divisions. Replace them with shifts. Reviewed-by: Alon Levy <alevy@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-12etraxfs-dma: Model metadata and eopLars Persson3-10/+33
- Send EOP flags to the out channels. - Send data descriptor metadata to the out channels. Signed-off-by: Lars Persson <larper@axis.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2012-01-10wm8750: Fix calculation of number of array elementsStefan Weil1-1/+1
Coverity says that the division by sizeof(*s->rate) might be wrong. I think that coverity is right. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2012-01-10elf: Improve symbol lookup (optimize, fix for bsd-user)Stefan Weil1-7/+5
Coverity complained about local variable key which was only partially initiated. Only key.st_value was set. As this was also the only part of key which was used in function symfind, the code could be optimized by directly passing a pointer to orig_addr. In bsd-user/elfload.c, fix ec822001a2f26eef8701194714f6482b6d852de2 was missing. This was a simple replacement of > by >= in symfind, so I fixed it here without creating an additional patch. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2012-01-10hw/integratorcp: Simplify flash remap codePeter Maydell1-19/+7
Use the new memory mutator API to simplify the flash remap code; this allows us to drop the flash_mapped flag. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2012-01-10hw/integratorcp: Fix sense of REMAP bitPeter Maydell1-1/+1
Fix the sense of the REMAP bit: 0 should mean "map flash", 1 should mean "map RAM". Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2012-01-10Merge branch 's390-next' of git://repo.or.cz/qemu/agrafAurelien Jarno4-25/+75
* 's390-next' of git://repo.or.cz/qemu/agraf: s390: fix cpu hotplug / cpu activity on interrupts s390x: add TR function for EXECUTE Expose drive_add on all architectures Add generic drive hotplugging Compile device-hotplug on all targets [S390] Add hotplug support
2012-01-09vhost: improve region filteringAvi Kivity1-4/+15
vhost memory management doesn't care about non-memory (e.g. PIO) or non-RAM regions. Adjust the filtering to reflect that, and move it earlier so it applies to mem_sections too. Signed-off-by: Avi Kivity <avi@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com>
2012-01-09vhost: fix mem_sections memory corruptionAvi Kivity1-1/+1
A memset() used to delete an entry in an array did not take into account the array element's size. Signed-off-by: Avi Kivity <avi@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com>
2012-01-09vhost: fix incorrect userspace addressAvi Kivity1-1/+1
MemoryListener::region_add() gives us a slice of a MemoryRegion, not a region. Adjust the userspace address to reflect that. Signed-off-by: Avi Kivity <avi@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com>
2012-01-07Merge branch 'ppc-next' of git://repo.or.cz/qemu/agrafAurelien Jarno7-57/+265
* 'ppc-next' of git://repo.or.cz/qemu/agraf: PPC: Add description for the Freescale e500mc core. pseries: Check for duplicate addresses on the spapr-vio bus pseries: Populate "/chosen/linux,stdout-path" in the FDT pseries: Add a routine to find a stable "default" vty and use it pseries: Emit device tree nodes in reg order pseries: FDT NUMA extensions to support multi-node guests pseries: Remove hcalls callback kvm-ppc: halt secondary cpus when guest reset console: Fix segfault on screendump without VGA adapter PPC: monitor: add ability to dump SLB entries
2012-01-07sm501: Fix size of color_regStefan Weil1-1/+1
color_reg is expected to hold 32 bit values, so it was too small. This bug was reported by coverity: hw/sm501.c:624: result_independent_of_operands: color_reg >> 16 is 0 regardless of the values of its operands. This occurs as the bitwise first operand of '&'. Cc: Shin-ichiro Kawasaki <kawasaki@juno.dti.ne.jp> Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2012-01-07malta: Fix regression (i8259 interrupts did not work)Stefan Weil1-4/+35
Commit 5632ae46d5bda798e971dae48ebb318ac2c3686a passes the address of i8259 to qemu_irq_proxy. i8259 is an auto variable with undefined value outside of mips_malta_init. This made the interrupt proxy unusable: either QEMU crashes, or the interrupt handler was not called. Ethernet for example no longer worked with MIPS Malta. v2: While v1 used a static variable for i8259, this patch introduces a qdev for the malta machine. i8259 is now part of the device status. This is a minimal qdev implementation to keep the patch small. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2012-01-06Merge remote-tracking branch 'stefanha/trivial-patches' into stagingAnthony Liguori5-14/+14
* stefanha/trivial-patches: qemu-nbd: drop loop which can never loop Make python mandatory net/socket.c: Fix fd leak in net_socket_listen_init() error paths gdbstub: Fix fd leak in gdbserver_open() error path configure: Fix test for supported host CPU type configure: CONFIG_QEMU_INTERP_PREFIX only for user mode scsi virtio-blk usb-msd: Clean up device init error messages Strip trailing '\n' from error_report()'s first argument (again) qemu-options.hx: fix tls-channel help text
2012-01-06virtio-9p-proxy: Fix typo causing compile failure on 32 bit hostsPeter Maydell1-2/+2
Fix a compile failure on 32 bit hosts (integer constant is too large for 'unsigned long' type) by correcting a typo where the mask used for filling in the second f_fsid word had too many 'F's in it. Also drop the 'L' suffix that allowed this typo to go undetected on 64 bit hosts. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-06scsi virtio-blk usb-msd: Clean up device init error messagesMarkus Armbruster4-8/+8
Replace error_report("DEVICE-NAME: MESSAGE"); by just error_report("MESSAGE"); in block device init functions. DEVICE-NAME is bogus in some cases: it's "scsi-disk" for device scsi-hd and scsi-cd, "virtio-blk-pci" for virtio-blk-s390, and "usb-msd" for usb-storage. There is no real need to put a device name in the message, because error_report() points to the offending command line option already: $ qemu-system-x86_64 --nodefaults --enable-kvm -vnc :0 -S -monitor stdio -usb -device virtio-blk-pci upstream-qemu: -device virtio-blk-pci: virtio-blk-pci: drive property not set upstream-qemu: -device virtio-blk-pci: Device 'virtio-blk-pci' could not be initialized And for a monitor command, it's obvious anyway: $ qemu-system-x86_64 --nodefaults --enable-kvm -vnc :0 -S -monitor stdio -usb (qemu) device_add virtio-blk-pci virtio-blk-pci: drive property not set Device 'virtio-blk-pci' could not be initialized Reported-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-01-06Strip trailing '\n' from error_report()'s first argument (again)Markus Armbruster1-6/+6
Commit 6daf194d got rid of them, but Hans and Gerd added some more lately. Tracked down with this Coccinelle semantic patch: @r@ expression fmt; position p; @@ error_report(fmt, ...)@p @script:python@ fmt << r.fmt; p << r.p; @@ if "\\n" in str(fmt): print "%s:%s:%s:%s" % (p[0].file, p[0].line, p[0].column, fmt) Signed-off-by: Markus Armbruster <armbru@redhat.com>
2012-01-06Merge remote-tracking branch 'amit/master' into stagingAnthony Liguori1-1/+13
* amit/master: virtio-console: Fix failure on unconnected pty
2012-01-06Merge remote-tracking branch 'aneesh/for-upstream' into stagingAnthony Liguori7-446/+1713
* aneesh/for-upstream: hw/9pfs: Add support to use named socket for proxy FS hw/9pfs: man page for proxy helper hw/9pfs: Documentation changes related to proxy fs hw/9pfs: Proxy getversion hw/9pfs: xattr interfaces in proxy filesystem driver hw/9pfs: File ownership and others hw/9pfs: Add stat/readlink/statfs for proxy FS hw/9pfs: Create other filesystem objects hw/9pfs: Open and create files hw/9pfs: File system helper process for qemu 9p proxy FS hw/9pfs: Add new proxy filesystem driver hw/9pfs: Add validation to {un}marshal code hw/9pfs: Move pdu_marshal/unmarshal code to a seperate file hw/9pfs: Move opt validation to FsDriver callback
2012-01-06Merge remote-tracking branch 'kraxel/usb.33' into stagingAnthony Liguori2-3/+15
* kraxel/usb.33: usb-ohci: td.cbp incorrectly updated near page end usb-host: properly release port on unplug & exit usb-storage: cancel I/O on reset Fix parse of usb device description with multiple configurations
2012-01-06usb-ohci: td.cbp incorrectly updated near page endAndriy Gapon1-3/+3
The current code that updates the cbp value after a transfer looks like this: td.cbp += ret; if ((td.cbp & 0xfff) + ret > 0xfff) { <handle page overflow> because the 'ret' value is effectively added twice the check may fire too early when the overflow hasn't happened yet. Below is one of the possible changes that correct the behavior: Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-01-06usb-storage: cancel I/O on resetGerd Hoffmann1-0/+12
When resetting the usb-storage device we'll have to carefully cancel and clear any requests which might be in flight, otherwise we'll confuse the state machine. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>