Anthony Liguori [Wed, 22 Jun 2011 12:13:10 +0000 (07:13 -0500)]
Merge remote-tracking branch 'qemu-kvm/uq/master' into staging
Anthony Liguori [Wed, 22 Jun 2011 12:11:09 +0000 (07:11 -0500)]
Merge remote-tracking branch 'mst/for_anthony' into staging
Conflicts:
hw/usb-uhci.c
Anthony Liguori [Wed, 22 Jun 2011 12:07:55 +0000 (07:07 -0500)]
Merge remote-tracking branch 'agraf/xen-next' into staging
Marcelo Tosatti [Tue, 21 Jun 2011 16:53:18 +0000 (13:53 -0300)]
kvm: fix FPU state subsection
There is no need to specify version on the subsection fields.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Andre Przywara [Fri, 10 Jun 2011 13:56:28 +0000 (15:56 +0200)]
KVM: Fix XSAVE feature bit enumeration
When iterating through the XSAVE feature enumeration CPUID leaf (0xD)
we should not stop at the first zero EAX, but instead keep scanning
since there are gaps in the enumeration (ECX=1 for instance).
This fixes the proper usage of AVX in KVM guests.
Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Jan Kiszka [Wed, 8 Jun 2011 14:11:06 +0000 (16:11 +0200)]
Remove unneeded kvm.h from cpu-exec.c
This was obsoleted by
6792a57bf1.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Jan Kiszka [Wed, 8 Jun 2011 14:11:05 +0000 (16:11 +0200)]
kvm: x86: Pass KVMState to kvm_arch_get_supported_cpuid
kvm_arch_get_supported_cpuid checks for global cpuid restrictions, it
does not require any CPUState reference. Changing its interface allows
to call it before any VCPU is initialized.
CC: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Jan Kiszka [Wed, 8 Jun 2011 14:11:04 +0000 (16:11 +0200)]
kvm: Clean up stubs
No one references kvm_check_extension, kvm_has_vcpu_events, and
kvm_has_robust_singlestep outside KVM code.
kvm_update_guest_debug is never called, thus has no job besides
returning an error.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Jan Kiszka [Wed, 8 Jun 2011 14:11:03 +0000 (16:11 +0200)]
kvm: ppc: Drop KVM_CAP build dependencies
No longer needed with accompanied kernel headers.
CC: Alexander Graf <agraf@suse.de>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Jan Kiszka [Wed, 8 Jun 2011 14:11:02 +0000 (16:11 +0200)]
kvm: x86: Drop KVM_CAP build dependencies
No longer needed with accompanied kernel headers.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Jan Kiszka [Wed, 8 Jun 2011 14:11:01 +0000 (16:11 +0200)]
kvm: Drop KVM_CAP build dependencies
No longer needed with accompanied kernel headers. We are only left with
build dependencies that are controlled by kvm arch headers.
CC: Alexander Graf <agraf@suse.de>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Jan Kiszka [Wed, 8 Jun 2011 14:11:00 +0000 (16:11 +0200)]
kvm: Drop useless zero-initializations
Backing KVMState is alreay zero-initialized.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Jan Kiszka [Wed, 8 Jun 2011 14:10:59 +0000 (16:10 +0200)]
kvm: ppc: Drop CONFIG_KVM_PPC_PVR
Required header support is now unconditionally available.
CC: Alexander Graf <agraf@suse.de>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Jan Kiszka [Wed, 8 Jun 2011 14:10:58 +0000 (16:10 +0200)]
kvm: Drop CONFIG_KVM_PARA
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>
Jan Kiszka [Wed, 8 Jun 2011 14:10:57 +0000 (16:10 +0200)]
Switch build system to accompanied kernel headers
This helps reducing our build-time checks for feature support in the
available Linux kernel headers. And it helps users that do not have
sufficiently recent headers installed on their build machine.
Consequently, the patch removes and build-time checks for kvm and vhost
in configure, the --kerneldir switch, and KVM_CFLAGS. Kernel headers are
supposed to be provided by QEMU only.
s390 needs some extra love as it carries redefinitions from kernel
headers.
CC: Alexander Graf <agraf@suse.de>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Jan Kiszka [Wed, 8 Jun 2011 14:10:56 +0000 (16:10 +0200)]
Import kernel headers
These kernel headers and the COPYING file were automatically imported
from current Linux git,
cb0a02ecf9 (post 3.0-rc2).
Licensing:
asm-powerpc GPLv2
asm-s390 GPLv2
asm-x86 Linux top-level license (GPLv2 with exception)
linux/kvm*: Linux top-level license (GPLv2 with exception)
linux/vhost: Linux top-level license (GPLv2 with exception)
linux/virtio*: 3-clause BSB
CC: Alexander Graf <agraf@suse.de>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Jan Kiszka [Wed, 8 Jun 2011 16:22:17 +0000 (18:22 +0200)]
Add kernel header update script
This helper pulls the required kernel headers for KVM and vhost into a
specified directory. The update is triggered via
scripts/update-linux-headers.sh LINUX_PATH
and will place the output under linux-headers/linux and linux-headers/asm-*.
It also imports the COPYING to care for headers without an explicit license.
CC: Alexander Graf <agraf@suse.de>
CC: Christoph Hellwig <hch@lst.de>
CC: Peter Maydell <peter.maydell@linaro.org>
CC: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Frediano Ziglio [Mon, 20 Jun 2011 16:08:57 +0000 (17:08 +0100)]
cmd: fix operator precedence
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Alexandre Raymond [Tue, 14 Jun 2011 02:16:36 +0000 (22:16 -0400)]
Fix typo in cpus.c
filed -> failed
Signed-off-by: Alexandre Raymond <cerbere@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Christophe Fergeau [Wed, 1 Jun 2011 12:56:30 +0000 (14:56 +0200)]
lsi: Fix unused-but-set-variable warning
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>
Jan Kiszka [Wed, 15 Jun 2011 13:17:26 +0000 (15:17 +0200)]
kvm: x86: Save/restore FPU OP, IP and DP
These FPU states are properly maintained by KVM but not yet by TCG. So
far we unconditionally set them to 0 in the guest which may cause
state corruptions, though not with modern guests.
To avoid breaking backward migration, use a conditional subsection that
is only written if any of the three fields is non-zero. The guest's
FNINIT clears them frequently, and cleared IA32_MISC_ENABLE MSR[2]
reduces the probability of non-zero values further so that this
subsection is not expected to restrict migration in any common scenario.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Steven Smith [Thu, 16 Jun 2011 16:05:17 +0000 (17:05 +0100)]
xen: Add the Xen platform pci device
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>
Stefano Stabellini [Wed, 15 Jun 2011 16:36:56 +0000 (17:36 +0100)]
xen: fix interrupt routing
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>
Stefano Stabellini [Wed, 15 Jun 2011 16:29:27 +0000 (17:29 +0100)]
xen: only track the linear framebuffer
Xen can only do dirty bit tracking for one memory region, so we should
explicitly avoid trying to track anything but the vga vram region.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Stefano Stabellini [Fri, 3 Jun 2011 15:56:54 +0000 (16:56 +0100)]
cirrus_vga: reset lfb_addr after a pci config write if the BAR is unmapped
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>
Stefano Stabellini [Thu, 19 May 2011 17:35:46 +0000 (18:35 +0100)]
xen: mapcache performance improvements
Use qemu_invalidate_entry in cpu_physical_memory_unmap.
Do not lock mapcache entries in qemu_get_ram_ptr if the address falls in
the ramblock with offset == 0. We don't need to do that because the
callers of qemu_get_ram_ptr either try to map an entire block, other
from the main ramblock, or until the end of a page to implement a single
read or write in the main ramblock.
If we don't lock mapcache entries in qemu_get_ram_ptr we don't need to
call qemu_invalidate_entry in qemu_put_ram_ptr anymore because we can
leave with few long lived block mappings requested by devices.
Also move the call to qemu_ram_addr_from_mapcache at the beginning of
qemu_ram_addr_from_host.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Stefano Stabellini [Thu, 19 May 2011 17:35:45 +0000 (18:35 +0100)]
exec.c: refactor cpu_physical_memory_map
Introduce qemu_ram_ptr_length that takes an address and a size as
parameters rather than just an address.
Refactor cpu_physical_memory_map so that we call qemu_ram_ptr_length only
once rather than calling qemu_get_ram_ptr one time per page.
This is not only more efficient but also tries to simplify the logic of
the function.
Currently we are relying on the fact that all the pages are mapped
contiguously in qemu's address space: we have a check to make sure that
the virtual address returned by qemu_get_ram_ptr from the second call on
is consecutive. Now we are making this more explicit replacing all the
calls to qemu_get_ram_ptr with a single call to qemu_ram_ptr_length
passing a size argument.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CC: agraf@suse.de
CC: anthony@codemonkey.ws
Signed-off-by: Alexander Graf <agraf@suse.de>
Stefano Stabellini [Thu, 19 May 2011 17:35:44 +0000 (18:35 +0100)]
xen: remove xen_map_block and xen_unmap_block
Replace xen_map_block with qemu_map_cache with the appropriate locking
and size parameters.
Replace xen_unmap_block with qemu_invalidate_entry.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Stefano Stabellini [Thu, 19 May 2011 17:35:43 +0000 (18:35 +0100)]
xen: remove qemu_map_cache_unlock
There is no need for qemu_map_cache_unlock, just use
qemu_invalidate_entry instead.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Stefano Stabellini [Thu, 19 May 2011 17:35:42 +0000 (18:35 +0100)]
xen: fix qemu_map_cache with size != MCACHE_BUCKET_SIZE
Fix the implementation of qemu_map_cache: correctly support size
arguments different from 0 or MCACHE_BUCKET_SIZE.
The new implementation supports locked mapcache entries with size
multiple of MCACHE_BUCKET_SIZE. qemu_invalidate_entry can correctly
find and unmap these "large" mapcache entries given that the virtual
address passed to qemu_invalidate_entry is the same returned by
qemu_map_cache when the locked mapcache entry was created.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Anthony PERARD [Tue, 24 May 2011 13:34:21 +0000 (14:34 +0100)]
xen: Introduce VGA sync dirty bitmap support
This patch introduces phys memory client for Xen.
Only sync dirty_bitmap and set_memory are actually implemented.
migration_log will stay empty for the moment.
Xen can only log one range for bit change, so only the range in the
first call will be synced.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Anthony PERARD [Tue, 24 May 2011 13:34:20 +0000 (14:34 +0100)]
xen: Add xc_domain_add_to_physmap to xen_interface.
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>
Michael S. Tsirkin [Tue, 14 Jun 2011 14:29:34 +0000 (17:29 +0300)]
wdt: remove unused variables
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Michael S. Tsirkin [Tue, 14 Jun 2011 17:06:06 +0000 (20:06 +0300)]
alpha: remove unused variable
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Richard Henderson <rth@twiddle.net>
Michael S. Tsirkin [Tue, 14 Jun 2011 15:06:40 +0000 (18:06 +0300)]
alpha/translate: remve unused variables
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Richard Henderson <rth@twiddle.net>
Michael S. Tsirkin [Tue, 14 Jun 2011 17:15:41 +0000 (20:15 +0300)]
get_maintainer: update to match qemu tree
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Michael S. Tsirkin [Tue, 14 Jun 2011 17:13:42 +0000 (20:13 +0300)]
get_maintainer.pl: copy utility from Linux
Our MAINTAINERS file format matches Linux so
get the utility to parse it from there.
Updated as of linux 3.0-rc3
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Michael S. Tsirkin [Tue, 14 Jun 2011 14:15:34 +0000 (17:15 +0300)]
usb-ehci: move device/vendor/class id to qdev
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Michael S. Tsirkin [Tue, 14 Jun 2011 14:14:52 +0000 (17:14 +0300)]
ppce500: move device/vendor/class id to qdev
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Isaku Yamahata [Tue, 14 Jun 2011 22:37:47 +0000 (07:37 +0900)]
pci: don't call qdev pci init method
As pci id initialization is moved to common layer,
some initialization function can be empty.
So don't call init method if NULL.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Michael S. Tsirkin [Tue, 14 Jun 2011 14:51:11 +0000 (17:51 +0300)]
Merge remote-tracking branch 'origin/master' into pci
Conflicts:
hw/virtio-pci.c
Peter Maydell [Thu, 26 May 2011 16:34:11 +0000 (17:34 +0100)]
hw/9118.c: Implement active-low interrupt support
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>
Andreas Färber [Thu, 2 Jun 2011 17:58:06 +0000 (19:58 +0200)]
Introduce format string for pid_t
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>
Juha Riihimäki [Tue, 31 May 2011 16:48:23 +0000 (17:48 +0100)]
smc91c111: qdevify reset
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>
Blue Swirl [Wed, 15 Jun 2011 18:31:56 +0000 (18:31 +0000)]
Merge branch 'cocoa-for-upstream' of git://repo.or.cz/qemu/afaerber
* '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
Matthew Fernandez [Tue, 7 Jun 2011 16:32:40 +0000 (16:32 +0000)]
Command line support for altering the log file location
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>
Anthony Liguori [Wed, 15 Jun 2011 14:03:49 +0000 (09:03 -0500)]
Merge remote-tracking branch 'alon/pull-libcacard-1' into staging
Anthony Liguori [Wed, 15 Jun 2011 14:03:33 +0000 (09:03 -0500)]
Merge remote-tracking branch 'qemu-kvm/uq/master' into staging
Anthony Liguori [Wed, 15 Jun 2011 14:03:22 +0000 (09:03 -0500)]
Merge remote-tracking branch 'kraxel/usb.16' into staging
Anthony Liguori [Wed, 15 Jun 2011 14:02:18 +0000 (09:02 -0500)]
Merge remote-tracking branch 'kwolf/for-anthony' into staging
Kevin Wolf [Tue, 7 Jun 2011 15:51:21 +0000 (17:51 +0200)]
Allow nested qemu_bh_poll() after BH deletion
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>
Kevin Wolf [Fri, 10 Jun 2011 14:32:13 +0000 (16:32 +0200)]
ide: Clear error_status after restarting flush
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>
Christoph Hellwig [Thu, 19 May 2011 08:58:19 +0000 (10:58 +0200)]
ide: add TRIM support
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>
Christoph Hellwig [Thu, 19 May 2011 08:58:09 +0000 (10:58 +0200)]
ide: allow other dma comands than read and write
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>
Christoph Hellwig [Thu, 19 May 2011 08:57:59 +0000 (10:57 +0200)]
make dma_bdrv_io available to drivers
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>
Kevin Wolf [Thu, 9 Jun 2011 12:15:18 +0000 (14:15 +0200)]
ide: Add forgotten VMSTATE_END_OF_LIST in subsection
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Kevin Wolf [Thu, 9 Jun 2011 12:12:57 +0000 (14:12 +0200)]
ide: Fix ide_drive_pio_state_needed()
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>
Kevin Wolf [Thu, 26 May 2011 13:00:34 +0000 (15:00 +0200)]
ide: Split error status from status register
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>
Kevin Wolf [Tue, 24 May 2011 14:40:02 +0000 (16:40 +0200)]
qcow2: Fix in-flight list after qcow2_cache_put failure
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>
Devin Nakamura [Thu, 9 Jun 2011 05:06:43 +0000 (01:06 -0400)]
Replaced tabs with spaces in block.h and block_int.h
Signed-off-by: Devin Nakamura <devin122@gmail.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Kevin Wolf [Tue, 7 Jun 2011 14:12:58 +0000 (16:12 +0200)]
vdi: Avoid direct AIO callback
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>
Kevin Wolf [Tue, 7 Jun 2011 13:20:44 +0000 (15:20 +0200)]
qcow: Avoid direct AIO callback
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>
Kevin Wolf [Tue, 7 Jun 2011 13:04:32 +0000 (15:04 +0200)]
qcow2: Avoid direct AIO callback
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>
Yang, Wei Y [Mon, 30 May 2011 15:17:42 +0000 (23:17 +0800)]
kvm: Enable CPU SMEP feature
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>
brillywu@viatech.com.cn [Wed, 1 Jun 2011 01:59:52 +0000 (09:59 +0800)]
kvm: Add CPUID support for VIA CPU
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>
Markus Armbruster [Tue, 24 May 2011 16:09:10 +0000 (18:09 +0200)]
usb-ccid: Plug memory leak on qdev exit()
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>
Alon Levy [Sun, 15 May 2011 08:51:28 +0000 (11:51 +0300)]
libcacard: add libcacard.la target
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.
Alon Levy [Sun, 15 May 2011 09:08:59 +0000 (12:08 +0300)]
configure: add libdir and --libdir
Michael Tokarev [Thu, 9 Jun 2011 20:55:57 +0000 (00:55 +0400)]
print meaningful error message in case of --disable-vhost-net
When qemu gets compiled without support of vhost-net, any attempt
to use it fails with a very clear error message:
qemu-system-x86_64: -netdev ...,vhost=on: vhost-net requested but could not be initialized
there's absolutely no reason given _why_ it coult not be
initialized, and even strace'ing the process in question
does not reveal any errors. So print a message telling
what's going on.
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Michael S. Tsirkin [Sun, 12 Jun 2011 13:31:38 +0000 (16:31 +0300)]
virtio: compat event idx support
Disable event index for compat machine types.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Gerd Hoffmann [Fri, 10 Jun 2011 12:38:08 +0000 (14:38 +0200)]
usb-uhci: fix expire time initialization.
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>
Peter Maydell [Tue, 7 Jun 2011 18:50:12 +0000 (19:50 +0100)]
hw/usb-ohci.c: Implement remote wakeup
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>
Peter Maydell [Tue, 7 Jun 2011 19:02:29 +0000 (20:02 +0100)]
hw/usb-ohci.c: Ignore writes to HcPeriodCurrentED register
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>
Brad Hards [Thu, 2 Jun 2011 01:18:48 +0000 (11:18 +1000)]
usb: Use defines for serial bus release number register for EHCI
Signed-off-by: Brad Hards <bradh@frogmouth.net>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Brad Hards [Thu, 2 Jun 2011 01:18:47 +0000 (11:18 +1000)]
usb: Use defines for serial bus release number register for UHCI
Signed-off-by: Brad Hards <bradh@frogmouth.net>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Brad Hards [Thu, 2 Jun 2011 01:18:46 +0000 (11:18 +1000)]
usb: Add defines for USB Serial Bus Release Number register
Signed-off-by: Brad Hards <bradh@frogmouth.net>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Hans de Goede [Tue, 31 May 2011 09:35:29 +0000 (11:35 +0200)]
usb-bus: Don't detach non attached devices on device exit
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>
Hans de Goede [Tue, 31 May 2011 09:35:27 +0000 (11:35 +0200)]
usb-bus: Add knowledge of USB_SPEED_SUPER to usb_speed helper
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Hans de Goede [Tue, 31 May 2011 09:35:26 +0000 (11:35 +0200)]
usb-linux: Enlarge buffer for descriptors to 8192 bytes
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>
Gerd Hoffmann [Wed, 1 Jun 2011 12:41:59 +0000 (14:41 +0200)]
usb: don't call usb_host_device_open from vl.c
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>
Gerd Hoffmann [Mon, 6 Jun 2011 07:45:20 +0000 (09:45 +0200)]
usb-linux: only cleanup in host_close when host_open was successful.
Hans de Goede [Tue, 31 May 2011 09:35:24 +0000 (11:35 +0200)]
usb-linux: Don't try to open the same device twice
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>
Hans de Goede [Tue, 31 May 2011 09:35:22 +0000 (11:35 +0200)]
usb-linux: Ensure devep != 0
So that we don't index endp_table with a negative index.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Hans de Goede [Tue, 31 May 2011 09:35:20 +0000 (11:35 +0200)]
usb-linux: Don't do perror when errno is not set
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>
Hans de Goede [Tue, 31 May 2011 09:35:19 +0000 (11:35 +0200)]
usb-linux: Teach about super speed
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Hans de Goede [Tue, 31 May 2011 09:35:18 +0000 (11:35 +0200)]
usb-linux: Get speed from sysfs rather then from the connectinfo ioctl
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>
Gerd Hoffmann [Tue, 31 May 2011 10:21:43 +0000 (12:21 +0200)]
usb: documentation update
Add some more informations to docs/usb2.txt about using usb2 (also usb1)
devices.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Gerd Hoffmann [Mon, 6 Jun 2011 10:31:34 +0000 (12:31 +0200)]
usb-ehci: split trace calls to handle arg count limits
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Gerd Hoffmann [Mon, 30 May 2011 14:09:08 +0000 (16:09 +0200)]
usb-ehci: itd handling fixes.
This patch fixes a bunch of issues in the itd descriptor handling.
Most important fix is to handle transfers which cross page borders
correctly by looking up the address of the next page. Luckily the
linux uses physically contigous memory so the data used to hits the
correct location even with this bug instead of corrupting guest
memory. Also the transfer length updates for outgoing transfers wasn't
correct.
While being at it DPRINTFs have been replaced by tracepoints.
The isoch_pause logic has been disabled. Not clear to me which propose
this serves and I think it is incorrect too as we just skip processing
itds. Even when no xfer happens we have to clear the active bit.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Kevin O'Connor [Sat, 28 May 2011 15:47:50 +0000 (11:47 -0400)]
The USB tablet should not claim boot protocol support.
The USB tablet advertises that it supports the "boot" protocol.
However, its reports aren't "boot" protocol compatible. So, it
shouldn't claim that.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Kevin O'Connor [Sat, 28 May 2011 15:47:15 +0000 (11:47 -0400)]
Fix USB mouse Set_Protocol behavior
The QEMU USB mouse claims to support the "boot" protocol
(bInterfaceSubClass is 1). However, the mouse rejects the
Set_Protocol command.
The qemu mouse does support the "boot" protocol specification, so a
simple fix is to enable the Set_Protocol request.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Gerd Hoffmann [Fri, 20 May 2011 20:08:44 +0000 (22:08 +0200)]
usb-ehci: drop EXECUTING checks.
The state machine doesn't stop in EXECUTING state any more when async
packets are in flight, so the checks are not needed any more and can
be dropped.
Also kick out the check for the frame timer. As we don't stop & sleep
any more on async packets this is obsolete.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Gerd Hoffmann [Mon, 23 May 2011 15:37:12 +0000 (17:37 +0200)]
usb: cancel async packets on unplug
This patch adds USBBusOps struct with (for now) only a single callback
which is called when a device is about to be destroyed. The USB Host
adapters are implementing this callback and use it to cancel any async
requests which might be in flight before the device actually goes away.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Hans de Goede [Mon, 23 May 2011 12:49:43 +0000 (14:49 +0200)]
ehci: fix a number of unused-but-set-variable warnings (new with gcc-4.6)
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Gerd Hoffmann [Mon, 23 May 2011 07:50:27 +0000 (09:50 +0200)]
usb-ehci: fix error handling.
Set the correct bits for nodev, stall and babble errors.
Raise errint irq. Fix state transition from WRITEBACK
to the next state.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Gerd Hoffmann [Fri, 20 May 2011 15:25:07 +0000 (17:25 +0200)]
usb-ehci: fix offset writeback in ehci_buffer_rw
Two bugs at once:
First the mask is backwards, so the it used to keeps the offset and
clears the page address, which is not what we need when we update the
offset.
Second the offset calculation is wrong in case head isn't page aligned.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Gerd Hoffmann [Thu, 19 May 2011 15:56:19 +0000 (17:56 +0200)]
usb-ehci: multiqueue support
This patch adds support for keeping multiple queues going at the same
time. One slow device will not affect other devices any more.
The patch adds code to manage EHCIQueue structs. It also does a number
of changes to the state machine:
* The state machine will never ever stop in EXECUTING any more.
Instead it will continue with the next queue (aka HORIZONTALQH) when
the usb device returns USB_RET_ASYNC.
* The state machine will stop processing when it figures it walks in
circles (easy to figure now that we have a EHCIQueue struct for each
QH we've processed). The bailout logic should not be needed any
more. For now it is still in, but will assert() in case it triggers.
* The state machine will just skip queues with a async USBPacket in
flight.
* The state machine will resume processing as soon as the async
USBPacket is finished.
The patch also takes care to flush the QH struct back to guest memory
when needed, so we don't get stale data when (re-)loading it from guest
memory in FETCHQH state.
It also makes the writeback code to not touch the first three dwords of
the QH struct as the EHCI must not write them. This actually fixes a
bug where QH chaining changes (next ptr) by the linux ehci driver where
overwritten by the emulated EHCI.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Gerd Hoffmann [Thu, 19 May 2011 08:49:03 +0000 (10:49 +0200)]
usb-ehci: add queue data struct
Add EHCIQueue struct, move the fields needed to track the queue state
into that struct. Pass the new struct instead of ehci state down to
functions which handle the queue state. Lot of variable references have
changed due to that without an actual functional change.
Replace fetch_addr with two variables, one for async and one for
periodic schedule. Add functions to get and set the fetch address.
Use EHCIQueue->usb_status (old name: EHCIState->exec_status) directly in
ehci_execute_complete instead of passing around the status using a
parameters and the return value.
ehci_state_fetchqh returns a EHCIQueue struct now.
No change in behavior.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Gerd Hoffmann [Thu, 19 May 2011 07:24:00 +0000 (09:24 +0200)]
usb-ehci: trace buffer copy
Add a trace point for buffer copies and drop the DPRINTF's.
No change in behavior.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Gerd Hoffmann [Thu, 19 May 2011 06:55:09 +0000 (08:55 +0200)]
usb-ehci: improve mmio tracing
Add a separate tracepoint to log how register values change in response
to a mmio write. Especially useful for registers which have read-only
or clear-on-write bits in them.
No change in behavior.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>