Skip to content

s390x tcg target

Richard Henderson qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest62 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/62S390 TCG targettcg/s390/tcg-target.c+1162 -140 replies
2/62add lost chunks from the original patchtcg/s390/tcg-target.c tcg/s390/tcg-target.h+86 -32 replies
3/62tcg-s390: Only validate CPUTLBEntry for system mode.tcg/s390/tcg-target.c+2 -00 replies
4/62tcg-s390: Fix tcg_prepare_qemu_ldst for user mode.tcg/s390/tcg-target.c+7 -10 replies
5/62tcg-s390: Move opcode defines to tcg-target.c.tcg/s390/tcg-target.c tcg/s390/tcg-target.h+81 -800 replies
6/62s390x: Avoid _llseek.linux-user/syscall.c+2 -20 replies
7/62s390x: Don't use a linker script for user-only.configure+3 -00 replies
8/62tcg-s390: Avoid set-but-not-used werrors.tcg/s390/tcg-target.c+6 -100 replies
9/62tcg-s390: Mark R0 & R15 reserved.tcg/s390/tcg-target.c+5 -20 replies
10/62tcg-s390: R6 is a function argument registertcg/s390/tcg-target.c+1 -00 replies
11/62tcg-s390: Move tcg_out_mov up and use it throughout.tcg/s390/tcg-target.c+20 -220 replies
12/62tcg-s390: Eliminate the S constraint.tcg/s390/tcg-target.c+6 -240 replies
13/62tcg-s390: Add -m64 and -march to s390x compilation.configure+5 -10 replies
14/62tcg-s390: Define tcg_target_reg_names.tcg/s390/tcg-target.c+6 -00 replies
15/62tcg-s390: Update disassembler from binutils head.s390-dis.c+669 -1490 replies
16/62tcg-s390: Compute is_write in cpu_signal_handler.cpu-exec.c+39 -30 replies
17/62tcg-s390: Reorganize instruction emissiontcg/s390/tcg-target.c tcg/s390/tcg-target.h+297 -3330 replies
18/62tcg-s390: Use matching constraints.tcg/s390/tcg-target.c+39 -1420 replies
19/62tcg-s390: Fixup qemu_ld/st opcodes.tcg/s390/tcg-target.c+5 -30 replies
20/62tcg-s390: Implement setcond.tcg/s390/tcg-target.c+47 -190 replies
21/62tcg-s390: Generalize the direct load/store emission.tcg/s390/tcg-target.c+71 -810 replies
22/62tcg-s390: Tidy branches.tcg/s390/tcg-target.c+55 -410 replies
23/62tcg-s390: Add tgen_calli.tcg/s390/tcg-target.c+16 -290 replies
24/62tcg-s390: Implement div2.tcg/s390/tcg-target.c tcg/s390/tcg-target.h+32 -160 replies
25/62tcg-s390: Re-implement tcg_out_movi.tcg/s390/tcg-target.c+74 -160 replies
26/62tcg-s390: Implement sign and zero-extension operations.tcg/s390/tcg-target.c tcg/s390/tcg-target.h+90 -240 replies
27/62tcg-s390: Implement bswap operations.tcg/s390/tcg-target.c tcg/s390/tcg-target.h+29 -50 replies
28/62tcg-s390: Implement rotates.tcg/s390/tcg-target.c tcg/s390/tcg-target.h+48 -20 replies
29/62tcg-s390: Use LOAD COMPLIMENT for negate.tcg/s390/tcg-target.c+2 -80 replies
30/62tcg-s390: Tidy unimplemented opcodes.tcg/s390/tcg-target.c+10 -150 replies
31/62tcg-s390: Use the extended-immediate facility for add/sub.tcg/s390/tcg-target.c+52 -160 replies
32/62tcg-s390: Implement immediate ANDs.tcg/s390/tcg-target.c+127 -110 replies
33/62tcg-s390: Implement immediate ORs.tcg/s390/tcg-target.c+59 -40 replies
34/62tcg-s390: Implement immediate MULs.tcg/s390/tcg-target.c+24 -40 replies
35/62tcg-s390: Implement immediate XORs.tcg/s390/tcg-target.c+41 -40 replies
36/62tcg-s390: Icache flush is a no-op.tcg/s390/tcg-target.h+0 -50 replies
37/62tcg-s390: Define TCG_TMP0.tcg/s390/tcg-target.c+26 -230 replies
38/62tcg-s390: Tidy regset initialization; use R14 as temporary.tcg/s390/tcg-target.c+12 -140 replies
39/62tcg-s390: Rearrange register allocation order.tcg/s390/tcg-target.c+13 -100 replies
40/62tcg-s390: Tidy goto_tb.tcg/s390/tcg-target.c+22 -120 replies
41/62tcg-s390: Allocate the code_gen_buffer near the main program.exec.c+7 -00 replies
42/62tcg-s390: Rearrange qemu_ld/st to avoid register copy.tcg/s390/tcg-target.c+145 -1250 replies
43/62tcg-s390: Tidy tcg_prepare_qemu_ldst.tcg/s390/tcg-target.c+19 -370 replies
44/62tcg-s390: Tidy user qemu_ld/st.tcg/s390/tcg-target.c+21 -120 replies
45/62tcg-s390: Implement GUEST_BASE.configure tcg/s390/tcg-target.c tcg/s390/tcg-target.h+29 -50 replies
46/62tcg-s390: Query instruction extensions that are installed.tcg/s390/tcg-target.c+122 -00 replies
47/62tcg-s390: Conditionalize general-instruction-extension insns.tcg/s390/tcg-target.c+31 -200 replies
48/62tcg-s390: Conditionalize ADD IMMEDIATE instructions.tcg/s390/tcg-target.c+46 -180 replies
49/62tcg-s390: Conditionalize LOAD IMMEDIATE instructions.tcg/s390/tcg-target.c+59 -200 replies
50/62tcg-s390: Conditionalize 8 and 16 bit extensions.tcg/s390/tcg-target.c+90 -250 replies
51/62tcg-s390: Conditionalize AND IMMEDIATE instructions.tcg/s390/tcg-target.c+122 -870 replies
52/62tcg-s390: Conditionalize OR IMMEDIATE instructions.tcg/s390/tcg-target.c+70 -220 replies
53/62tcg-s390: Conditionalize XOR IMMEDIATE instructions.tcg/s390/tcg-target.c+34 -190 replies
54/62tcg-s390: Do not require the extended-immediate facility.configure tcg/s390/tcg-target.c+1 -50 replies
55/62tcg-s390: Use 16-bit branches for forward jumps.tcg/s390/tcg-target.c+22 -50 replies
56/62tcg-s390: Use the LOAD AND TEST instruction for compares.tcg/s390/tcg-target.c+91 -420 replies
57/62tcg-s390: Use the COMPARE IMMEDIATE instrucions for compares.tcg/s390/tcg-target.c+42 -20 replies
58/62tcg-s390: Use COMPARE AND BRANCH instructions.tcg/s390/tcg-target.c+95 -70 replies
59/62tcg-s390: Generalize load/store support.tcg/s390/tcg-target.c+49 -450 replies
60/62tcg-s390: Fix TLB comparison width.tcg/s390/tcg-target.c+10 -20 replies
61/62tcg-s390: Enable compile in 32-bit mode.configure tcg/s390/tcg-target.c tcg/s390/tcg-target.h+207 -1890 replies
62/62tcg: Optionally sign-extend 32-bit arguments for 64-bit host.def-helper.h target-i386/ops_sse_header.h target-ppc/helper.h +3 more+87 -320 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 00/62] s390x tcg target

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(-)