qemu.git
10 years agoirq: Introduce CPU_INTERRUPT_TGT_* defines.
Richard Henderson [Wed, 4 May 2011 20:34:24 +0000 (13:34 -0700)] 
irq: Introduce CPU_INTERRUPT_TGT_* defines.

These defines will be place-holders for cpu-specific functionality.
Generic code will, at the end of the patch series, no longer have to
concern itself about how SMI, NMI, etc should be handled.  Instead,
generic code will know only that the interrupt is internal or external.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
10 years agolsi53c895a: Rename 'sense' to 'status'
Hannes Reinecke [Mon, 2 May 2011 07:54:05 +0000 (09:54 +0200)] 
lsi53c895a: Rename 'sense' to 'status'

The 'sense' field in the HBA status structure is misnamed, as it
actually carries the SCSI status. Rename it.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-trivial@nongnu.org
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agolibcacard: add correct subdirectory dependencies
Paolo Bonzini [Mon, 2 May 2011 07:54:03 +0000 (09:54 +0200)] 
libcacard: add correct subdirectory dependencies

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-trivial@nongnu.org
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agolinux-user: Replace deprecated function
Stefan Weil [Sat, 7 May 2011 20:32:25 +0000 (22:32 +0200)] 
linux-user: Replace deprecated function

Function bzero is deprecated, so replace it by function memset.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix spelling in comments (intruction -> instruction)
Stefan Weil [Sat, 7 May 2011 20:20:03 +0000 (22:20 +0200)] 
Fix spelling in comments (intruction -> instruction)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoac97: Remove unused local variables
Stefan Weil [Sun, 8 May 2011 06:58:11 +0000 (08:58 +0200)] 
ac97: Remove unused local variables

cppcheck report:
hw/ac97.c:1004: style:
 Variable 'written' is assigned a value that is never used
hw/ac97.c:1072: style:
 Variable 'written' is assigned a value that is never used

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typos in comment (threshhold -> threshold, mapp -> map)
Stefan Weil [Thu, 28 Apr 2011 15:20:42 +0000 (17:20 +0200)] 
Fix typos in comment (threshhold -> threshold, mapp -> map)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typo in comment (truely -> truly)
Stefan Weil [Thu, 28 Apr 2011 15:20:41 +0000 (17:20 +0200)] 
Fix typo in comment (truely -> truly)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typo in comment (responsiblity -> responsibility)
Stefan Weil [Thu, 28 Apr 2011 15:20:40 +0000 (17:20 +0200)] 
Fix typo in comment (responsiblity -> responsibility)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typo in comment (relevent -> relevant)
Stefan Weil [Thu, 28 Apr 2011 15:20:39 +0000 (17:20 +0200)] 
Fix typo in comment (relevent -> relevant)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typos in comments and code (occured -> occurred and related)
Stefan Weil [Thu, 28 Apr 2011 15:20:38 +0000 (17:20 +0200)] 
Fix typos in comments and code (occured -> occurred and related)

The code changed here is an unused data type name (evt_flush_occurred).

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typos in comments (neccessary -> necessary)
Stefan Weil [Thu, 28 Apr 2011 15:20:37 +0000 (17:20 +0200)] 
Fix typos in comments (neccessary -> necessary)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typos in comments (instanciation -> instantiation)
Stefan Weil [Thu, 28 Apr 2011 15:20:36 +0000 (17:20 +0200)] 
Fix typos in comments (instanciation -> instantiation)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typos in comments (interupt -> interrupt)
Stefan Weil [Thu, 28 Apr 2011 15:20:35 +0000 (17:20 +0200)] 
Fix typos in comments (interupt -> interrupt)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typos in comments (existance -> existence)
Stefan Weil [Thu, 28 Apr 2011 15:20:34 +0000 (17:20 +0200)] 
Fix typos in comments (existance -> existence)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typos in comments (imediately -> immediately)
Stefan Weil [Thu, 28 Apr 2011 15:20:33 +0000 (17:20 +0200)] 
Fix typos in comments (imediately -> immediately)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typo in comment (dieing -> dying)
Stefan Weil [Thu, 28 Apr 2011 15:20:32 +0000 (17:20 +0200)] 
Fix typo in comment (dieing -> dying)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typo in comment (consistant -> consistent)
Stefan Weil [Thu, 28 Apr 2011 15:20:31 +0000 (17:20 +0200)] 
Fix typo in comment (consistant -> consistent)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typo in comment (embeded -> embedded)
Stefan Weil [Thu, 28 Apr 2011 15:20:30 +0000 (17:20 +0200)] 
Fix typo in comment (embeded -> embedded)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typo in comment (auxilliary -> auxiliary)
Stefan Weil [Thu, 28 Apr 2011 15:20:29 +0000 (17:20 +0200)] 
Fix typo in comment (auxilliary -> auxiliary)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typo in comment (colum -> column)
Stefan Weil [Thu, 28 Apr 2011 15:20:28 +0000 (17:20 +0200)] 
Fix typo in comment (colum -> column)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typos in comments (accessable -> accessible, priveleged -> privileged)
Stefan Weil [Thu, 28 Apr 2011 15:20:27 +0000 (17:20 +0200)] 
Fix typos in comments (accessable -> accessible, priveleged -> privileged)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typos in comments (accross -> across)
Stefan Weil [Thu, 28 Apr 2011 15:20:26 +0000 (17:20 +0200)] 
Fix typos in comments (accross -> across)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoFix typos in comments (dependancy -> dependency)
Stefan Weil [Thu, 28 Apr 2011 15:20:25 +0000 (17:20 +0200)] 
Fix typos in comments (dependancy -> dependency)

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoxen: Add Xen hypercall for sleep state in the cmos_s3 callback.
Anthony PERARD [Tue, 5 Oct 2010 15:40:22 +0000 (16:40 +0100)] 
xen: Add Xen hypercall for sleep state in the cmos_s3 callback.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoxen: Set running state in xenstore.
Anthony PERARD [Mon, 6 Sep 2010 19:07:33 +0000 (20:07 +0100)] 
xen: Set running state in xenstore.

This tells to the xen management tool that the machine can begin run.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoxen: Initialize event channels and io rings
Arun Sharma [Mon, 6 Sep 2010 19:07:14 +0000 (20:07 +0100)] 
xen: Initialize event channels and io rings

Open and bind event channels; map ioreq and buffered ioreq rings.

Signed-off-by: Arun Sharma <arun.sharma@intel.com>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agovl.c: Introduce getter for shutdown_requested and reset_requested.
Anthony PERARD [Thu, 22 Jul 2010 14:52:48 +0000 (15:52 +0100)] 
vl.c: Introduce getter for shutdown_requested and reset_requested.

Introduce two functions qemu_shutdown_requested_get and
qemu_reset_requested_get to get the value of shutdown/reset_requested
without reset it.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agopci: Use of qemu_put_ram_ptr in pci_add_option_rom.
John Baboval [Tue, 22 Mar 2011 14:52:09 +0000 (14:52 +0000)] 
pci: Use of qemu_put_ram_ptr in pci_add_option_rom.

Prevent a deadlock caused by leaving a map cache bucket locked by the
preceding qemu_get_ram_ptr() call.

Signed-off-By: John Baboval <john.baboval@virtualcomputer.com>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoconfigure: Always use 64bits target physical addresses with xen enabled.
Anthony PERARD [Thu, 21 Oct 2010 11:47:08 +0000 (12:47 +0100)] 
configure: Always use 64bits target physical addresses with xen enabled.

With MapCache, we can handle a 64b target, even with a 32b host/qemu.
So, we need to have target_phys_addr_t to 64bits.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoIntroduce qemu_put_ram_ptr
Anthony PERARD [Thu, 16 Sep 2010 12:57:49 +0000 (13:57 +0100)] 
Introduce qemu_put_ram_ptr

This function allows to unlock a ram_ptr give by qemu_get_ram_ptr. After
a call to qemu_put_ram_ptr, the pointer may be unmap from QEMU when
used with Xen.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoxen: Adds a cap to the number of map cache entries.
John Baboval [Tue, 22 Mar 2011 14:50:28 +0000 (14:50 +0000)] 
xen: Adds a cap to the number of map cache entries.

Adds a cap to the number of map cache entries. This prevents the map
cache from overwhelming system memory.

I also removed the bitmap macros and #included bitmap.h instead.

Signed-off-By: John Baboval <john.baboval@virtualcomputer.com>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoxen: Introduce the Xen mapcache
Jun Nakajima [Tue, 31 Aug 2010 15:41:25 +0000 (16:41 +0100)] 
xen: Introduce the Xen mapcache

On IA32 host or IA32 PAE host, at present, generally, we can't create
an HVM guest with more than 2G memory, because generally it's almost
impossible for Qemu to find a large enough and consecutive virtual
address space to map an HVM guest's whole physical address space.
The attached patch fixes this issue using dynamic mapping based on
little blocks of memory.

Each call to qemu_get_ram_ptr makes a call to qemu_map_cache with the
lock option, so mapcache will not unmap these ram_ptr.

Blocks that do not belong to the RAM, but usually to a device ROM or to
a framebuffer, are handled in a separate function. So the whole RAMBlock
can be map.

Signed-off-by: Jun Nakajima <jun.nakajima@intel.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>
10 years agoxen: Introduce Xen Interrupt Controller
Anthony PERARD [Wed, 30 Jun 2010 16:50:10 +0000 (17:50 +0100)] 
xen: Introduce Xen Interrupt Controller

Every set_irq call makes a Xen hypercall.

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>
10 years agopiix_pci: Introduces Xen specific call for irq.
Anthony PERARD [Fri, 16 Jul 2010 13:55:39 +0000 (14:55 +0100)] 
piix_pci: Introduces Xen specific call for irq.

This patch introduces Xen specific call in piix_pci.

The specific part for Xen is in write_config, set_irq and get_pirq.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agopc, Disable vmport initialisation with Xen.
Anthony PERARD [Tue, 3 May 2011 16:06:54 +0000 (17:06 +0100)] 
pc, Disable vmport initialisation with Xen.

This is because there is not synchronisation of the vcpu register
between Xen and QEMU, so vmport can't work properly.

This patch introduces no_vmport parameter to pc_basic_device_init.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoxen: Add xenfv machine
Anthony PERARD [Wed, 30 Jun 2010 11:58:34 +0000 (12:58 +0100)] 
xen: Add xenfv machine

Introduce the Xen FV (Fully Virtualized) machine to Qemu, some more Xen
specific call will be added in further patches.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agopc_memory_init: Move memory calculation to the caller.
Anthony PERARD [Mon, 11 Apr 2011 18:48:11 +0000 (19:48 +0100)] 
pc_memory_init: Move memory calculation to the caller.

This patch moves above_4g_mem_size and below_4g_mem_size calculation in
the caller of pc_memory_init (pc_init1). And the prototype of
pc_memory_init is changed because there is no need anymore to have
variable pointer and the ram_size parameter.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoxen: Add initialisation of Xen
Anthony PERARD [Thu, 19 Aug 2010 11:27:56 +0000 (12:27 +0100)] 
xen: Add initialisation of Xen

The xenpv machine use the common init function.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoxen: Support new libxc calls from xen unstable.
Anthony PERARD [Fri, 25 Feb 2011 16:20:34 +0000 (16:20 +0000)] 
xen: Support new libxc calls from xen unstable.

This patch updates the libxenctrl calls in Qemu to use the new interface,
otherwise Qemu wouldn't be able to build against new versions of the
library.

We check libxenctrl version in configure, from Xen 3.3.0 to Xen
unstable.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoxen: Make Xen build once.
Anthony PERARD [Tue, 29 Mar 2011 17:39:00 +0000 (18:39 +0100)] 
xen: Make Xen build once.

xen_domainbuild and xen_machine_pv are built only for i386 targets.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoxen: Replace some tab-indents with spaces (clean-up).
Anthony PERARD [Thu, 23 Sep 2010 11:28:45 +0000 (12:28 +0100)] 
xen: Replace some tab-indents with spaces (clean-up).

And put braces for blocks with a single statement.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agomachine, Add default_machine_opts to QEMUMachine.
Anthony PERARD [Mon, 22 Nov 2010 15:44:15 +0000 (15:44 +0000)] 
machine, Add default_machine_opts to QEMUMachine.

With this new field, we can specified which accelerator use to run the
machine, if the accelerator is not already specified by either a
configuration file or the command line options.

Currently, the only use will be made in the xenfv machine.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoIntroduce -machine command option.
Anthony PERARD [Tue, 21 Sep 2010 19:05:31 +0000 (20:05 +0100)] 
Introduce -machine command option.

This option gives the ability to switch one "accelerator" like kvm, xen
or the default one tcg. We can specify more than one accelerator by
separate them by a colon. QEMU will try each one and use the first whose
works.

So,
./qemu -machine accel=xen:kvm:tcg

which would try Xen support first, then KVM and finally TCG if none of
the other works.

By default, QEMU will use TCG. But we can specify another default in the
global configuration file.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoFix typo in code and comments
Stefan Weil [Tue, 26 Apr 2011 08:29:36 +0000 (10:29 +0200)] 
Fix typo in code and comments

Replace writeable -> writable

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
10 years agoMerge remote-tracking branch 'mst/for_anthony' into staging
Anthony Liguori [Thu, 5 May 2011 18:05:32 +0000 (13:05 -0500)] 
Merge remote-tracking branch 'mst/for_anthony' into staging

10 years agoMerge remote-tracking branch 'kraxel/usb.7.pull' into staging
Anthony Liguori [Thu, 5 May 2011 18:04:57 +0000 (13:04 -0500)] 
Merge remote-tracking branch 'kraxel/usb.7.pull' into staging

10 years agoMerge remote branch 'origin/master' into pci
Michael S. Tsirkin [Thu, 5 May 2011 13:39:47 +0000 (16:39 +0300)] 
Merge remote branch 'origin/master' into pci

Conflicts:
exec.c

10 years agoCPUPhysMemoryClient: Pass guest physical address not region offset
Alex Williamson [Tue, 3 May 2011 18:36:46 +0000 (12:36 -0600)] 
CPUPhysMemoryClient: Pass guest physical address not region offset

When we're trying to get a newly registered phys memory client updated
with the current page mappings, we end up passing the region offset
(a ram_addr_t) as the start address rather than the actual guest
physical memory address (target_phys_addr_t).  If your guest has less
than 3.5G of memory, these are coincidentally the same thing.  If
there's more, the region offset for the memory above 4G starts over
at 0, so the set_memory client will overwrite it's lower memory entries.

Instead, keep track of the guest phsyical address as we're walking the
tables and pass that to the set_memory client.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
10 years agoCPUPhysMemoryClient: Fix typo in phys memory client registration
Alex Williamson [Tue, 3 May 2011 18:36:32 +0000 (12:36 -0600)] 
CPUPhysMemoryClient: Fix typo in phys memory client registration

When we register a physical memory client, we try to walk the page
tables, calling the set_memory hook for every entry.  Effectively
playing catchup for the client for everything already registered.
With this type, we only walk the 2nd entry of the l1 table,
typically missing all of the registered memory.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
10 years agopci: Add class 0x403 as 'audio controller'
Jan Kiszka [Mon, 2 May 2011 18:01:37 +0000 (20:01 +0200)] 
pci: Add class 0x403 as 'audio controller'

Used by HD audio controllers like our intel-hda.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
10 years agoMSI: Robust resource release
Jan Kiszka [Mon, 2 May 2011 18:00:47 +0000 (20:00 +0200)] 
MSI: Robust resource release

msi_init may fail, so we need to check on uninit if the cap was
actually installed. This also avoids that the users need to check.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
10 years agoeepro100: Support 32 bit read/write access to flash register
Stefan Weil [Sat, 30 Apr 2011 20:40:13 +0000 (22:40 +0200)] 
eepro100: Support 32 bit read/write access to flash register

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
10 years agoeepro100: Support byte read access to general control register
Stefan Weil [Sat, 30 Apr 2011 20:40:12 +0000 (22:40 +0200)] 
eepro100: Support byte read access to general control register

The general control register is a byte register.
Add support for byte reads.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
10 years agoeepro100: Support byte/word read/write access to MDI control register
Stefan Weil [Sat, 30 Apr 2011 20:40:11 +0000 (22:40 +0200)] 
eepro100: Support byte/word read/write access to MDI control register

MDI control is a 32 bit register, but may be read or written using
8 or 16 bit access. Data is latched when the MSB is written.

Add support for byte/word read/write access.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
10 years agoeepro100: Support byte/word writes to pointer register
Stefan Weil [Sat, 30 Apr 2011 20:40:10 +0000 (22:40 +0200)] 
eepro100: Support byte/word writes to pointer register

pointer is a 32 bit register, but may be written using 8 or 16 bit writes.
Add support for byte/word writes.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
10 years agoeepro100: Support byte/word writes to port address
Stefan Weil [Sat, 30 Apr 2011 20:40:09 +0000 (22:40 +0200)] 
eepro100: Support byte/word writes to port address

port is a 32 bit register, but may be written using 8 or 16 bit writes.
Add support for byte/word writes.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
10 years agoeepro100: Fix endianness issues
Stefan Weil [Sat, 30 Apr 2011 20:40:08 +0000 (22:40 +0200)] 
eepro100: Fix endianness issues

Like other Intel devices, e100 (eepro100) uses little endian byte order.

This patch was tested with these combinations:

i386 host, i386 + mipsel guests (le-le)
mipsel host, i386 guest (le-le)
i386 host, mips + ppc guests (le-be)
mips host, i386 guest (be-le)

mips and mipsel hosts were emulated machines.

v2:
Use prefix for new functions. Add the same prefix to stl_le_phys.
Fix alignment of mem (needed for word/dword reads/writes).

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
10 years agoeepro100: Pad received short frames
Stefan Weil [Sat, 30 Apr 2011 20:40:07 +0000 (22:40 +0200)] 
eepro100: Pad received short frames

QEMU sends frames smaller than 60 bytes to ethernet nics.
Such frames are rejected by real NICs and their emulations.
To avoid this behaviour, other NIC emulations pad received
frames. This patch enables this workaround for eepro100, too.

All related code is marked with CONFIG_PAD_RECEIVED_FRAMES,
so we can drop this in case QEMU's networking code is
ever changed.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
10 years agoeepro100: Remove unused structure element
Stefan Weil [Sat, 30 Apr 2011 20:40:06 +0000 (22:40 +0200)] 
eepro100: Remove unused structure element

cppcheck reports that 'packet' is unused.

It was only used to calculate the size of the preceding data.
Removing it saves a lot of stack space (local variable rx).

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
10 years agoeepro100: Remove type casts which are no longer needed
Stefan Weil [Sat, 30 Apr 2011 20:40:05 +0000 (22:40 +0200)] 
eepro100: Remove type casts which are no longer needed

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
10 years agoeepro100: Avoid duplicate debug messages
Stefan Weil [Sat, 30 Apr 2011 20:40:04 +0000 (22:40 +0200)] 
eepro100: Avoid duplicate debug messages

When DEBUG_EEPRO100 was enabled, unsupported writes were logged twice.
Now logging in eepro100_write1 and eepro100_write2 is similar to the
logging in eepro100_write4 (which already was correct).

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
10 years agousb: mass storage fix
Gerd Hoffmann [Wed, 4 May 2011 14:49:56 +0000 (16:49 +0200)] 
usb: mass storage fix

Initialize scsi_len with zero when starting a new request, so any
stuff leftover from the previous request is cleared out.  This may
happen in case the data returned by the scsi command doesn't fit
into the buffer provided by the guest.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agousb: move complete callback to port ops
Gerd Hoffmann [Thu, 16 Dec 2010 16:03:44 +0000 (17:03 +0100)] 
usb: move complete callback to port ops

10 years agomusb: get musb state via container_of()
Gerd Hoffmann [Thu, 16 Dec 2010 12:23:13 +0000 (13:23 +0100)] 
musb: get musb state via container_of()

10 years agoohci: get ohci state via container_of()
Gerd Hoffmann [Wed, 15 Dec 2010 10:47:19 +0000 (11:47 +0100)] 
ohci: get ohci state via container_of()

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agouhci: keep uhci state pointer in async packet struct.
Gerd Hoffmann [Wed, 15 Dec 2010 09:26:15 +0000 (10:26 +0100)] 
uhci: keep uhci state pointer in async packet struct.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agouhci: switch to QTAILQ
Gerd Hoffmann [Tue, 14 Dec 2010 17:19:47 +0000 (18:19 +0100)] 
uhci: switch to QTAILQ

10 years agousb: control buffer fixes
Hans de Goede [Wed, 2 Feb 2011 16:46:00 +0000 (17:46 +0100)] 
usb: control buffer fixes

Windows allows control transfers to pass up to 4k of data, so raise our
control buffer size to 4k. For control out transfers the usb core code copies
the control request data to a buffer before calling the device's handle_control
callback. Add a check for overflowing the buffer before copying the data.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
10 years agousb-linux: Add support for buffering iso out usb packets
Hans de Goede [Fri, 26 Nov 2010 18:11:03 +0000 (19:11 +0100)] 
usb-linux: Add support for buffering iso out usb packets

Extend the iso buffering code to also buffer iso out packets, this
fixes for example using usb speakers with usb redirection.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
10 years agousb-linux: We only need to keep track of 15 endpoints
Hans de Goede [Fri, 26 Nov 2010 14:02:16 +0000 (15:02 +0100)] 
usb-linux: We only need to keep track of 15 endpoints

Currently we reserve room for endpoint data for 16 endpoints, but given
that we only use endpoint data for endpoints 1-15, and always index the
array with the endpoint-number - 1, 15 is enough.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
10 years agousb-linux: Refuse iso packets when max packet size is 0 (alt setting 0)
Hans de Goede [Fri, 26 Nov 2010 13:59:35 +0000 (14:59 +0100)] 
usb-linux: Refuse iso packets when max packet size is 0 (alt setting 0)

Refuse iso usb packets when then max packet size for the endpoint is 0,
this avoids an abort in usb_host_alloc_iso() caused by trying to qemu_malloc
a 0 bytes large buffer.

10 years agousb-linux: Refuse packets for endpoints which are not in the usb descriptor
Hans de Goede [Fri, 26 Nov 2010 13:56:17 +0000 (14:56 +0100)] 
usb-linux: Refuse packets for endpoints which are not in the usb descriptor

If an endpoint is not in the usb descriptor we've no idea what kind of
endpoint it is and thus how to handle it, refuse packages in this case.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
10 years agousb-linux: Add support for buffering iso usb packets
Hans de Goede [Fri, 26 Nov 2010 10:41:08 +0000 (11:41 +0100)] 
usb-linux: Add support for buffering iso usb packets

Currently we are submitting iso packets to the host one at a time, as we
receive them from the emulated host controller. This has 2 problems:
1) If we were fast enough to submit every packet in time for the next host host
controller usb frame, we would be generating 1000 hardware interrupts per
second on the host
2) We are not fast enough to submit every packet in time for the next host host
controller usb frame, causing us to not submit iso urbs in some usb frames
which causes devices with an endpoint with an interval of 1 ms (so every
frame) to loose data. This causes for example ubs-1.1 webcams to not work
properly (usb-2.0 is not supported at all atm).

This patch fixes both problems by changing the iso packet pass through handling
to buffer packets. This version only does so for iso input packets (webcams,
audio in) I'm working on a second patch extending this to iso output packets
(audio out).

This patch makes use of the linux batching of iso packets in one urb.
When an iso in packet gets received from the emulated host controller,
it immediately submits 3 urbs with 32 iso in packets each. This causes
the host to only get an hw interrupt every 32 packets dropping the
interrupt rate to 32 interrupts per second and gives it a queue of urbs
to work from once the first 32 iso in packets have been received to make sure
no packets are dropped.

Besides submitting a whole bunch or urbs as soon as the first urb is
received, effectively creating a buffer inside the kernel, this patch also
gets rid of the asynchroneous completion for iso in urbs. Instead they are
only marked as complete in the fd write callback (which usbfs uses to signal
complete urbs). These complete packets then get consumed by returning them
synchroneously to the emulated host controller when it submits an iso in
packet for the ep in question. When no complete packets are ready (which
happens when the stream is starting) a 0 length packet gets returned to
the emulated host controller.

With this patch I've several usb-1.1 webcams working well with usb pass
through, where as without this patch none of them work.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
10 years agousb-linux: Get the alt. setting from sysfs rather then asking the dev
Hans de Goede [Wed, 24 Nov 2010 11:57:59 +0000 (12:57 +0100)] 
usb-linux: Get the alt. setting from sysfs rather then asking the dev

At least one device I have lies when receiving a USB_REQ_GET_INTERFACE,
always returning 0 even if the alternate setting is different. This is
likely caused because in practice this control message is never used as
the operating system's usb stack knows which alternate setting it has
told the device to get into, and thus this ctrl message does not get
tested by device manufacturers.

When usb_fs_type == USB_FS_SYS, the active alt. setting can be read directly
from sysfs, which allows using this device through qemu's usb redirection.
More in general it seems a good idea to not send needless control msg's to
devices, esp. as the code in question is called every time a set_interface
is done. Which happens multiple times during virtual machine startup, and
when device drivers are activating the usb device.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
10 years agousb-linux: introduce a usb_linux_alt_setting function
Hans de Goede [Wed, 24 Nov 2010 11:50:00 +0000 (12:50 +0100)] 
usb-linux: introduce a usb_linux_alt_setting function

The next patch in this series introduces multiple ways to get the
alt setting dependent upon usb_fs_type, it is cleaner to put this
into its own function.

Note that this patch also changes the assumed alt setting in case
of an error getting the alt setting to be 0 (a sane default) rather
then the interface numberwhich makes no sense.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
10 years agospice: drop obsolete iothread locking
Gerd Hoffmann [Wed, 27 Apr 2011 14:06:10 +0000 (16:06 +0200)] 
spice: drop obsolete iothread locking

We don't use qemu internals from spice server context any more.
Thus we don't also need to grab the iothread mutex from spice
server context.  And we don't have to temporarely release the
lock to avoid deadlocks.  Drop all the calls.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agospice: don't call displaystate callbacks from spice server context.
Gerd Hoffmann [Wed, 27 Apr 2011 13:50:32 +0000 (15:50 +0200)] 
spice: don't call displaystate callbacks from spice server context.

This patch moves the displaystate callback calls for setting the cursor
and the mouse pointer from spice server to qemu (iothread) context.
This allows us to simplify locking.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agospice: don't create updates in spice server context.
Gerd Hoffmann [Wed, 27 Apr 2011 13:21:51 +0000 (15:21 +0200)] 
spice: don't create updates in spice server context.

This patch moves the creation of spice screen updates from the spice
server context to qemu iothread context (display refresh timer to be
exact).  This way we avoid accessing qemu internals (display surface)
from spice thread context which in turn allows us to simplify locking.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoMake spice dummy functions inline to fix calls not checking return values
Jes Sorensen [Tue, 1 Feb 2011 14:53:23 +0000 (15:53 +0100)] 
Make spice dummy functions inline to fix calls not checking return values

qemu_spice_set_passwd() and qemu_spice_set_pw_expire() dummy functions
needs to be inline, in order to handle the case where they are called
without checking the return value.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoNBD: Avoid leaking a couple of strings when the NBD device is closed
Nick Thomas [Thu, 28 Apr 2011 15:20:01 +0000 (16:20 +0100)] 
NBD: Avoid leaking a couple of strings when the NBD device is closed

Signed-off-by: Nick Thomas <nick@bytemark.co.uk>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoqemu-progress.c: printf isn't signal safe
Jes Sorensen [Thu, 28 Apr 2011 11:58:30 +0000 (13:58 +0200)] 
qemu-progress.c: printf isn't signal safe

Change the signal handling to indicate a signal is pending, rather
then printing directly from the signal handler.

In addition make the signal prints go to stderr, rather than stdout.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoide/atapi: fix set but unused
Alon Levy [Thu, 28 Apr 2011 13:34:39 +0000 (16:34 +0300)] 
ide/atapi: fix set but unused

Signed-off-by: Alon Levy <alevy@redhat.com>
Acked-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoatapi: Explain why we need a 'media not present' state
Amit Shah [Thu, 28 Apr 2011 14:34:41 +0000 (20:04 +0530)] 
atapi: Explain why we need a 'media not present' state

After the re-org of the atapi code, it might not be intuitive for a
reader of the code to understand why we're inserting a 'media not
present' state between cd changes.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoatapi: Move comment to proper place
Amit Shah [Thu, 28 Apr 2011 14:34:40 +0000 (20:04 +0530)] 
atapi: Move comment to proper place

Move misplaced comment for media_is_dvd()

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agoqemu-img resize: Fix option parsing
Kevin Wolf [Fri, 29 Apr 2011 08:58:12 +0000 (10:58 +0200)] 
qemu-img resize: Fix option parsing

For shrinking images, you're supposed to use a negative size. However, the
leading minus makes getopt think that it's an option and so you get the help
text if you don't use -- like in 'qemu-img resize test.img -- -1G'.

This patch handles the size first and removes it from the argument list so that
getopt won't even try to interpret it and you don't need -- any more.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
10 years agolm32: add Milkymist Minimac2 support
Michael Walle [Tue, 12 Apr 2011 22:29:36 +0000 (00:29 +0200)] 
lm32: add Milkymist Minimac2 support

This patch adds support for Milkymist's minimal Ethernet MAC v2. It
superseds minimac1.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
10 years agomilkymist-sysctl: fix timers
Michael Walle [Tue, 12 Apr 2011 22:29:35 +0000 (00:29 +0200)] 
milkymist-sysctl: fix timers

Prevent timers from firing right after starting.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
10 years agomilkymist-vgafb: fix console resizing
Michael Walle [Tue, 12 Apr 2011 22:29:34 +0000 (00:29 +0200)] 
milkymist-vgafb: fix console resizing

After enabling the framebuffer, ensure that the console is resized.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
10 years agolm32: fix exception handling
Michael Walle [Tue, 12 Apr 2011 22:29:33 +0000 (00:29 +0200)] 
lm32: fix exception handling

Global interrupt enable bit is already saved within the exception handler
helper routine. Thus remove extra code in translation routines.

Additionally, debug exceptions has always DEBA as base address.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
10 years agokvm: use qemu_free consistently
Paolo Bonzini [Mon, 2 May 2011 07:54:04 +0000 (09:54 +0200)] 
kvm: use qemu_free consistently

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
10 years agofix crash in migration, 32-bit userspace on 64-bit host
Michael Tokarev [Tue, 26 Apr 2011 16:13:49 +0000 (20:13 +0400)] 
fix crash in migration, 32-bit userspace on 64-bit host

This change fixes a long-standing immediate crash (memory corruption
and abort in glibc malloc code) in migration on 32bits.

The bug is present since this commit:

  commit 692d9aca97b865b0f7903565274a52606910f129
  Author: Bruce Rogers <brogers@novell.com>
  Date:   Wed Sep 23 16:13:18 2009 -0600

    qemu-kvm: allocate correct size for dirty bitmap

    The dirty bitmap copied out to userspace is stored in a long array,
    and gets copied out to userspace accordingly.  This patch accounts
    for that correctly.  Currently I'm seeing kvm crashing due to writing
    beyond the end of the alloc'd dirty bitmap memory, because the buffer
    has the wrong size.

Signed-off-by: Bruce Rogers
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
 --- a/qemu-kvm.c
 +++ b/qemu-kvm.c
 @@ int kvm_get_dirty_pages_range(kvm_context_t kvm, unsigned long phys_addr,
 -            buf = qemu_malloc((slots[i].len / 4096 + 7) / 8 + 2);
 +            buf = qemu_malloc(BITMAP_SIZE(slots[i].len));
             r = kvm_get_map(kvm, KVM_GET_DIRTY_LOG, i, buf);

BITMAP_SIZE is now open-coded in that function, like this:

 size = ALIGN(((mem->memory_size) >> TARGET_PAGE_BITS), HOST_LONG_BITS) / 8;

The problem is that HOST_LONG_BITS in 32bit userspace is 32
but it's 64 in 64bit kernel.  So userspace aligns this to
32, and kernel to 64, but since no length is passed from
userspace to kernel on ioctl, kernel uses its size calculation
and copies 4 extra bytes to userspace, corrupting memory.

Here's how it looks like during migrate execution:

our=20, kern=24
our=4, kern=8
...
our=4, kern=8
our=4064, kern=4064
our=512, kern=512
our=4, kern=8
our=20, kern=24
our=4, kern=8
...
our=4, kern=8
our=4064, kern=4064
*** glibc detected *** ./x86_64-softmmu/qemu-system-x86_64: realloc(): invalid next size: 0x08f20528 ***

(our is userspace size above, kern is the size as calculated
by the kernel).

Fix this by always aligning to 64 in a hope that no platform will
have sizeof(long)>8 any time soon, and add a comment describing it
all.  It's a small price to pay for bad kernel design.

Alternatively it's possible to fix that in the kernel by using
different size calculation depending on the current process.
But this becomes quite ugly.

Special thanks goes to Stefan Hajnoczi for spotting the fundamental
cause of the issue, and to Alexander Graf for his support in #qemu.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
CC: Bruce Rogers <brogers@novell.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
10 years agokvm: Install specialized interrupt handler
Jan Kiszka [Tue, 12 Apr 2011 23:32:56 +0000 (01:32 +0200)] 
kvm: Install specialized interrupt handler

KVM only requires to set the raised IRQ in CPUState and to kick the
receiving vcpu if it is remote. Installing a specialized handler allows
potential future changes to the TCG code path without risking KVM side
effects.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
10 years agoRedirect cpu_interrupt to callback handler
Jan Kiszka [Tue, 12 Apr 2011 23:32:56 +0000 (01:32 +0200)] 
Redirect cpu_interrupt to callback handler

This allows to override the interrupt handling of QEMU in system mode.
KVM will make use of it to set a specialized handler.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
10 years agoBreak up user and system cpu_interrupt implementations
Jan Kiszka [Tue, 12 Apr 2011 23:32:56 +0000 (01:32 +0200)] 
Break up user and system cpu_interrupt implementations

Both have only two lines in common, and we will convert the system
service into a callback which is of no use for user mode operation.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
CC: Riku Voipio <riku.voipio@iki.fi>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
10 years agokvm: create kvmclock when one of the flags are present
Glauber Costa [Thu, 17 Mar 2011 22:42:07 +0000 (19:42 -0300)] 
kvm: create kvmclock when one of the flags are present

kvmclock presence can be signalled by two different flags. So for
device creation, we have to test for both.

Signed-off-by: Glauber Costa <glommer@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
10 years agokvm: add kvmclock to its second bit
Glauber Costa [Thu, 17 Mar 2011 22:42:06 +0000 (19:42 -0300)] 
kvm: add kvmclock to its second bit

We have two bits that can represent kvmclock in cpuid.
They signal the guest which msr set to use. When we tweak flags
involving this value - specially when we use "-", we have to act on both.

Signed-off-by: Glauber Costa <glommer@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
10 years agox86: Allow multiple cpu feature matches of lookup_feature
Jan Kiszka [Tue, 19 Apr 2011 11:06:06 +0000 (13:06 +0200)] 
x86: Allow multiple cpu feature matches of lookup_feature

kvmclock is represented by two feature bits. Therefore, lookup_feature
needs to continue its search even after the first match. Enhance it
accordingly and switch to a bool return type at this chance.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
10 years agokvm: use kernel-provided para_features instead of statically coming up with new capab...
Glauber Costa [Thu, 17 Mar 2011 22:42:05 +0000 (19:42 -0300)] 
kvm: use kernel-provided para_features instead of statically coming up with new capabilities

Use the features provided by KVM_GET_SUPPORTED_CPUID directly to
mask out features from guest-visible cpuid.

The old get_para_features() mechanism is kept for older kernels that do not implement it.

Signed-off-by: Glauber Costa <glommer@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
10 years agoDon't zero out buffer in sched_getaffinity
Mike McCormack [Mon, 18 Apr 2011 05:43:36 +0000 (14:43 +0900)] 
Don't zero out buffer in sched_getaffinity

The kernel doesn't fill the buffer provided to sched_getaffinity
with zero bytes, so neither should QEMU.

Signed-off-by: Mike McCormack <mj.mccormack@samsung.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>