qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 00/62] s390x tcg target
@ 2010-05-27 20:45 Richard Henderson
  2010-05-27 20:45 ` [Qemu-devel] [PATCH 01/62] S390 TCG target Richard Henderson
                   ` (62 more replies)
  0 siblings, 63 replies; 67+ messages in thread
From: Richard Henderson @ 2010-05-27 20:45 UTC (permalink / raw)
  To: qemu-devel; +Cc: agraf, aurelien

The following patch series is available at

  git://repo.or.cz/qemu/rth.git tcg-s390-2

It begins with Uli Hecht's original patch, posted by Alexander
sometime last year.  I then make incremental changes to

  (1) Make it compile -- first patch that compiles is tagged
      as tcg-s390-2-first-compile and is

      d142103... tcg-s390: Define tcg_target_reg_names.

  (2) Make it work -- the first patch that i386-linux-user 
      successfully completes linux-test-user-0.2 is tagged
      as tcg-s390-2-first-working and is

      3571f8d... tcg-s390: Implement setcond.

  (3) Make it work for other targets.  I don't tag this,
      but there are lots of load/store aborts and an 
      incorrectly division routine until

      9798371... tcg-s390: Implement div2.

  (4) Make it work well.  The balance of the patches incrementally
      add support for new instructions.  At

      7bfaa9e... tcg-s390: Query instruction extensions that are installed.

      I add support for detecting the instruction set extensions
      present in the host and then start disabling some of those
      new instructions that may not be present.

Once things start working, each step was tested with an --enable-debug
compile, and running the linux-user-test suite as well as booting 
the {arm,coldfire,sparc}-linux test kernels, and booting freedos.

Unfortunately, each step was only built without optimization, and it
is only at the end that we discovered that TCG was not properly honoring
the host ABI.  This is solved by the last patch, adding proper sign
extensions for the 32-bit function arguments.  With the final patch
everything works for an optimized build as well.

The current state is that the TCG compiler works for an s390x host.
That is, with a 64-bit userland binary.  It will *compile* for a 
32-bit userland binary, but that facility is only retained for the
purpose of running the s390 kvm guest.  If kvm is not used, the
32-bit binary will exit with an error message.

Given that this is the beginning of proper support for s390, I don't
know whether bisectability is really an issue.  I suppose we could
fairly easily re-base the patches that touch files outside tcg/s390/
and then squash the rest, but I suspect the history may be useful.



r~



Alexander Graf (2):
  S390 TCG target
  add lost chunks from the original patch

Richard Henderson (60):
  tcg-s390: Only validate CPUTLBEntry for system mode.
  tcg-s390: Fix tcg_prepare_qemu_ldst for user mode.
  tcg-s390: Move opcode defines to tcg-target.c.
  s390x: Avoid _llseek.
  s390x: Don't use a linker script for user-only.
  tcg-s390: Avoid set-but-not-used werrors.
  tcg-s390: Mark R0 & R15 reserved.
  tcg-s390: R6 is a function argument register
  tcg-s390: Move tcg_out_mov up and use it throughout.
  tcg-s390: Eliminate the S constraint.
  tcg-s390: Add -m64 and -march to s390x compilation.
  tcg-s390: Define tcg_target_reg_names.
  tcg-s390: Update disassembler from binutils head.
  tcg-s390: Compute is_write in cpu_signal_handler.
  tcg-s390: Reorganize instruction emission
  tcg-s390: Use matching constraints.
  tcg-s390: Fixup qemu_ld/st opcodes.
  tcg-s390: Implement setcond.
  tcg-s390: Generalize the direct load/store emission.
  tcg-s390: Tidy branches.
  tcg-s390: Add tgen_calli.
  tcg-s390: Implement div2.
  tcg-s390: Re-implement tcg_out_movi.
  tcg-s390: Implement sign and zero-extension operations.
  tcg-s390: Implement bswap operations.
  tcg-s390: Implement rotates.
  tcg-s390: Use LOAD COMPLIMENT for negate.
  tcg-s390: Tidy unimplemented opcodes.
  tcg-s390: Use the extended-immediate facility for add/sub.
  tcg-s390: Implement immediate ANDs.
  tcg-s390: Implement immediate ORs.
  tcg-s390: Implement immediate MULs.
  tcg-s390: Implement immediate XORs.
  tcg-s390: Icache flush is a no-op.
  tcg-s390: Define TCG_TMP0.
  tcg-s390: Tidy regset initialization; use R14 as temporary.
  tcg-s390: Rearrange register allocation order.
  tcg-s390: Tidy goto_tb.
  tcg-s390: Allocate the code_gen_buffer near the main program.
  tcg-s390: Rearrange qemu_ld/st to avoid register copy.
  tcg-s390: Tidy tcg_prepare_qemu_ldst.
  tcg-s390: Tidy user qemu_ld/st.
  tcg-s390: Implement GUEST_BASE.
  tcg-s390: Query instruction extensions that are installed.
  tcg-s390: Conditionalize general-instruction-extension insns.
  tcg-s390: Conditionalize ADD IMMEDIATE instructions.
  tcg-s390: Conditionalize LOAD IMMEDIATE instructions.
  tcg-s390: Conditionalize 8 and 16 bit extensions.
  tcg-s390: Conditionalize AND IMMEDIATE instructions.
  tcg-s390: Conditionalize OR IMMEDIATE instructions.
  tcg-s390: Conditionalize XOR IMMEDIATE instructions.
  tcg-s390: Do not require the extended-immediate facility.
  tcg-s390: Use 16-bit branches for forward jumps.
  tcg-s390: Use the LOAD AND TEST instruction for compares.
  tcg-s390: Use the COMPARE IMMEDIATE instrucions for compares.
  tcg-s390: Use COMPARE AND BRANCH instructions.
  tcg-s390: Generalize load/store support.
  tcg-s390: Fix TLB comparison width.
  tcg-s390: Enable compile in 32-bit mode.
  tcg: Optionally sign-extend 32-bit arguments for 64-bit host.

 configure                    |   12 +-
 cpu-exec.c                   |   42 +-
 def-helper.h                 |   38 +-
 exec.c                       |    7 +
 linux-user/syscall.c         |    4 +-
 s390-dis.c                   |  818 +++++++++++++---
 target-i386/ops_sse_header.h |    3 +
 target-ppc/helper.h          |    1 +
 tcg/s390/tcg-target.c        | 2240 +++++++++++++++++++++++++++++++++++++++++-
 tcg/s390/tcg-target.h        |   63 +-
 tcg/tcg-op.h                 |   34 +-
 tcg/tcg.c                    |   41 +-
 12 files changed, 3063 insertions(+), 240 deletions(-)

^ permalink raw reply	[flat|nested] 67+ messages in thread

end of thread, other threads:[~2010-05-28 17:13 UTC | newest]

Thread overview: 67+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-27 20:45 [Qemu-devel] [PATCH 00/62] s390x tcg target Richard Henderson
2010-05-27 20:45 ` [Qemu-devel] [PATCH 01/62] S390 TCG target Richard Henderson
2010-05-27 20:45 ` [Qemu-devel] [PATCH 02/62] add lost chunks from the original patch Richard Henderson
2010-05-28 16:49   ` Andreas Färber
2010-05-28 17:13     ` Richard Henderson
2010-05-27 20:45 ` [Qemu-devel] [PATCH 03/62] tcg-s390: Only validate CPUTLBEntry for system mode Richard Henderson
2010-05-27 20:45 ` [Qemu-devel] [PATCH 04/62] tcg-s390: Fix tcg_prepare_qemu_ldst for user mode Richard Henderson
2010-05-27 20:45 ` [Qemu-devel] [PATCH 05/62] tcg-s390: Move opcode defines to tcg-target.c Richard Henderson
2010-05-27 20:45 ` [Qemu-devel] [PATCH 06/62] s390x: Avoid _llseek Richard Henderson
2010-05-27 20:45 ` [Qemu-devel] [PATCH 07/62] s390x: Don't use a linker script for user-only Richard Henderson
2010-05-27 20:45 ` [Qemu-devel] [PATCH 08/62] tcg-s390: Avoid set-but-not-used werrors Richard Henderson
2010-05-27 20:45 ` [Qemu-devel] [PATCH 09/62] tcg-s390: Mark R0 & R15 reserved Richard Henderson
2010-05-27 20:45 ` [Qemu-devel] [PATCH 10/62] tcg-s390: R6 is a function argument register Richard Henderson
2010-05-27 20:45 ` [Qemu-devel] [PATCH 11/62] tcg-s390: Move tcg_out_mov up and use it throughout Richard Henderson
2010-05-27 20:45 ` [Qemu-devel] [PATCH 12/62] tcg-s390: Eliminate the S constraint Richard Henderson
2010-05-27 20:45 ` [Qemu-devel] [PATCH 13/62] tcg-s390: Add -m64 and -march to s390x compilation Richard Henderson
2010-05-27 20:45 ` [Qemu-devel] [PATCH 14/62] tcg-s390: Define tcg_target_reg_names Richard Henderson
2010-05-27 20:45 ` [Qemu-devel] [PATCH 15/62] tcg-s390: Update disassembler from binutils head Richard Henderson
2010-05-27 20:45 ` [Qemu-devel] [PATCH 16/62] tcg-s390: Compute is_write in cpu_signal_handler Richard Henderson
2010-05-27 20:45 ` [Qemu-devel] [PATCH 17/62] tcg-s390: Reorganize instruction emission Richard Henderson
2010-05-27 20:46 ` [Qemu-devel] [PATCH 18/62] tcg-s390: Use matching constraints Richard Henderson
2010-05-27 20:46 ` [Qemu-devel] [PATCH 19/62] tcg-s390: Fixup qemu_ld/st opcodes Richard Henderson
2010-05-27 20:46 ` [Qemu-devel] [PATCH 20/62] tcg-s390: Implement setcond Richard Henderson
2010-05-27 20:46 ` [Qemu-devel] [PATCH 21/62] tcg-s390: Generalize the direct load/store emission Richard Henderson
2010-05-27 20:46 ` [Qemu-devel] [PATCH 22/62] tcg-s390: Tidy branches Richard Henderson
2010-05-27 20:46 ` [Qemu-devel] [PATCH 23/62] tcg-s390: Add tgen_calli Richard Henderson
2010-05-27 20:46 ` [Qemu-devel] [PATCH 24/62] tcg-s390: Implement div2 Richard Henderson
2010-05-27 20:46 ` [Qemu-devel] [PATCH 25/62] tcg-s390: Re-implement tcg_out_movi Richard Henderson
2010-05-27 20:46 ` [Qemu-devel] [PATCH 26/62] tcg-s390: Implement sign and zero-extension operations Richard Henderson
2010-05-27 20:46 ` [Qemu-devel] [PATCH 27/62] tcg-s390: Implement bswap operations Richard Henderson
2010-05-27 20:46 ` [Qemu-devel] [PATCH 28/62] tcg-s390: Implement rotates Richard Henderson
2010-05-27 20:46 ` [Qemu-devel] [PATCH 29/62] tcg-s390: Use LOAD COMPLIMENT for negate Richard Henderson
2010-05-27 20:46 ` [Qemu-devel] [PATCH 30/62] tcg-s390: Tidy unimplemented opcodes Richard Henderson
2010-05-27 20:46 ` [Qemu-devel] [PATCH 31/62] tcg-s390: Use the extended-immediate facility for add/sub Richard Henderson
2010-05-27 20:46 ` [Qemu-devel] [PATCH 32/62] tcg-s390: Implement immediate ANDs Richard Henderson
2010-05-27 20:46 ` [Qemu-devel] [PATCH 33/62] tcg-s390: Implement immediate ORs Richard Henderson
2010-05-27 20:46 ` [Qemu-devel] [PATCH 34/62] tcg-s390: Implement immediate MULs Richard Henderson
2010-05-27 20:46 ` [Qemu-devel] [PATCH 35/62] tcg-s390: Implement immediate XORs Richard Henderson
2010-05-27 20:46 ` [Qemu-devel] [PATCH 36/62] tcg-s390: Icache flush is a no-op Richard Henderson
2010-05-27 20:46 ` [Qemu-devel] [PATCH 37/62] tcg-s390: Define TCG_TMP0 Richard Henderson
2010-05-27 20:46 ` [Qemu-devel] [PATCH 38/62] tcg-s390: Tidy regset initialization; use R14 as temporary Richard Henderson
2010-05-27 20:46 ` [Qemu-devel] [PATCH 39/62] tcg-s390: Rearrange register allocation order Richard Henderson
2010-05-27 20:46 ` [Qemu-devel] [PATCH 40/62] tcg-s390: Tidy goto_tb Richard Henderson
2010-05-27 20:46 ` [Qemu-devel] [PATCH 41/62] tcg-s390: Allocate the code_gen_buffer near the main program Richard Henderson
2010-05-27 20:46 ` [Qemu-devel] [PATCH 42/62] tcg-s390: Rearrange qemu_ld/st to avoid register copy Richard Henderson
2010-05-27 20:46 ` [Qemu-devel] [PATCH 43/62] tcg-s390: Tidy tcg_prepare_qemu_ldst Richard Henderson
2010-05-27 20:46 ` [Qemu-devel] [PATCH 44/62] tcg-s390: Tidy user qemu_ld/st Richard Henderson
2010-05-27 20:46 ` [Qemu-devel] [PATCH 45/62] tcg-s390: Implement GUEST_BASE Richard Henderson
2010-05-27 20:46 ` [Qemu-devel] [PATCH 46/62] tcg-s390: Query instruction extensions that are installed Richard Henderson
2010-05-27 20:46 ` [Qemu-devel] [PATCH 47/62] tcg-s390: Conditionalize general-instruction-extension insns Richard Henderson
2010-05-27 20:46 ` [Qemu-devel] [PATCH 48/62] tcg-s390: Conditionalize ADD IMMEDIATE instructions Richard Henderson
2010-05-27 20:46 ` [Qemu-devel] [PATCH 49/62] tcg-s390: Conditionalize LOAD " Richard Henderson
2010-05-27 20:46 ` [Qemu-devel] [PATCH 50/62] tcg-s390: Conditionalize 8 and 16 bit extensions Richard Henderson
2010-05-27 20:46 ` [Qemu-devel] [PATCH 51/62] tcg-s390: Conditionalize AND IMMEDIATE instructions Richard Henderson
2010-05-27 20:46 ` [Qemu-devel] [PATCH 52/62] tcg-s390: Conditionalize OR " Richard Henderson
2010-05-27 20:46 ` [Qemu-devel] [PATCH 53/62] tcg-s390: Conditionalize XOR " Richard Henderson
2010-05-27 20:46 ` [Qemu-devel] [PATCH 54/62] tcg-s390: Do not require the extended-immediate facility Richard Henderson
2010-05-27 20:46 ` [Qemu-devel] [PATCH 55/62] tcg-s390: Use 16-bit branches for forward jumps Richard Henderson
2010-05-27 20:46 ` [Qemu-devel] [PATCH 56/62] tcg-s390: Use the LOAD AND TEST instruction for compares Richard Henderson
2010-05-27 20:46 ` [Qemu-devel] [PATCH 57/62] tcg-s390: Use the COMPARE IMMEDIATE instrucions " Richard Henderson
2010-05-27 20:46 ` [Qemu-devel] [PATCH 58/62] tcg-s390: Use COMPARE AND BRANCH instructions Richard Henderson
2010-05-27 20:46 ` [Qemu-devel] [PATCH 59/62] tcg-s390: Generalize load/store support Richard Henderson
2010-05-27 20:46 ` [Qemu-devel] [PATCH 60/62] tcg-s390: Fix TLB comparison width Richard Henderson
2010-05-27 20:46 ` [Qemu-devel] [PATCH 61/62] tcg-s390: Enable compile in 32-bit mode Richard Henderson
2010-05-27 20:46 ` [Qemu-devel] [PATCH 62/62] tcg: Optionally sign-extend 32-bit arguments for 64-bit host Richard Henderson
2010-05-27 21:00 ` [Qemu-devel] [PATCH 00/62] s390x tcg target Blue Swirl
2010-05-27 21:14   ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).