summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2011-06-17PPC: update openbios firmwareAlexander Graf2-2/+4
There were some changes upstream to account for broken usage of mtmsr, so before applying the mtmsr patch we need to update OpenBIOS, otherwise the PPC target would break. Signed-off-by: Alexander Graf <agraf@suse.de>
2011-06-17PPC: mpc8544ds: Add hypervisor nodeAlexander Graf3-6/+18
When running a PPC guest with KVM that can do PV operations, we need to indicate the guest which instructions to use for a hypercall and that it is running as KVM guest. This logic was available on openbios based machines already. This patch also adds said functionality to the mpc8544ds machine. Signed-off-by: Alexander Graf <agraf@suse.de> Acked-by: Scott Wood <scottwood@freescale.com>
2011-06-17PPC: calculate kernel,initrd,cmdline locations dynamicallyAlexander Graf3-10/+23
During testing, I was generating a vmlinux binary that easily occupied more than 20MB of RAM. Since the current -kernel code loads the initrd at a fixed address behind the kernel, we were overwriting kernel data when the kernel got too big. To finally get rid of the issue, let's calculate the initrd and cmdline addresses relative to the kernel size, so we can have kernels and initrds that are as big as they want to - as long as they fit in RAM. Signed-off-by: Alexander Graf <agraf@suse.de>
2011-06-17target-ppc: Handle memory-forced I/O controller accessHervé Poussineau1-0/+16
On at least the PowerPC 601, a direct-store (T=1) with bus unit ID 0x07F is special-cased as memory-forced I/O controller access. It is supposed to be checked immediately if T=1, bypassing all protection mechanisms and acting cache-inhibited and global. Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Simplified by avoiding reindentation. Added explanatory comments. Cc: Alexander Graf <agraf@suse.de> Signed-off-by: Andreas Färber <andreas.faerber@web.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2011-06-17PPC: E500: Implement reboot controllerAlexander Graf5-1/+146
When Linux reboots an e500 VM, it writes to a magic register in the "global-utilities" device indicated by the device tree. We were not emulating that device so far, rendering the VM reboot-less. This patch implements that device with only the reboot functionality implemented and adds it to the device tree. With this patch applied, I can successfully reboot a -M mpc8544ds VM. Signed-off-by: Alexander Graf <agraf@suse.de> Reviewed-by: Andreas Färber <andreas.faerber@web.de>
2011-06-15hw/9118.c: Implement active-low interrupt supportPeter Maydell1-3/+9
The 9118 ethernet controller interrupt line is active low unless the IRQ config register is programmed to set both the IRQ_POL (polarity: active-high) and IRQ_TYPE (type: push-pull) bits: implement support for inverting the irq output in other configurations. This also requires that we support setting the bits in the first place, and that we correctly preserve them across software reset. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-06-15Introduce format string for pid_tAndreas Färber5-4/+10
BeOS and Haiku on i386 use long for 32-bit types, including pid_t. Using %d with pid_t therefore results in a warning. Unfortunately POSIX:2008 does not define a PRId* string for pid_t. In some places pid_t was previously casted to long and %ld hardcoded. The predecessor of this patch added another upcast for the simpletrace filename but was not applied to date. Since new uses of pid_t with %d keep creeping in, let's instead define an OS-dependent format string and use that consistently. Cc: Stefan Hajnoczi <stefanha@gmail.com> Cc: Blue Swirl <blauwirbel@gmail.com> Cc: Ingo Weinhold <ingo_weinhold@gmx.de> Cc: Gleb Natapov <gleb@redhat.com> Signed-off-by: Andreas Färber <andreas.faerber@web.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-06-15smc91c111: qdevify resetJuha Riihimäki1-5/+4
Register the smc91c111 reset function as a qdev reset function. Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-06-15Merge branch 'cocoa-for-upstream' of git://repo.or.cz/qemu/afaerberBlue Swirl10-18/+53
* 'cocoa-for-upstream' of git://repo.or.cz/qemu/afaerber: Darwin: Fix compilation warning regarding the deprecated daemon() function cocoa: Avoid warning related to multiple handleEvent: definitions cocoa: Revert dependency on VNC cocoa: Provide central qemu_main() prototype Fix libfdt warnings on Darwin configure: Fix check for fdatasync() Remove warning in printf due to type mismatch Cocoa: avoid displaying window when command-line contains '-h' or '-help' Fix compilation warning due to incorrectly specified type cocoa: do not create a spurious window for -version
2011-06-15Command line support for altering the log file locationMatthew Fernandez7-54/+114
Add command line support for logging to a location other than /tmp/qemu.log. With logging enabled (command line option -d), the log is written to the hard-coded path /tmp/qemu.log. This patch adds support for writing the log to a different location by passing the -D option. Signed-off-by: Matthew Fernandez <matthew.fernandez@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-06-15Merge remote-tracking branch 'alon/pull-libcacard-1' into stagingAnthony Liguori0-0/+0
2011-06-15Merge remote-tracking branch 'qemu-kvm/uq/master' into stagingAnthony Liguori0-0/+0
2011-06-15Merge remote-tracking branch 'kraxel/usb.16' into stagingAnthony Liguori12-546/+990
2011-06-15Merge remote-tracking branch 'kwolf/for-anthony' into stagingAnthony Liguori16-73/+423
2011-06-15Allow nested qemu_bh_poll() after BH deletionKevin Wolf1-2/+3
Without this, qemu segfaults when a BH handler first deletes its BH and then calls another function which involves a nested qemu_bh_poll() call. This can be reproduced by generating an I/O error (e.g. with blkdebug) on an IDE device and using rerror/werror=stop to stop the VM. When continuing the VM, qemu segfaults. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2011-06-15ide: Clear error_status after restarting flushKevin Wolf1-7/+11
Clearing the error status flag was missing for restarting flushes. Now that the error status is separate from the BM status register, we can simply set it to 0 after restarting the request. This ensures that we never forget to clear a bit. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-06-15ide: add TRIM supportChristoph Hellwig5-5/+124
Add support for TRIM sub function of the data set management command, and wire it up to the qemu discard infrastructure. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-06-15ide: allow other dma comands than read and writeChristoph Hellwig4-17/+33
Replace the is_read flag with a dma_cmd flag to allow the dma and restart logic to handler other commands like TRIM. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-06-15make dma_bdrv_io available to driversChristoph Hellwig2-13/+18
Make dma_bdrv_io available for drivers, and pass an explicit I/O function instead of hardcoding bdrv_aio_readv/bdrv_aio_writev. This is required to implement non-READ/WRITE dma commands in the ide driver, e.g. the upcoming TRIM support. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-06-15ide: Add forgotten VMSTATE_END_OF_LIST in subsectionKevin Wolf1-0/+1
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-06-15ide: Fix ide_drive_pio_state_needed()Kevin Wolf1-1/+2
When a failed PIO request caused the VM to stop, we still need to transfer the PIO state even though DRQ=0 at this point. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-06-15ide: Split error status from status registerKevin Wolf4-8/+105
When adding the werror=stop mode, some flags were added to s->status which are used to determine what kind of operation should be restarted when the VM is continued. Unfortunately, it turns out that s->status is in fact a device register and as such is visible to the guest (some of the abused bits are even writable for the guest). For migration we keep on using the old VMState field (renamed to migration_compat_status) if the status register doesn't use any of the previously abused bits. If it does, we use a subsection with a clean copy of the status register. The error status is always sent in a subsection if there is any error. It can't use the old field because errors happen even without PCI. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-06-15qcow2: Fix in-flight list after qcow2_cache_put failureKevin Wolf1-4/+8
If qcow2_cache_put returns an error during cluster allocation and the allocation fails, it must be removed from the list of in-flight allocations. Otherwise we'd get a loop in the list when the ACB is used for the next allocation. Luckily, this qcow2_cache_put shouldn't fail anyway because the L2 table is only read, so that qcow2_cache_put doesn't even involve I/O. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
2011-06-15Replaced tabs with spaces in block.h and block_int.hDevin Nakamura2-5/+5
Signed-off-by: Devin Nakamura <devin122@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-06-15vdi: Avoid direct AIO callbackKevin Wolf1-5/+36
bdrv_aio_* must not call the callback before returning to its caller. In vdi, this could happen in some error cases. This starts the real requests processing in a BH to avoid this situation. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-06-14qcow: Avoid direct AIO callbackKevin Wolf1-2/+56
bdrv_aio_* must not call the callback before returning to its caller. In qcow, this could happen in some error cases. This starts the real requests processing in a BH to avoid this situation. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-06-14qcow2: Avoid direct AIO callbackKevin Wolf1-9/+30
bdrv_aio_* must not call the callback before returning to its caller. In qcow2, this could happen in some error cases. This starts the real requests processing in a BH to avoid this situation. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2011-06-14kvm: Enable CPU SMEP featureYang, Wei Y1-0/+13
This patchset enables a new CPU feature SMEP (Supervisor Mode Execution Protection) in QEMU-KVM. SMEP prevents kernel from executing code in application. Updated Intel SDM describes this CPU feature. The document will be published soon. SMEP is identified by CPUID leaf 7 EBX[7], which is 0 before. Get the right value by query KVM kernel module, so that guest can get SMEP through CPUID. Signed-off-by: Yang, Wei <wei.y.yang@intel.com> Singed-off-by: Shan, Haitao <haitao.shan@intel.com> Singed-off-by: Li, Xin <xin.li@intel.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2011-06-14kvm: Add CPUID support for VIA CPUbrillywu@viatech.com.cn3-3/+74
When KVM is running on VIA CPU with host cpu's model, the feautures of VIA CPU will be passed into kvm guest by calling the CPUID instruction for Centaur. Signed-off-by: BrillyWu<brillywu@viatech.com.cn> Signed-off-by: KaryJin<karyjin@viatech.com.cn> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
2011-06-14usb-ccid: Plug memory leak on qdev exit()Markus Armbruster1-20/+8
ccid_initfn() allocates CCIDBus dynamically, but there is no exit callback to free it. Fix by getting rid of the allocation. Signed-off-by: Markus Armbruster <armbru@redhat.com>
2011-06-14libcacard: add libcacard.la targetAlon Levy5-6/+74
No flag to configure is required. Instead, added a libcacard.la target that is not built by default, only when requested explicitly via: mkdir build cd build ../configure make libcacard.la make install-libcacard Uses libtool to do actual linking of object files and shared library, and installing. Tested only under linux, but supposed to work on other systems as well. If libtool isn't found you get a message complaining about that, only at build time (since it is not a default target I did not add a message at configure time). New build artifacts: .libs subdirectories (at <buildroot> and <buildroot>/libcacard) *.lo files (at same locations as the respective o files) Added %.lo : %.c rule that uses libtool. Updated clean rule to clean up those artifacts. Added specific rule to call dtrace with libtool wrapper (note that because of a current upstream dtrace bug fixed by systemtap b1568fd85 commit the -fPIC flag isn't actually passed on. still current dtrace+libtool produced object links fine). If libtool is missing any of the following targets will complain and exit 1: any subdir: *.lo root and libcacard: libcacard.la, libcacard-instsall Tested to link and load with all tracing backends.
2011-06-14configure: add libdir and --libdirAlon Levy1-0/+5
2011-06-14usb-uhci: fix expire time initialization.Gerd Hoffmann1-2/+2
expire_time must be initialited when the guest activates the usb scheduler, not at device creation time. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-14hw/usb-ohci.c: Implement remote wakeupPeter Maydell1-0/+17
Implement the wakeup callback in the OHCI USBPortOps, so that when a downstream device wakes up it correctly causes the OHCI controller to come out of suspend. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-14hw/usb-ohci.c: Ignore writes to HcPeriodCurrentED registerPeter Maydell1-0/+4
HcPeriodCurrentED is read-only, but Linux writes to it anyway; silently ignore this rather than printing a warning message. (Specifically, drivers/usb/host/ohci-hub.c:ohci_rh_resume() writes a 0, in at least kernels 2.6.25 through 2.6.39.) Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-14usb: Use defines for serial bus release number register for EHCIBrad Hards1-1/+1
Signed-off-by: Brad Hards <bradh@frogmouth.net> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-14usb: Use defines for serial bus release number register for UHCIBrad Hards1-1/+1
Signed-off-by: Brad Hards <bradh@frogmouth.net> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-14usb: Add defines for USB Serial Bus Release Number registerBrad Hards1-0/+6
Signed-off-by: Brad Hards <bradh@frogmouth.net> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-14usb-bus: Don't detach non attached devices on device exitHans de Goede1-1/+3
This causes an "Error: tried to detach unattached usb device " to be printed, this can happen when deleting ie a usb host qdev, which did not get attached (because a device matching the filter never got plugged in). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-14usb-bus: Add knowledge of USB_SPEED_SUPER to usb_speed helperHans de Goede1-0/+1
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-14usb-linux: Enlarge buffer for descriptors to 8192 bytesHans de Goede1-1/+1
1024 bytes is way to small, one hd UVC webcam I have over here has so many resolutions its descriptors take op close to 4k. Hopefully 8k will be enough for all devices. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-14usb: don't call usb_host_device_open from vl.cGerd Hoffmann1-1/+5
Not needed any more, usb-host is qdev-ified these days. Well, at least the linux version ... Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-14usb-linux: only cleanup in host_close when host_open was successful.Gerd Hoffmann1-4/+4
2011-06-14usb-linux: Don't try to open the same device twiceHans de Goede1-0/+1
If a user wants to redirect 2 identical usb sticks, in theory this is possible by doing: usb_add host:1234:5678 usb_add host:1234:5678 But this will lead to us trying to open the first stick twice, since we don't break the loop after having found a match in our filter list, so the next' filter list entry will result in us trying to open the same device again. Fix this by adding the missing break. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-14usb-linux: Ensure devep != 0Hans de Goede1-0/+5
So that we don't index endp_table with a negative index. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-14usb-linux: Don't do perror when errno is not setHans de Goede1-2/+3
Note that "op" also is not set, so before this change these error paths would feed NULL to perror. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-14usb-linux: Teach about super speedHans de Goede1-2/+9
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-14usb-linux: Get speed from sysfs rather then from the connectinfo ioctlHans de Goede1-16/+21
The connectinfo ioctl only differentiates between lo speed devices, and all other speeds, where as we would like to know the real speed. The real speed is available in sysfs so use that when available. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-14usb: documentation updateGerd Hoffmann1-0/+85
Add some more informations to docs/usb2.txt about using usb2 (also usb1) devices. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-06-14usb-ehci: split trace calls to handle arg count limitsGerd Hoffmann2-23/+33
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>