]> git.proxmox.com Git - mirror_qemu.git/log
mirror_qemu.git
11 years agomemory: add big endian support to access_with_adjusted_size
Paolo Bonzini [Fri, 24 May 2013 10:54:01 +0000 (12:54 +0200)]
memory: add big endian support to access_with_adjusted_size

This will be used to split 8-byte access down to two four-byte accesses.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agomemory: accept mismatching sizes in memory_region_access_valid
Paolo Bonzini [Fri, 24 May 2013 15:48:52 +0000 (17:48 +0200)]
memory: accept mismatching sizes in memory_region_access_valid

The memory API is able to use smaller/wider accesses than requested,
match that in memory_region_access_valid.  Of course, the accepts
callback is still free to reject those accesses.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agomemory: add address_space_access_valid
Paolo Bonzini [Thu, 11 Apr 2013 13:40:59 +0000 (15:40 +0200)]
memory: add address_space_access_valid

The old-style IOMMU lets you check whether an access is valid in a
given DMAContext.  There is no equivalent for AddressSpace in the
memory API, implement it with a lookup of the dispatch tree.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agoexec: implement .valid.accepts for subpages
Paolo Bonzini [Fri, 24 May 2013 12:02:39 +0000 (14:02 +0200)]
exec: implement .valid.accepts for subpages

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agomemory: export memory_region_access_valid to exec.c
Paolo Bonzini [Fri, 24 May 2013 09:55:06 +0000 (11:55 +0200)]
memory: export memory_region_access_valid to exec.c

We'll use it to implement address_space_access_valid.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agoexec: introduce memory_access_size
Paolo Bonzini [Fri, 24 May 2013 09:59:43 +0000 (11:59 +0200)]
exec: introduce memory_access_size

This will be used by address_space_access_valid too.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agoexec: introduce memory_access_is_direct
Paolo Bonzini [Fri, 24 May 2013 10:29:54 +0000 (12:29 +0200)]
exec: introduce memory_access_is_direct

After the previous patches, this is a common test for all read/write
functions.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agoexec: expect mr->ops to be initialized for ROM
Paolo Bonzini [Fri, 24 May 2013 11:21:01 +0000 (13:21 +0200)]
exec: expect mr->ops to be initialized for ROM

There is no need to use the special phys_section_rom section.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agomemory: assign MemoryRegionOps to all regions
Paolo Bonzini [Fri, 24 May 2013 11:55:52 +0000 (13:55 +0200)]
memory: assign MemoryRegionOps to all regions

This allows to remove the checks on section->readonly.  Simply,
write accesses to ROM will not be considered "direct" and will
go through mr->ops without any special intervention.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agomemory: move unassigned_mem_ops to memory.c
Paolo Bonzini [Fri, 24 May 2013 11:23:38 +0000 (13:23 +0200)]
memory: move unassigned_mem_ops to memory.c

reservation_ops is already doing the same thing.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agomemory: add address_space_translate
Paolo Bonzini [Fri, 24 May 2013 10:59:37 +0000 (12:59 +0200)]
memory: add address_space_translate

Using phys_page_find to translate an AddressSpace to a MemoryRegionSection
is unwieldy.  It requires to pass the page index rather than the address,
and later memory_region_section_addr has to be called.  Replace
memory_region_section_addr with a function that does all of it: call
phys_page_find, compute the offset within the region, and check how
big the current mapping is.  This way, a large flat region can be written
with a single lookup rather than a page at a time.

address_space_translate will also provide a single point where IOMMU
forwarding is implemented.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agomemory: dispatch unassigned accesses based on .valid.accepts
Paolo Bonzini [Fri, 24 May 2013 12:48:38 +0000 (14:48 +0200)]
memory: dispatch unassigned accesses based on .valid.accepts

This provides the basics for detecting accesses to unassigned memory
as soon as they happen, and also for a simple implementation of
address_space_access_valid.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agoexec: do not use error_mem_read
Paolo Bonzini [Fri, 24 May 2013 12:39:13 +0000 (14:39 +0200)]
exec: do not use error_mem_read

We will soon reach this case when doing (unaligned) accesses that
span partly past the end of memory.  We do not want to crash in
that case.

unassigned_mem_ops and rom_mem_ops are now the same.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agoexec: make io_mem_unassigned private
Paolo Bonzini [Fri, 24 May 2013 12:37:28 +0000 (14:37 +0200)]
exec: make io_mem_unassigned private

There is no reason to avoid a recompile before accessing unassigned
memory.  In the end it will be treated as MMIO anyway.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agocputlb: simplify tlb_set_page
Paolo Bonzini [Fri, 24 May 2013 14:45:30 +0000 (16:45 +0200)]
cputlb: simplify tlb_set_page

The same "if" condition is repeated twice.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agoexec: drop useless #if
Paolo Bonzini [Fri, 24 May 2013 15:14:05 +0000 (17:14 +0200)]
exec: drop useless #if

This code is only compiled for softmmu targets.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agoexec: eliminate io_mem_ram
Paolo Bonzini [Fri, 24 May 2013 12:34:08 +0000 (14:34 +0200)]
exec: eliminate io_mem_ram

It is never used, the IOTLB always goes through io_mem_notdirty.

In fact in softmmu_template.h, if it were, QEMU would crash just
below the tests, as soon as io_mem_read/write dispatches to
error_mem_read/write.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agoRemove Sun4c, Sun4d and a few CPUs
Blue Swirl [Sun, 14 Apr 2013 18:10:28 +0000 (18:10 +0000)]
Remove Sun4c, Sun4d and a few CPUs

Sun4c and Sun4d architectures and related CPUs are not fully implemented
(especially Sun4c MMU) and there has been no interest for them.

Likewise, a few CPUs (Cypress, Ross etc) are only half implemented.

Remove the machines and CPUs, they can be re-added if needed later.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agoRemove OSS support for OpenBSD
Brad Smith [Fri, 24 May 2013 23:01:07 +0000 (19:01 -0400)]
Remove OSS support for OpenBSD

Remove the OSS support for OpenBSD. The OSS API has not been usable
for quite some time.

Signed-off-by: Brad Smith <brad@comstyle.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agotarget-arm: Remove gen_{ld,st}* definitions
Peter Maydell [Thu, 23 May 2013 12:00:03 +0000 (13:00 +0100)]
target-arm: Remove gen_{ld,st}* definitions

All the uses of the gen_{ld,st}* functions are gone now, so remove
the functions themselves.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agotarget-arm: Remove gen_{ld,st}* from thumb2 decoder
Peter Maydell [Thu, 23 May 2013 12:00:02 +0000 (13:00 +0100)]
target-arm: Remove gen_{ld,st}* from thumb2 decoder

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agotarget-arm: Remove gen_{ld,st}* from Thumb insns
Peter Maydell [Thu, 23 May 2013 12:00:01 +0000 (13:00 +0100)]
target-arm: Remove gen_{ld,st}* from Thumb insns

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agotarget-arm: Remove gen_{ld,st}* from basic ARM insns
Peter Maydell [Thu, 23 May 2013 12:00:00 +0000 (13:00 +0100)]
target-arm: Remove gen_{ld,st}* from basic ARM insns

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agotarget-arm: Remove use of gen_{ld,st}* from ldrex/strex
Peter Maydell [Thu, 23 May 2013 11:59:59 +0000 (12:59 +0100)]
target-arm: Remove use of gen_{ld,st}* from ldrex/strex

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agotarget-arm: Remove uses of gen_{ld,st}* from Neon code
Peter Maydell [Thu, 23 May 2013 11:59:58 +0000 (12:59 +0100)]
target-arm: Remove uses of gen_{ld,st}* from Neon code

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agotarget-arm: Remove uses of gen_{ld,st}* from iWMMXt code
Peter Maydell [Thu, 23 May 2013 11:59:57 +0000 (12:59 +0100)]
target-arm: Remove uses of gen_{ld,st}* from iWMMXt code

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agotarget-arm: Remove gen_ld64() and gen_st64()
Peter Maydell [Thu, 23 May 2013 11:59:56 +0000 (12:59 +0100)]
target-arm: Remove gen_ld64() and gen_st64()

gen_ld64() and gen_st64() are used only in one place, so just
expand them out.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agotarget-arm: Don't use TCGv when we mean TCGv_i32
Peter Maydell [Thu, 23 May 2013 11:59:55 +0000 (12:59 +0100)]
target-arm: Don't use TCGv when we mean TCGv_i32

TCGv changes size depending on the compile time value of
TARGET_LONG_BITS.  This is useful for generating code for MIPS style
"instructions are the same but the register width changes" CPUs, and
also for the generic bits of QEMU which operate on "width of a
virtual address" values, but mostly in the ARM target code we were
using it purely as a shorthand for "any 32 bit value".

This needs to change in preparation for AArch64 support, since an
AArch64-capable v8 core will have 64 bit virtual addresses but still
use 32 bit values for the 32 bit instruction set.

This patch mechanically converts all the occurrences of TCGv,
tcg_temp_new(), tcg_temp_free(), tcg_temp_local_new() and
TCGV_UNUSED() to their explicitly 32 bit counterparts.  This is
correct for everything except the arguments to tcg_gen_qemu_{ld,st}*,
which really do need to be TCGv and so will require a 32-to-64
conversion when building the 32 bit code for AArch64.  Those changes
will be in a separate patch for easier review.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agoMerge remote-tracking branch 'bonzini/iommu-for-anthony' into staging
Anthony Liguori [Fri, 24 May 2013 18:47:42 +0000 (13:47 -0500)]
Merge remote-tracking branch 'bonzini/iommu-for-anthony' into staging

# By Paolo Bonzini (11) and others
# Via Paolo Bonzini
* bonzini/iommu-for-anthony:
  memory: clean up phys_page_find
  memory: populate FlatView for new address spaces
  memory: limit sections in the radix tree to the actual address space size
  s390x: reduce TARGET_PHYS_ADDR_SPACE_BITS to 62
  memory: fix address space initialization/destruction
  memory: make memory_global_sync_dirty_bitmap take an AddressSpace
  memory: do not duplicate memory_region_destructor_none
  memory: Rename readable flag to romd_mode
  memory: Replace open-coded memory_region_is_romd
  memory: allow memory_region_find() to run on non-root memory regions
  memory: assert that PhysPageEntry's ptr does not overflow
  exec: eliminate stq_phys_notdirty
  exec: make qemu_get_ram_ptr private
  exec: eliminate qemu_put_ram_ptr
  exec: remove obsolete comment

Message-id: 1369414987-8839-1-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'stefanha/net' into staging
Anthony Liguori [Fri, 24 May 2013 18:47:33 +0000 (13:47 -0500)]
Merge remote-tracking branch 'stefanha/net' into staging

# By Alasdair McLeay (1) and Stefan Hajnoczi (1)
# Via Stefan Hajnoczi
* stefanha/net:
  rtl8139: flush queued packets when RxBufPtr is written
  net: support for bridged networking on Mac OS X

Message-id: 1369406295-20411-1-git-send-email-stefanha@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'stefanha/block' into staging
Anthony Liguori [Fri, 24 May 2013 18:47:25 +0000 (13:47 -0500)]
Merge remote-tracking branch 'stefanha/block' into staging

# By Wenchao Xia (5) and others
# Via Stefan Hajnoczi
* stefanha/block:
  coroutine: stop using AioContext in CoQueue
  coroutine: protect global pool with a mutex
  qemu-iotests: Try creating huge qcow2 image
  qcow2.py: Subcommand for changing header fields
  qemu-io: Fix 'map' output
  blockdev: Rename BlockdevAction -> TransactionAction
  block: make all steps in qmp_transaction() as callback
  block: package rollback code in qmp_transaction()
  block: package committing code in qmp_transaction()
  block: move input parsing code in qmp_transaction()
  block: package preparation code in qmp_transaction()

Message-id: 1369405947-14818-1-git-send-email-stefanha@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agomemory: clean up phys_page_find
Paolo Bonzini [Mon, 20 May 2013 10:21:07 +0000 (12:21 +0200)]
memory: clean up phys_page_find

Remove the goto.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agomemory: populate FlatView for new address spaces
Paolo Bonzini [Tue, 16 Apr 2013 13:39:51 +0000 (15:39 +0200)]
memory: populate FlatView for new address spaces

Even a new address space might have a non-empty FlatView.  In order
to initialize it properly, address_space_init should (a) call
memory_region_transaction_commit after the address space is inserted
into the list; (b) force memory_region_transaction_commit to do something.

This bug was latent so far because all address spaces started empty, including
the PCI address space where the bus master region is initially disabled.
However, the target address space of an IOMMU is usually rooted at
get_system_memory(), which might not be empty at the time the IOMMU is created.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agomemory: limit sections in the radix tree to the actual address space size
Avi Kivity [Tue, 30 Oct 2012 11:47:45 +0000 (13:47 +0200)]
memory: limit sections in the radix tree to the actual address space size

The radix tree is statically sized to fit TARGET_PHYS_ADDR_SPACE_BITS.
If a larger memory region is registered, it will overflow.

Fix by limiting any section in the radix tree to the supported size.

This problem was not observed earlier since artificial regions (containers
and aliases) are eliminated by the memory core, leaving only device regions
which have reasonable sizes.  An IOMMU however cannot be eliminated by the
memory core, and may have an artificial size.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Avi Kivity <avi.kivity@gmail.com>
[ Fail the build if TARGET_PHYS_ADDR_SPACE_BITS is too large - Paolo ]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agos390x: reduce TARGET_PHYS_ADDR_SPACE_BITS to 62
Paolo Bonzini [Mon, 13 May 2013 13:54:44 +0000 (15:54 +0200)]
s390x: reduce TARGET_PHYS_ADDR_SPACE_BITS to 62

With the next patch, the memory API will complain if the
TARGET_PHYS_ADDR_SPACE_BITS gets dangerously close to an
overflow.  s390x can handle up to 64 bit of physical address
space from its page tables, but we never use that much.  Just
decrease the value.

Cc: Alexander Graf <agraf@suse.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agomemory: fix address space initialization/destruction
Avi Kivity [Tue, 30 Oct 2012 11:47:44 +0000 (13:47 +0200)]
memory: fix address space initialization/destruction

A couple of fields were left uninitialized.  This was not observed earlier
because all address spaces were statically allocated.  Also free allocation
for those fields.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Avi Kivity <avi.kivity@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agomemory: make memory_global_sync_dirty_bitmap take an AddressSpace
Paolo Bonzini [Wed, 24 Apr 2013 08:46:55 +0000 (10:46 +0200)]
memory: make memory_global_sync_dirty_bitmap take an AddressSpace

Since this is a MemoryListener operation, it only makes sense
on an AddressSpace granularity.

Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agomemory: do not duplicate memory_region_destructor_none
Paolo Bonzini [Fri, 3 May 2013 15:18:36 +0000 (17:18 +0200)]
memory: do not duplicate memory_region_destructor_none

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agomemory: Rename readable flag to romd_mode
Jan Kiszka [Tue, 7 May 2013 17:04:25 +0000 (19:04 +0200)]
memory: Rename readable flag to romd_mode

"Readable" is a very unfortunate name for this flag because even a
rom_device region will always be readable from the guest POV. What
differs is the mapping, just like the comments had to explain already.
Also, readable could currently be understood as being a generic region
flag, but it only applies to rom_device regions.

So rename the flag and the function to modify it after the original term
"ROMD" which could also be interpreted as "ROM direct", i.e. ROM mode
with direct access. In any case, the scope of the flag is clearer now.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agomemory: Replace open-coded memory_region_is_romd
Jan Kiszka [Mon, 6 May 2013 16:07:05 +0000 (18:07 +0200)]
memory: Replace open-coded memory_region_is_romd

Improves readability.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
11 years agomemory: allow memory_region_find() to run on non-root memory regions
Paolo Bonzini [Tue, 7 May 2013 13:48:28 +0000 (15:48 +0200)]
memory: allow memory_region_find() to run on non-root memory regions

memory_region_find() is similar to registering a MemoryListener and
checking for the MemoryRegionSections that come from a particular
region.  There is no reason for this to be limited to a root memory
region.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agomemory: assert that PhysPageEntry's ptr does not overflow
Paolo Bonzini [Tue, 7 May 2013 09:30:23 +0000 (11:30 +0200)]
memory: assert that PhysPageEntry's ptr does not overflow

While sized to 15 bits in PhysPageEntry, the ptr field is ORed into the
iotlb entries together with a page-aligned pointer.  The ptr field must
not overflow into this page-aligned value, assert that it is smaller than
the page size.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agoexec: eliminate stq_phys_notdirty
Paolo Bonzini [Mon, 20 May 2013 10:40:58 +0000 (12:40 +0200)]
exec: eliminate stq_phys_notdirty

It is not used anywhere.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agoexec: make qemu_get_ram_ptr private
Paolo Bonzini [Tue, 14 May 2013 09:47:56 +0000 (11:47 +0200)]
exec: make qemu_get_ram_ptr private

It is a private interface between exec.c and memory.c.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agoexec: eliminate qemu_put_ram_ptr
Paolo Bonzini [Tue, 14 May 2013 09:44:02 +0000 (11:44 +0200)]
exec: eliminate qemu_put_ram_ptr

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agoexec: remove obsolete comment
Paolo Bonzini [Thu, 11 Apr 2013 13:33:16 +0000 (15:33 +0200)]
exec: remove obsolete comment

See how we call memory_region_section_addr two lines below to
convert a physical address to a base address in the region.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agortl8139: flush queued packets when RxBufPtr is written
Stefan Hajnoczi [Wed, 22 May 2013 12:50:18 +0000 (14:50 +0200)]
rtl8139: flush queued packets when RxBufPtr is written

Net queues support efficient "receive disable".  For example, tap's file
descriptor will not be polled while its peer has receive disabled.  This
saves CPU cycles for needlessly copying and then dropping packets which
the peer cannot receive.

rtl8139 is missing the qemu_flush_queued_packets() call that wakes the
queue up when receive becomes possible again.

As a result, the Windows 7 guest driver reaches a state where the
rtl8139 cannot receive packets.  The driver has actually refilled the
receive buffer but we never resume reception.

The bug can be reproduced by running a large FTP 'get' inside a Windows
7 guest:

  $ qemu -netdev tap,id=tap0,...
         -device rtl8139,netdev=tap0

The Linux guest driver does not trigger the bug, probably due to a
different buffer management strategy.

Reported-by: Oliver Francke <oliver.francke@filoo.de>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agonet: support for bridged networking on Mac OS X
Alasdair McLeay [Thu, 9 May 2013 18:44:30 +0000 (19:44 +0100)]
net: support for bridged networking on Mac OS X

tun tap can be implemented on Mac OS X using
http://tuntaposx.sourceforge.net

It behaves in the same way as FreeBSD/OpenBSD implementations, but Qemu
needs a patch to use the OpenBS/FreeBSD code.

As per the patch listed in this forum thread:
http://forum.gns3.net/post17679.html#p17679

And also as used in the MacPorts installation:
https://trac.macports.org/browser/trunk/dports/emulators/qemu/files/patch-net-tap-interface.diff

Signed-off-by: Alasdair McLeay <alasdair.mcleay@me.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agocoroutine: stop using AioContext in CoQueue
Stefan Hajnoczi [Fri, 17 May 2013 13:51:26 +0000 (15:51 +0200)]
coroutine: stop using AioContext in CoQueue

qemu_co_queue_next(&queue) arranges that the next queued coroutine is
run at a later point in time.  This deferred restart is useful because
the caller may not want to transfer control yet.

This behavior was implemented using QEMUBH in the past, which meant that
CoQueue (and hence CoMutex and CoRwlock) had a dependency on the
AioContext event loop.  This hidden dependency causes trouble when we
move to a world with multiple event loops - now qemu_co_queue_next()
needs to know which event loop to schedule the QEMUBH in.

After pondering how to stash AioContext I realized the best solution is
to not use AioContext at all.  This patch implements the deferred
restart behavior purely in terms of coroutines and no longer uses
QEMUBH.

Here is how it works:

Each Coroutine has a wakeup queue that starts out empty.  When
qemu_co_queue_next() is called, the next coroutine is added to our
wakeup queue.  The wakeup queue is processed when we yield or terminate.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agocoroutine: protect global pool with a mutex
Stefan Hajnoczi [Fri, 17 May 2013 13:51:25 +0000 (15:51 +0200)]
coroutine: protect global pool with a mutex

The coroutine freelist is a global pool of unused coroutines.  It avoids
the setup/teardown overhead associated with the coroutine lifecycle.
Since the pool is global, we need to synchronize access so that
coroutines can be used outside the BQL.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoqemu-iotests: Try creating huge qcow2 image
Kevin Wolf [Mon, 13 May 2013 12:11:13 +0000 (14:11 +0200)]
qemu-iotests: Try creating huge qcow2 image

It's supposed to fail gracefully instead of segfaulting.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
11 years agoqcow2.py: Subcommand for changing header fields
Kevin Wolf [Mon, 13 May 2013 12:00:15 +0000 (14:00 +0200)]
qcow2.py: Subcommand for changing header fields

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
11 years agoqemu-io: Fix 'map' output
Kevin Wolf [Mon, 13 May 2013 13:31:34 +0000 (15:31 +0200)]
qemu-io: Fix 'map' output

The output of the 'map' command in qemu-io used to directly resemble
bdrv_is_allocated() and could contain many lines for small chunks that
all have the same allocation status. After this patch, they will be
coalesced into a single output line for a large chunk.

As a side effect, the command gains some error handling.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
11 years agoblockdev: Rename BlockdevAction -> TransactionAction
Kevin Wolf [Mon, 13 May 2013 08:43:43 +0000 (10:43 +0200)]
blockdev: Rename BlockdevAction -> TransactionAction

There's no reason to restrict transactions to operations related to
block devices, so rename the type now before schema introspection stops
us from doing so.

Also change the schema documentation of 'transaction' to not refer to
block devices or snapshots any more.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
11 years agoblock: make all steps in qmp_transaction() as callback
Wenchao Xia [Wed, 8 May 2013 10:25:16 +0000 (18:25 +0800)]
block: make all steps in qmp_transaction() as callback

Make it easier to add other operations to qmp_transaction() by using
callbacks, with external snapshots serving as an example implementation
of the callbacks.

Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
11 years agoblock: package rollback code in qmp_transaction()
Wenchao Xia [Wed, 8 May 2013 10:25:15 +0000 (18:25 +0800)]
block: package rollback code in qmp_transaction()

Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
11 years agoblock: package committing code in qmp_transaction()
Wenchao Xia [Wed, 8 May 2013 10:25:14 +0000 (18:25 +0800)]
block: package committing code in qmp_transaction()

The code is simply moved into a separate function.

Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
11 years agoblock: move input parsing code in qmp_transaction()
Wenchao Xia [Wed, 8 May 2013 10:25:13 +0000 (18:25 +0800)]
block: move input parsing code in qmp_transaction()

The code is moved into preparation function, and changed
a bit to tip more clearly what it is doing.

Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
11 years agoblock: package preparation code in qmp_transaction()
Wenchao Xia [Wed, 8 May 2013 10:25:12 +0000 (18:25 +0800)]
block: package preparation code in qmp_transaction()

The code before really committing is moved into a function. Most
code is simply moved from qmp_transaction(), except that on fail it
just returns now. Other code such as input parsing is not touched,
to make it easier in review.

Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
11 years agoMerge remote-tracking branch 'luiz/queue/qmp' into staging
Anthony Liguori [Thu, 23 May 2013 19:16:34 +0000 (14:16 -0500)]
Merge remote-tracking branch 'luiz/queue/qmp' into staging

# By Michael Roth (10) and others
# Via Luiz Capitulino
* luiz/queue/qmp:
  monitor: allow to disable the default monitor
  ui/input.c: replace magic numbers with macros
  qapi: add native list coverage for QMP input visitor tests
  qapi: add native list coverage for QMP output visitor tests
  qapi: add native list coverage for visitor serialization tests
  qapi: fix visitor serialization tests for numbers/doubles
  qapi: add QMP input test for large integers
  json-parser: fix handling of large whole number values
  qapi: enable generation of native list code
  qapi: qapi-visit.py, native list support
  qapi: qapi-visit.py, fix list handling for union types
  qapi: qapi-types.py, native list support

Message-id: 1369333232-24145-1-git-send-email-lcapitulino@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agomonitor: allow to disable the default monitor
Luiz Capitulino [Thu, 16 May 2013 16:02:55 +0000 (12:02 -0400)]
monitor: allow to disable the default monitor

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
11 years agoui/input.c: replace magic numbers with macros
Amos Kong [Thu, 16 May 2013 05:19:47 +0000 (13:19 +0800)]
ui/input.c: replace magic numbers with macros

It's clearer to use defined macros than magic numbers.

Signed-off-by: Amos Kong <akong@redhat.com>
Reviewed-by: Lei Li <lilei@linux.vnet.ibm.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
11 years agoqapi: add native list coverage for QMP input visitor tests
Michael Roth [Fri, 10 May 2013 22:46:10 +0000 (17:46 -0500)]
qapi: add native list coverage for QMP input visitor tests

This exercises schema-generated visitors for native list types and does
some sanity checking on validity of deserialized data.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Amos Kong <akong@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
11 years agoqapi: add native list coverage for QMP output visitor tests
Michael Roth [Fri, 10 May 2013 22:46:09 +0000 (17:46 -0500)]
qapi: add native list coverage for QMP output visitor tests

This exercises schema-generated visitors for native list types and does
some sanity checking on validity of serialized data.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Amos Kong <akong@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
11 years agoqapi: add native list coverage for visitor serialization tests
Michael Roth [Fri, 10 May 2013 22:46:08 +0000 (17:46 -0500)]
qapi: add native list coverage for visitor serialization tests

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Amos Kong <akong@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
11 years agoqapi: fix visitor serialization tests for numbers/doubles
Michael Roth [Fri, 10 May 2013 22:46:07 +0000 (17:46 -0500)]
qapi: fix visitor serialization tests for numbers/doubles

We never actually stored the stringified double values into the strings
before we did the comparisons. This left number/double values completely
uncovered in test-visitor-serialization tests.

Fixing this exposed a bug in our handling of large whole number values
in QEMU's JSON parser which is now fixed.

Simplify the code while we're at it by dropping the
calc_float_string_storage() craziness in favor of GStrings.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Amos Kong <akong@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
11 years agoqapi: add QMP input test for large integers
Michael Roth [Fri, 10 May 2013 22:46:06 +0000 (17:46 -0500)]
qapi: add QMP input test for large integers

Large integers previously got capped to LLONG_MAX/LLONG_MIN so we could
store them as int64_t. This could lead to silent errors occuring.

Now, we use a double to handle these cases.

Add a test to confirm that QMPInputVisitor handles this as expected if
we're expected an integer value: errors for out of range integer values
that got promoted to doubles in this fashion.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Amos Kong <akong@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
11 years agojson-parser: fix handling of large whole number values
Michael Roth [Fri, 10 May 2013 22:46:05 +0000 (17:46 -0500)]
json-parser: fix handling of large whole number values

Currently our JSON parser assumes that numbers lacking a fractional
value are integers and attempts to store them as QInt/int64 values. This
breaks in the case where the number overflows/underflows int64 values (which
is still valid JSON)

Fix this by detecting such cases and using a QFloat to store the value
instead.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Amos Kong <akong@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
11 years agoqapi: enable generation of native list code
Michael Roth [Fri, 10 May 2013 22:46:03 +0000 (17:46 -0500)]
qapi: enable generation of native list code

Also, fix a dependency issue with libqemuutil: qemu-sockets.c needs
qapi-types.c/qapi-visit.c

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Amos Kong <akong@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
11 years agoqapi: qapi-visit.py, native list support
Michael Roth [Fri, 10 May 2013 22:46:02 +0000 (17:46 -0500)]
qapi: qapi-visit.py, native list support

Teach visitor generators about native types so they can generate the
appropriate visitor routines.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Amos Kong <akong@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
11 years agoqapi: qapi-visit.py, fix list handling for union types
Michael Roth [Fri, 10 May 2013 22:46:01 +0000 (17:46 -0500)]
qapi: qapi-visit.py, fix list handling for union types

Currently we assume non-list types when generating visitor routines for
union types. This is broken, since values like ['Type'] need to mapped
to 'TypeList'.

We already have a type_name() function to handle this that we use for
generating struct visitors, so use that here as well.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Amos Kong <akong@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
11 years agoqapi: qapi-types.py, native list support
Michael Roth [Fri, 10 May 2013 22:46:00 +0000 (17:46 -0500)]
qapi: qapi-types.py, native list support

Teach type generators about native types so they can generate the
appropriate linked list types.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Amos Kong <akong@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
11 years agoMerge remote-tracking branch 'mjt/trivial-patches' into staging
Anthony Liguori [Wed, 22 May 2013 13:22:36 +0000 (08:22 -0500)]
Merge remote-tracking branch 'mjt/trivial-patches' into staging

# By Christophe Lyon (1) and others
# Via Michael Tokarev
* mjt/trivial-patches:
  target-moxie: replace target_phys_addr_t with hwaddr
  Rename hexdump to avoid FreeBSD libutil conflict
  remove some double-includes
  translate: remove redundantly included qemu/timer.h
  Remove twice include of qemu-common.h
  fix /proc/self/maps output

Message-id: 51977B44.1000302@msgid.tls.msk.ru
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agopci-assign: Add MSI affinity support
Alex Williamson [Mon, 13 May 2013 20:20:02 +0000 (14:20 -0600)]
pci-assign: Add MSI affinity support

To support guest MSI affinity changes update the MSI message any time
the guest writes to the address or data fields.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Message-id: 20130513201840.5430.86331.stgit@bling.home
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio-net: dynamic network offloads configuration
Dmitry Fleytman [Mon, 20 May 2013 08:18:14 +0000 (11:18 +0300)]
virtio-net: dynamic network offloads configuration

Virtio-net driver currently negotiates network offloads
on startup via features mechanism and have no ability to
disable and re-enable offloads later.
This patch introduced a new control command that allows
to configure device network offloads state dynamically.
The patch also introduces a new feature flag
VIRTIO_NET_F_CTRL_GUEST_OFFLOADS.

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-id: 20130520081814.GA8162@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agochardev: Get filename for new qapi backend
Lei Li [Tue, 21 May 2013 10:27:59 +0000 (18:27 +0800)]
chardev: Get filename for new qapi backend

This patch sets the filename when the new qapi backend
init from opts.

The previous patch and discussions as link below:

http://patchwork.ozlabs.org/patch/243896/

If anyone who have better idea to fix this please let
me know your suggestions.

Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com>
Message-id: 1369132079-11377-3-git-send-email-lilei@linux.vnet.ibm.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agochardev: Make the name of memory device consistent
Lei Li [Tue, 21 May 2013 10:27:58 +0000 (18:27 +0800)]
chardev: Make the name of memory device consistent

Now we have memory char device, but the backend name of it
is a little confusion. We actually register it by 'memory', but
the description in qemu-option, the name of open functions
and the new api backend called it 'ringbuf'. It should keep
consistent. This patch named it all to 'memory'.

Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 1369132079-11377-2-git-send-email-lilei@linux.vnet.ibm.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoui/gtk.c: Fix *BSD build of Gtk+ UI
Brad Smith [Tue, 21 May 2013 16:14:24 +0000 (12:14 -0400)]
ui/gtk.c: Fix *BSD build of Gtk+ UI

Fix the build of the Gtk+ UI on *BSD systems.

Signed-off-by: Brad Smith <brad@comstyle.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Message-id: 20130521161324.GA29977@rox.home.comstyle.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqom/object: Don't poll cast cache for NULL objects
Peter Crosthwaite [Wed, 22 May 2013 01:19:16 +0000 (11:19 +1000)]
qom/object: Don't poll cast cache for NULL objects

object_dynamic_cast_assert used to be tolerant of NULL objects and not
assert. It's clear from the implementation that this is the expected
behavior.

The preceding check of the cast cache dereferences obj however causing
a segfault. Fix by conditionalizing the cast cache logic on obj being
non-null.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Message-id: 8e2bef6a55753869c50bfa32226f7fcf0439ca62.1369183592.git.peter.crosthwaite@xilinx.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoglib: Fix some misuses of gsize/size_t types
Peter Crosthwaite [Wed, 22 May 2013 03:01:43 +0000 (13:01 +1000)]
glib: Fix some misuses of gsize/size_t types

This unbreaks cross compile builds:

configure --target-list="i386-softmmu" --cpu=i386

When building on a 64bit machine.

Reported-by: David Holsgrove <david.holsgrove@xilinx.com>
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Message-id: 926326e96fd8685d74e9d5bf430fe4ad97a55289.1369191585.git.peter.crosthwaite@xilinx.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agolinux-user: Save the correct resume address for MIPS signal handling
Kwok Cheung Yeung [Fri, 17 May 2013 21:51:21 +0000 (14:51 -0700)]
linux-user: Save the correct resume address for MIPS signal handling

The current ISA mode needs to be saved in bit 0 of the resume address.
If the current instruction happens to be in a branch delay slot, then
the address of the preceding jump instruction should be stored instead.
exception_resume_pc already does both of these tasks, so it is
made available and reused.

MIPS_HFLAG_BMASK in hflags is cleared, otherwise QEMU may treat the
first instruction of the signal handler as a delay slot instruction.

Signed-off-by: Kwok Cheung Yeung <kcy@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agolinux-user: Fix MIPS ISA transitions during signal handling
Kwok Cheung Yeung [Fri, 17 May 2013 21:51:20 +0000 (14:51 -0700)]
linux-user: Fix MIPS ISA transitions during signal handling

Processors supporting the MIPS16 or microMIPS ISAs set bit 0 in target
addresses to indicate that the target is written using a compressed ISA.

During signal handling, when jumping to or returning from a signal
handler, bit 0 of the destination PC is inspected and MIPS_HFLAG_M16 in
hflags cleared or set accordingly.  Bit 0 of the PC is then cleared.

Signed-off-by: Kwok Cheung Yeung <kcy@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agotarget-mips: clean-up in BIT_INSV
Petar Jovanovic [Mon, 13 May 2013 01:35:37 +0000 (03:35 +0200)]
target-mips: clean-up in BIT_INSV

This is a small follow-up change to "fix incorrect behaviour for INSV".

It includes two minor modifications:

- sizefilter is constant so it can be moved inside of the block,
- several lines of the code are replaced with a call to deposit64.

No functional change.

Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agoOpen up 1.6 development
Anthony Liguori [Mon, 20 May 2013 15:55:18 +0000 (10:55 -0500)]
Open up 1.6 development

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoUpdate version for 1.5.0 release.
Anthony Liguori [Mon, 20 May 2013 12:22:02 +0000 (07:22 -0500)]
Update version for 1.5.0 release.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoosdep: fix qemu_anon_ram_free trace (+ fix compilation on 32 bit hosts)
Hervé Poussineau [Mon, 20 May 2013 10:33:08 +0000 (12:33 +0200)]
osdep: fix qemu_anon_ram_free trace (+ fix compilation on 32 bit hosts)

Commit e7a09b92b70786f9e8c5fbf787e0248c6ebbe707 added a trace at each
memory freeing, but unfortunately inverted size and pointer when printing
them. Fix trace.

This also led to a compilation error on 32 bit hosts:
In file included from include/trace.h:4:0,
                 from trace/generated-events.c:3:
./trace/generated-tracers.h: In function ‘trace_qemu_anon_ram_free’:
./trace/generated-tracers.h:64:9: error: format ‘%zu’ expects argument of type
‘size_t’, but argument 3 has type ‘void *’ [-Werror=format]
./trace/generated-tracers.h:64:9: error: format ‘%p’ expects argument of type
‘void *’, but argument 4 has type ‘size_t’ [-Werror=format]

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Message-id: 1369045989-14016-1-git-send-email-hpoussin@reactos.org
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoRename hexdump to avoid FreeBSD libutil conflict
Ed Maste [Thu, 16 May 2013 15:32:28 +0000 (11:32 -0400)]
Rename hexdump to avoid FreeBSD libutil conflict

On FreeBSD libutil is used for openpty(), but it also provides a hexdump()
which conflicts with QEMU's.

Signed-off-by: Ed Maste <emaste@freebsd.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1368718348-15199-1-git-send-email-emaste@freebsd.org
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovl: new runstate transition: RUN_STATE_GUEST_PANICKED -> RUN_STATE_FINISH_MIGRATE
Hu Tao [Mon, 20 May 2013 10:46:20 +0000 (12:46 +0200)]
vl: new runstate transition: RUN_STATE_GUEST_PANICKED -> RUN_STATE_FINISH_MIGRATE

This fixes a problem that after guest panic happens, virsh dump without
--memory-only fails:

ERROR: invalid runstate transition: 'guest-panicked' -> 'finish-migrate'

Reported-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1369046780-17498-1-git-send-email-pbonzini@redhat.com
Cc: qemu-stable@nongnu.org
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agochardev: Make consistent with udp device for new qapi backend
Lei Li [Mon, 20 May 2013 06:51:03 +0000 (14:51 +0800)]
chardev: Make consistent with udp device for new qapi backend

When register and open a chardev udp, the backend name should be udp
not dgram, and we do not have backend dgram in the chardev list. This
patch makes the new qapi udp backend consistent with the original
udp device.

Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com>
Message-id: 1369032665-18159-2-git-send-email-lilei@linux.vnet.ibm.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoide/macio: fix wrong opaque with TRIM support
Aurelien Jarno [Sun, 19 May 2013 11:22:11 +0000 (13:22 +0200)]
ide/macio: fix wrong opaque with TRIM support

Commit 215e47b9 enabled TRIM by default, which revealed a bug in TRIM
support for the IDE macio emulation driver, introduced in d353fb72.

The call to dma_bdrv_io() is using a wrong opaque of type IDEState
instead of DBDMA_io. This patch fixes that.

Fixes LP#1179104

Reported-by: Michael Tokarev <mjt@tls.msk.ru>
Tested-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agotarget-mips: set carry bit correctly in DSPControl register
Petar Jovanovic [Mon, 13 May 2013 15:14:35 +0000 (17:14 +0200)]
target-mips: set carry bit correctly in DSPControl register

First we need to clear the bit and then we set the given value.
Instruction ADDSC sets the bit and instruction ADDWC uses this bit.

Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agotarget-mips: fix EXTPDP and setting up pos field in the DSPControl reg
Petar Jovanovic [Sat, 18 May 2013 01:53:41 +0000 (03:53 +0200)]
target-mips: fix EXTPDP and setting up pos field in the DSPControl reg

This change makes sure that modifications of pos field in the DSPControl
register do not trash other bits in the register. This bug can be triggered
with the additional test case in mips32-dsp/extpdp.c in this commit.

In addition to this, this change corrects incorrect calculation of the mask
for EXTPDP.

Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agotarget-moxie: replace target_phys_addr_t with hwaddr
Hu Tao [Wed, 15 May 2013 06:04:29 +0000 (14:04 +0800)]
target-moxie: replace target_phys_addr_t with hwaddr

target_phys_addr_t has been already replaced by hwaddr, but this
one is introduced after.

Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
11 years agoRename hexdump to avoid FreeBSD libutil conflict
Ed Maste [Thu, 16 May 2013 15:32:28 +0000 (11:32 -0400)]
Rename hexdump to avoid FreeBSD libutil conflict

On FreeBSD libutil is used for openpty(), but it also provides a hexdump()
which conflicts with QEMU's.

Signed-off-by: Ed Maste <emaste@freebsd.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
11 years agoremove some double-includes
Michael Tokarev [Tue, 14 May 2013 10:55:17 +0000 (14:55 +0400)]
remove some double-includes

Some source files #include the same header more than
once for no good reason.  Remove second #includes in
such cases.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
11 years agotranslate: remove redundantly included qemu/timer.h
liguang [Tue, 30 Apr 2013 02:59:50 +0000 (10:59 +0800)]
translate: remove redundantly included qemu/timer.h

Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>
Reviewed-By: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
11 years agoRemove twice include of qemu-common.h
Qiao Nuohan [Wed, 8 May 2013 04:39:01 +0000 (12:39 +0800)]
Remove twice include of qemu-common.h

This patch is used to remove twice include of "qemu-common.h" in
block/win32-aio.c

Signed-off-by: Qiao Nuohan <qiaonuohan@cn.fujitsu.com>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
11 years agofix /proc/self/maps output
Christophe Lyon [Tue, 2 Apr 2013 12:03:38 +0000 (14:03 +0200)]
fix /proc/self/maps output

Add a space at end of line when there is no filename to print, to
conform to linux kernel format (see show_map_vma() in
fs/proc/task_mmu.c).

Signed-off-by: Christophe Lyon <christophe.lyon@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
11 years agotarget-mips: fix incorrect behaviour for EXTP
Petar Jovanovic [Mon, 13 May 2013 13:20:26 +0000 (15:20 +0200)]
target-mips: fix incorrect behaviour for EXTP

The mask for EXTP instruction when size=31 has not been correctly
calculated.

The test (mips32-dsp/extp.c) has been extended to include the case that
triggers the issue.

Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agoUpdate version for 1.5.0-rc3 release
Anthony Liguori [Fri, 17 May 2013 15:01:00 +0000 (10:01 -0500)]
Update version for 1.5.0-rc3 release

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>