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-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>
2012-01-04Merge remote-tracking branch 'pmaydell/arm-devs.for-upstream' into stagingAnthony Liguori9-113/+403
* pmaydell/arm-devs.for-upstream: add L2x0/PL310 cache controller device arm: add dummy gic security registers arm: Set frequencies for arm_timer arm: add missing scu registers hw/omap_gpmc: Fix region map/unmap when configuring prefetch engine hw/omap1.c: Drop unused includes hw/omap1.c: Separate dpll_ctl from omap_mpu_state hw/omap1.c: Separate PWT from omap_mpu_state hw/omap1.c: Separate PWL from omap_mpu_state hw/omap1.c: omap_mpuio_init() need not be public hw/pl110.c: Add post-load hook to invalidate display hw/pl181.c: Add save/load support
2012-01-04hw/9pfs: Add support to use named socket for proxy FSM. Mohan Kumar1-7/+45
Add option to use named socket for communicating between proxy helper and qemu proxy FS. Access to socket can be given by using command line options -u and -g. Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2012-01-04hw/9pfs: Proxy getversionM. Mohan Kumar2-0/+33
Add proxy getversion to get generation number Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2012-01-04hw/9pfs: xattr interfaces in proxy filesystem driverM. Mohan Kumar2-8/+120
Add xattr support for proxy FS Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2012-01-04hw/9pfs: File ownership and othersM. Mohan Kumar2-12/+130
Add file ownership interfaces like chmod/chown, utime update, rename, remove and truncating files for proxy FS Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2012-01-04hw/9pfs: Add stat/readlink/statfs for proxy FSM. Mohan Kumar2-8/+232
Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2012-01-04hw/9pfs: Create other filesystem objectsM. Mohan Kumar2-17/+190
Add interfaces to create filesystem objects like directory, device nodes, symbolic links, links for proxy filesytem driver Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2012-01-04hw/9pfs: Open and create filesM. Mohan Kumar2-6/+192
Add interfaces to open and create files for proxy file system driver. Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2012-01-04hw/9pfs: File system helper process for qemu 9p proxy FSM. Mohan Kumar1-0/+9
Provide root privilege access to QEMU 9p proxy filesystem using socket communication. Proxy helper is started by root user as: ~ # virtfs-proxy-helper -f|--fd <socket descriptor> -p|--path <path-to-share> Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2012-01-04hw/9pfs: Add new proxy filesystem driverM. Mohan Kumar2-0/+412
Add new proxy filesystem driver to add root privilege to qemu process. It needs a helper process to be started by root user. Following command line can be used to utilize proxy filesystem driver -virtfs proxy,id=<id>,mount_tag=<tag>,socket_fd=<socket-fd> Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2012-01-04hw/9pfs: Add validation to {un}marshal codeM. Mohan Kumar1-123/+338
Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2012-01-04hw/9pfs: Move pdu_marshal/unmarshal code to a seperate fileM. Mohan Kumar2-322/+12
Move p9 marshaling/unmarshaling code to a separate file so that proxy filesytem driver can use these calls. Also made marshaling code generic to accept "struct iovec" instead of V9fsPDU. Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2012-01-04hw/9pfs: Move opt validation to FsDriver callbackAneesh Kumar K.V3-5/+62
This remove all conditional code from common code path and make opt validation a FSDriver callback. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
2012-01-04add L2x0/PL310 cache controller deviceRob Herring1-0/+181
This is just a dummy device for ARM L2 cache controllers, based on the pl310. The cache type parameter can be defined by a property value and has a meaningful default. Signed-off-by: Rob Herring <rob.herring@calxeda.com> Signed-off-by: Mark Langsdorf <mark.langsdorf@calxeda.com> [Peter Maydell: removed stray blank line at end] Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-01-04arm: add dummy gic security registersRob Herring1-0/+6
Implement handling for the RAZ/WI gic security registers. Signed-off-by: Rob Herring <rob.herring@calxeda.com> Signed-off-by: Mark Langsdorf <mark.langsdorf@calxeda.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-01-04arm: Set frequencies for arm_timerMark Langsdorf1-5/+19
Use qdev properties to allow board modelers to set the frequencies for the sp804 timer. Each of the sp804's timers can have an individual frequency. The timers default to 1MHz. Signed-off-by: Mark Langsdorf <mark.langsdorf@calxeda.com> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-01-04arm: add missing scu registersRob Herring1-3/+33
Add power control register to a9mpcore Signed-off-by: Rob Herring <rob.herring@calxeda.com> Signed-off-by: Mark Langsdorf <mark.langsdorf@calxeda.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-01-04hw/omap_gpmc: Fix region map/unmap when configuring prefetch enginePeter Maydell1-9/+21
When configuring the prefetch engine (and also when resetting from a state where the prefetch engine was enabled) be careful to adhere to the "unmap/change config fields/map" ordering, to avoid trying to delete the wrong MemoryRegions. This fixes an assertion failure in some cases. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reported-by: Alexander Graf <agraf@suse.de> Tested-by: Alexander Graf <agraf@suse.de>
2012-01-04hw/omap1.c: Drop unused includesPeter Maydell1-4/+0
Drop includes of qemu-timer.h, qemu-char.h and pc.h as they are no longer needed. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>