]> git.proxmox.com Git - qemu.git/log
qemu.git
11 years agopetalogix_ml605_mmu: Fix machine node attachment
Peter Crosthwaite [Tue, 16 Apr 2013 00:23:59 +0000 (10:23 +1000)]
petalogix_ml605_mmu: Fix machine node attachment

Just attach devices straight to the root machine node, rather than the
"unattached node"

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Acked-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
11 years agoxilinx_axidma: converted init->realize
Peter Crosthwaite [Tue, 16 Apr 2013 00:23:20 +0000 (10:23 +1000)]
xilinx_axidma: converted init->realize

The prescribed transition from SysBusDevice::init to Device::realize. I'm going
with Andreas suggestion to move the sysbus foo to Object::init for early IRQ
visibility.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Acked-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
11 years agoxilinx_axidma: Register reset properly
Peter Crosthwaite [Tue, 16 Apr 2013 00:22:41 +0000 (10:22 +1000)]
xilinx_axidma: Register reset properly

Register the reset function as the Device::reset function rather than
explicitly call it from the sysbus::init.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Acked-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
11 years agoxilinx_axidma: Defined and use type cast macro
Peter Crosthwaite [Tue, 16 Apr 2013 00:22:02 +0000 (10:22 +1000)]
xilinx_axidma: Defined and use type cast macro

Standard QOM cast macro. Replaces usages of FROM_SYSBUS

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Acked-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
11 years agoxilinx_axidma: typedef XilinxAXIDMA struct
Peter Crosthwaite [Tue, 16 Apr 2013 00:21:23 +0000 (10:21 +1000)]
xilinx_axidma: typedef XilinxAXIDMA struct

Typedef xilinx_axidma's object state struct to shorten the repeated usages of
struct XilinxAXIDMA.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Acked-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
11 years agoxilinx_axienet: converted init->realize
Peter Crosthwaite [Tue, 16 Apr 2013 00:20:44 +0000 (10:20 +1000)]
xilinx_axienet: converted init->realize

The prescribed transition from SysBusDevice::init to Device::realize. Im going
with Andreas suggestion to move the sysbus foo to Object::init for early IRQ
visibility.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Acked-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
11 years agoxilinx_axienet: Register reset properly
Peter Crosthwaite [Tue, 16 Apr 2013 00:20:06 +0000 (10:20 +1000)]
xilinx_axienet: Register reset properly

Register the reset function and the Device::reset function rather than
explicitly call it from the sysbus::init.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Acked-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
11 years agoxilinx_axienet: Defined and use type cast macro
Peter Crosthwaite [Tue, 16 Apr 2013 00:19:27 +0000 (10:19 +1000)]
xilinx_axienet: Defined and use type cast macro

Standard QOM cast macro. Replaces usages of FROM_SYSBUS

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Acked-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
11 years agoxilinx_axienet: typedef XilinxAXIEnet struct
Peter Crosthwaite [Tue, 16 Apr 2013 00:18:47 +0000 (10:18 +1000)]
xilinx_axienet: typedef XilinxAXIEnet struct

Typedef xilinx_axienets object state struct to shorten the repeated usages of
struct XilinxAXIEnet.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Acked-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
11 years agovirtio-balloon: fix dynamic properties.
KONRAD Frederic [Sun, 14 Apr 2013 12:07:00 +0000 (14:07 +0200)]
virtio-balloon: fix dynamic properties.

To keep compatibility with the old virtio-balloon-x, add the dynamic properties
to virtio-balloon-pci and virtio-balloon-ccw.

Cc: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Message-id: 1365941220-8114-1-git-send-email-fred.konrad@greensocs.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'bonzini/hw-dirs' into staging
Anthony Liguori [Mon, 15 Apr 2013 22:06:04 +0000 (17:06 -0500)]
Merge remote-tracking branch 'bonzini/hw-dirs' into staging

* bonzini/hw-dirs:
  exec: remove useless declarations from memory-internal.h
  memory: move core typedefs to qemu/typedefs.h
  include: avoid useless includes of exec/ headers
  sysemu: avoid proliferation of include/ subdirectories
  tpm: reorganize headers and split hardware part
  configure: fix TPM logic
  acpi.h: make it self contained
  acpi: move declarations from pc.h to acpi.h
  hw: Add lost ARM core again
  Fix failure to create q35 machine
  Add linux-headers to QEMU_INCLUDES
  arm: fix location of some include files

Conflicts:
configure

aliguori: trivial conflict in configure output

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoAllow qtest to be used together with a virtual CPU
Edgar E. Iglesias [Mon, 15 Apr 2013 19:28:17 +0000 (21:28 +0200)]
Allow qtest to be used together with a virtual CPU

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Message-id: 1366054097-14132-1-git-send-email-edgar.iglesias@gmail.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoqdev: Fix QOM unrealize behavior
Andreas Färber [Mon, 15 Apr 2013 16:34:10 +0000 (18:34 +0200)]
qdev: Fix QOM unrealize behavior

Since commit 249d41720b7dfbb5951b430b9eefdbee7464f515 (qdev: Prepare
"realized" property) setting realized = true would register the device's
VMStateDescription, but realized = false would not unregister it. Fix that.

Moving the code from unparenting also revealed that we were calling
DeviceClass::init through DeviceClass::realize as interim solution but
DeviceClass::exit still at unparenting time with a realized check.
Make this symmetrical by implementing DeviceClass::unrealize to call it,
while we're setting realized = false in the unparenting path.
The only other unrealize user is mac_nvram, which can safely override it.

Thus, mark DeviceClass::exit as obsolete, new devices should implement
DeviceClass::unrealize instead.

Cc: qemu-stable@nongnu.org
Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Message-id: 1366043650-9719-1-git-send-email-afaerber@suse.de
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge branch 'tcg-ppc64' of git://github.com/rth7680/qemu
Aurelien Jarno [Mon, 15 Apr 2013 20:51:32 +0000 (22:51 +0200)]
Merge branch 'tcg-ppc64' of git://github.com/rth7680/qemu

* 'tcg-ppc64' of git://github.com/rth7680/qemu: (33 commits)
  tcg-ppc64: Handle deposit of zero
  tcg-ppc64: Implement mulu2/muls2_i64
  tcg-ppc64: Implement add2/sub2_i64
  tcg-ppc64: Use getauxval for ISA detection
  tcg-ppc64: Implement movcond
  tcg-ppc64: Use ISEL for setcond
  tcg-ppc64: Use MFOCRF instead of MFCR
  tcg-ppc64: Cleanup i32 constants to tcg_out_cmp
  tcg-ppc64: Use TCGType throughout compares
  tcg-ppc64: Use I constraint for mul
  tcg-ppc64: Implement deposit
  tcg-ppc64: Handle constant inputs for some compound logicals
  tcg-ppc64: Implement compound logicals
  tcg-ppc64: Implement bswap64
  tcg-ppc64: Implement bswap16 and bswap32
  tcg-ppc64: Implement rotates
  tcg-ppc64: Streamline qemu_ld/st insn selection
  tcg-ppc64: Use automatic implementation of ext32u_i64
  tcg-ppc64: Improve and_i64 with constant
  tcg-ppc64: Improve and_i32 with constant
  ...

11 years agoAdd -f FMT / --format FMT arg to qemu-nbd
Daniel P. Berrange [Tue, 19 Mar 2013 11:20:20 +0000 (11:20 +0000)]
Add -f FMT / --format FMT arg to qemu-nbd

Currently the qemu-nbd program will auto-detect the format of
any disk it is given. This behaviour is known to be insecure.
For example, if qemu-nbd initially exposes a 'raw' file to an
unprivileged app, and that app runs

   'qemu-img create -f qcow2 -o backing_file=/etc/shadow /dev/nbd0'

then the next time the app is started, the qemu-nbd will now
detect it as a 'qcow2' file and expose /etc/shadow to the
unprivileged app.

The only way to avoid this is to explicitly tell qemu-nbd what
disk format to use on the command line, completely disabling
auto-detection. This patch adds a '-f' / '--format' arg for
this purpose, mirroring what is already available via qemu-img
and qemu commands.

  qemu-nbd --format raw -p 9000 evil.img

will now always use raw, regardless of what format 'evil.img'
looks like it contains

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
[Use errx, not err. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agotcg-ppc64: Handle deposit of zero
Richard Henderson [Thu, 4 Apr 2013 19:47:22 +0000 (12:47 -0700)]
tcg-ppc64: Handle deposit of zero

The TCG optimizer does great work when inserting constants, being able
to fold the open-coded deposit expansion to just an AND or an OR.  Avoid
a bit the regression caused by having the deposit opcode by expanding
deposit of zero as an AND.

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-ppc64: Implement mulu2/muls2_i64
Richard Henderson [Tue, 5 Mar 2013 00:20:51 +0000 (16:20 -0800)]
tcg-ppc64: Implement mulu2/muls2_i64

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-ppc64: Implement add2/sub2_i64
Richard Henderson [Mon, 4 Mar 2013 22:26:52 +0000 (14:26 -0800)]
tcg-ppc64: Implement add2/sub2_i64

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-ppc64: Use getauxval for ISA detection
Richard Henderson [Mon, 18 Feb 2013 17:11:15 +0000 (09:11 -0800)]
tcg-ppc64: Use getauxval for ISA detection

Glibc 2.16 includes an easy way to get feature bits previously
buried in /proc or the program startup auxiliary vector.  Use it.

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-ppc64: Implement movcond
Richard Henderson [Fri, 1 Feb 2013 21:00:05 +0000 (13:00 -0800)]
tcg-ppc64: Implement movcond

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-ppc64: Use ISEL for setcond
Richard Henderson [Tue, 2 Apr 2013 22:16:10 +0000 (15:16 -0700)]
tcg-ppc64: Use ISEL for setcond

There are a few simple special cases that should be handled first.
Break these out to subroutines to avoid code duplication.

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-ppc64: Use MFOCRF instead of MFCR
Richard Henderson [Tue, 2 Apr 2013 22:09:52 +0000 (15:09 -0700)]
tcg-ppc64: Use MFOCRF instead of MFCR

It takes half the cycles to read one CR register instead of all 8.
This is a backward compatible addition to the ISA, so chips prior
to Power 2.00 spec will simply continue to read the entire CR register.

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-ppc64: Cleanup i32 constants to tcg_out_cmp
Richard Henderson [Tue, 2 Apr 2013 21:14:23 +0000 (14:14 -0700)]
tcg-ppc64: Cleanup i32 constants to tcg_out_cmp

Nothing else in the call chain ensures that these
constants don't have garbage in the high bits.

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-ppc64: Use TCGType throughout compares
Richard Henderson [Tue, 2 Apr 2013 21:58:27 +0000 (14:58 -0700)]
tcg-ppc64: Use TCGType throughout compares

The optimization/bug being fixed is that tcg_out_cmp was not applying the
right type to loading a constant, in the case it can't be implemented
directly.  Rather than recomputing the TCGType enum from the arch64 bool,
pass around the original TCGType throughout.

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-ppc64: Use I constraint for mul
Richard Henderson [Thu, 31 Jan 2013 17:45:11 +0000 (09:45 -0800)]
tcg-ppc64: Use I constraint for mul

The mul_i32 pattern was loading non-16-bit constants into a register,
when we can get the middle-end to do that for us.  The mul_i64 pattern
was not considering that MULLI takes 64-bit inputs.

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-ppc64: Implement deposit
Richard Henderson [Thu, 31 Jan 2013 16:39:30 +0000 (08:39 -0800)]
tcg-ppc64: Implement deposit

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-ppc64: Handle constant inputs for some compound logicals
Richard Henderson [Mon, 4 Mar 2013 21:48:38 +0000 (13:48 -0800)]
tcg-ppc64: Handle constant inputs for some compound logicals

Since we have special code to handle and/or/xor with a constant,
apply the same to andc/orc/eqv with a constant.

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-ppc64: Implement compound logicals
Richard Henderson [Thu, 31 Jan 2013 15:49:13 +0000 (07:49 -0800)]
tcg-ppc64: Implement compound logicals

Mostly copied from the ppc32 port.

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-ppc64: Implement bswap64
Richard Henderson [Thu, 31 Jan 2013 05:41:54 +0000 (21:41 -0800)]
tcg-ppc64: Implement bswap64

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-ppc64: Implement bswap16 and bswap32
Richard Henderson [Thu, 31 Jan 2013 05:16:38 +0000 (21:16 -0800)]
tcg-ppc64: Implement bswap16 and bswap32

Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-ppc64: Implement rotates
Richard Henderson [Thu, 31 Jan 2013 03:24:06 +0000 (19:24 -0800)]
tcg-ppc64: Implement rotates

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-ppc64: Streamline qemu_ld/st insn selection
Richard Henderson [Sat, 2 Feb 2013 08:58:14 +0000 (00:58 -0800)]
tcg-ppc64: Streamline qemu_ld/st insn selection

Using a table to look up insns of the right width and sign.
Include support for the Power 2.06 LDBRX and STDBRX insns.

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-ppc64: Use automatic implementation of ext32u_i64
Richard Henderson [Thu, 4 Apr 2013 18:36:07 +0000 (13:36 -0500)]
tcg-ppc64: Use automatic implementation of ext32u_i64

The enhancements to and immediate obviate this.

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-ppc64: Improve and_i64 with constant
Richard Henderson [Sat, 2 Feb 2013 07:58:17 +0000 (23:58 -0800)]
tcg-ppc64: Improve and_i64 with constant

Use RLDICL and RLDICR.

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-ppc64: Improve and_i32 with constant
Richard Henderson [Sat, 2 Feb 2013 07:43:42 +0000 (23:43 -0800)]
tcg-ppc64: Improve and_i32 with constant

Use RLWINM

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-ppc64: Tidy or and xor patterns.
Richard Henderson [Sat, 2 Feb 2013 04:22:05 +0000 (20:22 -0800)]
tcg-ppc64: Tidy or and xor patterns.

Handle constants in common code; we'll want to reuse that later.

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-ppc64: Allow constant first argument to sub
Richard Henderson [Thu, 4 Apr 2013 14:30:20 +0000 (07:30 -0700)]
tcg-ppc64: Allow constant first argument to sub

Using SUBFIC for 16-bit signed constants.

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-ppc64: Improve constant add and sub ops.
Richard Henderson [Sat, 2 Feb 2013 00:17:17 +0000 (16:17 -0800)]
tcg-ppc64: Improve constant add and sub ops.

Improve constant addition -- previously we'd emit useless addi with 0.
Use new constraints to force the driver to pull full 64-bit constants
into a register.

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-ppc64: Rearrange integer constant constraints
Richard Henderson [Sat, 2 Feb 2013 00:51:53 +0000 (16:51 -0800)]
tcg-ppc64: Rearrange integer constant constraints

We'll need a zero, and Z makes more sense for that.  Make sure we
have a full compliment of signed and unsigned 16 and 32-bit tests.

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-ppc64: Cleanup tcg_out_movi
Richard Henderson [Thu, 31 Jan 2013 23:52:49 +0000 (15:52 -0800)]
tcg-ppc64: Cleanup tcg_out_movi

The test for using movi32 was sub-optimal for TCG_TYPE_I32, comparing
a signed 32-bit quantity against an unsigned 32-bit quantity.

When possible, use addi+oris for 32-bit unsigned constants.  Otherwise,
standardize on addi+oris+ori instead of addis+ori+rldicl.

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-ppc64: Fix setcond_i32
Richard Henderson [Tue, 2 Apr 2013 18:13:28 +0000 (11:13 -0700)]
tcg-ppc64: Fix setcond_i32

We weren't ignoring the high 32 bits during a NE comparison.

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-ppc64: Introduce and use TAI and SAI
Richard Henderson [Sat, 2 Feb 2013 00:08:50 +0000 (16:08 -0800)]
tcg-ppc64: Introduce and use TAI and SAI

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-ppc64: Introduce and use tcg_out_shri64
Richard Henderson [Fri, 1 Feb 2013 23:19:05 +0000 (15:19 -0800)]
tcg-ppc64: Introduce and use tcg_out_shri64

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-ppc64: Introduce and use tcg_out_shli64
Richard Henderson [Fri, 1 Feb 2013 23:12:14 +0000 (15:12 -0800)]
tcg-ppc64: Introduce and use tcg_out_shli64

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-ppc64: Introduce and use tcg_out_ext32u
Richard Henderson [Fri, 1 Feb 2013 23:06:30 +0000 (15:06 -0800)]
tcg-ppc64: Introduce and use tcg_out_ext32u

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-ppc64: Introduce and use tcg_out_rlw
Richard Henderson [Fri, 1 Feb 2013 23:00:45 +0000 (15:00 -0800)]
tcg-ppc64: Introduce and use tcg_out_rlw

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agotcg-ppc64: Use TCGReg everywhere
Richard Henderson [Fri, 1 Feb 2013 22:48:37 +0000 (14:48 -0800)]
tcg-ppc64: Use TCGReg everywhere

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agodisas: Disassemble all ppc insns for the host
Richard Henderson [Thu, 31 Jan 2013 19:16:21 +0000 (11:16 -0800)]
disas: Disassemble all ppc insns for the host

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
11 years agoexec: remove useless declarations from memory-internal.h
Paolo Bonzini [Mon, 8 Apr 2013 16:26:41 +0000 (18:26 +0200)]
exec: remove useless declarations from memory-internal.h

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agomemory: move core typedefs to qemu/typedefs.h
Paolo Bonzini [Tue, 9 Apr 2013 09:10:27 +0000 (11:10 +0200)]
memory: move core typedefs to qemu/typedefs.h

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agoinclude: avoid useless includes of exec/ headers
Paolo Bonzini [Mon, 8 Apr 2013 15:29:59 +0000 (17:29 +0200)]
include: avoid useless includes of exec/ headers

Headers in include/exec/ are for the deepest innards of QEMU,
they should almost never be included directly.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agosysemu: avoid proliferation of include/ subdirectories
Paolo Bonzini [Mon, 8 Apr 2013 14:55:25 +0000 (16:55 +0200)]
sysemu: avoid proliferation of include/ subdirectories

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agotpm: reorganize headers and split hardware part
Paolo Bonzini [Tue, 2 Apr 2013 16:28:41 +0000 (18:28 +0200)]
tpm: reorganize headers and split hardware part

The TPM subsystem does not have a full front-end/back-end separation.
The sole available backend, tpm_passthrough, depends on the data
structures of the sole available frontend, tpm_tis.

However, we can at least try to split the user interface (tpm.c) from the
implementation (hw/tpm).  The patches makes tpm.c not include tpm_int.h,
which is shared between tpm_tis.c and tpm_passthrough.c; instead it
moves more stuff to tpm_backend.h.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agoqemu-char: another io_add_watch_poll fix
Paolo Bonzini [Wed, 10 Apr 2013 13:23:27 +0000 (15:23 +0200)]
qemu-char: another io_add_watch_poll fix

After attaching the source, we have to remove the reference we hold
to it, because we do not hold anymore a pointer to the source.

If we do not do this, removing the source will not finalize it and
will not drop the "real" I/O watch source.

This showed up when backporting the new flow control patches to older
versions of QEMU that still used select.  The whole select then failed
with EBADF (poll instead will reporting POLLNVAL on a single pollfd)
and QEMU froze.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1365600207-21685-1-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio-serial: cleanup: remove qdev field.
KONRAD Frederic [Tue, 9 Apr 2013 12:53:36 +0000 (14:53 +0200)]
virtio-serial: cleanup: remove qdev field.

The qdev field is no longer needed, just drop it.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Acked-by: Amit Shah <amit.shah@redhat.com>
Message-id: 1365512016-21944-8-git-send-email-fred.konrad@greensocs.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio-serial: cleanup: use QOM casts.
KONRAD Frederic [Tue, 9 Apr 2013 12:53:35 +0000 (14:53 +0200)]
virtio-serial: cleanup: use QOM casts.

As the virtio-serial-pci and virtio-serial-s390 are switched to the new
API, we can use QOM casts.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Acked-by: Amit Shah <amit.shah@redhat.com>
Message-id: 1365512016-21944-7-git-send-email-fred.konrad@greensocs.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio-serial: cleanup: init and exit functions.
KONRAD Frederic [Tue, 9 Apr 2013 12:53:34 +0000 (14:53 +0200)]
virtio-serial: cleanup: init and exit functions.

This remove old init and exit function as they are no longer needed.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Acked-by: Amit Shah <amit.shah@redhat.com>
Message-id: 1365512016-21944-6-git-send-email-fred.konrad@greensocs.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio-serial-ccw: switch to the new API.
KONRAD Frederic [Tue, 9 Apr 2013 12:53:33 +0000 (14:53 +0200)]
virtio-serial-ccw: switch to the new API.

Here the virtio-serial-ccw is modified for the new API. The device
virtio-serial-ccw extends virtio-ccw-device as before. It creates and
connects a virtio-serial during the init. The properties are not modified.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Acked-by: Amit Shah <amit.shah@redhat.com>
Message-id: 1365512016-21944-5-git-send-email-fred.konrad@greensocs.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio-serial-s390: switch to the new API.
KONRAD Frederic [Tue, 9 Apr 2013 12:53:32 +0000 (14:53 +0200)]
virtio-serial-s390: switch to the new API.

Here the virtio-serial-s390 is modified for the new API. The device
virtio-serial-s390 extends virtio-s390-device as before. It creates and
connects a virtio-serial during the init. The properties are not
modified.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Acked-by: Amit Shah <amit.shah@redhat.com>
Message-id: 1365512016-21944-4-git-send-email-fred.konrad@greensocs.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio-serial-pci: switch to the new API.
KONRAD Frederic [Tue, 9 Apr 2013 12:53:31 +0000 (14:53 +0200)]
virtio-serial-pci: switch to the new API.

Here the virtio-serial-pci is modified for the new API. The device
virtio-serial-pci extends virtio-pci. It creates and connects a
virtio-serial during the init. The properties are not changed.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Acked-by: Amit Shah <amit.shah@redhat.com>
Message-id: 1365512016-21944-3-git-send-email-fred.konrad@greensocs.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio-serial: add the virtio-serial device.
KONRAD Frederic [Tue, 9 Apr 2013 12:53:30 +0000 (14:53 +0200)]
virtio-serial: add the virtio-serial device.

Create virtio-serial which extends virtio-device, so it can be connected
on virtio-bus.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Acked-by: Amit Shah <amit.shah@redhat.com>
Message-id: 1365512016-21944-2-git-send-email-fred.konrad@greensocs.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agovirtio: fix broken aliases.
KONRAD Frederic [Tue, 9 Apr 2013 10:04:48 +0000 (12:04 +0200)]
virtio: fix broken aliases.

This fix the broken aliases, by renaming the devices.

So: * virtio-blk => virtio-blk-device.
    * virtio-balloon => virtio-balloon-device.
    * virtio-scsi => virtio-scsi-device.

All virtio-*-pci, virtio-*-s390, virtio-*-ccw didn't change.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Message-id: 1365501888-14602-1-git-send-email-fred.konrad@greensocs.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoUpdate Makefile to actually install the new efi-enabled nic roms that are used by...
Sander Eikelenboom [Mon, 8 Apr 2013 21:08:13 +0000 (23:08 +0200)]
Update Makefile to actually install the new efi-enabled nic roms that are used by default.

Commit c45e5b5b30ac1f5505725a7b36e68cedfce4f01f made a switch use the efi-enabled nic roms by default.
This patch updates the Makefile to install the roms so they can actually be used.

Signed-off-by: Sander Eikelenboom <linux@eikelenboom.it>
Message-id: 1365455293-7084-1-git-send-email-linux@eikelenboom.it
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoacpi.h: make it self contained
Michael S. Tsirkin [Mon, 15 Apr 2013 08:12:50 +0000 (11:12 +0300)]
acpi.h: make it self contained

Headers shouldn't assume another header is included,
pull in everything necessary.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-id: 20130415081250.GA7374@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agotarget-mips: fix mipsdsp_mul_q15_q15 and tests for MAQ_SA_W_PHL/PHR
Petar Jovanovic [Mon, 15 Apr 2013 11:54:07 +0000 (13:54 +0200)]
target-mips: fix mipsdsp_mul_q15_q15 and tests for MAQ_SA_W_PHL/PHR

The operands for MAQ_SA_W.PHL/MAQ_SA_W.PHR must in specified format.
Otherwise, the results are unpredictable. Once the operands were corrected
in the tests (part of this change), a bug in mipsdsp_mul_q15_q15 became
visible.

This change corrects the tests for MAQ_SA_W.PHL/MAQ_SA_W.PHR and fixes
sign-related issue in mipsdsp_mul_q15_q15. It also removes unnecessary
comment.

Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com>
11 years agofpu: Correct edgecase in float64_muladd
Peter Maydell [Fri, 12 Apr 2013 15:37:52 +0000 (16:37 +0100)]
fpu: Correct edgecase in float64_muladd

In handling float64_muladd, if we end up doing a subtraction of the
product and c, and the 128 bit result of this subtraction happens to
have its most significant bit in bit 63, we weren't handling this
correctly when attempting to normalize to put the most significant
bit into bit 126.  We would end up doing a right shift by a negative
number (undefined behaviour in C) so at best we would return an
incorrect result to the guest.  MSB in bit 63 has to be handled as a
special case separately from MSB in 0..62 and MSB in 63..126.  (MSB
in 127 is not possible.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agoconfigure: fix TPM logic
Paolo Bonzini [Mon, 18 Mar 2013 15:37:50 +0000 (16:37 +0100)]
configure: fix TPM logic

A non-native i386 or x86_64 emulator should not have TPM passthrough
support, since the TPM is only present for those hosts.

Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agoacpi.h: make it self contained
Michael S. Tsirkin [Mon, 15 Apr 2013 08:12:50 +0000 (11:12 +0300)]
acpi.h: make it self contained

Headers shouldn't assume another header is included,
pull in everything necessary.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agoacpi: move declarations from pc.h to acpi.h
Michael S. Tsirkin [Mon, 15 Apr 2013 06:19:22 +0000 (09:19 +0300)]
acpi: move declarations from pc.h to acpi.h

Functions defined in acpi/ should be declared in
acpi.h

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agohw: Add lost ARM core again
Stefan Weil [Sun, 14 Apr 2013 20:52:50 +0000 (22:52 +0200)]
hw: Add lost ARM core again

Commit 0434e30afb6175212389811e0b28b948eb3c1e40 accidentally removed
the compilation of arm11mpcore.c.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agoFix failure to create q35 machine
Hu Tao [Wed, 10 Apr 2013 08:43:09 +0000 (16:43 +0800)]
Fix failure to create q35 machine

This is a regression introduced by c0907c9e6417c. How to reproduce:

$ qemu-system-x86_64 -nodefaults -vnc :0 -M q35
qemu-system-x86_64: Unknown device 'q35-pcihost' for default sysbus
Aborted (core dumped)

Tested-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agoAdd linux-headers to QEMU_INCLUDES
Jan Kiszka [Wed, 10 Apr 2013 08:29:47 +0000 (10:29 +0200)]
Add linux-headers to QEMU_INCLUDES

virtio/dataplane/vring.c requires the Linux headers and is built for all
targets. So we need to add the corresponding include to QEMU_INCLUDES to
avoid that outdated distribution headers are used.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agoarm: fix location of some include files
Peter Maydell [Tue, 9 Apr 2013 14:26:55 +0000 (15:26 +0100)]
arm: fix location of some include files

The recent rearrangement of include files had some minor errors:
 devices.h is not ARM specific and should not be in arm/
 arm.h should be in arm/

Move these two headers to correct this.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
11 years agoMerge remote-tracking branch 'stefanha/block' into staging
Anthony Liguori [Mon, 15 Apr 2013 13:02:41 +0000 (08:02 -0500)]
Merge remote-tracking branch 'stefanha/block' into staging

* stefanha/block:
  rbd: add an asynchronous flush
  iotests: Add 'check -ssh' option to test Secure Shell block device.
  block: ssh: Use libssh2_sftp_fsync (if supported by libssh2) to flush to disk.
  block: Add support for Secure Shell (ssh) block device.
  ide: refuse WIN_READ_NATIVE_MAX on empty device
  qemu-iotests: filter QEMU_PROG in 051.out
  qemu-iotests: Add test for -drive options
  qemu-iotests: A few more bdrv_pread/pwrite tests
  block: Introduce bdrv_pwritev() for qcow2_save_vmstate
  savevm: Implement block_writev_buffer()
  block: Introduce bdrv_writev_vmstate

Conflicts:
savevm.c

aliguori: add f->pos parameter to writev_buffer().

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'luiz/queue/qmp' into staging
Anthony Liguori [Mon, 15 Apr 2013 12:49:21 +0000 (07:49 -0500)]
Merge remote-tracking branch 'luiz/queue/qmp' into staging

# By Michal Novotny (2) and Eric Blake (1)
# Via Luiz Capitulino
* luiz/queue/qmp:
  qapi: use valid JSON in schema
  Revert "New QMP command query-cpu-max and HMP command cpu_max"
  New cpu-max field in query-machines QMP command output

Message-id: 1365775103-18737-1-git-send-email-lcapitulino@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agoMerge remote-tracking branch 'quintela/migration.next' into staging
Anthony Liguori [Mon, 15 Apr 2013 12:46:39 +0000 (07:46 -0500)]
Merge remote-tracking branch 'quintela/migration.next' into staging

# By Paolo Bonzini
# Via Juan Quintela
* quintela/migration.next:
  migration: simplify writev vs. non-writev logic
  migration: drop is_write complications
  migration: use a single I/O operation when writev_buffer is not defined
  migration: set f->is_write and flush in add_to_iovec

Message-id: 1365512961-15623-1-git-send-email-quintela@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
11 years agorbd: add an asynchronous flush
Josh Durgin [Fri, 29 Mar 2013 20:03:23 +0000 (13:03 -0700)]
rbd: add an asynchronous flush

The existing bdrv_co_flush_to_disk implementation uses rbd_flush(),
which is sychronous and causes the main qemu thread to block until it
is complete. This results in unresponsiveness and extra latency for
the guest.

Fix this by using an asynchronous version of flush.  This was added to
librbd with a special #define to indicate its presence, since it will
be backported to stable versions. Thus, there is no need to check the
version of librbd.

Implement this as bdrv_aio_flush, since it matches other aio functions
in the rbd block driver, and leave out bdrv_co_flush_to_disk when the
asynchronous version is available.

Reported-by: Oliver Francke <oliver@filoo.de>
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoiotests: Add 'check -ssh' option to test Secure Shell block device.
Richard W.M. Jones [Tue, 9 Apr 2013 14:30:55 +0000 (15:30 +0100)]
iotests: Add 'check -ssh' option to test Secure Shell block device.

Note in order to run these tests on ssh, you must be running a local
ssh daemon, and that daemon must accept loopback connections, and
ssh-agent has to be set up to allow logins on the local daemon.  In
other words, the following command should just work without demanding
any passphrase:

 ssh localhost

Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoblock: ssh: Use libssh2_sftp_fsync (if supported by libssh2) to flush to disk.
Richard W.M. Jones [Tue, 9 Apr 2013 14:30:54 +0000 (15:30 +0100)]
block: ssh: Use libssh2_sftp_fsync (if supported by libssh2) to flush to disk.

libssh2_sftp_fsync is an extension to libssh2 to support fsync(2) over
sftp, which is itself an extension of OpenSSH.

If both libssh2 and the ssh daemon support it, this will allow
bdrv_flush_to_disk to commit changes through to disk on the remote
server.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoblock: Add support for Secure Shell (ssh) block device.
Richard W.M. Jones [Tue, 9 Apr 2013 14:30:53 +0000 (15:30 +0100)]
block: Add support for Secure Shell (ssh) block device.

  qemu-system-x86_64 -drive file=ssh://hostname/some/image

QEMU will ssh into 'hostname' and open '/some/image' which is made
available as a standard block device.

You can specify a username (ssh://user@host/...) and/or a port number
(ssh://host:port/...).  You can also use an alternate syntax using
properties (file.user, file.host, file.port, file.path).

Current limitations:

- Authentication must be done without passwords or passphrases, using
  ssh-agent.  Other authentication methods are not supported.

- Uses a single connection, instead of concurrent AIO with multiple
  SSH connections.

This is implemented using libssh2 on the client side.  The server just
requires a regular ssh daemon with sftp-server support.  Most ssh
daemons on Unix/Linux systems will work out of the box.

Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
Cc: Stefan Hajnoczi <stefanha@gmail.com>
Cc: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoide: refuse WIN_READ_NATIVE_MAX on empty device
Stefan Hajnoczi [Fri, 5 Apr 2013 09:51:01 +0000 (11:51 +0200)]
ide: refuse WIN_READ_NATIVE_MAX on empty device

What is the highest addressable sector on an empty CD-ROM?  Nothing is
addressable so produce an error.

This patch prevents a divide-by-zero in ide_set_sector() since
s->sectors and s->heads would be 0.  Not to mention that a sector=-1
argument would be nonsense.

Note that WIN_READ_NATIVE_MAX can be triggered using hdparm -N 1024
/dev/cdrom.  The LBA bit will be set to 1 though, so the only easy way
to go down the ide_set_sector() CHS code path which divides by zero is
to comment out the s->select & 0x40 case for testing.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
11 years agoqemu-iotests: filter QEMU_PROG in 051.out
Stefan Hajnoczi [Mon, 15 Apr 2013 08:15:17 +0000 (10:15 +0200)]
qemu-iotests: filter QEMU_PROG in 051.out

Filter the name of the QEMU executable so the output can be diffed no
matter what QEMU_PROG is (e.g. qemu-system-x86_64).

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoqemu-iotests: Add test for -drive options
Kevin Wolf [Tue, 9 Apr 2013 13:56:13 +0000 (15:56 +0200)]
qemu-iotests: Add test for -drive options

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoqemu-iotests: A few more bdrv_pread/pwrite tests
Kevin Wolf [Fri, 5 Apr 2013 19:27:56 +0000 (21:27 +0200)]
qemu-iotests: A few more bdrv_pread/pwrite tests

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoblock: Introduce bdrv_pwritev() for qcow2_save_vmstate
Kevin Wolf [Fri, 5 Apr 2013 19:27:55 +0000 (21:27 +0200)]
block: Introduce bdrv_pwritev() for qcow2_save_vmstate

Directly pass the QEMUIOVector on instead of linearising it.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agosavevm: Implement block_writev_buffer()
Kevin Wolf [Fri, 5 Apr 2013 19:27:54 +0000 (21:27 +0200)]
savevm: Implement block_writev_buffer()

Instead of breaking up RAM state into many small chunks, pass the iovec
to the block layer for better performance.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoblock: Introduce bdrv_writev_vmstate
Kevin Wolf [Fri, 5 Apr 2013 19:27:53 +0000 (21:27 +0200)]
block: Introduce bdrv_writev_vmstate

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
11 years agoqjson: to_json() case QTYPE_QSTRING is buggy, rewrite
Markus Armbruster [Thu, 11 Apr 2013 16:07:21 +0000 (18:07 +0200)]
qjson: to_json() case QTYPE_QSTRING is buggy, rewrite

Known bugs in to_json():

* A start byte for a three-byte sequence followed by less than two
  continuation bytes is split into one-byte sequences.

* Start bytes for sequences longer than three bytes get misinterpreted
  as start bytes for three-byte sequences.  Continuation bytes beyond
  byte three become one-byte sequences.

  This means all characters outside the BMP are decoded incorrectly.

* One-byte sequences with the MSB are put into the JSON string
  verbatim when char is unsigned, producing invalid UTF-8.  When char
  is signed, they're replaced by "\\uFFFF" instead.

  This includes \xFE, \xFF, and stray continuation bytes.

* Overlong sequences are happily accepted, unless screwed up by the
  bugs above.

* Likewise, sequences encoding surrogate code points or noncharacters.

* Unlike other control characters, ASCII DEL is not escaped.  Except
  in overlong encodings.

My rewrite fixes them as follows:

* Malformed UTF-8 sequences are replaced.

  Except the overlong encoding \xC0\x80 of U+0000 is still accepted.
  Permits embedding NUL characters in C strings.  This trick is known
  as "Modified UTF-8".

* Sequences encoding code points beyond Unicode range are replaced.

* Sequences encoding code points beyond the BMP produce a surrogate
  pair.

* Sequences encoding surrogate code points are replaced.

* Sequences encoding noncharacters are replaced.

* ASCII DEL is now always escaped.

The replacement character is U+FFFD.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agocheck-qjson: Test noncharacters other than U+FFFE, U+FFFF in strings
Markus Armbruster [Thu, 11 Apr 2013 16:07:20 +0000 (18:07 +0200)]
check-qjson: Test noncharacters other than U+FFFE, U+FFFF in strings

Test cases cover the two noncharacters in the BMP.  Add tests for the
other 64 noncharacters.

Three existing test cases involve noncharacters U+FFFF and U+10FFFF.
Instead of deleting them as now duplicates, adjust them to use U+FFFC
and U+10FFFFD.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agocheck-qjson: Improve a few comments, delete bogus ones
Markus Armbruster [Thu, 11 Apr 2013 16:07:19 +0000 (18:07 +0200)]
check-qjson: Improve a few comments, delete bogus ones

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agounicode: New mod_utf8_codepoint()
Markus Armbruster [Thu, 11 Apr 2013 16:07:18 +0000 (18:07 +0200)]
unicode: New mod_utf8_codepoint()

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
11 years agoMerge branch 'mingw' of git://qemu.weilnetz.de/qemu
Aurelien Jarno [Sat, 13 Apr 2013 12:31:54 +0000 (14:31 +0200)]
Merge branch 'mingw' of git://qemu.weilnetz.de/qemu

* 'mingw' of git://qemu.weilnetz.de/qemu:
  qemu-timer: move timeBeginPeriod/timeEndPeriod to os-win32
  Release SMP restriction on Windows
  Ensure good ordering of memory instruction in cpu_exec
  Check effective suspension of TCG thread

11 years agotarget-i386: add AES-NI instructions
Aurelien Jarno [Sun, 31 Mar 2013 10:58:31 +0000 (12:58 +0200)]
target-i386: add AES-NI instructions

Reviewed-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agoaes: make Td[0-5] and Te[0-5] tables non static
Aurelien Jarno [Sun, 31 Mar 2013 10:58:31 +0000 (12:58 +0200)]
aes: make Td[0-5] and Te[0-5] tables non static

Remove static attribute to Td[0-5] and Te[0-5] tables so that they
can be used outside of aes.c. Change their type from u32 to uint32_t,
to keep the u32 udef local to aes.c. Prefix them with AES_ so that they
do not conflict with other symbols.

Reviewed-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agoaes: move aes.h from include/block to include/qemu
Aurelien Jarno [Sun, 31 Mar 2013 10:58:30 +0000 (12:58 +0200)]
aes: move aes.h from include/block to include/qemu

Move aes.h from include/block to include/qemu to show it can be reused
by other subsystems.

Cc: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agodisas/i386.c: disassemble aes-ni instructions
Aurelien Jarno [Sun, 31 Mar 2013 10:58:30 +0000 (12:58 +0200)]
disas/i386.c: disassemble aes-ni instructions

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agotarget-i386: enable PCLMULQDQ on Westmere CPU
Aurelien Jarno [Sun, 31 Mar 2013 10:58:30 +0000 (12:58 +0200)]
target-i386: enable PCLMULQDQ on Westmere CPU

The PCLMULQDQ instruction has been introduced on the Westmere CPU.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agotarget-i386: add pclmulqdq instruction
Aurelien Jarno [Sun, 31 Mar 2013 10:58:30 +0000 (12:58 +0200)]
target-i386: add pclmulqdq instruction

Reviewed-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agodisas/i386.c: disassemble pclmulqdq instruction
Aurelien Jarno [Sun, 31 Mar 2013 10:58:30 +0000 (12:58 +0200)]
disas/i386.c: disassemble pclmulqdq instruction

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 years agosh7750: Change cpu field type to SuperHCPU
Andreas Färber [Tue, 9 Apr 2013 14:51:24 +0000 (16:51 +0200)]
sh7750: Change cpu field type to SuperHCPU

This brings us a step closer to QOM'ified SH7750 SoC and
fixes b350ab75 (target-sh4: Move PVR/PRR/CVR into SuperHCPUClass)
assuming SuperHCPU type for SUPERH_CPU_GET_CLASS().

Fix Coding Style issues while at it (indentation, braces).

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>