qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 86360a: exec-all.h: Use stl_p to avoid undefi


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 86360a: exec-all.h: Use stl_p to avoid undefined behaviour...
Date: Tue, 13 May 2014 07:30:08 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 86360ad71df0070283469b8ae59f33cdd013501d
      
https://github.com/qemu/qemu/commit/86360ad71df0070283469b8ae59f33cdd013501d
  Author: Peter Maydell <address@hidden>
  Date:   2014-05-12 (Mon, 12 May 2014)

  Changed paths:
    M include/exec/exec-all.h

  Log Message:
  -----------
  exec-all.h: Use stl_p to avoid undefined behaviour patching x86 jumps

The code which patches x86 jump instructions assumes it can do an
unaligned write of a uint32_t. This is actually safe on x86, but it's
still undefined behaviour. We have infrastructure for doing efficient
unaligned accesses which doesn't engage in undefined behaviour, so
use it.

This is technically fractionally less efficient, at least with gcc 4.6;
instead of one instruction:
 7b2:   89 3e                   mov    %edi,(%rsi)
we get an extra spurious store to the stack slot:
 7b2:   89 7c 24 64             mov    %edi,0x64(%rsp)
 7b6:   89 3e                   mov    %edi,(%rsi)

Reviewed-by: Alex Bennée <address@hidden>
Signed-off-by: Peter Maydell <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: 4387345a962284c77435a9644d528d2356adecc5
      
https://github.com/qemu/qemu/commit/4387345a962284c77435a9644d528d2356adecc5
  Author: Peter Maydell <address@hidden>
  Date:   2014-05-12 (Mon, 12 May 2014)

  Changed paths:
    M tcg/tcg.c

  Log Message:
  -----------
  tcg: Avoid stores to unaligned addresses

Avoid stores to unaligned addresses in TCG code generation, by using the
usual memcpy() approach. (Using bswap.h would drag a lot of QEMU baggage
into TCG, so it's simpler just to do direct memcpy() here.)

Reviewed-by: Alex Bennée <address@hidden>
Signed-off-by: Peter Maydell <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: 5c53bb812152c3d7919cadfd47c210b181bf89ac
      
https://github.com/qemu/qemu/commit/5c53bb812152c3d7919cadfd47c210b181bf89ac
  Author: Peter Maydell <address@hidden>
  Date:   2014-05-12 (Mon, 12 May 2014)

  Changed paths:
    M tcg/i386/tcg-target.c
    M tcg/tcg.c

  Log Message:
  -----------
  tcg: Avoid undefined behaviour patching code at unaligned addresses

To avoid C undefined behaviour when patching generated code,
provide wrappers tcg_patch8/16/32/64 which use the usual memcpy
trick, and use them in the i386 backend.

Reviewed-by: Alex Bennée <address@hidden>
Signed-off-by: Peter Maydell <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: 52a1f64ec54354157ee73435e53d2dfda0414d07
      
https://github.com/qemu/qemu/commit/52a1f64ec54354157ee73435e53d2dfda0414d07
  Author: Richard Henderson <address@hidden>
  Date:   2014-05-12 (Mon, 12 May 2014)

  Changed paths:
    M tcg/tcg.h

  Log Message:
  -----------
  tcg: Introduce byte pointer arithmetic helpers

Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: 1813e1758dcc60c96f8caf2d0c66c2193f1f86e0
      
https://github.com/qemu/qemu/commit/1813e1758dcc60c96f8caf2d0c66c2193f1f86e0
  Author: Richard Henderson <address@hidden>
  Date:   2014-05-12 (Mon, 12 May 2014)

  Changed paths:
    M include/exec/exec-all.h
    M tcg/tcg-be-ldst.h
    M tcg/tcg.c
    M tcg/tcg.h
    M translate-all.c

  Log Message:
  -----------
  tcg: Define tcg_insn_unit for code pointers

To be defined by the tcg backend based on the elemental unit of the ISA.
During the transition, allow TCG_TARGET_INSN_UNIT_SIZE to be undefined,
which allows us to default tcg_insn_unit to the current uint8_t.

Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: f6bff89d06349fd3807403a0d4ee2203fab811f1
      
https://github.com/qemu/qemu/commit/f6bff89d06349fd3807403a0d4ee2203fab811f1
  Author: Richard Henderson <address@hidden>
  Date:   2014-05-12 (Mon, 12 May 2014)

  Changed paths:
    M tcg/i386/tcg-target.c
    M tcg/i386/tcg-target.h

  Log Message:
  -----------
  tcg-i386: Define TCG_TARGET_INSN_UNIT_SIZE

And use tcg pointer differencing functions as appropriate.

Reviewed-by: Alex Bennée <address@hidden>
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: e083c4a2338dad6caa939056405314d648af484e
      
https://github.com/qemu/qemu/commit/e083c4a2338dad6caa939056405314d648af484e
  Author: Richard Henderson <address@hidden>
  Date:   2014-05-12 (Mon, 12 May 2014)

  Changed paths:
    M tcg/ppc64/tcg-target.c
    M tcg/ppc64/tcg-target.h

  Log Message:
  -----------
  tcg-ppc64: Define TCG_TARGET_INSN_UNIT_SIZE

And use tcg pointer differencing functions as appropriate.

Reviewed-by: Alex Bennée <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: 38cf39f7399bf00c8e3e4b014bba0d6bec6bbe89
      
https://github.com/qemu/qemu/commit/38cf39f7399bf00c8e3e4b014bba0d6bec6bbe89
  Author: Richard Henderson <address@hidden>
  Date:   2014-05-12 (Mon, 12 May 2014)

  Changed paths:
    M tcg/ppc/tcg-target.c
    M tcg/ppc/tcg-target.h

  Log Message:
  -----------
  tcg-ppc: Define TCG_TARGET_INSN_UNIT_SIZE

And use tcg pointer differencing functions as appropriate.

Reviewed-by: Alex Bennée <address@hidden>
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: abce5964be02146c204722c0c55bc6939fb8603d
      
https://github.com/qemu/qemu/commit/abce5964be02146c204722c0c55bc6939fb8603d
  Author: Richard Henderson <address@hidden>
  Date:   2014-05-12 (Mon, 12 May 2014)

  Changed paths:
    M tcg/sparc/tcg-target.c
    M tcg/sparc/tcg-target.h

  Log Message:
  -----------
  tcg-sparc: Define TCG_TARGET_INSN_UNIT_SIZE

And use tcg pointer differencing functions as appropriate.

Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: 267c931985cf4a003fdeaab197a49bdd83e50e19
      
https://github.com/qemu/qemu/commit/267c931985cf4a003fdeaab197a49bdd83e50e19
  Author: Richard Henderson <address@hidden>
  Date:   2014-05-12 (Mon, 12 May 2014)

  Changed paths:
    M tcg/arm/tcg-target.c
    M tcg/arm/tcg-target.h

  Log Message:
  -----------
  tcg-arm: Define TCG_TARGET_INSN_UNIT_SIZE

And use tcg pointer differencing functions as appropriate.

Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: 8587c30c3e3807728d12966667bc6055b772f1ac
      
https://github.com/qemu/qemu/commit/8587c30c3e3807728d12966667bc6055b772f1ac
  Author: Richard Henderson <address@hidden>
  Date:   2014-05-12 (Mon, 12 May 2014)

  Changed paths:
    M tcg/aarch64/tcg-target.c
    M tcg/aarch64/tcg-target.h

  Log Message:
  -----------
  tcg-aarch64: Define TCG_TARGET_INSN_UNIT_SIZE

And use tcg pointer differencing functions as appropriate.

Acked-by: Claudio Fontana <address@hidden>
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: 8c081b18025407fd5fa7c0d25a69398594ea5b2c
      
https://github.com/qemu/qemu/commit/8c081b18025407fd5fa7c0d25a69398594ea5b2c
  Author: Richard Henderson <address@hidden>
  Date:   2014-05-12 (Mon, 12 May 2014)

  Changed paths:
    M tcg/s390/tcg-target.c
    M tcg/s390/tcg-target.h

  Log Message:
  -----------
  tcg-s390: Define TCG_TARGET_INSN_UNIT_SIZE

And use tcg pointer differencing functions as appropriate.

Signed-off-by: Richard Henderson <address@hidden>


  Commit: 5588ff29210666234bb046034595fd0d53be90ef
      
https://github.com/qemu/qemu/commit/5588ff29210666234bb046034595fd0d53be90ef
  Author: Richard Henderson <address@hidden>
  Date:   2014-05-12 (Mon, 12 May 2014)

  Changed paths:
    M tcg/ia64/tcg-target.c
    M tcg/ia64/tcg-target.h

  Log Message:
  -----------
  tcg-ia64: Define TCG_TARGET_INSN_UNIT_SIZE

Using a 16-byte aligned structure achieves best results, both for code
cleanliness and compiled code size.  However, this means that we can't
use the trick of encoding the slot number into the low 2 bits.

Thankfully, we only ever use slot2, so make that explicit in the names
of the relocation functions, and drop the code for other slots.

Signed-off-by: Richard Henderson <address@hidden>


  Commit: ae0218e3509a84f01bf0d8cfe59ab7e5d0dd2a92
      
https://github.com/qemu/qemu/commit/ae0218e3509a84f01bf0d8cfe59ab7e5d0dd2a92
  Author: Richard Henderson <address@hidden>
  Date:   2014-05-12 (Mon, 12 May 2014)

  Changed paths:
    M tcg/mips/tcg-target.c
    M tcg/mips/tcg-target.h

  Log Message:
  -----------
  tcg-mips: Define TCG_TARGET_INSN_UNIT_SIZE

And use tcg pointer differencing functions as appropriate.

Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: a7f96f7666fe1d79c91578806b0c32786adca7ae
      
https://github.com/qemu/qemu/commit/a7f96f7666fe1d79c91578806b0c32786adca7ae
  Author: Richard Henderson <address@hidden>
  Date:   2014-05-12 (Mon, 12 May 2014)

  Changed paths:
    M tcg/tci/tcg-target.c
    M tcg/tci/tcg-target.h

  Log Message:
  -----------
  tci: Define TCG_TARGET_INSN_UNIT_SIZE

And use tcg pointer differencing functions as appropriate.

Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: 5053361b3edab82bc5bc276dae30345bf0261ee6
      
https://github.com/qemu/qemu/commit/5053361b3edab82bc5bc276dae30345bf0261ee6
  Author: Richard Henderson <address@hidden>
  Date:   2014-05-12 (Mon, 12 May 2014)

  Changed paths:
    M tcg/tcg.h

  Log Message:
  -----------
  tcg: Require TCG_TARGET_INSN_UNIT_SIZE

Now that all backends do define TCG_TARGET_INSN_UNIT_SIZE,
remove the fallback definition.

Reviewed-by: Alex Bennée <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>


  Commit: 6bf3e99747d107c9202ebe0970d7bb8b9d4a3472
      
https://github.com/qemu/qemu/commit/6bf3e99747d107c9202ebe0970d7bb8b9d4a3472
  Author: Richard Henderson <address@hidden>
  Date:   2014-05-12 (Mon, 12 May 2014)

  Changed paths:
    M tcg/i386/tcg-target.c

  Log Message:
  -----------
  tcg-i386: Rename tcg_out_calli to tcg_out_call

Signed-off-by: Richard Henderson <address@hidden>


  Commit: a8111212b3531020daa5cb4270e5633fc7999f5d
      
https://github.com/qemu/qemu/commit/a8111212b3531020daa5cb4270e5633fc7999f5d
  Author: Richard Henderson <address@hidden>
  Date:   2014-05-12 (Mon, 12 May 2014)

  Changed paths:
    M tcg/s390/tcg-target.c

  Log Message:
  -----------
  tcg-s390: Rename tgen_calli to tcg_out_call

Signed-off-by: Richard Henderson <address@hidden>


  Commit: 00d7a1acabbb875ff0a4bd8f8d9bd69051f36666
      
https://github.com/qemu/qemu/commit/00d7a1acabbb875ff0a4bd8f8d9bd69051f36666
  Author: Richard Henderson <address@hidden>
  Date:   2014-05-12 (Mon, 12 May 2014)

  Changed paths:
    M tcg/ppc/tcg-target.c

  Log Message:
  -----------
  tcg-ppc: Split out tcg_out_call

Signed-off-by: Richard Henderson <address@hidden>


  Commit: fdd8ec71847b5167a4be524c2d22d186fc3b6e3a
      
https://github.com/qemu/qemu/commit/fdd8ec71847b5167a4be524c2d22d186fc3b6e3a
  Author: Richard Henderson <address@hidden>
  Date:   2014-05-12 (Mon, 12 May 2014)

  Changed paths:
    M tcg/ppc64/tcg-target.c

  Log Message:
  -----------
  tcg-ppc64: Rename tcg_out_calli to tcg_out_call

Merge the existing tcg_out_call into tcg_out_op.

Signed-off-by: Richard Henderson <address@hidden>


  Commit: 4e9cf8409aa993d4925075ddaf41770d46eb1fb1
      
https://github.com/qemu/qemu/commit/4e9cf8409aa993d4925075ddaf41770d46eb1fb1
  Author: Richard Henderson <address@hidden>
  Date:   2014-05-12 (Mon, 12 May 2014)

  Changed paths:
    M tcg/sparc/tcg-target.c

  Log Message:
  -----------
  tcg-sparc: Create tcg_out_call

Rename the existing tcg_out_calli to tcg_out_call_nodelay.

Signed-off-by: Richard Henderson <address@hidden>


  Commit: eb68a4fa4e04910baac6726c52910a94f02ef483
      
https://github.com/qemu/qemu/commit/eb68a4fa4e04910baac6726c52910a94f02ef483
  Author: Richard Henderson <address@hidden>
  Date:   2014-05-12 (Mon, 12 May 2014)

  Changed paths:
    M tcg/mips/tcg-target.c

  Log Message:
  -----------
  tcg-mips: Split out tcg_out_call

Signed-off-by: Richard Henderson <address@hidden>


  Commit: dddbb2e1e3f8137d7e3f1faf9758c66cca0c94ea
      
https://github.com/qemu/qemu/commit/dddbb2e1e3f8137d7e3f1faf9758c66cca0c94ea
  Author: Richard Henderson <address@hidden>
  Date:   2014-05-12 (Mon, 12 May 2014)

  Changed paths:
    M tcg/tci/tcg-target.c

  Log Message:
  -----------
  tci: Create tcg_out_call

Signed-off-by: Richard Henderson <address@hidden>


  Commit: cf066674280c65a9e035eca073ce3a05887af502
      
https://github.com/qemu/qemu/commit/cf066674280c65a9e035eca073ce3a05887af502
  Author: Richard Henderson <address@hidden>
  Date:   2014-05-12 (Mon, 12 May 2014)

  Changed paths:
    M tcg/optimize.c
    M tcg/tcg-op.h
    M tcg/tcg-opc.h
    M tcg/tcg.c
    M tcg/tcg.h

  Log Message:
  -----------
  tcg: Make call address a constant parameter

Avoid allocating a tcg temporary to hold the constant address,
and instead place it directly into the op_call arguments.

At the same time, convert to the newly introduced tcg_out_call
backend function, rather than invoking tcg_out_op for the call.

Signed-off-by: Richard Henderson <address@hidden>


  Commit: af3cbfbe8018ccc16fb3a0048e928f66f0d05e87
      
https://github.com/qemu/qemu/commit/af3cbfbe8018ccc16fb3a0048e928f66f0d05e87
  Author: Richard Henderson <address@hidden>
  Date:   2014-05-12 (Mon, 12 May 2014)

  Changed paths:
    M tcg/tcg.c

  Log Message:
  -----------
  tcg: Use tcg_target_available_regs in tcg_reg_alloc_mov

The move opcodes are special in that their constraints must cover
all available registers.  So instead of checking the constraints,
just use the available registers.

Signed-off-by: Richard Henderson <address@hidden>


  Commit: 96d0ee7f0950e725ef7a4f7516e0af6a08d303e0
      
https://github.com/qemu/qemu/commit/96d0ee7f0950e725ef7a4f7516e0af6a08d303e0
  Author: Richard Henderson <address@hidden>
  Date:   2014-05-12 (Mon, 12 May 2014)

  Changed paths:
    M tcg/aarch64/tcg-target.c
    M tcg/arm/tcg-target.c
    M tcg/i386/tcg-target.c
    M tcg/ia64/tcg-target.c
    M tcg/mips/tcg-target.c
    M tcg/ppc/tcg-target.c
    M tcg/ppc64/tcg-target.c
    M tcg/s390/tcg-target.c
    M tcg/sparc/tcg-target.c
    M tcg/tcg-opc.h
    M tcg/tci/tcg-target.c

  Log Message:
  -----------
  tcg: Remove unreachable code in tcg_out_op and op_defs

The INDEX_op_call case has just been obsoleted; the mov and movi
cases have not been reachable for years.  Attempt to document this
both in each tcg_out_op switch, and via TCG_OPF_NOT_PRESENT.

Because of the TCG_OPF_NOT_PRESENT change, this must be done for
all targets in a single commit.

Signed-off-by: Richard Henderson <address@hidden>


  Commit: cd2b9b86803e46a09cf239afc44413884efa53f4
      
https://github.com/qemu/qemu/commit/cd2b9b86803e46a09cf239afc44413884efa53f4
  Author: Peter Maydell <address@hidden>
  Date:   2014-05-13 (Tue, 13 May 2014)

  Changed paths:
    M include/exec/exec-all.h
    M tcg/aarch64/tcg-target.c
    M tcg/aarch64/tcg-target.h
    M tcg/arm/tcg-target.c
    M tcg/arm/tcg-target.h
    M tcg/i386/tcg-target.c
    M tcg/i386/tcg-target.h
    M tcg/ia64/tcg-target.c
    M tcg/ia64/tcg-target.h
    M tcg/mips/tcg-target.c
    M tcg/mips/tcg-target.h
    M tcg/optimize.c
    M tcg/ppc/tcg-target.c
    M tcg/ppc/tcg-target.h
    M tcg/ppc64/tcg-target.c
    M tcg/ppc64/tcg-target.h
    M tcg/s390/tcg-target.c
    M tcg/s390/tcg-target.h
    M tcg/sparc/tcg-target.c
    M tcg/sparc/tcg-target.h
    M tcg/tcg-be-ldst.h
    M tcg/tcg-op.h
    M tcg/tcg-opc.h
    M tcg/tcg.c
    M tcg/tcg.h
    M tcg/tci/tcg-target.c
    M tcg/tci/tcg-target.h
    M translate-all.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20140512' into staging

tcg updates for 20140512

# gpg: Signature made Tue 13 May 2014 00:19:56 BST using RSA key ID 4DD0279B
# gpg: Can't check signature: public key not found

* remotes/rth/tags/pull-tcg-20140512: (26 commits)
  tcg: Remove unreachable code in tcg_out_op and op_defs
  tcg: Use tcg_target_available_regs in tcg_reg_alloc_mov
  tcg: Make call address a constant parameter
  tci: Create tcg_out_call
  tcg-mips: Split out tcg_out_call
  tcg-sparc: Create tcg_out_call
  tcg-ppc64: Rename tcg_out_calli to tcg_out_call
  tcg-ppc: Split out tcg_out_call
  tcg-s390: Rename tgen_calli to tcg_out_call
  tcg-i386: Rename tcg_out_calli to tcg_out_call
  tcg: Require TCG_TARGET_INSN_UNIT_SIZE
  tci: Define TCG_TARGET_INSN_UNIT_SIZE
  tcg-mips: Define TCG_TARGET_INSN_UNIT_SIZE
  tcg-ia64: Define TCG_TARGET_INSN_UNIT_SIZE
  tcg-s390: Define TCG_TARGET_INSN_UNIT_SIZE
  tcg-aarch64: Define TCG_TARGET_INSN_UNIT_SIZE
  tcg-arm: Define TCG_TARGET_INSN_UNIT_SIZE
  tcg-sparc: Define TCG_TARGET_INSN_UNIT_SIZE
  tcg-ppc: Define TCG_TARGET_INSN_UNIT_SIZE
  tcg-ppc64: Define TCG_TARGET_INSN_UNIT_SIZE
  ...

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/fccae3226da3...cd2b9b86803e

reply via email to

[Prev in Thread] Current Thread [Next in Thread]