aboutsummaryrefslogtreecommitdiff
path: root/hw
AgeCommit message (Collapse)AuthorFilesLines
2011-07-17vhost: fix double free on device stopMichael S. Tsirkin1-0/+1
vhost dev stop failed to clear the log field. Typically not an issue as dev start overwrites this field, but if logging gets disabled before the following start, it doesn't so this causes a double free. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2011-07-12esp: cancel current request only if some request is in flightHervé Poussineau1-1/+1
This bug was introduced in 94d3f98a3f3caddd7875f9a11776daeb84962a7b: scsi_cancel_io was checking if some request was pending before trying to cancel it, while scsi_req_cancel always cancels the request. This may lead to a crash of Qemu due to dereferencing a NULL pointer, as exhibited by NetBSD 5.1 installer on MIPS Magnum emulation. Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-07-12spapr: use specific endian ld/st_physAlexander Graf2-8/+8
Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-07-12s390-virtio: use specific endian ld/st_physAlexander Graf2-8/+8
Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-07-12ppc405_uc: use specific endian ld/st_physAlexander Graf1-20/+23
Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-07-12pl080: use specific endian ld/st_physAlexander Graf1-4/+4
Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-07-12msix: use specific endian ld/st_physAlexander Graf1-1/+1
Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-07-12msi: use specific endian ld/st_physAlexander Graf1-1/+1
Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-07-12intel-hda: use specific endian ld/st_physAlexander Graf1-17/+4
Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-07-12hpet: use specific endian ld/st_physAlexander Graf1-1/+1
Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-07-05ide: Initialise buffers with zerosKevin Wolf1-1/+5
Just in case there's still a way how a guest can read out buffers when it's not supposed to, let's zero the buffers during initialisation so that we don't leak information to the guest. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
2011-07-05ide: Ignore reads during PIO in and writes during PIO outKevin Wolf1-8/+36
This fixes https://bugs.launchpad.net/qemu/+bug/786209: When the DRQ_STAT bit is set, the IDE core permits both data reads and data writes, regardless of whether the current transfer was initiated as a read or write. This potentially leaks uninitialized host memory into the guest, if, before doing anything else to an IDE device, the guest begins a write transaction (e.g. WIN_WRITE), but then *reads* from the IO port instead of writing to it. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
2011-07-05virtio-blk: Turn drive serial into a qdev propertyMarkus Armbruster7-13/+31
It needs to be a qdev property, because it belongs to the drive's guest part. Precedence: commit a0fef654 and 6ced55a5. Bonus: info qtree now shows the serial number. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-07-04pxa2xx_lcd: add proper rotation supportVasily Khoruzhick2-12/+100
Until now, pxa2xx_lcd only supported 90deg rotation, but some machines (for example Zipit Z2) needs 270deg rotation. Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-07-04arm: Add const attribute to some arm_boot_info pointersStefan Weil3-6/+6
Parameter 'info' is const, so add the missing attribute. v2: Add 'const' to the local variable info in do_cpu_reset() and to the boot_info field in CPUARMState (suggested by Peter Maydell). Cc: Andrzej Zaborowski <balrogg@gmail.com> Cc: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-07-02esp: correctly fill bus id with requested lunHervé Poussineau1-1/+1
This bug showed up after 1455084ea2c48abf23c4e4e15e378ee43457f381, and may be seen only on operating systems *not* using DMA to give commands to SCSI adapter. Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-07-01Merge branch 'ppc-next' of git://repo.or.cz/qemu/agrafBlue Swirl7-28/+195
* 'ppc-next' of git://repo.or.cz/qemu/agraf: PPC: move TLBs to their own arrays PPC: 440: Use 440 style MMU as default, so Qemu knows the MMU type PPC: E500: Use MAS registers instead of internal TLB representation PPC: Only set lower 32bits with mtmsr PPC: update openbios firmware PPC: mpc8544ds: Add hypervisor node PPC: calculate kernel,initrd,cmdline locations dynamically target-ppc: Handle memory-forced I/O controller access PPC: E500: Implement reboot controller
2011-06-30etraxfs-ser: Correct default value for RW_REC_CTRLEdgar E. Iglesias1-5/+19
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2011-06-27Merge remote-tracking branch 'kraxel/usb.17' into stagingAnthony Liguori7-38/+91
2011-06-27Merge remote-tracking branch 'amit/for-anthony' into stagingAnthony Liguori1-10/+14
2011-06-27Merge remote-tracking branch 'stefanha/trivial-patches' into stagingAnthony Liguori16-37/+37
2011-06-27virtio-serial: Fix segfault on guest bootLuiz Capitulino1-10/+14
If I start qemu with: # qemu -hda disks/test.img -enable-kvm -m 1G -snapshot \ -device virtio-serial \ -chardev socket,host=localhost,port=1234,server,nowait,id=foo \ -device virtserialport,chardev=foo,name=org.qemu.guest_agent I get a segfault when booting a Fedora 14 guest. The backtrace says: Program terminated with signal 11, Segmentation fault. #0 0x0000000000420850 in handle_control_message (vser=0x3732bd0, buf=0x2c173e0, len=8) at /home/lcapitulino/src/qmp-unstable/hw/virtio-serial-bus.c:335 335 info = DO_UPCAST(VirtIOSerialPortInfo, qdev, port->dev.info); What's happening is VIRTIO_CONSOLE_DEVICE_READY is a message for the whole device, not for an individual port. So port is NULL. This bug was introduced by commit a15bb0d6a981de749452a5180fc8084d625671da. This commit fixes that by making the port returned by find_port_by_id() be used only by the VIRTIO_CONSOLE_PORT_READY and VIRTIO_CONSOLE_PORT_OPEN messages. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com>
2011-06-26Remove exec-all.h include directivesBlue Swirl2-2/+0
Most exec-all.h include directives are now useless, remove them. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-06-26Fix fallouts from Linux header inclusionJan Kiszka1-0/+10
This is an all-in-one fix for the smaller and bigger mistakes of the build system changes for accompanied Linux headers: - only enable KVM and vhost on Linux hosts - fix powerpc asm header symlink - do not use Linux headers on non-Linux hosts - fix kvmclock for !CONFIG_KVM - fix s390 build on non-Linux hosts Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Tested-by: Andreas Färber <andreas.faerber@web.de> Tested-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-06-24Fix comment typos in hw/armv7m.cMatthew Fernandez1-2/+2
Fix a couple of typos in comments. Signed-off-by: Matthew Fernandez <matthew.fernandez@gmail.com> Acked-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-06-24Spell "unkown" correctly in error_report() argumentsMarkus Armbruster6-11/+11
Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-06-24Strip trailing '\n' from error_report()'s first argumentMarkus Armbruster9-24/+24
error_report() prepends location, and appends a newline. The message constructed from the arguments should not contain a newline. Fix the obvious offenders. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-06-23usb: ignore USB_DT_DEBUGGerd Hoffmann2-0/+5
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-23usb-storage: Turn drive serial into a qdev property usb-storage.serialMarkus Armbruster1-3/+11
It needs to be a qdev property, because it belongs to the drive's guest part. Precedence: commit a0fef654 and 6ced55a5. Bonus: info qtree now shows the serial number. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-23hw/usb-ohci.c: Fix handling of remote wakeup corner casesPeter Maydell1-3/+14
Correct a number of minor errors in the OHCI wakeup implementation: * when the port is suspended but the controller is not, raise RHSC * when the controller is suspended but the port is not, raise RD * when the controller is suspended, move it to resume state These fix some edge cases where a USB device might not successfully get the attention of the guest OS if it tried to do so at the wrong time. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-23usb-bus: Don't allow speed mismatch while attaching devicesHans de Goede1-0/+5
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-23usb: Add a speedmask to devicesHans de Goede3-0/+14
This is used to indicate at which speed[s] the device can operate, so that this can be checked to match the ports capabilities when it gets attached to a bus. Note that currently all usb1 emulated device claim to be fullspeed, this seems to not cause any problems, but still seems wrong, because with real hardware keyboards, mice and tablets usually are lo-speed, so reporting these as fullspeed devices seems wrong. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-23usb: Proper error propagation for usb_device_attach errorsHans de Goede2-14/+16
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-23usb-bus: Don't allow attaching a device to a bus with no free portsHans de Goede1-0/+5
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-23ehci: switch to nanosecondsGerd Hoffmann1-18/+11
Make ehci use nanoseconds everywhere. Simplifies time calculations. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-23ehci: add freq + maxframes propertiesGerd Hoffmann1-2/+12
Add properties for the wakeup rate and the max number of frames ehci will process at once. The wakeup rate defaults to 1000 which equals the usb frame rate. This can be reduced to make qemu wake up less often when ehci is active. In case the wakeup rate is reduced or the ehci timer is delayed due to latency issues elsewhere in qemu ehci will process multiple frames at once. The maxframes property specifies the upper limit for this. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-22net: Warn about "-net nic" options which were ignoredPeter Maydell1-0/+1
Diagnose the case where the user asked for a NIC via "-net nic" but the board didn't instantiate that NIC (for example where the user asked for two NICs but the board only supports one). Note that this diagnostic doesn't apply to NICs created through -device, because those are always instantiated. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-06-22Optimize screendumpAvi Kivity1-3/+10
When running kvm-autotest, fputc() is often the second highest (sometimes #1) function showing up in a profile. This is due to fputc() locking the file for every byte written. Optimize by buffering a line's worth of pixels and writing that out in a single call. Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-06-22Merge remote-tracking branch 'qemu-kvm/uq/master' into stagingAnthony Liguori1-9/+0
2011-06-22Merge remote-tracking branch 'mst/for_anthony' into stagingAnthony Liguori53-432/+552
Conflicts: hw/usb-uhci.c
2011-06-22Merge remote-tracking branch 'agraf/xen-next' into stagingAnthony Liguori8-39/+402
2011-06-20kvm: Drop CONFIG_KVM_PARAJan Kiszka1-9/+0
The kvm_para.h header is now always available. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2011-06-20lsi: Fix unused-but-set-variable warningChristophe Fergeau1-2/+0
This warning is new in gcc 4.6. Signed-off-by: Christophe Fergeau <cfergeau@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-06-19xen: Add the Xen platform pci deviceSteven Smith4-0/+349
Introduce a new emulated PCI device, specific to fully virtualized Xen guests. The device is necessary for PV on HVM drivers to work. Signed-off-by: Steven Smith <ssmith@xensource.com> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2011-06-19xen: fix interrupt routingStefano Stabellini3-38/+35
Compared to the last version I only added a comment to the code. - remove i440FX-xen and i440fx_write_config_xen we don't need to intercept pci config writes to i440FX anymore; - introduce PIIX3-xen and piix3_write_config_xen we do need to intercept pci config write to the PCI-ISA bridge to update the PCI link routing; - set the number of PIIX3-xen interrupts line to 128; Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2011-06-19cirrus_vga: reset lfb_addr after a pci config write if the BAR is unmappedStefano Stabellini1-1/+4
If the cirrus_vga PCI BAR is unmapped than we should not only reset map_addr but also lfb_addr, otherwise we'll keep trying to map the old lfb_addr in map_linear_vram. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2011-06-19xen: Add xc_domain_add_to_physmap to xen_interface.Anthony PERARD1-0/+14
This function will be used to support sync dirty bitmap. This come with a check against every Xen release, and special implementation for Xen version that doesn't have this specific call. This function will not be usable with Xen 3.3 because the behavior is different. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2011-06-17PPC: move TLBs to their own arraysAlexander Graf1-2/+2
Until now, we've created a union over multiple different TLB types and allocated that union. While it's a waste of memory (and cache) to allocate TLB information for a TLB type with much information when you only need little, it also inflicts another issue. With the new KVM API, we can now share the TLB between KVM and qemu, but for that to work we need to have both be in the same layout. We can't just stretch it over to fit some internal different TLB representation. Hence this patch moves all TLB types to their own array, allowing us to only address and allocate exactly the boundaries required for the specific TLB type at hand. Signed-off-by: Alexander Graf <agraf@suse.de>
2011-06-17PPC: 440: Use 440 style MMU as default, so Qemu knows the MMU typeAlexander Graf1-2/+3
We have some KVM interaction code in Qemu that tries to be clever and ignore some capabilities when running on BookE style MMUs. Unfortunately, the default CPU bamboo was defaulting to was not a BookE-style MMU, resulting in the check to fail. With this patch, guests can run again on 440 with -enable-kvm. Signed-off-by: Alexander Graf <agraf@suse.de>
2011-06-17PPC: E500: Use MAS registers instead of internal TLB representationAlexander Graf1-8/+13
The natural format for e500 cores to do TLB manipulation with are the MAS registers. Instead of converting them into some internal representation and back again when the guest reads them, we can just keep the data identical to the way the guest passed it to us. The main advantage of this approach is that we're getting closer to being able to share MMU data with KVM using shared memory, so that we don't need to copy lots of MMU data back and forth all the time. For this to work however, another patch is required that gets rid of the TLB union, as that destroys our memory layout that needs to be identical with the kernel one. Signed-off-by: Alexander Graf <agraf@suse.de>