]> git.proxmox.com Git - qemu.git/log
qemu.git
11 years agoUpdate version for 1.3.0-rc1 v1.3.0-rc1
Anthony Liguori [Mon, 26 Nov 2012 21:13:31 +0000 (15:13 -0600)]
Update version for 1.3.0-rc1

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio-rng: fix typos, comments
Amit Shah [Wed, 21 Nov 2012 05:51:21 +0000 (11:21 +0530)]
virtio-rng: fix typos, comments

Fix typos, whitespace and update comments to match current
implementation.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio-rng: disable timer on device removal
Amit Shah [Wed, 21 Nov 2012 05:51:20 +0000 (11:21 +0530)]
virtio-rng: disable timer on device removal

Disable the rate-limit timer on device remove (e.g. hot-unplug).

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio-rng: remove extra request for entropy
Amit Shah [Wed, 21 Nov 2012 05:51:19 +0000 (11:21 +0530)]
virtio-rng: remove extra request for entropy

If we got fewer bytes from the backend than requested, don't poke the
backend for more bytes; the guest will ask for more (or if the guest has
already asked for more, the backend knows about it via handle_input()).

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio-rng: use virtqueue_get_avail_bytes, fix migration
Amit Shah [Wed, 21 Nov 2012 05:51:18 +0000 (11:21 +0530)]
virtio-rng: use virtqueue_get_avail_bytes, fix migration

Popping an elem from the vq just to find out its length causes problems
with save/load later on.  Use the new virtqueue_get_avail_bytes()
function instead, saves us the complexity in the migration code, as well
as makes the migration endian-safe.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoi8259: Fix PIC_COMMON() macro
Andreas Färber [Sun, 25 Nov 2012 19:44:33 +0000 (20:44 +0100)]
i8259: Fix PIC_COMMON() macro

It used a wrong struct type name since its introduction in
8f04ee0882aec9fe91fb70f767edf5dacff59835 (isa: pic: convert to QEMU
Object Model), apparently it is unused so far.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqapi: handle visitor->type_size() in QapiDeallocVisitor
Stefan Hajnoczi [Mon, 26 Nov 2012 12:10:12 +0000 (13:10 +0100)]
qapi: handle visitor->type_size() in QapiDeallocVisitor

visit_type_size() requires either visitor->type_size() or
visitor_uint64() to be implemented, otherwise a NULL function pointer is
invoked.

It is possible to trigger this crash as follows:

  $ qemu-system-x86_64 -netdev tap,sndbuf=0,id=netdev0 \
                       -device virtio-blk-pci,netdev=netdev0

The 'sndbuf' option has type "size".

Reviewed-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agotarget-i386: cpu: add missing flags to Haswell CPU model
Eduardo Habkost [Thu, 22 Nov 2012 15:31:03 +0000 (13:31 -0200)]
target-i386: cpu: add missing flags to Haswell CPU model

When adding the Haswell CPU model, I intended to make it a superset of the
features present on the SandyBridge model, but I have removed the SEP and
RDTSCP features from the feature list by mistake. This patch adds the missing
SEP and RDTSCP features (that are present on SandyBridge) to Haswell.

Reported-by: Martin Kletzander <mkletzan@redhat.com>
Acked-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovl.c: Fix broken -usb option
Peter Maydell [Thu, 22 Nov 2012 16:48:45 +0000 (16:48 +0000)]
vl.c: Fix broken -usb option

Commit 094b287f0b accidentally broke the "-usb" command line
option, so it would have no effect if the user had not specified
any machine options at that point. (the return value from
'qemu_opts_find(qemu_find_opts("machine"), 0);' is NULL if there
are no user specified options, so it is only to be used for
looking up an option, not when trying to set one.) Similarly,
would '-usbdevice' no longer cause USB to default to enabled.

Fix this regression by using the same style of code for forcing
the usb=on machine option that we use for other aliases such as
'-enable-kvm'.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqom: make object_finalize static
Paolo Bonzini [Fri, 23 Nov 2012 08:47:16 +0000 (09:47 +0100)]
qom: make object_finalize static

It is not used anymore, and there is no need to make it public.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqdev: simplify (de)allocation of buses
Paolo Bonzini [Fri, 23 Nov 2012 08:47:15 +0000 (09:47 +0100)]
qdev: simplify (de)allocation of buses

All conditional deallocation can now be done with object_delete.
Remove the @qom_allocated and @glib_allocated fields; replace the latter
with a direct assignment of the @free function pointer.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqom: make object_delete usable for statically-allocated objects
Paolo Bonzini [Fri, 23 Nov 2012 08:47:14 +0000 (09:47 +0100)]
qom: make object_delete usable for statically-allocated objects

Store in the object the freeing function that will be used at deletion
time.  This makes it possible to use object_delete on statically-allocated
(embedded) objects.  Dually, it makes it possible to use object_unparent
and object_unref without leaking memory, when the lifetime of object
might extend until after the call to object_delete.

Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqdev: move bus removal to object_unparent
Paolo Bonzini [Fri, 23 Nov 2012 08:47:13 +0000 (09:47 +0100)]
qdev: move bus removal to object_unparent

Add an ObjectClass method that is done at object_unparent time.  It
should remove any backlinks to the object in the composition tree,
so that object_delete will be able to drop the last reference and
free the object.

Use it for qdev buses.

Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqom: fix refcount of non-heap-allocated objects
Paolo Bonzini [Fri, 23 Nov 2012 08:47:12 +0000 (09:47 +0100)]
qom: fix refcount of non-heap-allocated objects

The reference count for embedded objects is always one too low, because
object_initialize_with_type returns with zero references to the object.
This causes premature finalization of the object (or an assertion failure)
after calling object_ref to add an extra reference and object_unref to
remove it.

The fix is to move the initial object_ref call from object_new_with_type
to object_initialize_with_type.

Acked-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agohmp: do not crash on invalid SCSI hotplug
Paolo Bonzini [Fri, 23 Nov 2012 15:56:18 +0000 (16:56 +0100)]
hmp: do not crash on invalid SCSI hotplug

Commit 0d93692 (qdev: Convert busses to QEMU Object Model, 2012-05-02)
removed a check on the type of the bus where a SCSI disk is hotplugged.
However, hot-plugging to the wrong kind of device now causes a crash
due to either a NULL pointer dereference (avoided by the previous patch)
or a failed QOM cast.

Instead, in this case we need to use object_dynamic_cast and check for
the result, similar to what was done before that commit.

Reported-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqom: dynamic_cast of NULL is always NULL
Paolo Bonzini [Fri, 23 Nov 2012 15:56:17 +0000 (16:56 +0100)]
qom: dynamic_cast of NULL is always NULL

Trying to cast a NULL value will cause a crash.  Returning
NULL is also sensible, and it is also what the type-unsafe
DO_UPCAST macro does.

Reported-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agotests: add thread pool unit tests
Paolo Bonzini [Fri, 23 Nov 2012 15:13:24 +0000 (16:13 +0100)]
tests: add thread pool unit tests

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agotests: add AioContext unit tests
Paolo Bonzini [Fri, 23 Nov 2012 15:13:23 +0000 (16:13 +0100)]
tests: add AioContext unit tests

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoaio: avoid livelock behavior for Win32
Paolo Bonzini [Fri, 23 Nov 2012 14:59:43 +0000 (15:59 +0100)]
aio: avoid livelock behavior for Win32

The repeated calls to WaitForMultipleObjects may cause a livelock in aio_poll,
where no progress is made on bottom halves.  This patch matches the behavior
of the POSIX code.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoq35: Add kvmclock support
Jan Kiszka [Wed, 14 Nov 2012 20:54:08 +0000 (15:54 -0500)]
q35: Add kvmclock support

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Jason Baron <jbaron@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoq35: Fix non-PCI IRQ processing in ich9_lpc_update_apic
Jan Kiszka [Wed, 14 Nov 2012 20:54:08 +0000 (15:54 -0500)]
q35: Fix non-PCI IRQ processing in ich9_lpc_update_apic

Avoid passing a non-PCI IRQ to ich9_gsi_to_pirq. It's wrong and triggers
an assertion.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Jason Baron <jbaron@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoq35: Suppress SMM BIOS initialization under KVM
Jan Kiszka [Wed, 14 Nov 2012 20:54:07 +0000 (15:54 -0500)]
q35: Suppress SMM BIOS initialization under KVM

Same as for i44fx: KVM does not support SMM yet. Signal it initialized
to Seabios to avoid failures.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Jason Baron <jbaron@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoich9: Add i82801b11 dmi-to-pci bridge
Jason Baron [Wed, 14 Nov 2012 20:54:07 +0000 (15:54 -0500)]
ich9: Add i82801b11 dmi-to-pci bridge

Add the dmi-to-pci i82801b11 bridge chip. This is the pci bridge chip
that q35 uses on its host bus for PCI bus arbitration.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Jason Baron <jbaron@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoq35: Introduce q35 pc based chipset emulator
Isaku Yamahata [Wed, 14 Nov 2012 20:54:06 +0000 (15:54 -0500)]
q35: Introduce q35 pc based chipset emulator

pc q35 based chipset emulator to support pci express natively. Based on
Anthony Liguori's suggestion, the machine name is 'q35-next', with an alias
of 'q35'. At this point, there are no compatibility guarantees. When the
chipset stabilizes more, we will begin to version the machine names.

Major features which still need to be added:

-Migration support (mostly around ahci)
-ACPI hotplug support (pcie hotplug support is working)
-Passthrough support

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Jason Baron <jbaron@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoich9: Add smbus
Jason Baron [Fri, 23 Nov 2012 03:06:42 +0000 (22:06 -0500)]
ich9: Add smbus

Add support for the ich9 smbus chip.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Jason Baron <jbaron@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoich9: Add the lpc chip
Jason Baron [Wed, 14 Nov 2012 20:54:05 +0000 (15:54 -0500)]
ich9: Add the lpc chip

Add support for the ICH9 LPC chip.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Jason Baron <jbaron@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoich9: Add acpi support and definitions
Jason Baron [Fri, 23 Nov 2012 03:05:06 +0000 (22:05 -0500)]
ich9: Add acpi support and definitions

Lay the groundwork for subsequent ich9 support.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Jason Baron <jbaron@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agopc/piix_pci: factor out smram/pam logic
Isaku Yamahata [Wed, 14 Nov 2012 20:54:02 +0000 (15:54 -0500)]
pc/piix_pci: factor out smram/pam logic

Factor out smram/pam logic for use by other chipsets, namely q35
at this point.

Note: Should be factored out into a generic North Bridge Class.

[jbaron@redhat.com: changes for updated memory API]
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Jason Baron <jbaron@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agopc_piix: Move kvm irq routing functions out of pc_piix.c
Jason Baron [Wed, 14 Nov 2012 20:54:02 +0000 (15:54 -0500)]
pc_piix: Move kvm irq routing functions out of pc_piix.c

Rename: kvm_piix3_gsi_handlei() -> kvm_pc_gsi_handler()
        kvm_piix3_setup_irq_routing() -> kvm_pc_setup_irq_routing()

This is in preparation for other users, namely q35 at this time.

Signed-off-by: Jason Baron <jbaron@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agopc: Move ioapic_init() from pc_piix.c to pc.c
Jason Baron [Wed, 14 Nov 2012 20:54:01 +0000 (15:54 -0500)]
pc: Move ioapic_init() from pc_piix.c to pc.c

Move ioapic_init() from pc_piix.c to pc.c, to make it a common function.
Rename ioapic_init() -> ioapic_init_gsi().
Move to pc.h so q35 can use them as well.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jason Baron <jbaron@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agopc, pc_piix: split out pc nic initialization
Isaku Yamahata [Wed, 14 Nov 2012 20:54:01 +0000 (15:54 -0500)]
pc, pc_piix: split out pc nic initialization

Factor out pc nic initialization.
This simplifies the pc initialization and will reduce the code
duplication of q35 pc initialization.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Jason Baron <jbaron@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'qemu-kvm/uq/master' into staging
Anthony Liguori [Mon, 26 Nov 2012 14:19:45 +0000 (08:19 -0600)]
Merge remote-tracking branch 'qemu-kvm/uq/master' into staging

* qemu-kvm/uq/master:
  Legacy qemu-kvm options have no argument

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'kraxel/usb.72' into staging
Anthony Liguori [Mon, 26 Nov 2012 14:19:20 +0000 (08:19 -0600)]
Merge remote-tracking branch 'kraxel/usb.72' into staging

* kraxel/usb.72:
  usb-redir: Don't handle interrupt output packets async
  usb-redir: Split usb_handle_interrupt_data into separate in/out functions
  usb-smartcard-reader: Properly NAK interrupt eps when we've no events
  usb-bt: Return NAK instead of STALL when interrupt ep has no data
  uhci: Fix double unlink
  uhci: Don't allow the guest to set port-enabled when there is no dev connected
  uhci: Add a completions_only flag for async completions

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'spice/spice.v64' into staging
Anthony Liguori [Mon, 26 Nov 2012 14:19:07 +0000 (08:19 -0600)]
Merge remote-tracking branch 'spice/spice.v64' into staging

* spice/spice.v64:
  spice: add new spice-server callbacks to ui/spice-display.c
  Fix the inconsistency in x509-dh-key-file parameter

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'stefanha/block' into staging
Anthony Liguori [Mon, 26 Nov 2012 14:18:25 +0000 (08:18 -0600)]
Merge remote-tracking branch 'stefanha/block' into staging

* stefanha/block:
  ide: Fix status register after short PRDs
  ide: Fix crash with too long PRD
  use int64_t for return values from rbd instead of int
  vdi: don't override libuuid symbols
  block: add bdrv_reopen() support for raw hdev, floppy, and cdrom

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'stefanha/net' into staging
Anthony Liguori [Mon, 26 Nov 2012 14:18:06 +0000 (08:18 -0600)]
Merge remote-tracking branch 'stefanha/net' into staging

* stefanha/net:
  tap: reset vnet header size on open

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovnc: fix option misspelling ("non-adapative" -> "non-adaptive")
Catalin Patulea [Sat, 10 Nov 2012 00:01:26 +0000 (19:01 -0500)]
vnc: fix option misspelling ("non-adapative" -> "non-adaptive")

Signed-off-by: Catalin Patulea <catalinp@google.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agochardev: Use real-time clock for open timer
Jan Kiszka [Thu, 22 Nov 2012 17:30:02 +0000 (18:30 +0100)]
chardev: Use real-time clock for open timer

The vm clock may be stopped, and then we won't get open events anymore.
Seen with QMP sessions.

Reported-by: Dietmar Maurer <dietmar@proxmox.com>
Tested-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agoBuild system fix distclean error for pixman
Wenchao Xia [Sat, 24 Nov 2012 09:27:18 +0000 (17:27 +0800)]
Build system fix distclean error for pixman

  Currently Makefile test if pixman have configure log, but the script directly
return error if that file do not exist. This patch fix it.

Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agoblock: Fix regression for MinGW (assertion caused by short string)
Stefan Weil [Thu, 22 Nov 2012 06:25:48 +0000 (07:25 +0100)]
block: Fix regression for MinGW (assertion caused by short string)

The local string tmp_filename is passed to function get_tmp_filename
which expects a string with minimum size MAX_PATH for w32 hosts.

MAX_PATH is 260 and PATH_MAX is 259, so tmp_filename was too short.

Commit eba25057b9a5e19d10ace2bc7716667a31297169 introduced this
regression.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agotci: Fix type of tci_read_label
Richard Henderson [Mon, 19 Nov 2012 20:43:14 +0000 (12:43 -0800)]
tci: Fix type of tci_read_label

Fixes the pointer truncation that was occurring for branches.

Cc: Stefan Weil <sw@weilnetz.de>
Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Tested-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agotarget-mips: remove POOL48A from the microMIPS decoding
Aurelien Jarno [Sat, 24 Nov 2012 12:35:06 +0000 (13:35 +0100)]
target-mips: remove POOL48A from the microMIPS decoding

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agotcg: mark local temps as MEM in dead_temp()
Aurelien Jarno [Sat, 24 Nov 2012 10:53:55 +0000 (11:53 +0100)]
tcg: mark local temps as MEM in dead_temp()

In dead_temp, local temps should always be marked as back to memory,
even if they have not been allocated (i.e. they are discared before
cross a basic block).

It fixes the following assertion in target-xtensa:

    qemu-system-xtensa: tcg/tcg.c:1665: temp_save: Assertion `s->temps[temp].val_type == 2 || s->temps[temp].fixed_reg' failed.
    Aborted

Reported-by: Max Filippov <jcmvbkbc@gmail.com>
Tested-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agotarget-mips: Clean up microMIPS32 major opcode
陳韋任 (Wei-Ren Chen) [Wed, 21 Nov 2012 06:04:41 +0000 (14:04 +0800)]
target-mips: Clean up microMIPS32 major opcode

  I check MIPS microMIPS manual [1], and found the major opcode might
be wrong. I add a comment to explicitly indicate what manual I am refering
to, and according that manual I remove microMIPS32 major opcodes 0x1f.
As for others, like 0x16, 0x17, 0x36 and 0x37, they are for higher-order
MIPS ISA level or new revision of this microMIPS architecture. Quote
from Johnson, they are belong MIPS64 [2].

[1] http://www.mips.com/products/architectures/micromips/#specifications

    MIPS Architecture for Programmers Volume II-B:
      The microMIPS32 Instruction Set (Revision 3.05)

    MD00582-2B-microMIPS-AFP-03.05.pdf

[2] http://www.mips.com/products/architectures/mips64/

    MIPS Architecture For Programmers
      Volume II-A: The MIPS64 Instruction Set

    MD00087-2B-MIPS64BIS-AFP-03.51.pdf

Signed-off-by: Chen Wei-Ren <chenwj@iis.sinica.edu.tw>
Reviewed-by: Eric Johnson <ericj@mips.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agotarget-mips: Add comments on POOL32Axf encoding
陳韋任 (Wei-Ren Chen) [Wed, 21 Nov 2012 05:50:45 +0000 (13:50 +0800)]
target-mips: Add comments on POOL32Axf encoding

  Current QEMU MIPS POOL32AXF encoding comes from microMIPS32
and microMIPS32 DSP. Add comment here to help reading.

Signed-off-by: Chen Wei-Ren <chenwj@iis.sinica.edu.tw>
Reviewed-by: Eric Johnson <ericj@mips.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agotarget-openrisc: remove conflicting definitions from cpu.h
Aurelien Jarno [Tue, 9 Oct 2012 19:53:12 +0000 (21:53 +0200)]
target-openrisc: remove conflicting definitions from cpu.h

On an ARM host, the registers definitions from cpu.h clash
with /usr/include/sys/ucontext.h. As there are unused, just remove
them.

Cc: Jia Liu <proljc@gmail.com>
Cc: qemu-stable@nongnu.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agotcg/arm: fix cross-endian qemu_st16
Aurelien Jarno [Tue, 9 Oct 2012 19:53:11 +0000 (21:53 +0200)]
tcg/arm: fix cross-endian qemu_st16

The bswap16 TCG opcode assumes that the high bytes of the temp equal
to 0 before calling it. The ARM backend implementation takes this
assumption to slightly optimize the generated code.

The same implementation is called for implementing the cross-endian
qemu_st16 opcode, where this assumption is not true anymore. One way to
fix that would be to zero the high bytes before calling it. Given the
store instruction just ignore them, it is possible to provide a slightly
more optimized version. With ARMv6+ the rev16 instruction does the work
correctly. For lower ARM versions the patch provides a version which
behaves correctly with non-zero high bytes, but fill them with junk.

Cc: Andrzej Zaborowski <balrogg@gmail.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-stable@nongnu.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agotcg/arm: fix TLB access in qemu-ld/st ops
Aurelien Jarno [Tue, 9 Oct 2012 19:53:11 +0000 (21:53 +0200)]
tcg/arm: fix TLB access in qemu-ld/st ops

The TCG arm backend considers likely that the offset to the TLB
entries does not exceed 12 bits for mem_index = 0. In practice this is
not true for at least the MIPS target.

The current patch fixes that by loading the bits 23-12 with a separate
instruction, and using loads with address writeback, independently of
the value of mem_idx. In total this allow a 24-bit offset, which is a
lot more than needed.

Cc: Andrzej Zaborowski <balrogg@gmail.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-stable@nongnu.org
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agoLegacy qemu-kvm options have no argument
Bruce Rogers [Tue, 20 Nov 2012 14:11:21 +0000 (07:11 -0700)]
Legacy qemu-kvm options have no argument

The options no-kvm, no-kvm-pit, no-kvm-pit-reinjection, and no-kvm-irqchip
should be marked as having no argument.

Signed-off-by: Bruce Rogers <brogers@suse.com>
Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
11 years agousb-redir: Don't handle interrupt output packets async
Hans de Goede [Sat, 17 Nov 2012 11:26:57 +0000 (12:26 +0100)]
usb-redir: Don't handle interrupt output packets async

Instead report them as successfully completed directly on submission, this
has 2 advantages:

1) This matches the timing of interrupt output packets on real hardware,
with the previous async handling, if an ep has an interval of say 500 ms,
then there would be 500+ ms between the submission and the guest seeing the
completion, as we wont do the write back until the qh gets polled again. And
in the mean time the guest may very well have timed out, as the guest can
reasonable expect a much quicker completion.

2) This fixes interrupt output packets potentially getting send twice
surrounding a migration. As we delay the writeback to guest memory until
the qh gets polled again, there is a window between completion and writeback
where migration can happen, in this case the destination will not know
about the completion, and it will execute the packet *again*

But it does also come with a disadvantage:

1) If the actual interrupt out to the real usb device fails, there is no
way to report this back to the guest.

This patch assumes however that interrupt outs in practice never fail, as
they are only used by specialized drivers, which are unlikely to issue illegal
requests (unlike general class drivers which often issue requests which some
devices don't implement). And that thus the advantages outway the disadvantage.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agousb-redir: Split usb_handle_interrupt_data into separate in/out functions
Hans de Goede [Sat, 17 Nov 2012 11:26:56 +0000 (12:26 +0100)]
usb-redir: Split usb_handle_interrupt_data into separate in/out functions

No functional changes.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agousb-smartcard-reader: Properly NAK interrupt eps when we've no events
Hans de Goede [Sat, 17 Nov 2012 11:15:02 +0000 (12:15 +0100)]
usb-smartcard-reader: Properly NAK interrupt eps when we've no events

When we've no data to return from the interrupt endpoint, return NAK rather
then a 0 length packet.

CC: Alon Levy <alevy@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agousb-bt: Return NAK instead of STALL when interrupt ep has no data
Hans de Goede [Sat, 17 Nov 2012 11:15:01 +0000 (12:15 +0100)]
usb-bt: Return NAK instead of STALL when interrupt ep has no data

I noticed this while making all devices with interrupt endpoints properly
do wakeup. While at it also add wakeup support.

Note that I've not tested this, but returning STALL for an interrupt ep
which has no data is cleary the wrong thing to do.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agouhci: Fix double unlink
Hans de Goede [Sat, 17 Nov 2012 11:11:51 +0000 (12:11 +0100)]
uhci: Fix double unlink

uhci_async_cancel() already does a uhci_async_unlink().

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agouhci: Don't allow the guest to set port-enabled when there is no dev connected
Hans de Goede [Sat, 17 Nov 2012 11:11:50 +0000 (12:11 +0100)]
uhci: Don't allow the guest to set port-enabled when there is no dev connected

It is possible for device disconnect and the guest trying to reset the port
(because of USB xact errors prior to the disconnect getting signaled) to race,
when we hit this race, the guest will write the port-control register with its
pre-disconnect value + the reset bit set, after which we have a disconnected
device with its port-enabled bit set in its port-control register, which
is no good :)

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agouhci: Add a completions_only flag for async completions
Hans de Goede [Sat, 17 Nov 2012 11:11:49 +0000 (12:11 +0100)]
uhci: Add a completions_only flag for async completions

Add a completions_only flag, and set this when running process_frame for async
completion handling, this fixes 2 issues in a single patch:

1) It makes sure async completed packets get written to guest mem immediately,
even if all the bandwidth for the frame was consumed from the timer run
process_frame. This is necessary as delaying their writeback to the next frame
can cause the completion to get lost on migration.

2) The calling of process_frame from a bh on async completion causes iso
tds to get server more often they should, messing up usb sound class device
timing. By only processing completed packets, the iso tds get skipped fixing
this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agospice: add new spice-server callbacks to ui/spice-display.c
Gerd Hoffmann [Wed, 21 Nov 2012 13:41:48 +0000 (14:41 +0100)]
spice: add new spice-server callbacks to ui/spice-display.c

Otherwise qemu crashes with non-qxl graphics cards.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agoFix the inconsistency in x509-dh-key-file parameter
Lei Li [Mon, 19 Nov 2012 09:15:08 +0000 (17:15 +0800)]
Fix the inconsistency in x509-dh-key-file parameter

Commit c448e8552b0f6135dabddf944a7110f929c08320 (spice: tls
support) added options to the -spice command line. But there
is an inconsistency between the declaration of the option
'x509-dh-key-file' to -spice command line and its parameter
parsing 'x509-dh-file' in function qemu_spice_init.

https://bugs.launchpad.net/qemu/+bug/1035042

Reported-by: Alon Bar-Lev <alon.barlev@gmail.com>
Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
11 years agoide: Fix status register after short PRDs
Kevin Wolf [Tue, 20 Nov 2012 16:27:44 +0000 (17:27 +0100)]
ide: Fix status register after short PRDs

When failing a request because the length of the regions described by
the PRDT was too short for the requested number of sectors, the IDE
emulation forgot to update the status register, so that the device would
keep the BSY flag set indefinitely.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoide: Fix crash with too long PRD
Kevin Wolf [Tue, 20 Nov 2012 16:27:43 +0000 (17:27 +0100)]
ide: Fix crash with too long PRD

Without this, s->nsector can become negative and badness happens (trying
to malloc huge amount of memory and glib calls abort())

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agouse int64_t for return values from rbd instead of int
Stefan Priebe [Tue, 20 Nov 2012 12:44:55 +0000 (13:44 +0100)]
use int64_t for return values from rbd instead of int

rbd / rados tends to return pretty often length of writes
or discarded blocks. These values might be bigger than int.

The steps to reproduce are:

  mkfs.xfs -f a whole device bigger than int in bytes. mkfs.xfs sends
  a discard. Important is that you use scsi-hd and set
  discard_granularity=512. Otherwise rbd disabled discard support.

Signed-off-by: Stefan Priebe <s.priebe@profihost.ag>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agovdi: don't override libuuid symbols
Stefan Hajnoczi [Tue, 20 Nov 2012 15:34:17 +0000 (16:34 +0100)]
vdi: don't override libuuid symbols

It's poor symbol hygiene to provide a global symbols that collide with a
common library like libuuid.  If QEMU links against a shared library
that depends on uuid_generate() it can end up calling our stub version
of the function.

This exact scenario happened with GlusterFS libgfapi.so, which depends
on libglusterfs.so's uuid_generate().

Scope the uuid stubs for vdi.c only and avoid affecting other shared
objects.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
11 years agoblock: add bdrv_reopen() support for raw hdev, floppy, and cdrom
Jeff Cody [Tue, 20 Nov 2012 15:21:10 +0000 (10:21 -0500)]
block: add bdrv_reopen() support for raw hdev, floppy, and cdrom

For hdev, floppy, and cdrom, the reopen() handlers are the same as
for the file reopen handler.  For floppy and cdrom types, however,
we keep O_NONBLOCK, as in the _open function.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoqemu-sockets: Fix parsing of the inet option 'to'.
Anthony PERARD [Fri, 16 Nov 2012 04:08:14 +0000 (04:08 +0000)]
qemu-sockets: Fix parsing of the inet option 'to'.

Having a qemu command line argument like "-vnc 127.0.0.1:0,to=99" is broken.
This have been break with commit 879e45c72da1569e07fbbc6a1aa2a708ea796044.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: malc <av1474@comtv.ru>
11 years agotcg/ppc: Fix !softmmu case
malc [Wed, 21 Nov 2012 06:55:28 +0000 (10:55 +0400)]
tcg/ppc: Fix !softmmu case

Signed-off-by: malc <av1474@comtv.ru>
11 years agotap: reset vnet header size on open
Michael S. Tsirkin [Tue, 13 Nov 2012 10:23:23 +0000 (12:23 +0200)]
tap: reset vnet header size on open

For tap, we currently assume the vnet header size is 10
(the default value) but that might not be the case
if tap is persistent and has been used by qemu previously.
To fix, set host header size in tap device on open.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoUpdate version for 1.3.0-rc0 release v1.3.0-rc0
Anthony Liguori [Mon, 19 Nov 2012 16:31:17 +0000 (10:31 -0600)]
Update version for 1.3.0-rc0 release

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoaudio/audio_pt_int: Clarify licensing
malc [Mon, 19 Nov 2012 18:26:13 +0000 (22:26 +0400)]
audio/audio_pt_int: Clarify licensing

Signed-off-by: malc <av1474@comtv.ru>
11 years agoaudio/wavcapture: Clarify licensing
malc [Mon, 19 Nov 2012 18:23:17 +0000 (22:23 +0400)]
audio/wavcapture: Clarify licensing

Signed-off-by: malc <av1474@comtv.ru>
11 years agotcg/ppc: Remove unused s_bits variable
malc [Mon, 19 Nov 2012 18:22:24 +0000 (22:22 +0400)]
tcg/ppc: Remove unused s_bits variable

Thanks to Alexander Graf for heads up.

Signed-off-by: malc <av1474@comtv.ru>
11 years agoMerge remote-tracking branch 'kiszka/queues/slirp' into staging
Anthony Liguori [Mon, 19 Nov 2012 15:27:24 +0000 (09:27 -0600)]
Merge remote-tracking branch 'kiszka/queues/slirp' into staging

* kiszka/queues/slirp:
  slirp: Add domain-search option to slirp's DHCP server
  slirp: Don't crash on packets from 0.0.0.0/8.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'bonzini/build-urgent' into staging
Anthony Liguori [Mon, 19 Nov 2012 15:27:13 +0000 (09:27 -0600)]
Merge remote-tracking branch 'bonzini/build-urgent' into staging

* bonzini/build-urgent:
  Makefile: Add missing dependency (fix parallel builds)
  tests: link in stubs
  libcacard: link in stubs
  libcacard: make unnesting rules available to Makefile.objs

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'kwolf/for-anthony' into staging
Anthony Liguori [Mon, 19 Nov 2012 15:27:00 +0000 (09:27 -0600)]
Merge remote-tracking branch 'kwolf/for-anthony' into staging

* kwolf/for-anthony: (26 commits)
  qemu-io: Use bdrv_drain_all instead of qemu_aio_flush
  megasas: Use bdrv_drain_all instead of qemu_aio_flush
  vmdk: Fix data corruption bug in WRITE and READ handling
  fdc: remove last usage of FD_STATE_SEEK
  fdc: fix typo in zero constant
  fdc: remove double affectation of FD_MSR_CMDBUSY flag
  fdc-tests: add tests for VERIFY command
  fdc: implement VERIFY command
  fdc-test: Check READ ID
  fdc: fix false FD_SR0_SEEK
  fdc: fix FD_SR0_SEEK for initial seek on DMA transfers
  fdc: fix FD_SR0_SEEK for non-DMA transfers and multi sectors transfers
  fdc: use status0 field instead of a local variable
  fdc-test: add tests for non-DMA READ command
  fdc-test: insert media before fuzzing registers
  fdc-test: split test_media_change() test, so insert part can be reused
  fdc: Remove status0 parameter from fdctrl_set_fifo()
  aio: rename AIOPool to AIOCBInfo
  aio: use g_slice_alloc() for AIOCB pooling
  aio: switch aiocb_size type int -> size_t
  ...

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'kraxel/usb.71' into staging
Anthony Liguori [Mon, 19 Nov 2012 15:26:48 +0000 (09:26 -0600)]
Merge remote-tracking branch 'kraxel/usb.71' into staging

* kraxel/usb.71:
  usb-host: fix splitted transfers
  usb-host: update tracing
  usb-redir: Set default debug level to warning
  usb-redir: Only add actually in flight packets to the in flight queue
  ehci: handle dma errors
  ehci: keep the frame timer running in case the guest asked for frame list rollover interrupts
  ehci: Don't verify the next pointer for periodic qh-s and qtd-s
  ehci: Better detection for qtd-s linked in circles
  ehci: Fixup q->qtdaddr after cancelling an already completed packet
  ehci: Don't access packet after freeing it
  usb: host-linux: Ignore parsing errors of the device descriptors
  usb-host: scan for usb devices when the vm starts
  usb: Fix (another) bug in usb_packet_map() for IOMMU handling
  fix live migration

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'stefanha/tracing' into staging
Anthony Liguori [Mon, 19 Nov 2012 14:32:03 +0000 (08:32 -0600)]
Merge remote-tracking branch 'stefanha/tracing' into staging

* stefanha/tracing:
  trace: Remove "info trace" from documents
  trace: document '-' syntax for disabling events
  trace: allow disabling events in events file
  Avoid all systemtap reserved words

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'amit/loadvm-irq-inj-fix' into staging
Anthony Liguori [Mon, 19 Nov 2012 14:31:48 +0000 (08:31 -0600)]
Merge remote-tracking branch 'amit/loadvm-irq-inj-fix' into staging

* amit/loadvm-irq-inj-fix:
  virtio-serial-bus: post_load send_event when vm is running

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'afaerber/qom-cpu' into staging
Anthony Liguori [Mon, 19 Nov 2012 14:31:24 +0000 (08:31 -0600)]
Merge remote-tracking branch 'afaerber/qom-cpu' into staging

* afaerber/qom-cpu:
  target-i386: Add Haswell CPU model
  target-i386/cpu: Add new Opteron CPU model
  target-i386/cpu: Name new CPUID bits
  qapi-types.h: Don't include qemu-common.h
  osdep: Move qemu_{open,close}() prototypes
  qemu-config.h: Include headers it needs
  vnc-palette.h: Include <stdbool.h>
  qemu-fsdev-dummy.c: Include module.h
  qdev: Split up header so it can be used in cpu.h
  Move qemu_irq typedef out of qemu-common.h
  qemu-common.h: Comment about usage rules

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'qemu-kvm/uq/master' into staging
Anthony Liguori [Mon, 19 Nov 2012 14:30:45 +0000 (08:30 -0600)]
Merge remote-tracking branch 'qemu-kvm/uq/master' into staging

* qemu-kvm/uq/master:
  kvm: Actually remove software breakpoints from list on cleanup
  acpi_piix4: fix migration of gpe fields

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agorng-random: only build on POSIX platforms
Anthony Liguori [Sat, 17 Nov 2012 13:40:47 +0000 (07:40 -0600)]
rng-random: only build on POSIX platforms

There is no /dev/random on win32.

Cc: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMakefile: Add missing dependency (fix parallel builds)
Stefan Weil [Sun, 18 Nov 2012 22:09:51 +0000 (23:09 +0100)]
Makefile: Add missing dependency (fix parallel builds)

The executables in i386-softmmu, i386-linux-user, ...
depend on the recently added libqemustub.a.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agotests: link in stubs
Paolo Bonzini [Mon, 19 Nov 2012 08:45:34 +0000 (09:45 +0100)]
tests: link in stubs

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agolibcacard: link in stubs
Paolo Bonzini [Mon, 19 Nov 2012 08:45:20 +0000 (09:45 +0100)]
libcacard: link in stubs

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agolibcacard: make unnesting rules available to Makefile.objs
Paolo Bonzini [Mon, 19 Nov 2012 08:45:06 +0000 (09:45 +0100)]
libcacard: make unnesting rules available to Makefile.objs

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agotci: Support deposit operations
Stefan Weil [Tue, 18 Sep 2012 20:52:14 +0000 (22:52 +0200)]
tci: Support deposit operations

The operations for INDEX_op_deposit_i32 and INDEX_op_deposit_i64
are now supported and enabled by default.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agotci: Fix build breakage (unresolved symbol tcg_out_tb_finalize)
Stefan Weil [Sun, 18 Nov 2012 19:16:26 +0000 (20:16 +0100)]
tci: Fix build breakage (unresolved symbol tcg_out_tb_finalize)

Commit 32761257c0b9fa7ee04d2871a6e48a41f119c469 enabled
qemu_ld/st optimization unconditionally for some hosts.

The TCG interpreter still does not support this kind of
optimization. Therefore builds with TCI fail with an
unresolved symbol tcg_out_tb_finalize. This is fixed here.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agotci: fix build breakage for target MIPS
Stefan Weil [Sun, 18 Nov 2012 19:06:19 +0000 (20:06 +0100)]
tci: fix build breakage for target MIPS

commit 5f7319cd introduced GETPC() usage for MIPS, which is currently
not defined when building with --enable-tcg-interpreter. Add MIPS to
the list of targets we selectively define GETPC() for.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agobuild: replace weak symbols with a static library
Paolo Bonzini [Fri, 16 Nov 2012 17:35:27 +0000 (18:35 +0100)]
build: replace weak symbols with a static library

Weak symbols were a nice idea, but they turned out not to be a good one.
Toolchain support is just too sparse, in particular llvm-gcc is totally
broken.

This patch uses a surprisingly low-tech approach: a static library.
Symbols in a static library are always overridden by symbols in an
object file.  Furthermore, if you place each function in a separate
source file, object files for unused functions will not be taken in.
This means that each function can use all the dependencies that it needs
(especially QAPI stuff such as error_setg).

Thus, all stubs are placed in separate object files and put together in
a static library.  The library then is linked to all programs.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Tested-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agolibseccomp: require version 1.0.0
Blue Swirl [Sat, 3 Nov 2012 15:42:21 +0000 (15:42 +0000)]
libseccomp: require version 1.0.0

Debian Wheezy has version 0.1.0 which is not compatible, avoid it.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agoMerge branch 'vga.1' of git://git.kraxel.org/qemu
Blue Swirl [Sat, 17 Nov 2012 16:38:05 +0000 (16:38 +0000)]
Merge branch 'vga.1' of git://git.kraxel.org/qemu

* 'vga.1' of git://git.kraxel.org/qemu:
  vga: fix mmio vga register mapping
  vga: fix bochs alignment issue

11 years agoTCG: Remove unused global variables
Evgeny Voevodin [Mon, 12 Nov 2012 09:27:49 +0000 (13:27 +0400)]
TCG: Remove unused global variables

Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agoTCG: Use gen_opparam_buf from context instead of global variable.
Evgeny Voevodin [Mon, 12 Nov 2012 09:27:48 +0000 (13:27 +0400)]
TCG: Use gen_opparam_buf from context instead of global variable.

Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agoTCG: Use gen_opc_buf from context instead of global variable.
Evgeny Voevodin [Mon, 12 Nov 2012 09:27:47 +0000 (13:27 +0400)]
TCG: Use gen_opc_buf from context instead of global variable.

Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agoTCG: Use gen_opparam_ptr from context instead of global variable.
Evgeny Voevodin [Mon, 12 Nov 2012 09:27:46 +0000 (13:27 +0400)]
TCG: Use gen_opparam_ptr from context instead of global variable.

Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agoTCG: Use gen_opc_ptr from context instead of global variable.
Evgeny Voevodin [Mon, 12 Nov 2012 09:27:45 +0000 (13:27 +0400)]
TCG: Use gen_opc_ptr from context instead of global variable.

Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agotcg/tcg.h: Duplicate global TCG variables in TCGContext
Evgeny Voevodin [Mon, 12 Nov 2012 09:27:44 +0000 (13:27 +0400)]
tcg/tcg.h: Duplicate global TCG variables in TCGContext

Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agotarget-cris/translate.c: Code style clean-up
Evgeny Voevodin [Mon, 12 Nov 2012 09:27:43 +0000 (13:27 +0400)]
target-cris/translate.c: Code style clean-up

Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agorng-egd: don't use gslist_free_full
Anthony Liguori [Fri, 16 Nov 2012 19:09:34 +0000 (13:09 -0600)]
rng-egd: don't use gslist_free_full

This function was only introduced in glib 2.28.0.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio-rng-pci: create a default backend if none exists
Anthony Liguori [Fri, 26 Oct 2012 17:05:49 +0000 (12:05 -0500)]
virtio-rng-pci: create a default backend if none exists

This allows you to specify:

  $ qemu -device virtio-rng-pci

And things will Just Work with a reasonable default.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio-rng: add rate limiting support
Anthony Liguori [Tue, 30 Oct 2012 22:45:05 +0000 (17:45 -0500)]
virtio-rng: add rate limiting support

This adds parameters to virtio-rng-pci to allow rate limiting the entropy a
guest receives.  An example command line:

$ qemu -device virtio-rng-pci,max-bytes=1024,period=1000

Would limit entropy collection to 1Kb/s.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio-rng: hardware random number generator device
Amit Shah [Wed, 20 Jun 2012 06:59:32 +0000 (12:29 +0530)]
virtio-rng: hardware random number generator device

The Linux kernel already has a virtio-rng driver, this is the device
implementation.

When the guest asks for entropy from the virtio hwrng, it puts a buffer
in the vq.  We then put entropy into that buffer, and push it back to
the guest.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
aliguori: converted to new RngBackend interface
aliguori: remove entropy needed event
aliguori: fix migration