sdk/emulator/qemu.git
10 years agotarget-i386: Use TCGMemOp for 'ot' variables
Richard Henderson [Tue, 5 Nov 2013 21:25:05 +0000 (07:25 +1000)]
target-i386: Use TCGMemOp for 'ot' variables

The 'ot' variables (operand type?) hold the log2(byte size) of
the operand being manipulated.  This is the same as the MO_SIZE
subset of the TCGMemOp.  Indeed, we often pass 'ot' to the
tcg_gen_qemu_ld/st functions.

Changing the type from 'int' makes it easier to see what domain
the variable should be.

This does require adding some default cases to some switch statements,
to avoid the 'unhandled enumeration value' warning that would result
from the change of type.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-i386: Remove gen_op_andl_A0_ffff
Richard Henderson [Tue, 5 Nov 2013 02:38:58 +0000 (12:38 +1000)]
target-i386: Remove gen_op_andl_A0_ffff

Replace it with tcg_gen_ext16u_tl, and in two cases merge with a
previous move from cpu_regs.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-i386: Remove gen_op_movl_T0_T1
Richard Henderson [Tue, 5 Nov 2013 02:29:14 +0000 (12:29 +1000)]
target-i386: Remove gen_op_movl_T0_T1

Replace it with its definition.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-i386: Remove gen_op_andl_T0_im
Richard Henderson [Tue, 5 Nov 2013 02:27:09 +0000 (12:27 +1000)]
target-i386: Remove gen_op_andl_T0_im

Replace it with its definition.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-i386: Remove gen_op_andl_T0_ffff
Richard Henderson [Tue, 5 Nov 2013 02:23:48 +0000 (12:23 +1000)]
target-i386: Remove gen_op_andl_T0_ffff

Replace it with tcg_gen_ext16u_tl.  In four places we can combine that
with a previous move into cpu_T[0], and in one place we can infer that
the zero-extension has already happened via the previous load.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-i386: Remove gen_movtl_T*_im
Richard Henderson [Tue, 5 Nov 2013 02:13:44 +0000 (12:13 +1000)]
target-i386: Remove gen_movtl_T*_im

Propagate the definitions into all users.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-i386: Remove gen_op_mov*_A0_im
Richard Henderson [Tue, 5 Nov 2013 02:09:00 +0000 (12:09 +1000)]
target-i386: Remove gen_op_mov*_A0_im

Propagate the definitions into all users.  In two cases, this allows
us to share code between the 32-bit and 64-bit immediate moves.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-i386: Remove gen_op_movl_T0_im*
Richard Henderson [Tue, 5 Nov 2013 01:58:01 +0000 (11:58 +1000)]
target-i386: Remove gen_op_movl_T0_im*

Propagate the definitions into all users.  The only time that
gen_op_movl_T1_imu was used, the input was type 'unsigned',
so the replacement works identically.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-i386: Remove gen_op_movl_T0_im*
Richard Henderson [Tue, 5 Nov 2013 01:51:10 +0000 (11:51 +1000)]
target-i386: Remove gen_op_movl_T0_im*

Propagate the definition of gen_op_movl_T0_im to all users.
The function gen_op_movl_T0_imu was unused.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-i386: Remove gen_op_movl_T0_0
Richard Henderson [Tue, 5 Nov 2013 01:37:35 +0000 (11:37 +1000)]
target-i386: Remove gen_op_movl_T0_0

Propagate its definition into all users.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-i386: Tidy extend + move
Richard Henderson [Tue, 5 Nov 2013 01:31:34 +0000 (11:31 +1000)]
target-i386: Tidy extend + move

For the known MO_32/MO_64 cases, we don't need to extend a 32-bit temp
into a 64-bit temp before storing into the hardware register.

We do need the extension for the MO_8/MO_16 cases, in order for the
deposit_tl operation to work, so leave those alone.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-i386: Tidy extend + store
Richard Henderson [Tue, 5 Nov 2013 01:14:33 +0000 (11:14 +1000)]
target-i386: Tidy extend + store

We can now use tcg_gen_qemu_st_i32 directly to avoid the extension.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-i386: Tidy load + truncate
Richard Henderson [Sat, 2 Nov 2013 19:54:48 +0000 (09:54 -1000)]
target-i386: Tidy load + truncate

We can now use tcg_gen_qemu_ld_i32 directly to avoid the truncation.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-i386: Tidy gen_op_mov_TN_reg+tcg_gen_trunc_tl_i32
Richard Henderson [Sat, 2 Nov 2013 19:35:30 +0000 (09:35 -1000)]
target-i386: Tidy gen_op_mov_TN_reg+tcg_gen_trunc_tl_i32

For the 16 and 32-bit cases, we don't need to truncate via
a temporary register.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-i386: Use MO_BE for movbe
Richard Henderson [Sat, 2 Nov 2013 19:22:04 +0000 (09:22 -1000)]
target-i386: Use MO_BE for movbe

Fold the bswap into the memory operation.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-i386: Remove unused arguments to gen_lea_modrm
Richard Henderson [Sat, 2 Nov 2013 18:55:59 +0000 (08:55 -1000)]
target-i386: Remove unused arguments to gen_lea_modrm

The reg_ptr and offset_ptr outputs are universally unused.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-i386: Tidy movsl
Richard Henderson [Sat, 2 Nov 2013 18:32:39 +0000 (08:32 -1000)]
target-i386: Tidy movsl

Always perform a sign-extending load.  In the extremely unlikely
case that we've used an 0x66 prefix, the extension to 64-bits is
unnecessary but not wrong; the store will still examine only 16 bits.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-i386: Tidy mov[sz][bw]
Richard Henderson [Sat, 2 Nov 2013 18:28:40 +0000 (08:28 -1000)]
target-i386: Tidy mov[sz][bw]

We can use the MO_SIGN bit to tidy the reg-reg switch statement
as well as pass it on to gen_op_ld_v, eliminating one call.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-i386: Fix typo in gen_push_T1
Richard Henderson [Sat, 2 Nov 2013 18:16:45 +0000 (08:16 -1000)]
target-i386: Fix typo in gen_push_T1

By inspection, obviously we should be storing T[1] not T[0].
This could only happen for x86_64 in 64-bit mode with 0x66
prefix to call insn -- i.e. never.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-i386: Remove gen_op_st_T1_A0
Richard Henderson [Sat, 2 Nov 2013 18:14:26 +0000 (08:14 -1000)]
target-i386: Remove gen_op_st_T1_A0

Propagate its definition into all users.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-i386: Remove gen_op_st_T0_A0
Richard Henderson [Sat, 2 Nov 2013 18:12:01 +0000 (08:12 -1000)]
target-i386: Remove gen_op_st_T0_A0

Propagate its definition into all users.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-i386: Introduce gen_op_st_rm_T0_A0
Richard Henderson [Sat, 2 Nov 2013 17:59:43 +0000 (10:59 -0700)]
target-i386: Introduce gen_op_st_rm_T0_A0

Too many places have the same test vs OR_TMP0 to indicate
a write back to memory.  Hoist that to a subroutine.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-i386: Remove gen_op_lds_T0_A0
Richard Henderson [Sat, 2 Nov 2013 17:43:41 +0000 (10:43 -0700)]
target-i386: Remove gen_op_lds_T0_A0

Replace its users by gen_op_ld_v with the MO_SIGN bit set.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-i386: Remove gen_op_ld_T1_A0
Richard Henderson [Sat, 2 Nov 2013 17:39:41 +0000 (10:39 -0700)]
target-i386: Remove gen_op_ld_T1_A0

Propagate its definition into all users.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-i386: Remove gen_op_ldu_T0_A0
Richard Henderson [Sat, 2 Nov 2013 17:35:24 +0000 (10:35 -0700)]
target-i386: Remove gen_op_ldu_T0_A0

Propagate its definition into all users.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-i386: Remove gen_op_ld_T0_A0
Richard Henderson [Sat, 2 Nov 2013 17:30:24 +0000 (10:30 -0700)]
target-i386: Remove gen_op_ld_T0_A0

Propagate its definition into all users.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-i386: Replace OT_* constants with MO_* constants
Richard Henderson [Sat, 2 Nov 2013 16:54:47 +0000 (09:54 -0700)]
target-i386: Replace OT_* constants with MO_* constants

The MO_8/16/32/64 constants have the same encoding and meaning
as the OT_BYTE/WORD/LONG/QUAD.  Since we rely on them being the
same, for the qemu_ld/st helpers, standardize on the common names.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-i386: Use new tcg_gen_qemu_st_* helpers
Richard Henderson [Sat, 2 Nov 2013 16:49:20 +0000 (09:49 -0700)]
target-i386: Use new tcg_gen_qemu_st_* helpers

In preference to the older helpers.  Stores only in this patch.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-i386: Use new tcg_gen_qemu_ld_* helpers
Richard Henderson [Sat, 2 Nov 2013 16:30:34 +0000 (09:30 -0700)]
target-i386: Use new tcg_gen_qemu_ld_* helpers

In preference to the older helpers.  Loads only in this patch.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-i386: Stop encoding DisasContext.mem_index
Richard Henderson [Thu, 31 Oct 2013 05:20:42 +0000 (22:20 -0700)]
target-i386: Stop encoding DisasContext.mem_index

Now that we don't combine mem_index with operand size info,
we don't need to encode it.  Which tidies many places that
access it.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-i386: Push DisasContext into load/store helpers
Richard Henderson [Thu, 31 Oct 2013 05:04:05 +0000 (22:04 -0700)]
target-i386: Push DisasContext into load/store helpers

Rather than add s->mem_index into a combined size+mem_index
argument, pass the context down.  This will allow cleaning
up s->mem_index later.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agoexec: Delay CPU_LOG_TB_CPU until we actually execute a TB
Richard Henderson [Wed, 6 Nov 2013 07:29:39 +0000 (17:29 +1000)]
exec: Delay CPU_LOG_TB_CPU until we actually execute a TB

The previous placement could result in duplicate logging while
still processing interrupts.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agoPPC: Fix compilation with TCG debug
Alexander Graf [Fri, 20 Dec 2013 10:01:50 +0000 (11:01 +0100)]
PPC: Fix compilation with TCG debug

The recent VSX patches broken compilation of QEMU when configurated
with --enable-debug, as it was treating "target long" TCG variables
as "i64" which is not true for 32bit targets.

This patch fixes all the places that the compiler has found to use
the correct variable type and if necessary manually cast.

Reported-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
10 years agoMerge tag 'signed-s390-for-upstream' of git://github.com/agraf/qemu
Aurelien Jarno [Sat, 21 Dec 2013 15:46:07 +0000 (16:46 +0100)]
Merge tag 'signed-s390-for-upstream' of git://github.com/agraf/qemu

Patch queue for s390 - 2013-12-18

This covers mostly minor bug fixes and implements the SIGP START
hypercall which allows to start a remote CPU without changing its
state.

Cornelia Huck (1):
      s390x/kvm: Fix diagnose handling.

Thomas Huth (7):
      s390x/kvm: Removed duplicated SIGP defines
      s390x/kvm: Removed s390_store_status stub
      s390x/kvm: Fix coding style in handle_sigp()
      s390x/kvm: Implemented SIGP START
      s390x/kvm: Simplified the calculation of the SIGP order code
      s390x/kvm: Fixed condition code for unknown SIGP orders
      s390x/ioinst: CHSC has to set a condition code

* tag 'signed-s390-for-upstream' of git://github.com/agraf/qemu:
  s390x/ioinst: CHSC has to set a condition code
  s390x/kvm: Fixed condition code for unknown SIGP orders
  s390x/kvm: Simplified the calculation of the SIGP order code
  s390x/kvm: Implemented SIGP START
  s390x/kvm: Fix coding style in handle_sigp()
  s390x/kvm: Removed s390_store_status stub
  s390x/kvm: Removed duplicated SIGP defines
  s390x/kvm: Fix diagnose handling.

10 years agotarget-sh4: Use new qemu_ld/st opcodes
Aurelien Jarno [Wed, 11 Dec 2013 06:56:47 +0000 (07:56 +0100)]
target-sh4: Use new qemu_ld/st opcodes

Reviewed-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
10 years agotarget-mips: Use new qemu_ld/st opcodes
Aurelien Jarno [Wed, 11 Dec 2013 07:35:27 +0000 (08:35 +0100)]
target-mips: Use new qemu_ld/st opcodes

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
10 years agotcg/i386: fix a comment
Aurelien Jarno [Tue, 10 Dec 2013 09:35:28 +0000 (10:35 +0100)]
tcg/i386: fix a comment

The comments apply to 8-bit stores, not 8-byte stores.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
10 years agoMerge remote-tracking branch 'agraf/tags/signed-ppc-for-upstream' into staging
Anthony Liguori [Fri, 20 Dec 2013 01:03:17 +0000 (17:03 -0800)]
Merge remote-tracking branch 'agraf/tags/signed-ppc-for-upstream' into staging

Patch queue for ppc - 2013-12-20

Alexander Graf (3):
      PPC: Use default pci bus name for grackle and heathrow
      roms: Flush icache when writing roms to guest memory
      PPC: Add VSX to hflags

Alexey Kardashevskiy (5):
      powerpc: add PVR mask support
      target-ppc: move POWER7+ to a separate family
      spapr-rtas: replace return code constants with macros
      spapr-rtas: add ibm, (get|set)-system-parameter
      spapr: make sure RMA is in first mode of first memory node

Greg Kurz (1):
      target-ppc: add stubs for KVM breakpoints

Paolo Bonzini (1):
      spapr: tie spapr-nvram to -pflash

Paul Mackerras (1):
      spapr: limit numa memory regions by ram size

Peter Crosthwaite (2):
      device_tree: s/qemu_devtree/qemu_fdt globally
      device_tree: qemu_fdt_setprop: Rename val_array arg

Tom Musta (19):
      Declare and Enable VSX
      Add MSR VSX and Associated Exception
      Add VSX Instruction Decoders
      Add VSR to Global Registers
      Add lxvd2x
      Add stxvd2x
      Add xxpermdi
      Add lxsdx
      Add lxvdsx
      Add lxvw4x
      Add stxsdx
      Add stxvw4x
      Add VSX Scalar Move Instructions
      Add VSX Vector Move Instructions
      Add Power7 VSX Logical Instructions
      Add xxmrgh/xxmrgl
      Add xxsel
      Add xxspltw
      Add xxsldwi

* agraf/tags/signed-ppc-for-upstream: (32 commits)
  spapr: limit numa memory regions by ram size
  spapr: make sure RMA is in first mode of first memory node
  device_tree: qemu_fdt_setprop: Rename val_array arg
  device_tree: s/qemu_devtree/qemu_fdt globally
  PPC: Add VSX to hflags
  Add xxsldwi
  Add xxspltw
  Add xxsel
  Add xxmrgh/xxmrgl
  Add Power7 VSX Logical Instructions
  Add VSX Vector Move Instructions
  Add VSX Scalar Move Instructions
  roms: Flush icache when writing roms to guest memory
  spapr: tie spapr-nvram to -pflash
  PPC: Use default pci bus name for grackle and heathrow
  spapr-rtas: add ibm, (get|set)-system-parameter
  spapr-rtas: replace return code constants with macros
  target-ppc: move POWER7+ to a separate family
  Add stxvw4x
  Add stxsdx
  ...

10 years agospapr: limit numa memory regions by ram size
Paul Mackerras [Mon, 25 Nov 2013 03:14:51 +0000 (14:14 +1100)]
spapr: limit numa memory regions by ram size

This makes sure that all NUMA memory blocks reside within RAM or
have zero length.

Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agospapr: make sure RMA is in first mode of first memory node
Alexey Kardashevskiy [Mon, 25 Nov 2013 03:14:50 +0000 (14:14 +1100)]
spapr: make sure RMA is in first mode of first memory node

The SPAPR specification says that the RMA starts at the LPAR's logical
address 0 and is the first logical memory block reported in
the LPAR’s device tree.

So SLOF only maps the first block and that block needs to span
the full RMA.

This makes sure that the RMA area is where SLOF expects it.

Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agodevice_tree: qemu_fdt_setprop: Rename val_array arg
Peter Crosthwaite [Mon, 11 Nov 2013 08:15:21 +0000 (18:15 +1000)]
device_tree: qemu_fdt_setprop: Rename val_array arg

Looking at the implementation, this doesn't really have a lot to do
with arrays. Its just a pointer to a buffer and is passed through
to the wrapped fn (qemu_fdt_setprop) unchanged. So rename to make it
consistent with libfdt, which in the wrapped function just calls it
"val".

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agodevice_tree: s/qemu_devtree/qemu_fdt globally
Peter Crosthwaite [Mon, 11 Nov 2013 08:14:41 +0000 (18:14 +1000)]
device_tree: s/qemu_devtree/qemu_fdt globally

The qemu_devtree API is a wrapper around the fdt_ set of APIs.
Rename accordingly.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
[agraf: also convert hw/arm/virt.c]
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoPPC: Add VSX to hflags
Alexander Graf [Wed, 18 Dec 2013 08:21:02 +0000 (09:21 +0100)]
PPC: Add VSX to hflags

We generate different code depending on whether MSR_VSX is set or
clear, so it needs to be part of our hflags too which indicate whether
we're still in the same translation block cache bucket.

Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoAdd xxsldwi
Tom Musta [Fri, 1 Nov 2013 13:21:23 +0000 (08:21 -0500)]
Add xxsldwi

This patch adds the VSX Shift Left Double by Word Immediate
(xxsldwi) instruction.

Signed-off-by: Tom Musta <tommusta@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoAdd xxspltw
Tom Musta [Fri, 1 Nov 2013 13:21:22 +0000 (08:21 -0500)]
Add xxspltw

This patch adds the VSX Splat Word (xxsplatw) instruction.

This is the first instruction to use the UIM immediate field
and consequently a decoder is also added.

V2: reworked implementation per Richard Henderson's comments.

Signed-off-by: Tom Musta <tommusta@gmail.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoAdd xxsel
Tom Musta [Fri, 1 Nov 2013 13:21:21 +0000 (08:21 -0500)]
Add xxsel

This patch adds the VSX Select (xxsel) instruction.

The xxsel instruction has four VSR operands.  Thus the xC
instruction decoder is added.

The xxsel instruction is massively overloaded in the opcode
table since only bits 26 and 27 are opcode bits.  This
overloading is done in matrix fashion with two macros
(GEN_XXSEL_ROW and GEN_XX_SEL).

V2: (1) eliminated unecessary XXSEL macro  (2) tighter implementation
using tcg_gen_andc_i64.

Signed-off-by: Tom Musta <tommusta@gmail.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoAdd xxmrgh/xxmrgl
Tom Musta [Fri, 1 Nov 2013 13:21:20 +0000 (08:21 -0500)]
Add xxmrgh/xxmrgl

This patch adds the VSX Merge High Word and VSX Merge Low Word
instructions.

V2: Now implemented using deposit (per Richard Henderson's comment)

Signed-off-by: Tom Musta <tommusta@gmail.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoAdd Power7 VSX Logical Instructions
Tom Musta [Fri, 1 Nov 2013 13:21:19 +0000 (08:21 -0500)]
Add Power7 VSX Logical Instructions

This patch adds the VSX logical instructions that are defined
by the Version 2.06 Power ISA (aka Power7):

   - xxland
   - xxlandc
   - xxlor
   - xxlxor
   - xxlnor

Signed-off-by: Tom Musta <tommusta@gmail.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoAdd VSX Vector Move Instructions
Tom Musta [Fri, 1 Nov 2013 13:21:18 +0000 (08:21 -0500)]
Add VSX Vector Move Instructions

This patch adds the vector move instructions:

  - xvabsdp - Vector Absolute Value Double-Precision
  - xvnabsdp - Vector Negative Absolute Value Double-Precision
  - xvnegdp - Vector Negate Double-Precision
  - xvcpsgndp - Vector Copy Sign Double-Precision
  - xvabssp - Vector Absolute Value Single-Precision
  - xvnabssp - Vector Negative Absolute Value Single-Precision
  - xvnegsp - Vector Negate Single-Precision
  - xvcpsgnsp - Vector Copy Sign Single-Precision

V3: Per Paolo Bonzini's suggestion, used a temporary for the
sign mask and andc.

Signed-off-by: Tom Musta <tommusta@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoAdd VSX Scalar Move Instructions
Tom Musta [Fri, 1 Nov 2013 13:21:17 +0000 (08:21 -0500)]
Add VSX Scalar Move Instructions

This patch adds the VSX scalar move instructions:

  - xsabsdp (Scalar Absolute Value Double-Precision)
  - xsnabspd (Scalar Negative Absolute Value Double-Precision)
  - xsnegdp (Scalar Negate Double-Precision)
  - xscpsgndp (Scalar Copy Sign Double-Precision)

A common generator macro (VSX_SCALAR_MOVE) is added since these
instructions vary only slightly from each other.

Macros to support VSX XX2 and XX3 form opcodes are also added.
These macros handle the overloading of "opcode 2" space (instruction
bits 26:30) caused by AX and BX bits (29 and 30, respectively).

V3: Per feedback from Paolo Bonzini, moved the sign mask into a
temporary and used andc.

Signed-off-by: Tom Musta <tommusta@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoroms: Flush icache when writing roms to guest memory
Alexander Graf [Wed, 11 Dec 2013 13:17:44 +0000 (14:17 +0100)]
roms: Flush icache when writing roms to guest memory

We use the rom infrastructure to write firmware and/or initial kernel
blobs into guest address space. So we're basically emulating the cache
off phase on very early system bootup.

That phase is usually responsible for clearing the instruction cache for
anything it writes into cachable memory, to ensure that after reboot we
don't happen to execute stale bits from the instruction cache.

So we need to invalidate the icache every time we write a rom into guest
address space. We do not need to do this for every DMA since the guest
expects it has to flush the icache manually in that case.

This fixes random reboot issues on e5500 (booke ppc) for me.

Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agospapr: tie spapr-nvram to -pflash
Paolo Bonzini [Fri, 22 Nov 2013 09:27:40 +0000 (10:27 +0100)]
spapr: tie spapr-nvram to -pflash

spapr-nvram's drive property is currently connected to a non-existent
"-machine nvram=<drivename>" option.  Instead, tie it to -pflash like
other non-volatile RAM devices.  This provides the following possibilities
for adding a backend for the sPAPR non-volatile RAM:

* -pflash filename

* -drive if=pflash,file=filename,format=raw,...

* -drive if=none,file=filename,format=raw,id=foo,... -global spapr-nvram.drive=foo

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoPPC: Use default pci bus name for grackle and heathrow
Alexander Graf [Wed, 4 Dec 2013 11:42:32 +0000 (12:42 +0100)]
PPC: Use default pci bus name for grackle and heathrow

There's no good reason to call our bus "pci" rather than let the default
bus name take over ("pci.0").

The big downside to calling it different from anyone else is that tools
that pass -device get confused. They are looking for a bus "pci.0" rather
than "pci".

To make life easier for everyone, let's just drop the name override.

Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agospapr-rtas: add ibm, (get|set)-system-parameter
Alexey Kardashevskiy [Tue, 19 Nov 2013 04:28:55 +0000 (15:28 +1100)]
spapr-rtas: add ibm, (get|set)-system-parameter

This adds very basic handlers for ibm,get-system-parameter and
ibm,set-system-parameter RTAS calls.

The only parameter handled at the moment is
"platform-processor-diagnostics-run-mode" which is always disabled and
does not support changing. This is expected to make
"ppc64_cpu --run-mode=1" happy.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
[agraf: s/papameter/parameter/g]
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agospapr-rtas: replace return code constants with macros
Alexey Kardashevskiy [Tue, 19 Nov 2013 04:28:54 +0000 (15:28 +1100)]
spapr-rtas: replace return code constants with macros

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agotarget-ppc: move POWER7+ to a separate family
Alexey Kardashevskiy [Tue, 19 Nov 2013 01:39:15 +0000 (12:39 +1100)]
target-ppc: move POWER7+ to a separate family

So far POWER7+ was a part of POWER7 family. However it has a different
PVR base value so in order to support PVR masks, it needs a separate
family class.

This adds a new family class, PVR base and mask values and moves
Power7+ v2.1 CPU to a new family. The class init function is copied
from the POWER7 family.

This defines a firmware name for the new family as "PowerPC,POWER7+"
instead of previously used "PowerPC,POWER7" from the POWER7 family.
The reason for that is that the Sapphire firmware (a h0st firmware)
uses "PowerPC,POWER7+" already and since no specification defines
exactly the CPU nodes naming in the device tree, we better stay
in sync with the host firmware.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoAdd stxvw4x
Tom Musta [Fri, 1 Nov 2013 13:21:16 +0000 (08:21 -0500)]
Add stxvw4x

This patch adds the Store VSX Vector Word*4 Indexed (stxvw4x)
instruction.

Signed-off-by: Tom Musta <tommusta@gmail.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoAdd stxsdx
Tom Musta [Fri, 1 Nov 2013 13:21:15 +0000 (08:21 -0500)]
Add stxsdx

This patch adds the Store VSX Scalar Doubleword Indexed (stxsdx)
instruction.

Signed-off-by: Tom Musta <tommusta@gmail.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoAdd lxvw4x
Tom Musta [Fri, 1 Nov 2013 13:21:14 +0000 (08:21 -0500)]
Add lxvw4x

This patch adds the Load VSX Vector Word*4 Indexed (lxvw4x)
instruction.

V2: changed to use deposit_i64 per Richard Henderson's review.

Signed-off-by: Tom Musta <tommusta@gmail.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoAdd lxvdsx
Tom Musta [Fri, 1 Nov 2013 13:21:13 +0000 (08:21 -0500)]
Add lxvdsx

This patch adds the Load VSX Vector Doubleword & Splat Indexed
(lxvdsx) instruction.

Signed-off-by: Tom Musta <tommusta@gmail.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoAdd lxsdx
Tom Musta [Fri, 1 Nov 2013 13:21:12 +0000 (08:21 -0500)]
Add lxsdx

This patch adds the Load VSX Scalar Doubleowrd Indexed (lxsdx)
instruction.

The lower 8 bytes of the target register are undefined; this
implementation leaves those bytes unaltered.

Signed-off-by: Tom Musta <tommusta@gmail.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoAdd xxpermdi
Tom Musta [Tue, 22 Oct 2013 11:09:35 +0000 (22:09 +1100)]
Add xxpermdi

This patch adds the xxpermdi instruction.  The instruction
uses bits 22, 23, 29 and 30 for non-opcode fields (DM, AX
and BX).  This results in overloading of the opcode table
with aliases, which can be seen in the GEN_XX3FORM_DM
macro.

Signed-off-by: Tom Musta <tommusta@gmail.com>
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoAdd stxvd2x
Tom Musta [Tue, 22 Oct 2013 11:09:00 +0000 (22:09 +1100)]
Add stxvd2x

This patch adds the stxvd2x instruction.

Signed-off-by: Tom Musta <tommusta@gmail.com>
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoAdd lxvd2x
Tom Musta [Tue, 22 Oct 2013 11:08:32 +0000 (22:08 +1100)]
Add lxvd2x

This patch adds the lxvd2x instruction.

Signed-off-by: Tom Musta <tommusta@gmail.com>
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoAdd VSR to Global Registers
Tom Musta [Tue, 22 Oct 2013 11:07:41 +0000 (22:07 +1100)]
Add VSR to Global Registers

This patch adds VSX VSRs to the the list of global register indices.
More specifically, it adds the lower halves of the first 32 VSRs to
the list of global register indices.  The upper halves of the first
32 VSRs are already defined via cpu_fpr[].  And the second 32 VSRs
are already defined via the cpu_avrh[] and cpu_avrl[] arrays.

Signed-off-by: Tom Musta <tommusta@gmail.com>
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoAdd VSX Instruction Decoders
Tom Musta [Tue, 22 Oct 2013 11:06:46 +0000 (22:06 +1100)]
Add VSX Instruction Decoders

This patch adds decoders for the VSX fields XT, XS, XA, XB and
DM.  The first four are split fields and a general helper for
these types of fields is also added.

Signed-off-by: Tom Musta <tommusta@gmail.com>
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoAdd MSR VSX and Associated Exception
Tom Musta [Tue, 22 Oct 2013 11:06:17 +0000 (22:06 +1100)]
Add MSR VSX and Associated Exception

This patch adds support for the VSX bit of the PowerPC Machine
State Register (MSR) as well as the corresponding VSX Unavailable
exception.

The VSX bit is added to the defined bits masks of the Power7 and
Power8 CPU models.

Signed-off-by: Tom Musta <tommusta@gmail.com>
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoDeclare and Enable VSX
Tom Musta [Tue, 22 Oct 2013 11:05:46 +0000 (22:05 +1100)]
Declare and Enable VSX

This patch adds the flag POWERPC_FLAG_VSX to the list of defined
flags and also adds this flag to the list of supported features of
the Power7 and Power8 CPUs.  Additionally, the VSX instructions
are added to the list of TCG-enabled instruction.

Signed-off-by: Tom Musta <tommusta@gmail.com>
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agopowerpc: add PVR mask support
Alexey Kardashevskiy [Fri, 27 Sep 2013 08:05:03 +0000 (18:05 +1000)]
powerpc: add PVR mask support

IBM POWERPC processors encode PVR as a CPU family in higher 16 bits and
a CPU version in lower 16 bits. Since there is no significant change
in behavior between versions, there is no point to add every single CPU
version in QEMU's CPU list. Also, new CPU versions of already supported
CPU won't break the existing code.

This adds PVR value/mask support for KVM, i.e. for -cpu host option.

As CPU family class name for POWER7 is "POWER7-family", there is no need
to touch aliases.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agotarget-ppc: add stubs for KVM breakpoints
Greg Kurz [Wed, 11 Dec 2013 13:15:34 +0000 (14:15 +0100)]
target-ppc: add stubs for KVM breakpoints

The latest update to v3.13-rc3 (bf63839f) breaks the
ppc build with KVM:

kvm-all.o: In function `kvm_update_guest_debug':
kvm-all.c:1910: undefined reference to `kvm_arch_update_guest_debug'
kvm-all.o: In function `kvm_insert_breakpoint':
kvm-all.c:1937: undefined reference to `kvm_arch_insert_sw_breakpoint'
kvm-all.c:1945: undefined reference to `kvm_arch_insert_hw_breakpoint'
kvm-all.o: In function `kvm_remove_breakpoint':
kvm-all.c:1977: undefined reference to `kvm_arch_remove_sw_breakpoint'
kvm-all.c:1985: undefined reference to `kvm_arch_remove_hw_breakpoint'
kvm-all.o: In function `kvm_remove_all_breakpoints':
kvm-all.c:2009: undefined reference to `kvm_arch_remove_sw_breakpoint'
kvm-all.c:2006: undefined reference to `kvm_arch_remove_sw_breakpoint'
kvm-all.c:2017: undefined reference to `kvm_arch_remove_all_hw_breakpoints'

We need stubs until something gets implemented.

Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoMerge remote-tracking branch 'pmaydell/tags/pull-target-arm-20131217' into staging
Anthony Liguori [Thu, 19 Dec 2013 19:56:33 +0000 (11:56 -0800)]
Merge remote-tracking branch 'pmaydell/tags/pull-target-arm-20131217' into staging

target-arm queue:
 * AES instruction support for 32 bit ARM
 * pflash01: much better emulation of 2x16bit and similar configs
   where multiple flash devices are banked together
 * fixed CBAR handling on Zynq, Highbank
 * initial AArch64 KVM control support
 * first two chunks of patches for A64 instruction emulation
 * new board: canon-a1100 (Canon DIGIC SoC)
 * new board: cubieboard (Allwinner A10 SoC)

# gpg: Signature made Tue 17 Dec 2013 12:18:39 PM PST using RSA key ID 14360CDE
# gpg: Can't check signature: public key not found

# By Alexander Graf (14) and others
# Via Peter Maydell
* pmaydell/tags/pull-target-arm-20131217: (62 commits)
  MAINTAINERS: add myself to maintain allwinner-a10
  hw/arm: add cubieboard support
  hw/arm: add allwinner a10 SoC support
  hw/intc: add allwinner A10 interrupt controller
  hw/timer: add allwinner a10 timer
  vmstate: Add support for an array of ptimer_state *
  MAINTAINERS: Document 'Canon DIGIC' machine
  hw/arm/digic: add NOR ROM support
  hw/arm/digic: add UART support
  hw/arm/digic: add timer support
  hw/arm/digic: prepare DIGIC-based boards support
  hw/arm: add very initial support for Canon DIGIC SoC
  target-arm: A64: add support for logical (immediate) insns
  target-arm: A64: add support for 1-src CLS insn
  host-utils: add clrsb32/64 - count leading redundant sign bits
  target-arm: A64: add support for bitfield insns
  target-arm: A64: add support for 1-src REV insns
  target-arm: A64: add support for 1-src RBIT insn
  target-arm: A64: add support for 1-src data processing and CLZ
  target-arm: A64: add support for 2-src shift reg insns
  ...

Message-id: 1387312160-12318-1-git-send-email-peter.maydell@linaro.org
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
10 years agos390x/ioinst: CHSC has to set a condition code
Thomas Huth [Tue, 17 Dec 2013 18:50:01 +0000 (19:50 +0100)]
s390x/ioinst: CHSC has to set a condition code

I missed to set the CC in the CHSC instruction when I refactored
the CC setting in the IO instructions with the following commit:
5d9bf1c07c1369ab3506fc82cc65a10f4415d867
s390/ioinst: Moved the CC setting to the IO instruction handlers
This patch now restores the correct behaviour of CHSC by setting the
condition code 0 at the end of the instruction.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agos390x/kvm: Fixed condition code for unknown SIGP orders
Thomas Huth [Tue, 17 Dec 2013 13:22:09 +0000 (14:22 +0100)]
s390x/kvm: Fixed condition code for unknown SIGP orders

If SIGP is called with an unknown order code, it has to return CC1
instead of CC3 and set the "invalid order" bit in the return status.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agos390x/kvm: Simplified the calculation of the SIGP order code
Thomas Huth [Tue, 17 Dec 2013 13:22:08 +0000 (14:22 +0100)]
s390x/kvm: Simplified the calculation of the SIGP order code

We've already got a helper function for calculating the
base/displacement of RS formatted instructions, so we can
get rid of the manual calculation of the SIGP order code.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agos390x/kvm: Implemented SIGP START
Thomas Huth [Tue, 17 Dec 2013 13:22:07 +0000 (14:22 +0100)]
s390x/kvm: Implemented SIGP START

This patch adds the missing START order to the SIGP instruction handler.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agos390x/kvm: Fix coding style in handle_sigp()
Thomas Huth [Tue, 17 Dec 2013 13:22:06 +0000 (14:22 +0100)]
s390x/kvm: Fix coding style in handle_sigp()

To make scripts/checkpatch.pl happy for the following patches,
the coding style in handle_sigp() has to be fixed first.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agos390x/kvm: Removed s390_store_status stub
Thomas Huth [Tue, 17 Dec 2013 13:22:05 +0000 (14:22 +0100)]
s390x/kvm: Removed s390_store_status stub

The SIGP order STORE STATUS AT ADDRESS will be handled in
kernel space, so we do not need the stub in QEMU anymore.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agos390x/kvm: Removed duplicated SIGP defines
Thomas Huth [Tue, 17 Dec 2013 13:22:04 +0000 (14:22 +0100)]
s390x/kvm: Removed duplicated SIGP defines

The SIGP order defines are also available in cpu.h,
so there is no need to re-define them in kvm.c.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agos390x/kvm: Fix diagnose handling.
Cornelia Huck [Tue, 17 Dec 2013 17:27:33 +0000 (18:27 +0100)]
s390x/kvm: Fix diagnose handling.

The instruction intercept handler for diagnose used only the displacement
when trying to calculate the function code. This is only correct for base
0, however; we need to perform a complete base/displacement address
calculation and use bits 48-63 as the function code.

Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
10 years agoMAINTAINERS: add myself to maintain allwinner-a10
liguang [Tue, 17 Dec 2013 19:42:38 +0000 (19:42 +0000)]
MAINTAINERS: add myself to maintain allwinner-a10

Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>
Message-id: 1387159292-10436-7-git-send-email-lig.fnst@cn.fujitsu.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agohw/arm: add cubieboard support
liguang [Tue, 17 Dec 2013 19:42:38 +0000 (19:42 +0000)]
hw/arm: add cubieboard support

Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Message-id: 1387159292-10436-6-git-send-email-lig.fnst@cn.fujitsu.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agohw/arm: add allwinner a10 SoC support
liguang [Tue, 17 Dec 2013 19:42:38 +0000 (19:42 +0000)]
hw/arm: add allwinner a10 SoC support

Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Message-id: 1387159292-10436-5-git-send-email-lig.fnst@cn.fujitsu.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agohw/intc: add allwinner A10 interrupt controller
liguang [Tue, 17 Dec 2013 19:42:38 +0000 (19:42 +0000)]
hw/intc: add allwinner A10 interrupt controller

Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1387159292-10436-4-git-send-email-lig.fnst@cn.fujitsu.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agohw/timer: add allwinner a10 timer
liguang [Tue, 17 Dec 2013 19:42:37 +0000 (19:42 +0000)]
hw/timer: add allwinner a10 timer

Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Message-id: 1387159292-10436-3-git-send-email-lig.fnst@cn.fujitsu.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agovmstate: Add support for an array of ptimer_state *
Peter Maydell [Tue, 17 Dec 2013 19:42:37 +0000 (19:42 +0000)]
vmstate: Add support for an array of ptimer_state *

Add support for defining a vmstate field which is an array
of pointers to structures, and use this to define a
VMSTATE_PTIMER_ARRAY() which allows an array of ptimer_state*
to be used by devices.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1387159292-10436-2-git-send-email-lig.fnst@cn.fujitsu.com

10 years agoMAINTAINERS: Document 'Canon DIGIC' machine
Antony Pavlov [Tue, 17 Dec 2013 19:42:37 +0000 (19:42 +0000)]
MAINTAINERS: Document 'Canon DIGIC' machine

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Message-id: 1387188908-754-7-git-send-email-antonynpavlov@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agohw/arm/digic: add NOR ROM support
Antony Pavlov [Tue, 17 Dec 2013 19:42:37 +0000 (19:42 +0000)]
hw/arm/digic: add NOR ROM support

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Message-id: 1387188908-754-6-git-send-email-antonynpavlov@gmail.com
[PMM: don't try to load ROM blob if qtest_enabled()]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agohw/arm/digic: add UART support
Antony Pavlov [Tue, 17 Dec 2013 19:42:37 +0000 (19:42 +0000)]
hw/arm/digic: add UART support

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Message-id: 1387188908-754-5-git-send-email-antonynpavlov@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agohw/arm/digic: add timer support
Antony Pavlov [Tue, 17 Dec 2013 19:42:36 +0000 (19:42 +0000)]
hw/arm/digic: add timer support

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Message-id: 1387188908-754-4-git-send-email-antonynpavlov@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agohw/arm/digic: prepare DIGIC-based boards support
Antony Pavlov [Tue, 17 Dec 2013 19:42:36 +0000 (19:42 +0000)]
hw/arm/digic: prepare DIGIC-based boards support

Also this patch adds initial support for Canon
PowerShot A1100 IS compact camera.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Message-id: 1387188908-754-3-git-send-email-antonynpavlov@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agohw/arm: add very initial support for Canon DIGIC SoC
Antony Pavlov [Tue, 17 Dec 2013 19:42:36 +0000 (19:42 +0000)]
hw/arm: add very initial support for Canon DIGIC SoC

DIGIC is Canon Inc.'s name for a family of SoC
for digital cameras and camcorders.

There is no publicly available specification for
DIGIC chips. All information about DIGIC chip
internals is based on reverse engineering efforts
made by CHDK (http://chdk.wikia.com) and
Magic Lantern (http://www.magiclantern.fm) projects
contributors.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Message-id: 1387188908-754-2-git-send-email-antonynpavlov@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agotarget-arm: A64: add support for logical (immediate) insns
Alexander Graf [Tue, 17 Dec 2013 19:42:36 +0000 (19:42 +0000)]
target-arm: A64: add support for logical (immediate) insns

This patch adds support for C3.4.4 Logical (immediate),
which include AND, ANDS, ORR, EOR.

Signed-off-by: Alexander Graf <agraf@suse.de>
[claudio: adapted to new decoder, function renaming,
          removed a TCG temp variable]
Signed-off-by: Claudio Fontana <claudio.fontana@linaro.org>
[PMM: cleaned up some unnecessary code in logic_imm_decode_wmask
and added clarifying commentary on what it's actually doing.
Dropped an ext32u that's not needed if we've just done an AND.]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-arm: A64: add support for 1-src CLS insn
Claudio Fontana [Tue, 17 Dec 2013 19:42:35 +0000 (19:42 +0000)]
target-arm: A64: add support for 1-src CLS insn

this patch adds support for the CLS instruction.

Signed-off-by: Claudio Fontana <claudio.fontana@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
10 years agohost-utils: add clrsb32/64 - count leading redundant sign bits
Claudio Fontana [Tue, 17 Dec 2013 19:42:35 +0000 (19:42 +0000)]
host-utils: add clrsb32/64 - count leading redundant sign bits

this patch introduces wrappers for the clrsb builtins,
which count the leading redundant sign bits.

Signed-off-by: Claudio Fontana <claudio.fontana@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-arm: A64: add support for bitfield insns
Claudio Fontana [Tue, 17 Dec 2013 19:42:35 +0000 (19:42 +0000)]
target-arm: A64: add support for bitfield insns

This patch implements the C3.4.2 Bitfield instructions:
SBFM, BFM, UBFM.

Signed-off-by: Claudio Fontana <claudio.fontana@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-arm: A64: add support for 1-src REV insns
Claudio Fontana [Tue, 17 Dec 2013 19:42:35 +0000 (19:42 +0000)]
target-arm: A64: add support for 1-src REV insns

This adds support for C5.6.149 REV, C5.6.151 REV32, C5.6.150 REV16.

Signed-off-by: Claudio Fontana <claudio.fontana@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-arm: A64: add support for 1-src RBIT insn
Alexander Graf [Tue, 17 Dec 2013 19:42:35 +0000 (19:42 +0000)]
target-arm: A64: add support for 1-src RBIT insn

This adds support for the C5.6.147 RBIT instruction.

Signed-off-by: Alexander Graf <agraf@suse.de>
[claudio: adapted to new decoder, use bswap64,
          make RBIT part standalone from the rest of the patch,
  splitting REV into a separate patch]
Signed-off-by: Claudio Fontana <claudio.fontana@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-arm: A64: add support for 1-src data processing and CLZ
Claudio Fontana [Tue, 17 Dec 2013 19:42:35 +0000 (19:42 +0000)]
target-arm: A64: add support for 1-src data processing and CLZ

This patch adds support for decoding 1-src data processing insns,
and the first user, C5.6.40 CLZ (count leading zeroes).

Signed-off-by: Claudio Fontana <claudio.fontana@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-arm: A64: add support for 2-src shift reg insns
Alexander Graf [Tue, 17 Dec 2013 19:42:34 +0000 (19:42 +0000)]
target-arm: A64: add support for 2-src shift reg insns

This adds 2-src variable shift register instructions:
C5.6.115 LSLV, C5.6.118 LSRV, C5.6.17 ASRV, C5.6.154 RORV

Signed-off-by: Alexander Graf <agraf@suse.de>
[claudio: adapted to new decoder, use enums for shift types]
Signed-off-by: Claudio Fontana <claudio.fontana@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
10 years agotarget-arm: A64: add support for 2-src data processing and DIV
Alexander Graf [Tue, 17 Dec 2013 19:42:34 +0000 (19:42 +0000)]
target-arm: A64: add support for 2-src data processing and DIV

This patch adds support for decoding 2-src data processing insns,
and the first users, UDIV and SDIV.

Signed-off-by: Alexander Graf <agraf@suse.de>
[claudio: adapted to new decoder adding the 2-src decoding level,
          always zero-extend result in 32bit mode]
Signed-off-by: Claudio Fontana <claudio.fontana@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>