]> git.proxmox.com Git - qemu.git/log
qemu.git
12 years agousb-hub: remove unused descriptor arrays
Gerd Hoffmann [Thu, 7 Jul 2011 13:02:58 +0000 (15:02 +0200)]
usb-hub: remove unused descriptor arrays

Somehow they where left over when converting the hub
to the new usb descriptor infrastructure ...

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb: fixup bluetooth descriptors
Gerd Hoffmann [Wed, 6 Jul 2011 10:40:28 +0000 (12:40 +0200)]
usb: fixup bluetooth descriptors

Commit 4696425cd05c7baa0a4b469d43ba4b8488bcfc0f changes some
endpoints from isocrounous to interrupt by mistake.  Fix it.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb_register_port(): do not set port->opaque and port->index twice
Jes Sorensen [Mon, 4 Jul 2011 15:33:05 +0000 (17:33 +0200)]
usb_register_port(): do not set port->opaque and port->index twice

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb: update documentation
Gerd Hoffmann [Tue, 5 Jul 2011 14:58:41 +0000 (16:58 +0200)]
usb: update documentation

Add a paragraph on companion controller mode and a
configuration file which sets it all up for you.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoehci: add ich9 controller.
Gerd Hoffmann [Fri, 1 Jul 2011 09:51:02 +0000 (11:51 +0200)]
ehci: add ich9 controller.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoehci: fix port count.
Gerd Hoffmann [Fri, 1 Jul 2011 07:56:43 +0000 (09:56 +0200)]
ehci: fix port count.

The ICH4 EHCI controller which we emulate has six ports not four.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agouhci: add ich9 controllers
Gerd Hoffmann [Fri, 1 Jul 2011 07:48:49 +0000 (09:48 +0200)]
uhci: add ich9 controllers

Add ich9 controllers,  Factor out properties to a separate
struct and reference it to reduce duplication.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agopci: add ich9 usb controller ids
Gerd Hoffmann [Fri, 1 Jul 2011 09:45:02 +0000 (11:45 +0200)]
pci: add ich9 usb controller ids

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-ohci: Add support for being a companion controller
Hans de Goede [Fri, 24 Jun 2011 18:29:05 +0000 (20:29 +0200)]
usb-ohci: Add support for being a companion controller

To use as a companion controller, use pci-ohci as device and set the
masterbus and num-ports properties, ie:

-device usb-ehci,addr=0b.1,multifunction=on,id=ehci0
-device pci-ohci,addr=0b.0,multifunction=on,masterbus=ehci0.0,num-ports=4

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-uhci: Add support for being a companion controller
Hans de Goede [Fri, 24 Jun 2011 15:44:53 +0000 (17:44 +0200)]
usb-uhci: Add support for being a companion controller

To use as a companion controller set the masterbus property.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-ehci: Add support for registering companion controllers
Hans de Goede [Fri, 24 Jun 2011 14:18:13 +0000 (16:18 +0200)]
usb-ehci: Add support for registering companion controllers

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-ehci: Fix handling of PED and PEDC port status bits
Hans de Goede [Fri, 24 Jun 2011 12:36:13 +0000 (14:36 +0200)]
usb-ehci: Fix handling of PED and PEDC port status bits

The PED bit should only be set for highspeed devices and the PEDC bit
should not be set on "normal" PED bit changes, only on io errors.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb: assert on calling usb_attach(port, NULL) on a port without a dev
Hans de Goede [Fri, 24 Jun 2011 12:26:18 +0000 (14:26 +0200)]
usb: assert on calling usb_attach(port, NULL) on a port without a dev

with the "usb-ehci: cleanup port reset handling" patch in place no callers
are calling usb_attach(port, NULL) for a port where port->dev is NULL.

Doing that makes no sense as that causes the port detach op to get called
for a port with nothing attached. Add an assert that port->dev != NULL when
dev == NULL, and remove the check for not having a port->dev in the dev == NULL
case.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-ehci: cleanup port reset handling
Hans de Goede [Tue, 21 Jun 2011 10:23:40 +0000 (12:23 +0200)]
usb-ehci: cleanup port reset handling

Doing a usb_attach when dev is NULL will just result in the
port detach op getting called even though nothing was connected in
the first place.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-ehci: Connect Status bit is read only, don't allow changing it by the guest
Hans de Goede [Tue, 21 Jun 2011 10:12:35 +0000 (12:12 +0200)]
usb-ehci: Connect Status bit is read only, don't allow changing it by the guest

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-ehci: drop unused num-ports state member
Hans de Goede [Fri, 17 Jun 2011 13:26:29 +0000 (15:26 +0200)]
usb-ehci: drop unused num-ports state member

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb: Replace device_destroy bus op with a child_detach port op
Hans de Goede [Fri, 24 Jun 2011 10:31:11 +0000 (12:31 +0200)]
usb: Replace device_destroy bus op with a child_detach port op

Note this fixes 2 things in one go, first of all the device_destroy bus
op should be a device_detach bus op, as pending async packets from the
device should be cancelled on detach not on destroy.

Secondly having this as a bus op won't work with companion controllers, since
then there will be 1 bus driven by the ehci controller and thus 1 set of bus
ops, but the device being detached may be downstream of a handed over port.
Making the detach of a downstream device a port op allows the ehci controller
to forward this to the companion controller port for handed over ports.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb: Make port wakeup and complete ops take a USBPort instead of a Device
Hans de Goede [Tue, 21 Jun 2011 09:52:28 +0000 (11:52 +0200)]
usb: Make port wakeup and complete ops take a USBPort instead of a Device

This makes them consistent with the attach and detach ops, and in general
it makes sense to make portops take a port as argument. This also makes
adding support for a companion controller easier / cleaner.

[ kraxel: fix usb-musb.c build ]

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb: Add a register_companion USB bus op.
Hans de Goede [Fri, 24 Jun 2011 09:29:56 +0000 (11:29 +0200)]
usb: Add a register_companion USB bus op.

This is a preparation patch for adding support for USB companion controllers.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb: Move (initial) call of usb_port_location to usb_fill_port
Hans de Goede [Thu, 30 Jun 2011 10:05:19 +0000 (12:05 +0200)]
usb: Move (initial) call of usb_port_location to usb_fill_port

Cleanup / preparation patch for companion controller support. Note that
as a "side-effect" this patch also fixes the milkymist-softusb controller
not having a port_location set for its ports.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb: Add a usb_fill_port helper function
Hans de Goede [Thu, 30 Jun 2011 09:57:57 +0000 (11:57 +0200)]
usb: Add a usb_fill_port helper function

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agohw/usb-musb.c: Don't misuse usb_packet_complete()
Peter Maydell [Tue, 14 Jun 2011 11:24:04 +0000 (12:24 +0100)]
hw/usb-musb.c: Don't misuse usb_packet_complete()

In musb_packet() handle final processing of non-asynchronous
USB packets by directly calling musb_schedule_cb() rather than
going through usb_packet_complete(). The latter will trigger
an assertion because the packet doesn't belong to a device.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agopxa2xx_lcd: add proper rotation support
Vasily Khoruzhick [Fri, 17 Jun 2011 10:04:36 +0000 (13:04 +0300)]
pxa2xx_lcd: add proper rotation support

Until now, pxa2xx_lcd only supported 90deg rotation, but
some machines (for example Zipit Z2) needs 270deg rotation.

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
12 years agoarm: Add const attribute to some arm_boot_info pointers
Stefan Weil [Thu, 23 Jun 2011 15:53:48 +0000 (17:53 +0200)]
arm: Add const attribute to some arm_boot_info pointers

Parameter 'info' is const, so add the missing attribute.

v2:
Add 'const' to the local variable info in do_cpu_reset() and to
the boot_info field in CPUARMState (suggested by Peter Maydell).

Cc: Andrzej Zaborowski <balrogg@gmail.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
12 years agoesp: correctly fill bus id with requested lun
Hervé Poussineau [Sat, 2 Jul 2011 15:23:00 +0000 (17:23 +0200)]
esp: correctly fill bus id with requested lun

This bug showed up after 1455084ea2c48abf23c4e4e15e378ee43457f381, and
may be seen only on operating systems *not* using DMA to give commands
to SCSI adapter.

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoTCG/PPC: use stack for TCG temps
Blue Swirl [Sat, 28 May 2011 08:27:20 +0000 (08:27 +0000)]
TCG/PPC: use stack for TCG temps

Use stack instead of temp_buf array in CPUState for TCG temps.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agofix cpu_cc_src and cpu_cc_src2 corruption in udivx and sdivx
Artyom Tarasenko [Fri, 1 Jul 2011 19:28:42 +0000 (21:28 +0200)]
fix cpu_cc_src and cpu_cc_src2 corruption in udivx and sdivx

udivx and sdvix don't modify condition flags, so they shall not
overwrite cpu_cc_*

Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoMerge branch 'ppc-next' of git://repo.or.cz/qemu/agraf
Blue Swirl [Fri, 1 Jul 2011 21:12:50 +0000 (21:12 +0000)]
Merge branch 'ppc-next' of git://repo.or.cz/qemu/agraf

* 'ppc-next' of git://repo.or.cz/qemu/agraf:
  PPC: move TLBs to their own arrays
  PPC: 440: Use 440 style MMU as default, so Qemu knows the MMU type
  PPC: E500: Use MAS registers instead of internal TLB representation
  PPC: Only set lower 32bits with mtmsr
  PPC: update openbios firmware
  PPC: mpc8544ds: Add hypervisor node
  PPC: calculate kernel,initrd,cmdline locations dynamically
  target-ppc: Handle memory-forced I/O controller access
  PPC: E500: Implement reboot controller

12 years agotcg-hppa: Support deposit opcode.
Richard Henderson [Mon, 20 Jun 2011 22:10:49 +0000 (15:10 -0700)]
tcg-hppa: Support deposit opcode.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agohppa: Fix printf warnings in hppa-dis.c.
Richard Henderson [Mon, 20 Jun 2011 22:02:29 +0000 (15:02 -0700)]
hppa: Fix printf warnings in hppa-dis.c.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoTCG/HPPA: use stack for TCG temps
Blue Swirl [Sat, 28 May 2011 07:55:47 +0000 (07:55 +0000)]
TCG/HPPA: use stack for TCG temps

Use stack instead of temp_buf array in CPUState for TCG temps.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoTCG/HPPA: use TCG_REG_CALL_STACK instead of TCG_REG_SP
Blue Swirl [Sat, 28 May 2011 07:49:35 +0000 (07:49 +0000)]
TCG/HPPA: use TCG_REG_CALL_STACK instead of TCG_REG_SP

Use TCG_REG_CALL_STACK instead of TCG_REG_SP for consistency.

Acked-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoetraxfs-ser: Correct default value for RW_REC_CTRL
Edgar E. Iglesias [Thu, 30 Jun 2011 08:52:22 +0000 (10:52 +0200)]
etraxfs-ser: Correct default value for RW_REC_CTRL

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
12 years agouser: Fix -d debug logging for usermode emulation
Edgar E. Iglesias [Tue, 28 Jun 2011 18:57:09 +0000 (20:57 +0200)]
user: Fix -d debug logging for usermode emulation

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
12 years agocris: Handle opcode zero
Edgar E. Iglesias [Tue, 28 Jun 2011 18:52:37 +0000 (20:52 +0200)]
cris: Handle opcode zero

It's a valid branch pc + 2.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
12 years agotcg/ppc64: Remove tcg_out_addi
malc [Mon, 27 Jun 2011 22:27:52 +0000 (02:27 +0400)]
tcg/ppc64: Remove tcg_out_addi

The only user (within tcg.c) was removed

Signed-off-by: malc <av1474@comtv.ru>
12 years agotcg/ppc: Remove tcg_out_addi
malc [Mon, 27 Jun 2011 22:26:06 +0000 (02:26 +0400)]
tcg/ppc: Remove tcg_out_addi

The only user (within tcg.c) was removed

Signed-off-by: malc <av1474@comtv.ru>
12 years agoMerge remote-tracking branch 'kraxel/usb.17' into staging
Anthony Liguori [Mon, 27 Jun 2011 19:59:08 +0000 (14:59 -0500)]
Merge remote-tracking branch 'kraxel/usb.17' into staging

12 years agoMerge remote-tracking branch 'amit/for-anthony' into staging
Anthony Liguori [Mon, 27 Jun 2011 16:27:15 +0000 (11:27 -0500)]
Merge remote-tracking branch 'amit/for-anthony' into staging

12 years agoMerge remote-tracking branch 'riku/linux-user-for-upstream' into staging
Anthony Liguori [Mon, 27 Jun 2011 16:26:47 +0000 (11:26 -0500)]
Merge remote-tracking branch 'riku/linux-user-for-upstream' into staging

12 years agoMerge remote-tracking branch 'stefanha/trivial-patches' into staging
Anthony Liguori [Mon, 27 Jun 2011 16:25:23 +0000 (11:25 -0500)]
Merge remote-tracking branch 'stefanha/trivial-patches' into staging

12 years agovnc: Fix compilation with --enable-vnc-png
Stefan Weil [Sun, 26 Jun 2011 19:29:13 +0000 (19:29 +0000)]
vnc: Fix compilation with --enable-vnc-png

Commit f26e428da505709ec03b2ed2c9eb3db82b30bd7b fixed compilation
with --enable-vnc-png, but broke it with --enable-vnc-png.

The breakage is caused by pngconfig.h which checks whether
setjmp.h was already included and fails because qemu-common.h
includes setjmp.h.

The check is disabled by defining PNG_SKIP_SETJMP_CHECK.

Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agovirtio-serial: Fix segfault on guest boot
Luiz Capitulino [Fri, 17 Jun 2011 18:58:08 +0000 (15:58 -0300)]
virtio-serial: Fix segfault on guest boot

If I start qemu with:

  # qemu -hda disks/test.img -enable-kvm -m 1G -snapshot \
         -device virtio-serial \
         -chardev socket,host=localhost,port=1234,server,nowait,id=foo \
         -device virtserialport,chardev=foo,name=org.qemu.guest_agent

I get a segfault when booting a Fedora 14 guest. The backtrace says:

  Program terminated with signal 11, Segmentation fault.
    #0  0x0000000000420850 in handle_control_message (vser=0x3732bd0, buf=0x2c173e0, len=8) at /home/lcapitulino/src/qmp-unstable/hw/virtio-serial-bus.c:335
    335     info = DO_UPCAST(VirtIOSerialPortInfo, qdev, port->dev.info);

What's happening is VIRTIO_CONSOLE_DEVICE_READY is a message for the
whole device, not for an individual port. So port is NULL. This bug was
introduced by commit a15bb0d6a981de749452a5180fc8084d625671da.

This commit fixes that by making the port returned by find_port_by_id()
be used only by the VIRTIO_CONSOLE_PORT_READY and
VIRTIO_CONSOLE_PORT_OPEN messages.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
12 years agoFix MinGW compilation when --enable-vnc-jpeg is specified
Roy Tam [Sat, 18 Jun 2011 05:13:39 +0000 (13:13 +0800)]
Fix MinGW compilation when --enable-vnc-jpeg is specified

Fix conflicting types for 'INT32' in basetsd.h and jmorecfg.h by
including qemu-common.h first.

Signed-off-by: Roy Tam <roytam@gmail.com>
Acked-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoTCG/Sparc64: use stack for TCG temps
Blue Swirl [Sat, 14 May 2011 17:06:56 +0000 (17:06 +0000)]
TCG/Sparc64: use stack for TCG temps

Use stack instead of temp_buf array in CPUState for TCG temps.

On Sparc64, stack pointer is not aligned but there is a fixed bias of 2047,
so don't try to enforce alignment.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoTCG/x86: use stack for TCG temps
Blue Swirl [Sat, 14 May 2011 13:14:45 +0000 (13:14 +0000)]
TCG/x86: use stack for TCG temps

Use stack instead of temp_buf array in CPUState for TCG
temps.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoTCG/x86: use TCG_REG_CALL_STACK instead of TCG_REG_ESP
Blue Swirl [Sat, 28 May 2011 06:51:52 +0000 (06:51 +0000)]
TCG/x86: use TCG_REG_CALL_STACK instead of TCG_REG_ESP

Except for specific cases where the use of %esp changes the encoding of
the instruction, it's cleaner to use TCG_REG_CALL_STACK instead of
TCG_REG_ESP.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoTCG: remove broken stack allocation for call arguments
Blue Swirl [Sat, 28 May 2011 07:13:05 +0000 (07:13 +0000)]
TCG: remove broken stack allocation for call arguments

The code for stack allocation for call arguments is way too simplistic
to actually work on targets with non-trivial stack allocation policies,
e.g. ppc64. We've also already allocated TCG_STATIC_CALL_ARGS_SIZE worth
of stack for calls which should be well more than any helper needs.

Remove broken dynamic stack allocation code and replace it with an assert.
Should dynamic stack allocation ever be needed again, target specific
functions should be added.

Thanks to Richard Henderson for the analysis.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoTCG: fix negative frame offset calculations
Blue Swirl [Sat, 14 May 2011 14:03:22 +0000 (14:03 +0000)]
TCG: fix negative frame offset calculations

size_t is unsigned, so the frame offset calculations can be incorrect for
negative offsets.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoDelegate setup of TCG temporaries to targets
Blue Swirl [Sat, 14 May 2011 12:58:04 +0000 (12:58 +0000)]
Delegate setup of TCG temporaries to targets

Delegate TCG temp_buf setup to targets, so that they can use a stack
frame later instead.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agocpu-exec.c: avoid AREG0 use
Blue Swirl [Sun, 15 May 2011 16:03:25 +0000 (16:03 +0000)]
cpu-exec.c: avoid AREG0 use

Make functions take a parameter for CPUState instead of relying
on global env. Pass CPUState pointer to TCG prologue, which moves
it to AREG0.

Thanks to Peter Maydell and Laurent Desnogues for the ARM prologue
change.

Revert the hacks to avoid AREG0 use on Sparc hosts.

Move cpu_has_work() and cpu_pc_from_tb() from exec.h to cpu.h.

Compile the file without HELPER_CFLAGS.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoRemove exec-all.h include directives
Blue Swirl [Sun, 19 Jun 2011 20:38:22 +0000 (20:38 +0000)]
Remove exec-all.h include directives

Most exec-all.h include directives are now useless, remove them.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoMove cpu_has_work and cpu_pc_from_tb to cpu.h
Blue Swirl [Sat, 21 May 2011 07:10:23 +0000 (07:10 +0000)]
Move cpu_has_work and cpu_pc_from_tb to cpu.h

Move functions cpu_has_work() and cpu_pc_from_tb() from exec.h to cpu.h. This is
needed by later patches.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoexec.h: fix coding style and change cpu_has_work to return bool
Blue Swirl [Sat, 21 May 2011 12:16:05 +0000 (12:16 +0000)]
exec.h: fix coding style and change cpu_has_work to return bool

Before the next patch, fix coding style of the areas affected.

Change the type of the return value from cpu_has_work() and
qemu_cpu_has_work() to bool.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agocpu-exec: unify do_interrupt call
Blue Swirl [Sat, 21 May 2011 08:17:08 +0000 (08:17 +0000)]
cpu-exec: unify do_interrupt call

Now that all targets use common function signature for do_interrupt(), there is no
need for the #ifdeffery anymore.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agom68k: use caller supplied CPUState for interrupt related stuff
Blue Swirl [Sat, 21 May 2011 07:55:24 +0000 (07:55 +0000)]
m68k: use caller supplied CPUState for interrupt related stuff

Pass CPUState to do_interrupt(). This is needed by later patches.

It would be cleaner to move the function to helper.c, but there are
a few dependencies between do_interrupt() and other functions.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agox86: use caller supplied CPUState for interrupt related stuff
Blue Swirl [Mon, 16 May 2011 19:38:48 +0000 (19:38 +0000)]
x86: use caller supplied CPUState for interrupt related stuff

Several x86 specific functions are called from cpu-exec.c with the
assumption that global env register is valid. This will be changed
later, so make the functions use caller supplied CPUState parameter.

It would be cleaner to move the functions to helper.c, but there are
quite a lot of dependencies between do_interrupt() and other functions.

Add helpers for svm_check_intercept() and cpu_cc_compute_all() instead
of calling the helper (which uses global env, AREG0) directly.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agosparc: move do_interrupt to helper.c
Blue Swirl [Sun, 15 May 2011 16:11:04 +0000 (16:11 +0000)]
sparc: move do_interrupt to helper.c

do_interrupt() was mixing CPUState pointer passed from caller
and global env (AREG0).

Fix by moving the function to helper.c. Introduce a helper for calling
change_pstate() safely from outside of execution context.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agosparc: fix coding style of the area to be moved
Blue Swirl [Sat, 21 May 2011 11:41:50 +0000 (11:41 +0000)]
sparc: fix coding style of the area to be moved

Before the next patch, fix coding style of the areas affected.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agocpu_loop_exit: avoid using AREG0
Blue Swirl [Sat, 14 May 2011 12:52:35 +0000 (12:52 +0000)]
cpu_loop_exit: avoid using AREG0

Make cpu_loop_exit() take a parameter for CPUState instead of relying
on global env.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoSparc32: dummy implementation of MXCC MMU breakpoint registers
Blue Swirl [Sat, 18 Jun 2011 20:27:05 +0000 (20:27 +0000)]
Sparc32: dummy implementation of MXCC MMU breakpoint registers

Add dummy registers for SuperSPARC MXCC MMU counter breakpoints, save
and load all MXCC registers.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoFix fallouts from Linux header inclusion
Jan Kiszka [Thu, 23 Jun 2011 08:05:12 +0000 (10:05 +0200)]
Fix fallouts from Linux header inclusion

This is an all-in-one fix for the smaller and bigger mistakes of the
build system changes for accompanied Linux headers:
 - only enable KVM and vhost on Linux hosts
 - fix powerpc asm header symlink
 - do not use Linux headers on non-Linux hosts
 - fix kvmclock for !CONFIG_KVM
 - fix s390 build on non-Linux hosts

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Tested-by: Andreas Färber <andreas.faerber@web.de>
Tested-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
12 years agoqemu-kvm: fix pulseaudio detection in configure
Marc-Antoine Perennou [Fri, 29 Apr 2011 05:59:19 +0000 (05:59 +0000)]
qemu-kvm: fix pulseaudio detection in configure

pulse/simple.h does not include stdlib.h
We cannot use NULL since it may not be defined
Use 0 instead

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoexec: last_first_tb was only used in !ONLY_USER case
Juan Quintela [Thu, 2 Jun 2011 01:53:44 +0000 (01:53 +0000)]
exec: last_first_tb was only used in !ONLY_USER case

Once there, use a better variable name.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agow32: Remove redundant definitions of PRI*64
Stefan Weil [Fri, 24 Jun 2011 10:15:49 +0000 (12:15 +0200)]
w32: Remove redundant definitions of PRI*64

The PRI*64 macros are defined in MinGW's inttypes.h since 2002,
so they are not needed in qemu-common.h (which includes inttypes.h).

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoDo not include compatfd for WIN32
Jan Kiszka [Thu, 23 Jun 2011 08:15:55 +0000 (10:15 +0200)]
Do not include compatfd for WIN32

sigset_t, used by that header, is not available in mingw32 environments.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoFix comment typos in hw/armv7m.c
Matthew Fernandez [Thu, 23 Jun 2011 00:59:26 +0000 (10:59 +1000)]
Fix comment typos in hw/armv7m.c

Fix a couple of typos in comments.

Signed-off-by: Matthew Fernandez <matthew.fernandez@gmail.com>
Acked-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoMAINTAINERS: Fix typo in email address
Peter Maydell [Wed, 22 Jun 2011 14:45:01 +0000 (15:45 +0100)]
MAINTAINERS: Fix typo in email address

Fix a typo in one of the copies of Aurelien Jarno's email address.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoblockdev: Put space after comma in error message
Markus Armbruster [Wed, 22 Jun 2011 12:03:57 +0000 (14:03 +0200)]
blockdev: Put space after comma in error message

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoSpell "unkown" correctly in error_report() arguments
Markus Armbruster [Wed, 22 Jun 2011 12:03:56 +0000 (14:03 +0200)]
Spell "unkown" correctly in error_report() arguments

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoqemu-img: Don't prepend qemu-img to error messages twice.
Markus Armbruster [Wed, 22 Jun 2011 12:03:55 +0000 (14:03 +0200)]
qemu-img: Don't prepend qemu-img to error messages twice.

error_report() prepends the location already.  Example:

$ qemu-img convert -6
qemu-img: qemu-img: option -6 is deprecated, please use '-o compat6' instead!

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoStrip trailing '\n' from error_report()'s first argument
Markus Armbruster [Wed, 22 Jun 2011 12:03:54 +0000 (14:03 +0200)]
Strip trailing '\n' from error_report()'s first argument

error_report() prepends location, and appends a newline.  The message
constructed from the arguments should not contain a newline.  Fix the
obvious offenders.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agosheepdog: qemu_bh_new() can't return null pointer, drop check
Markus Armbruster [Wed, 22 Jun 2011 12:03:53 +0000 (14:03 +0200)]
sheepdog: qemu_bh_new() can't return null pointer, drop check

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoAlign dummy display to fixed-size active console
Jan Kiszka [Sun, 19 Jun 2011 09:53:02 +0000 (11:53 +0200)]
Align dummy display to fixed-size active console

This fixes e.g. '-vga none -monitor vc:120Cx50C'.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agoconfigure: Don't create symlinks to nonexistent targets
Peter Maydell [Fri, 3 Jun 2011 16:10:40 +0000 (17:10 +0100)]
configure: Don't create symlinks to nonexistent targets

When we create the symlinks to source tree files, don't create them
if the file is not actually present in the source tree; this will
happen if the file is in a git submodule that wasn't checked out.

This also avoids the odd effect where an in-source-tree configure
will end up creating the missing file as a symlink to itself.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
12 years agousb: ignore USB_DT_DEBUG
Gerd Hoffmann [Thu, 23 Jun 2011 15:15:43 +0000 (17:15 +0200)]
usb: ignore USB_DT_DEBUG

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-storage: Turn drive serial into a qdev property usb-storage.serial
Markus Armbruster [Fri, 17 Jun 2011 08:52:36 +0000 (10:52 +0200)]
usb-storage: Turn drive serial into a qdev property usb-storage.serial

It needs to be a qdev property, because it belongs to the drive's
guest part.  Precedence: commit a0fef654 and 6ced55a5.

Bonus: info qtree now shows the serial number.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agocoreaudio: Fix OSStatus format specifier
Andreas Färber [Thu, 23 Jun 2011 14:24:45 +0000 (16:24 +0200)]
coreaudio: Fix OSStatus format specifier

OSStatus type is defined as SInt32. That's signed int on __LP64__ and
signed long otherwise.
Since it is an explicit 32-bit-width type, cast to corresponsing POSIX type
and use PRId32 format specifier. This avoids a warning on ppc64.

Cc: malc <av1474@comtv.ru>
Signed-off-by: Andreas Faerber <andreas.faerber@web.de>
Signed-off-by: malc <av1474@comtv.ru>
12 years agocoreaudio: Avoid formatting UInt32 type
Andreas Färber [Thu, 23 Jun 2011 14:24:46 +0000 (16:24 +0200)]
coreaudio: Avoid formatting UInt32 type

coreaudioVoiceOut's audioDevicePropertyBufferFrameSize is defined as UInt32
and is being used by reference for AudioDevice{Get,Set}Property().
UInt32 is unsigned int on __LP64__ but unsigned long otherwise.

Cast to POSIX type and use PRIu32 format specifier to hide the details.
This avoids a warning on ppc64.

Cc: malc <av1474@comtv.ru>
Signed-off-by: Andreas Faerber <andreas.faerber@web.de>
Signed-off-by: malc <av1474@comtv.ru>
12 years agohw/usb-ohci.c: Fix handling of remote wakeup corner cases
Peter Maydell [Wed, 15 Jun 2011 17:22:35 +0000 (18:22 +0100)]
hw/usb-ohci.c: Fix handling of remote wakeup corner cases

Correct a number of minor errors in the OHCI wakeup implementation:
 * when the port is suspended but the controller is not, raise RHSC
 * when the controller is suspended but the port is not, raise RD
 * when the controller is suspended, move it to resume state

These fix some edge cases where a USB device might not successfully get
the attention of the guest OS if it tried to do so at the wrong time.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-bus: Don't allow speed mismatch while attaching devices
Hans de Goede [Fri, 27 May 2011 12:50:39 +0000 (14:50 +0200)]
usb-bus: Don't allow speed mismatch while attaching devices

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-linux: allow "compatible" high speed devices to connect at fullspeed
Hans de Goede [Mon, 30 May 2011 09:40:45 +0000 (11:40 +0200)]
usb-linux: allow "compatible" high speed devices to connect at fullspeed

Some usb2 highspeed devices, like usb-msd devices, work fine when redirected
to a usb1 virtual controller. Allow this to avoid the new speedhecks causing
regressions for users who do not enable the new experimental ehci code.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb: Add a speedmask to devices
Hans de Goede [Fri, 27 May 2011 12:27:18 +0000 (14:27 +0200)]
usb: Add a speedmask to devices

This is used to indicate at which speed[s] the device can operate,
so that this can be checked to match the ports capabilities when it gets
attached to a bus.

Note that currently all usb1 emulated device claim to be fullspeed, this
seems to not cause any problems, but still seems wrong, because with real
hardware keyboards, mice and tablets usually are lo-speed, so reporting these
as fullspeed devices seems wrong.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb: Proper error propagation for usb_device_attach errors
Hans de Goede [Fri, 27 May 2011 17:05:15 +0000 (19:05 +0200)]
usb: Proper error propagation for usb_device_attach errors

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-bus: Don't allow attaching a device to a bus with no free ports
Hans de Goede [Fri, 27 May 2011 12:46:27 +0000 (14:46 +0200)]
usb-bus: Don't allow attaching a device to a bus with no free ports

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoehci: switch to nanoseconds
Gerd Hoffmann [Tue, 31 May 2011 10:23:13 +0000 (12:23 +0200)]
ehci: switch to nanoseconds

Make ehci use nanoseconds everywhere.
Simplifies time calculations.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agoehci: add freq + maxframes properties
Gerd Hoffmann [Mon, 30 May 2011 14:24:29 +0000 (16:24 +0200)]
ehci: add freq + maxframes properties

Add properties for the wakeup rate and the max number of frames ehci
will process at once.

The wakeup rate defaults to 1000 which equals the usb frame rate.  This
can be reduced to make qemu wake up less often when ehci is active.

In case the wakeup rate is reduced or the ehci timer is delayed due to
latency issues elsewhere in qemu ehci will process multiple frames at
once.  The maxframes property specifies the upper limit for this.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-linux: track inflight iso urb count
Gerd Hoffmann [Fri, 10 Jun 2011 12:00:24 +0000 (14:00 +0200)]
usb-linux: track inflight iso urb count

Track the number of iso urbs which are currently in flight.
Log a message in case the count goes down to zero.  Also
warn in case many urbs are returned at the same time.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-linux: make iso urb count contigurable
Gerd Hoffmann [Fri, 10 Jun 2011 12:03:56 +0000 (14:03 +0200)]
usb-linux: make iso urb count contigurable

Add a qdev property for the number of iso urbs which
usb-linux keeps in flight, so it can be configured at
runtime.  Make it default to four (old hardcoded value
used to be three).

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agousb-linux: add get_endp()
Gerd Hoffmann [Fri, 10 Jun 2011 11:34:10 +0000 (13:34 +0200)]
usb-linux: add get_endp()

Add a helper function to get the endpoint data structure
and put it into use.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
12 years agonet: Warn about "-net nic" options which were ignored
Peter Maydell [Fri, 20 May 2011 15:50:01 +0000 (16:50 +0100)]
net: Warn about "-net nic" options which were ignored

Diagnose the case where the user asked for a NIC via "-net nic"
but the board didn't instantiate that NIC (for example where the
user asked for two NICs but the board only supports one). Note
that this diagnostic doesn't apply to NICs created through -device,
because those are always instantiated.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agonet: Don't warn about the default network setup
Peter Maydell [Fri, 20 May 2011 15:50:00 +0000 (16:50 +0100)]
net: Don't warn about the default network setup

Don't warn about the default network setup that you get if no command line
-net options are specified.  There are two cases that we would otherwise
complain about:

(1) board doesn't support a NIC but the implicit "-net nic" requested one
(2) CONFIG_SLIRP not set, so the implicit "-net nic" sets up a nic that
isn't connected to anything

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoRevert "net: Improve the warnings for dubious command line option combinations"
Peter Maydell [Fri, 20 May 2011 15:49:59 +0000 (16:49 +0100)]
Revert "net: Improve the warnings for dubious command line option combinations"

This reverts commit f68b9d672b90dedc79aeb9b44607f484dbe46a6b.
That attempt at diagnosing unused -net nic options failed to account
for NICs created via -device; back it out cleanly in preparation
for implementing in a different manner.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoOptimize screendump
Avi Kivity [Mon, 20 Jun 2011 08:12:47 +0000 (11:12 +0300)]
Optimize screendump

When running kvm-autotest, fputc() is often the second highest (sometimes #1)
function showing up in a profile.  This is due to fputc() locking the file
for every byte written.

Optimize by buffering a line's worth of pixels and writing that out in a
single call.

Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
12 years agoMerge remote-tracking branch 'qmp/for-anthony' into staging
Anthony Liguori [Wed, 22 Jun 2011 12:14:00 +0000 (07:14 -0500)]
Merge remote-tracking branch 'qmp/for-anthony' into staging

12 years agoMerge remote-tracking branch 'qemu-kvm/uq/master' into staging
Anthony Liguori [Wed, 22 Jun 2011 12:13:10 +0000 (07:13 -0500)]
Merge remote-tracking branch 'qemu-kvm/uq/master' into staging

12 years agoMerge remote-tracking branch 'mst/for_anthony' 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

12 years agoMerge remote-tracking branch 'agraf/xen-next' into staging
Anthony Liguori [Wed, 22 Jun 2011 12:07:55 +0000 (07:07 -0500)]
Merge remote-tracking branch 'agraf/xen-next' into staging

12 years agolinux-user: Fix sync_file_range on 32bit mips
Riku Voipio [Mon, 20 Jun 2011 13:24:39 +0000 (16:24 +0300)]
linux-user: Fix sync_file_range on 32bit mips

As noticed while looking at "Bump do_syscall() up to 8 syscall arguments"
patch, sync_file_range uses a pad argument on 32bit mips. Deal with it
by reading the correct arguments when on mips.

Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
12 years agolinux-user/signal.c: Remove unused fenab
Peter Maydell [Thu, 16 Jun 2011 16:37:15 +0000 (17:37 +0100)]
linux-user/signal.c: Remove unused fenab

Remove fenab as it is only written, never used. Add a FIXME
comment about the discrepancy between our behaviour and that
of the Linux kernel for this routine.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>