]> git.proxmox.com Git - qemu.git/log
qemu.git
11 years agotarget-sparc: Use get_temp_i32 in gen_dest_fpr_F
Richard Henderson [Tue, 16 Oct 2012 09:32:21 +0000 (19:32 +1000)]
target-sparc: Use get_temp_i32 in gen_dest_fpr_F

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agotarget-sparc: Split out get_temp_i32
Richard Henderson [Tue, 16 Oct 2012 09:32:20 +0000 (19:32 +1000)]
target-sparc: Split out get_temp_i32

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agotarget-sparc: Make the cpu_addr variable local to load/store handling
Richard Henderson [Tue, 16 Oct 2012 09:32:19 +0000 (19:32 +1000)]
target-sparc: Make the cpu_addr variable local to load/store handling

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agotarget-sparc: Cleanup cpu_src[12] allocation
Richard Henderson [Tue, 16 Oct 2012 09:32:18 +0000 (19:32 +1000)]
target-sparc: Cleanup cpu_src[12] allocation

Now that get_temp_tl is used for get_src[12], we don't need to
pre-allocate these temporaries.

Fallout from this is moving some assignments around cas/casx to
avoid uninitialized variable warnings.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agotarget-sparc: Finish conversion to gen_load_gpr
Richard Henderson [Tue, 16 Oct 2012 09:32:17 +0000 (19:32 +1000)]
target-sparc: Finish conversion to gen_load_gpr

All users of gen_movl_{reg_TN,TN_reg} are removed.  At the same time,
make cpu_val a local variable for load/store disassembly.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agotarget-sparc: Convert swap to gen_load/store_gpr
Richard Henderson [Tue, 16 Oct 2012 09:32:16 +0000 (19:32 +1000)]
target-sparc: Convert swap to gen_load/store_gpr

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agotarget-sparc: Convert asi helpers to gen_*_gpr
Richard Henderson [Tue, 16 Oct 2012 09:32:15 +0000 (19:32 +1000)]
target-sparc: Convert asi helpers to gen_*_gpr

Push the DisasContext down so that we can use gen_load/store_gpr
in sode gen_ldda_asi, gen_stda_ast, gen_cas_asi, gen_casx_asi.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agotarget-sparc: Use gen_load_gpr in get_src[12]
Richard Henderson [Tue, 16 Oct 2012 09:32:14 +0000 (19:32 +1000)]
target-sparc: Use gen_load_gpr in get_src[12]

This means we can avoid the incoming temporary, though the cleanup
of the existing temporaries is not performed in this patch.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agotarget-sparc: Conversion to gen_*_gpr, part 1
Richard Henderson [Tue, 16 Oct 2012 09:32:13 +0000 (19:32 +1000)]
target-sparc: Conversion to gen_*_gpr, part 1

Only handle the easy cases directly within disas_sparc_insn.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agotarget-sparc: Add gen_load/store/dest_gpr
Richard Henderson [Tue, 16 Oct 2012 09:32:12 +0000 (19:32 +1000)]
target-sparc: Add gen_load/store/dest_gpr

Infrastructure to be used to clean up handling of temporaries.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agoexec: Make MIN_CODE_GEN_BUFFER_SIZE private to exec.c
Richard Henderson [Tue, 16 Oct 2012 07:30:14 +0000 (17:30 +1000)]
exec: Make MIN_CODE_GEN_BUFFER_SIZE private to exec.c

It is used nowhere else, and the corresponding MAX_CODE_GEN_BUFFER_SIZE
also lives there.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agoexec: Allocate code_gen_prologue from code_gen_buffer
Richard Henderson [Tue, 16 Oct 2012 07:30:13 +0000 (17:30 +1000)]
exec: Allocate code_gen_prologue from code_gen_buffer

We had a hack for arm and sparc, allocating code_gen_prologue to a
special section.  Which, honestly does no good under certain cases.
We've already got limits on code_gen_buffer_size to ensure that all
TBs can use direct branches between themselves; reuse this limit to
ensure the prologue is also reachable.

As a bonus, we get to avoid marking a page of the main executable's
data segment as executable.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agoexec: Do not use absolute address hints for code_gen_buffer with -fpie
Richard Henderson [Tue, 16 Oct 2012 07:30:12 +0000 (17:30 +1000)]
exec: Do not use absolute address hints for code_gen_buffer with -fpie

The hard-coded addresses inside alloc_code_gen_buffer only make sense
if we're building an executable that will actually run at the address
we've put into the linker scripts.

When we're building with -fpie, the executable will run at some
random location chosen by the kernel.  We get better placement for
the code_gen_buffer if we allow the kernel to place the memory,
as it will tend to to place it near the executable, based on the
PROT_EXEC bit.

Since code_gen_prologue is always inside the executable, this effect
is easily seen at the end of most TB, with the exit_tb opcode, and
with any calls to helper functions.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agoexec: Don't make DEFAULT_CODE_GEN_BUFFER_SIZE too large
Richard Henderson [Tue, 16 Oct 2012 07:30:11 +0000 (17:30 +1000)]
exec: Don't make DEFAULT_CODE_GEN_BUFFER_SIZE too large

For ARM we cap the buffer size to 16MB.  Do not allocate 32MB in that case.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agoexec: Split up and tidy code_gen_buffer
Richard Henderson [Tue, 16 Oct 2012 07:30:10 +0000 (17:30 +1000)]
exec: Split up and tidy code_gen_buffer

It now consists of:

A macro definition of MAX_CODE_GEN_BUFFER_SIZE with host-specific values,

A function size_code_gen_buffer that applies most of the reasoning for
choosing a buffer size,

Three variations of a function alloc_code_gen_buffer that contain all
of the logic for allocating executable memory via a given allocation
mechanism.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agocreate struct for machine initialization arguments
Eduardo Habkost [Mon, 15 Oct 2012 20:22:02 +0000 (17:22 -0300)]
create struct for machine initialization arguments

This should help us to:
- More easily add or remove machine initialization arguments without
  having to change every single machine init function;
- More easily make mechanical changes involving the machine init
  functions in the future;
- Let machine initialization forward the init arguments to other
  functions more easily.

This change was half-mechanical process: first the struct was added with
the local ram_size, boot_device, kernel_*, initrd_*, and cpu_model local
variable initialization to all functions. Then the compiler helped me
locate the local variables that are unused, so they could be removed.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agovga: remove CONFIG_BOCHS_VBE
Gerd Hoffmann [Mon, 15 Oct 2012 06:02:57 +0000 (08:02 +0200)]
vga: remove CONFIG_BOCHS_VBE

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agovga: add specs for standard vga
Gerd Hoffmann [Mon, 15 Oct 2012 06:02:56 +0000 (08:02 +0200)]
vga: add specs for standard vga

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agovga: add mmio bar to standard vga
Gerd Hoffmann [Mon, 15 Oct 2012 06:02:55 +0000 (08:02 +0200)]
vga: add mmio bar to standard vga

This patch adds a mmio bar to the qemu standard vga which allows to
access the standard vga registers and bochs dispi interface registers
via mmio.

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agovga: fix indention
Gerd Hoffmann [Mon, 15 Oct 2012 06:02:54 +0000 (08:02 +0200)]
vga: fix indention

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agotests/tcg: fix build
Catalin Patulea [Tue, 16 Oct 2012 20:00:23 +0000 (16:00 -0400)]
tests/tcg: fix build

This broke when the tests were moved from tests/ to tests/tcg/.

On x86_64 host/i386-linux-user non-kvm guest, test-i386 and test-mmap are broken, but at least they build.

To build/run the tests:
$ cd $BUILD_PATH/tests/tcg
$ SRC_PATH=path/to/qemu make <target>

Signed-off-by: Catalin Patulea <catalinp@google.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agoallow make {dist, }clean work w/out configure
Mike Frysinger [Sun, 16 Sep 2012 20:07:13 +0000 (16:07 -0400)]
allow make {dist, }clean work w/out configure

There's no reason to require configure to run before running a clean
target, so check MAKECMDGOALS before.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agotci: fix build breakage for target-sparc
Michael Roth [Mon, 8 Oct 2012 20:45:49 +0000 (15:45 -0500)]
tci: fix build breakage for target-sparc

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

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agoMAINTAINERS: Update email address for Stefan Hajnoczi
Stefan Hajnoczi [Sun, 7 Oct 2012 16:08:49 +0000 (18:08 +0200)]
MAINTAINERS: Update email address for Stefan Hajnoczi

Switch to my new work email address from which I am contributing.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agoconfigure: Fix CONFIG_QEMU_HELPERDIR generation
Jan Kiszka [Wed, 17 Oct 2012 17:09:25 +0000 (19:09 +0200)]
configure: Fix CONFIG_QEMU_HELPERDIR generation

We need to evaluate $libexecdir in configure, otherwise we literally end
up with "${prefix}/libexec" instead of the absolute path as
CONFIG_QEMU_HELPERDIR.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agoqemu-options.hx: Change from recommending '?' to 'help'
Peter Maydell [Thu, 4 Oct 2012 15:22:01 +0000 (16:22 +0100)]
qemu-options.hx: Change from recommending '?' to 'help'

Update the -help output and documentation so that it recommends
'help' rather than '?' for the various "list valid values for this
option" cases. '?' is deprecated (as it can fail confusingly if
not quoted), so it's better to steer users towards 'help'. ('?'
still works, for backwards compatibility.)

This is the -help option part of the change otherwise done in
commit c8057f9, since we are now past release 1.2 and free to
change our help text without worrying about breaking libvirt.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agoMerge branch 'linux-user-for-upstream' of git://git.linaro.org/people/rikuvoipio...
Aurelien Jarno [Fri, 19 Oct 2012 18:28:22 +0000 (20:28 +0200)]
Merge branch 'linux-user-for-upstream' of git://git.linaro.org/people/rikuvoipio/qemu

* 'linux-user-for-upstream' of git://git.linaro.org/people/rikuvoipio/qemu:
  linux-user: register align p{read, write}64
  linux-user: ppc: mark as long long aligned
  tcg: Remove TCG_TARGET_HAS_GUEST_BASE define
  configure: Remove unnecessary host_guest_base code
  linux-user: If loading fails, print error as string, not number
  linux-user: Fix siginfo handling
  alpha-linux-user: Fix sigaltstack structure definition
  linux-user: Implement gethostname
  linux-user: Perform more checks on iovec lists
  linux-user: fix multi-threaded /proc/self/maps
  linux-user: fix statfs

11 years agoMerge branch 'trivial-patches' of git://github.com/stefanha/qemu
Aurelien Jarno [Fri, 19 Oct 2012 18:18:44 +0000 (20:18 +0200)]
Merge branch 'trivial-patches' of git://github.com/stefanha/qemu

* 'trivial-patches' of git://github.com/stefanha/qemu:
  ui/vnc-jobs.c: Fix minor typos in comments
  net/tap-win32: Fix compiler warning caused by missing include statement
  configure: Remove unused parameters from main function
  target-arm/neon_helper: Remove obsolete FIXME comment
  targphys.h: Don't define target_phys_addr_t for user-mode emulators
  ui/vnc: Only report/use TIGHT_PNG encoding if enabled.

11 years agomicroblaze: Update PC before simulating syscall
Edgar E. Iglesias [Thu, 26 Apr 2012 12:18:25 +0000 (14:18 +0200)]
microblaze: Update PC before simulating syscall

Fixes a clone() emulation bug were the new thread starts
at the point of the syscall and thus clones in a loop.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
11 years agomicroblaze: Support setting of TLS ptr
Edgar E. Iglesias [Thu, 26 Apr 2012 12:17:41 +0000 (14:17 +0200)]
microblaze: Support setting of TLS ptr

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
11 years agoui/vnc-jobs.c: Fix minor typos in comments
Peter Maydell [Thu, 18 Oct 2012 16:40:53 +0000 (17:40 +0100)]
ui/vnc-jobs.c: Fix minor typos in comments

Fix some minor typos/grammar errors in comments.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agonet/tap-win32: Fix compiler warning caused by missing include statement
Stefan Weil [Wed, 17 Oct 2012 17:53:50 +0000 (19:53 +0200)]
net/tap-win32: Fix compiler warning caused by missing include statement

The include file for net_init_tap was missing:

net/tap-win32.c:703:
 warning: no previous prototype for ‘net_init_tap’

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoconfigure: Remove unused parameters from main function
Stefan Weil [Mon, 15 Oct 2012 05:45:40 +0000 (07:45 +0200)]
configure: Remove unused parameters from main function

This modification is required if compiler option -Wunused-parameter is activated.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agotarget-arm/neon_helper: Remove obsolete FIXME comment
Peter Maydell [Fri, 12 Oct 2012 18:07:23 +0000 (19:07 +0100)]
target-arm/neon_helper: Remove obsolete FIXME comment

Commit 33ebc29 fixed the bugs in the implementation of VQRSHL,
but forgot to remove the FIXME comment...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agotargphys.h: Don't define target_phys_addr_t for user-mode emulators
Peter Maydell [Fri, 12 Oct 2012 17:59:44 +0000 (18:59 +0100)]
targphys.h: Don't define target_phys_addr_t for user-mode emulators

Commit 4be403c accidentally defined the target_phys_addr_t type when
building user-mode emulators. Since the type doesn't really make
any sense except for system emulators, avoid defining it when building
in user mode.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoui/vnc: Only report/use TIGHT_PNG encoding if enabled.
Joel Martin [Wed, 16 May 2012 12:54:25 +0000 (12:54 +0000)]
ui/vnc: Only report/use TIGHT_PNG encoding if enabled.

If TIGHT_PNG is not enabled by the --enable-vnc-png configure flag
then do not report to the client that it is supported.

Also, since TIGHT_PNG is the same as the TIGHT encoding but with the
filter/copy replaced with PNG data, adding it to the supported
encodings list when it is disabled will cause the TIGHT encoding to be
used even though the client requested TIGHT_PNG.

Signed-off-by: Joel Martin <github@martintribe.org>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agotarget-arm/translate: Fix RRX operands
Peter Crosthwaite [Tue, 16 Oct 2012 09:15:50 +0000 (19:15 +1000)]
target-arm/translate: Fix RRX operands

Instructions that both use the RRX second operand and update CS were
incorrect, as the Carry flag was updated too early. An example of such an
instruction would be:

ands r12,r13,RRX

Ands, because of the "s" flag will update the carry flag. But the RRX second
operand rotates through the C flag which should happen before the update.
Fixed the ordering of the two, the old carry is read by "r13,RRX" before being
updated.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Reported-by: Vinesh Peringat <vineshp@xilinx.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agovfio-pci: Mark non-migratable
Alex Williamson [Wed, 17 Oct 2012 17:20:14 +0000 (11:20 -0600)]
vfio-pci: Mark non-migratable

We haven't magically fixed this yet.  Toss in a description too.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
11 years agovfio-pci: Fix debug build
Alex Williamson [Wed, 17 Oct 2012 17:20:11 +0000 (11:20 -0600)]
vfio-pci: Fix debug build

Stray variable from before MSI-X rework

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
11 years agocpus: create qemu_in_vcpu_thread()
Juan Quintela [Tue, 18 Sep 2012 14:30:11 +0000 (16:30 +0200)]
cpus: create qemu_in_vcpu_thread()

Old code used !io_thread to know if a thread was an vcpu or not.  That
fails when we introduce the iothread.

Signed-off-by: Juan Quintela <quintela@redhat.com>
11 years agosavevm: make qemu_file_put_notify() return errors
Juan Quintela [Tue, 4 Sep 2012 10:45:42 +0000 (12:45 +0200)]
savevm: make qemu_file_put_notify() return errors

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agosavevm: un-export qemu_file_set_error()
Juan Quintela [Thu, 30 Aug 2012 11:37:56 +0000 (13:37 +0200)]
savevm: un-export qemu_file_set_error()

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agoblock-migration: handle errors with the return codes correctly
Juan Quintela [Wed, 29 Aug 2012 19:59:22 +0000 (21:59 +0200)]
block-migration: handle errors with the return codes correctly

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agoblock-migration: Switch meaning of return value
Juan Quintela [Wed, 29 Aug 2012 19:37:14 +0000 (21:37 +0200)]
block-migration:  Switch meaning of return value

Make consistent the result of blk_mig_save_dirty_block() and
mig_save_device_dirty()

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agoblock-migration: make flush_blks() return errors
Juan Quintela [Wed, 29 Aug 2012 18:17:13 +0000 (20:17 +0200)]
block-migration: make flush_blks() return errors

This means we don't need to pass through qemu_file to get the errors.
Adjust all callers.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agobuffered_file: buffered_put_buffer() don't need to set last_error
Juan Quintela [Wed, 29 Aug 2012 17:52:16 +0000 (19:52 +0200)]
buffered_file: buffered_put_buffer() don't need to set last_error

Callers on savevm.c:qemu_fflush() will set it.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agosavevm: Only qemu_fflush() can generate errors
Juan Quintela [Wed, 29 Aug 2012 17:43:39 +0000 (19:43 +0200)]
savevm: Only qemu_fflush() can generate errors

Move the error check to the beggining of the callers.  Once this is fixed
qemu_file_set_if_error() is not used anymore, so remove it.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agosavevm: make qemu_fill_buffer() be consistent
Juan Quintela [Wed, 29 Aug 2012 17:36:26 +0000 (19:36 +0200)]
savevm: make qemu_fill_buffer() be consistent

It was setting last_error directly once, and with the helper the other time.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agosavevm: unexport qemu_ftell()
Juan Quintela [Wed, 29 Aug 2012 17:16:56 +0000 (19:16 +0200)]
savevm: unexport qemu_ftell()

It was unused out of savevm.c.

Signed-off-by: Juan Quintela <quintela@redhat.com>
11 years agosavevm: unfold qemu_fclose_internal()
Juan Quintela [Wed, 29 Aug 2012 17:14:54 +0000 (19:14 +0200)]
savevm: unfold qemu_fclose_internal()

It was used only one, and was only one if.  It makes error handling
saner.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agosavevm: make qemu_fflush() return an error code
Juan Quintela [Wed, 29 Aug 2012 17:08:59 +0000 (19:08 +0200)]
savevm: make qemu_fflush() return an error code

Adjust all the callers.  We moved the set of last_error from inside
qemu_fflush() to all the callers.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agosavevm: Remove qemu_fseek()
Juan Quintela [Wed, 29 Aug 2012 17:04:47 +0000 (19:04 +0200)]
savevm: Remove qemu_fseek()

It has no users, and is only half implemented.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agovirtio-net: use qemu_get_buffer() in a temp buffer
Juan Quintela [Wed, 29 Aug 2012 17:03:09 +0000 (19:03 +0200)]
virtio-net: use qemu_get_buffer() in a temp buffer

qemu_fseek() is known to be wrong.  Would be removed on the next
commit.  This code should never been used (value has been
MAC_TABLE_ENTRIES since 2009).

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agosavevm: unexport qemu_fflush
Juan Quintela [Tue, 28 Aug 2012 11:54:06 +0000 (13:54 +0200)]
savevm: unexport qemu_fflush

It is not used outside of savevm.c

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agomigration: make migrate_fd_wait_for_unfreeze() return errors
Juan Quintela [Fri, 24 Aug 2012 10:51:48 +0000 (12:51 +0200)]
migration: make migrate_fd_wait_for_unfreeze() return errors

Adjust all callers

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agobuffered_file: make buffered_flush return the error code
Juan Quintela [Fri, 24 Aug 2012 10:43:04 +0000 (12:43 +0200)]
buffered_file: make buffered_flush return the error code

Or the amount of data written if there is no error.  Adjust all callers.

Signed-off-by: Juan Quintela <quintela@redhat.com>
11 years agobuffered_file: callers of buffered_flush() already check for errors
Juan Quintela [Fri, 24 Aug 2012 09:45:31 +0000 (11:45 +0200)]
buffered_file: callers of buffered_flush() already check for errors

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agobuffered_file: We can access directly to bandwidth_limit
Juan Quintela [Fri, 20 Jul 2012 11:33:53 +0000 (13:33 +0200)]
buffered_file: We can access directly to bandwidth_limit

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agobuffered_file: unfold migrate_fd_close
Juan Quintela [Fri, 20 Jul 2012 11:19:36 +0000 (13:19 +0200)]
buffered_file: unfold migrate_fd_close

We only used it once, just remove the callback indirection.

Signed-off-by: Juan Quintela <quintela@redhat.com>
11 years agobuffered_file: unfold migrate_fd_wait_for_unfreeze
Juan Quintela [Fri, 20 Jul 2012 11:16:28 +0000 (13:16 +0200)]
buffered_file: unfold migrate_fd_wait_for_unfreeze

We only used it once, just remove the callback indirection.

Signed-off-by: Juan Quintela <quintela@redhat.com>
11 years agobuffered_file: unfold migrate_fd_put_ready
Juan Quintela [Fri, 20 Jul 2012 11:13:59 +0000 (13:13 +0200)]
buffered_file: unfold migrate_fd_put_ready

We only use it once, just remove the callback indirection.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agobuffered_file: unfold migrate_fd_put_buffer
Juan Quintela [Fri, 20 Jul 2012 11:10:54 +0000 (13:10 +0200)]
buffered_file: unfold migrate_fd_put_buffer

We only used it once, just remove the callback indirection

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agobuffered_file: opaque is MigrationState
Juan Quintela [Fri, 20 Jul 2012 11:07:17 +0000 (13:07 +0200)]
buffered_file: opaque is MigrationState

It always have that type, just change it.
We will remove buffered file later on the migration thread series.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agobuffered_file: rename opaque to migration_state
Juan Quintela [Fri, 20 Jul 2012 11:04:42 +0000 (13:04 +0200)]
buffered_file: rename opaque to migration_state

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agoBufferedFile: append, then flush
Paolo Bonzini [Tue, 16 Aug 2011 23:43:24 +0000 (16:43 -0700)]
BufferedFile: append, then flush

Simplify the logic for pushing data from the buffer to the output
pipe/socket.  This also matches more closely what will be the
operation of the migration thread.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Orit Wasserman <owasserm@redhat.com>
11 years agomigration: Add dirty_pages_rate to query migrate output
Juan Quintela [Mon, 13 Aug 2012 10:31:25 +0000 (12:31 +0200)]
migration: Add dirty_pages_rate to query migrate output

It indicates how many pages were dirtied during the last second.

Signed-off-by: Juan Quintela <quintela@redhat.com>
11 years agoSeparate migration bitmap
Juan Quintela [Fri, 20 Jul 2012 10:33:00 +0000 (12:33 +0200)]
Separate migration bitmap

This patch creates a migration bitmap, which is periodically kept in
sync with the qemu bitmap. A separate copy of the dirty bitmap for the
migration limits the amount of concurrent access to the qemu bitmap
from iothread and migration thread (which requires taking the big
lock).

We use the qemu bitmap type.  We have to "undo" the dirty_pages
counting optimization on the general dirty bitmap and do the counting
optimization with the migration local bitmap.

Signed-off-by: Umesh Deshpande <udeshpan@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
11 years agoram: create trace event for migration sync bitmap
Juan Quintela [Tue, 4 Sep 2012 11:08:57 +0000 (13:08 +0200)]
ram: create trace event for migration sync bitmap

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agoram: introduce migration_bitmap_sync()
Juan Quintela [Fri, 20 Jul 2012 08:52:51 +0000 (10:52 +0200)]
ram: introduce migration_bitmap_sync()

Helper that we use each time that we need to syncronize the migration
bitmap with the other dirty bitmaps.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agoram: Export last_ram_offset()
Juan Quintela [Fri, 20 Jul 2012 08:37:54 +0000 (10:37 +0200)]
ram: Export last_ram_offset()

Is the only way of knowing the RAM size.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agoram: Introduce migration_bitmap_test_and_reset_dirty()
Juan Quintela [Fri, 20 Jul 2012 08:36:12 +0000 (10:36 +0200)]
ram: Introduce migration_bitmap_test_and_reset_dirty()

It just test if the dirty bit is set, and clears it.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Orit Wasserman <owasserm@redhat.com>
11 years agoram: introduce migration_bitmap_set_dirty()
Juan Quintela [Fri, 20 Jul 2012 08:16:08 +0000 (10:16 +0200)]
ram: introduce migration_bitmap_set_dirty()

It just marks a region of memory as dirty.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Orit Wasserman <owasserm@redhat.com>
11 years agosavevm: Factorize ram globals reset in its own function
Juan Quintela [Tue, 17 Jul 2012 15:02:24 +0000 (17:02 +0200)]
savevm: Factorize ram globals reset in its own function

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Orit Wasserman <owasserm@redhat.com>
11 years agomigration: print expected downtime in info migrate
Juan Quintela [Mon, 13 Aug 2012 07:53:12 +0000 (09:53 +0200)]
migration: print expected downtime in info migrate

Signed-off-by: Juan Quintela <quintela@redhat.com>
11 years agomigration: export migrate_get_current()
Juan Quintela [Mon, 13 Aug 2012 07:42:49 +0000 (09:42 +0200)]
migration: export migrate_get_current()

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agomigration: rename expected_time to expected_downtime
Juan Quintela [Mon, 13 Aug 2012 07:36:36 +0000 (09:36 +0200)]
migration: rename expected_time to expected_downtime

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Orit Wasserman <owasserm@redhat.com>
11 years agomigration: print total downtime for final phase of migration
Juan Quintela [Mon, 13 Aug 2012 07:35:16 +0000 (09:35 +0200)]
migration: print total downtime for final phase of migration

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Orit Wasserman <owasserm@redhat.com>
11 years agomigration: store end_time in a local variable
Juan Quintela [Fri, 10 Aug 2012 19:53:08 +0000 (21:53 +0200)]
migration: store end_time in a local variable

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Orit Wasserman <owasserm@redhat.com>
11 years agofix migration sync
Juan Quintela [Fri, 3 Aug 2012 10:58:16 +0000 (12:58 +0200)]
fix migration sync

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agobuffered_file: g_realloc() can't fail
Juan Quintela [Tue, 24 Jul 2012 12:14:32 +0000 (14:14 +0200)]
buffered_file: g_realloc() can't fail

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Orit Wasserman <owasserm@redhat.com>
11 years agotcg: Optimize mulu2
Richard Henderson [Tue, 2 Oct 2012 18:32:30 +0000 (11:32 -0700)]
tcg: Optimize mulu2

Like add2, do operand ordering, constant folding, and dead operand
elimination.  The latter happens about 15% of all mulu2 during an
x86_64 bios boot.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agotcg: Optimize half-dead add2/sub2
Richard Henderson [Tue, 2 Oct 2012 18:32:29 +0000 (11:32 -0700)]
tcg: Optimize half-dead add2/sub2

When x86_64 guest is not in 64-bit mode, the high-part of the 64-bit
add is dead.  When the host is 32-bit, we can simplify to 32-bit
arithmetic.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agotcg: Constant fold add2 and sub2
Richard Henderson [Tue, 2 Oct 2012 18:32:28 +0000 (11:32 -0700)]
tcg: Constant fold add2 and sub2

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agotcg: Do constant folding on double-word comparisons
Richard Henderson [Tue, 2 Oct 2012 18:32:27 +0000 (11:32 -0700)]
tcg: Do constant folding on double-word comparisons

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agotcg: Split out subroutines from do_constant_folding_cond
Richard Henderson [Tue, 2 Oct 2012 18:32:26 +0000 (11:32 -0700)]
tcg: Split out subroutines from do_constant_folding_cond

We can re-use these for implementing double-word folding.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agotcg: Optimize double-word comparisons against zero
Richard Henderson [Tue, 2 Oct 2012 18:32:25 +0000 (11:32 -0700)]
tcg: Optimize double-word comparisons against zero

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agotcg: Use common code when failing to optimize
Richard Henderson [Tue, 2 Oct 2012 18:32:24 +0000 (11:32 -0700)]
tcg: Use common code when failing to optimize

This saves a whole lot of repetitive code sequences.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agotcg: Swap commutative double-word comparisons
Richard Henderson [Tue, 2 Oct 2012 18:32:23 +0000 (11:32 -0700)]
tcg: Swap commutative double-word comparisons

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agotcg: Canonicalize add2 operand ordering
Richard Henderson [Tue, 2 Oct 2012 18:32:22 +0000 (11:32 -0700)]
tcg: Canonicalize add2 operand ordering

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agotcg: Split out swap_commutative as a subroutine
Richard Henderson [Tue, 2 Oct 2012 18:32:21 +0000 (11:32 -0700)]
tcg: Split out swap_commutative as a subroutine

Reduces code duplication and prefers

  movcond d, c1, c2, const, s
to
  movcond d, c1, c2, s, const

It also prefers

  add r, r, c
over
  add r, c, r

when both inputs are known constants.  This doesn't matter for true add, as
we will fully constant fold that.  But it matters for a follow-on patch using
this routine for add2 which may not be fully foldable.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agomemory: abort if a memory region is destroyed during a transaction
Avi Kivity [Wed, 17 Oct 2012 15:14:41 +0000 (17:14 +0200)]
memory: abort if a memory region is destroyed during a transaction

Destroying a memory region is illegal within a transaction, as until
the transaction is committed, the memory core may hold references to
the region.  Add an assert to check for violations of this rule.

Signed-off-by: Avi Kivity <avi@redhat.com>
11 years agoi440fx: avoid destroying memory regions within a transaction
Avi Kivity [Wed, 17 Oct 2012 15:10:04 +0000 (17:10 +0200)]
i440fx: avoid destroying memory regions within a transaction

Calling memory_region_destroy() within a transaction is illegal, since
the memory API is allowed to continue to dispatch to a region until the
transaction commits.  440fx does that however when managing PAM registers.

This bug is benign, since the regions are all aliases (which the memory
core tends to throw anyway), and since we don't do concurrent dispatch yet,
but instead of relying on that, tighten ship ahead of the coming concurrency
storm.

Fix by having a predefined set of regions, of which one will be enabled at
any time.

Signed-off-by: Avi Kivity <avi@redhat.com>
11 years agomemory: Make eventfd adhere to device endianness
Alexander Graf [Mon, 15 Oct 2012 18:30:28 +0000 (20:30 +0200)]
memory: Make eventfd adhere to device endianness

Our memory API MMIO regions know the concept of device endianness. This
is used to automatically swap endianness between devices and host CPU,
depending on whether buses in between would swizzle the bits.

The ioeventfd value comparison does not adhere to that semantic though.
Probably because nobody has been running ioeventfd on a BE platform and
the only device implementing ioeventfd right now is LE (PCI) based.

So add swizzling to ioeventfd registration / deletion to make the rest
of the code as consistent as possible.

Thanks a lot to Michael Tsirkin to point me towards the right direction.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Avi Kivity <avi@redhat.com>
11 years agotarget-mips: Pass MIPSCPU to mips_vpe_sleep()
Andreas Färber [Thu, 11 Oct 2012 22:56:37 +0000 (00:56 +0200)]
target-mips: Pass MIPSCPU to mips_vpe_sleep()

Needed for moving halted field to CPUState.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agotarget-mips: Pass MIPSCPU to mips_tc_sleep()
Andreas Färber [Thu, 11 Oct 2012 22:56:36 +0000 (00:56 +0200)]
target-mips: Pass MIPSCPU to mips_tc_sleep()

Needed for changing mips_vpe_sleep() argument type to MIPSCPU.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agotarget-mips: Pass MIPSCPU to mips_vpe_is_wfi()
Andreas Färber [Thu, 11 Oct 2012 22:56:35 +0000 (00:56 +0200)]
target-mips: Pass MIPSCPU to mips_vpe_is_wfi()

Needed for moving halted field to CPUState.
The variable name "c" is retained for MIPSCPU to leave "cpu" for CPUState.

Also change return type to bool while at it.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agotarget-mips: Pass MIPSCPU to mips_tc_wake()
Andreas Färber [Thu, 11 Oct 2012 22:56:34 +0000 (00:56 +0200)]
target-mips: Pass MIPSCPU to mips_tc_wake()

Needed for changing mips_vpe_is_wfi() argument type to MIPSCPU.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agotarget-mips: Clean up other_cpu in helper_{d,e}vpe()
Andreas Färber [Thu, 11 Oct 2012 22:56:33 +0000 (00:56 +0200)]
target-mips: Clean up other_cpu in helper_{d,e}vpe()

Free the variable name "other_cpu" for later use for MIPSCPU.

Fix off-by-one indentation while at it.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agotcg-ia64: Implement deposit
Richard Henderson [Wed, 10 Oct 2012 23:01:35 +0000 (16:01 -0700)]
tcg-ia64: Implement deposit

Note that in the general reg=reg,reg case we're restricted
to 16-bit insertions.  This makes it easy to allow "any"
constant as input, as post-truncation it will fit into the
constant load insn for which we have room in the bundle.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agotcg/ia64: slightly optimize TLB access code
Aurelien Jarno [Tue, 9 Oct 2012 19:53:55 +0000 (21:53 +0200)]
tcg/ia64: slightly optimize TLB access code

It is possible to slightly optimize the TLB access code, by replacing
the movi + and instructions by a deposit instruction.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>