]> git.proxmox.com Git - qemu.git/log
qemu.git
13 years agosparc64: fix incorrect BPcc target sign extension
Blue Swirl [Sat, 14 May 2011 07:14:57 +0000 (07:14 +0000)]
sparc64: fix incorrect BPcc target sign extension

Fix wrong number of bits used when sign extending the branch offset of BPcc
instructions.

Reported-by: Artyom Tarasenko <atar4qemu@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agosparc64: fix wrpstate and wrtl on delay slot
Blue Swirl [Tue, 26 Apr 2011 18:44:20 +0000 (18:44 +0000)]
sparc64: fix wrpstate and wrtl on delay slot

Use TCG local to work around TCG register flush due to a branch.

Thanks to Artyom Tarasenko, Igor Kovalenko and Aurelien Jarno.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agoMerge remote-tracking branch 'stefanha/trivial-patches' into staging
Anthony Liguori [Thu, 12 May 2011 13:08:12 +0000 (08:08 -0500)]
Merge remote-tracking branch 'stefanha/trivial-patches' into staging

Conflicts:
cpu-all.h

13 years agoMerge remote-tracking branch 'agraf/xen-next' into staging
Anthony Liguori [Thu, 12 May 2011 13:06:06 +0000 (08:06 -0500)]
Merge remote-tracking branch 'agraf/xen-next' into staging

13 years agousb-linux: Add missing break statement
Stefan Weil [Sat, 7 May 2011 20:10:53 +0000 (22:10 +0200)]
usb-linux: Add missing break statement

cppcheck report:
usb-linux.c:661: warning: Redundant assignment of "len" in switch

Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
13 years agousb-musb: uninline functions
Gerd Hoffmann [Mon, 9 May 2011 07:44:03 +0000 (09:44 +0200)]
usb-musb: uninline functions

Prototype without "inline" keyword breaks the build with some gcc
versions.  Noticed by Alexander Graf.

Fix this by removing the inline keywork everywhere.  Some functions
can't be inlined anyway as the are referenced using function pointers.
Beside that gcc does a pretty good job on auto-inlining these days.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
13 years agoirq: Privatize CPU_INTERRUPT_NMI.
Richard Henderson [Wed, 4 May 2011 20:34:31 +0000 (13:34 -0700)]
irq: Privatize CPU_INTERRUPT_NMI.

This interrupt name is used by i386, CRIS, and MicroBlaze.
Copy the name into each target.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agotarget-i386: Privatize some i386-specific interrupt names.
Richard Henderson [Wed, 4 May 2011 20:34:30 +0000 (13:34 -0700)]
target-i386: Privatize some i386-specific interrupt names.

SMI, VIRQ, INIT, SIPI, and MCE are all only used by the i386 port.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agotarget-arm: Privatize CPU_INTERRUPT_FIQ.
Richard Henderson [Wed, 4 May 2011 20:34:29 +0000 (13:34 -0700)]
target-arm: Privatize CPU_INTERRUPT_FIQ.

This interrupt name was only used by the ARM port.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agoirq: Remove CPU_INTERRUPT_TIMER.
Richard Henderson [Wed, 4 May 2011 20:34:28 +0000 (13:34 -0700)]
irq: Remove CPU_INTERRUPT_TIMER.

It is no longer used anywhere.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agotarget-sparc: Do not check CPU_INTERRUPT_TIMER.
Richard Henderson [Wed, 4 May 2011 20:34:27 +0000 (13:34 -0700)]
target-sparc: Do not check CPU_INTERRUPT_TIMER.

This bit is never set, therefore we should not read it either.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agotarget-mips: Do not check CPU_INTERRUPT_TIMER.
Richard Henderson [Wed, 4 May 2011 20:34:26 +0000 (13:34 -0700)]
target-mips: Do not check CPU_INTERRUPT_TIMER.

This bit is never set, therefore we should not read it either.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 years agoirq: Introduce and use CPU_INTERRUPT_SSTEP_MASK.
Richard Henderson [Wed, 4 May 2011 20:34:25 +0000 (13:34 -0700)]
irq: Introduce and use CPU_INTERRUPT_SSTEP_MASK.

This mask contains all of the bits that should be ignored while single
stepping in the debugger.  The mask contains 2 bits that are not currently
cleared, but are also never set.  The bits are included in the mask for
consistency in handling of the CPU_INTERRUPT_TGT_EXT_N bits.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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

13 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

13 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

13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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

13 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()

13 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>
13 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>
13 years agouhci: switch to QTAILQ
Gerd Hoffmann [Tue, 14 Dec 2010 17:19:47 +0000 (18:19 +0100)]
uhci: switch to QTAILQ

13 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>
13 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>
13 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>
13 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.

13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>
13 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>