Statistics
| Branch: | Revision:

root / target-s390x @ 834574ea

# Date Author Comment
c05efcb1 02/16/2013 03:51 pm Andreas Färber

cpu: Add CPUArchState pointer to CPUState

The target-specific ENV_GET_CPU() macros have allowed us to navigate
from CPUArchState to CPUState. The reverse direction was not supported.
Avoid introducing CPU_GET_ENV() macros by initializing an untyped
pointer that is initialized in derived instance_init functions....

0dac8459 02/16/2013 03:51 pm Andreas Färber

target-s390x: Drop unused cpu_s390x_close() prototype

It was never implemented.

Signed-off-by: Andreas Färber <>

2b7ac767 02/16/2013 03:50 pm Andreas Färber

target-s390x: Move TCG initialization to S390CPU initfn

Ensures that a QOM-created S390CPU is usable.

Acked-by: Richard Henderson <>
Signed-off-by: Andreas Färber <>

1f136632 02/16/2013 03:50 pm Andreas Färber

target-s390x: Introduce QOM realizefn for S390CPU

Introduce realizefn and set realized = true in cpu_s390x_init().

Defer CPU reset from initfn to realizefn.

Acked-by: Richard Henderson <>
[AF: Invoke parent's realizefn]
Signed-off-by: Andreas Färber <>

bd9a8d85 02/13/2013 07:56 pm Cornelia Huck

s390: Keep I/O interrupts enabled for all iscs.

do_io_interrupt() would stop scanning further iscs if it found
an I/O interrupt it could inject. This might cause the pending
interrupt indication for I/O interrupts to be reset although there
might be queued I/O interrupts for subsequent iscs....

91b0a8f3 02/13/2013 07:56 pm Cornelia Huck

s390: Fix handling of iscs.

There are two ways to express an interruption subclass:
- As a bitmask, as used in cr6.
- As a number, as used in the I/O interruption word.

Unfortunately, we have treated to I/O interruption word as if it
contained the bitmask as well, which went unnoticed so far as...

0123c486 02/04/2013 11:24 pm Anthony Liguori

s390x: silence warning from GCC on uninitialized values

As best I can tell, this is a false positive.

[aliguori@ccnode4 qemu-s390]$ make
CC s390x-softmmu/target-s390x/helper.o
/home/aliguori/git/qemu/target-s390x/helper.c: In function ‘do_interrupt’:...
b22dd124 02/04/2013 11:24 pm Stefan Weil

target-s390x: Fix wrong comparison in interrupt handling

gcc with -Wextra complains about an ordered pointer comparison:

target-s390x/helper.c:660:27: warning:
ordered comparison of pointer with integer zero [-Wextra]

Obviously the index was missing in the code....

e205842b 02/01/2013 05:06 pm Anthony Liguori

Merge remote-tracking branch 'agraf/s390-for-upstream' into staging

  1. By Andreas Färber
  2. Via Alexander Graf
    • agraf/s390-for-upstream:
      target-s390x: Pass S390CPU to s390_{add, del}_running_cpu()
      target-s390x: Clean up cpu_inject_*() signatures
      target-s390x: Fix debug output...
a6f921b0 02/01/2013 03:02 am Andreas Färber

target-s390x: Fix debug output (continued)

Since its introduction in d5a439645a5a70fed5431318c3bce9dc2caa950f
(s390x: helper functions for system emulation) the variable name was
raddr. Fix this.

Signed-off-by: Andreas Färber <>
Signed-off-by: Alexander Graf <>

07cc7d12 02/01/2013 03:02 am Andreas Färber

target-s390x: Fix debug output

Commit 71e470886fb6092504503a5fe41092ace71c096c (target-s390x: fix
style) renamed the cpu_s390x_handle_mmu_fault() argument from _vaddr to
orig_vaddr. Update the debug output code.

Signed-off-by: Andreas Färber <>...

f9466733 02/01/2013 03:02 am Andreas Färber

target-s390x: Clean up cpu_inject_*() signatures

Despite cautioning that S390CPU is needed for upcoming CPUState
refactorings, commit 5d69c547d947798cba92d836d06f6e017ba2b19d (s390:
I/O interrupt and machine check injection.) added functions
cpu_inject_io() and cpu_inject_crw_mchk() with CPUS390XState argument,...

49e15878 02/01/2013 03:02 am Andreas Färber

target-s390x: Pass S390CPU to s390_{add, del}_running_cpu()

This prepares for moving the halted field to CPUState.
Most call sites can already supply S390CPU, for some env becomes unused.

Signed-off-by: Andreas Färber <>
Acked-by: Cornelia Huck <>...

c7396bbb 02/01/2013 02:35 am Andreas Färber

target-s390x: Mark as unmigratable

CPU_SAVE_VERSION was undefined, so "cpu_common" VMState and
cpu_{save,load}() were not registered. They were no-ops.
Therefore there is no backwards compatibility to keep, so we can mark
S390CPU as unmigratable at device level....

50c8d9bf 01/29/2013 10:50 pm Cornelia Huck

s390: Use s390_cpu_physical_memory_map for tpi.

Map the I/O interruption code before calling into css.

Signed-off-by: Cornelia Huck <>
Signed-off-by: Alexander Graf <>

4782a23b 01/29/2013 10:50 pm Cornelia Huck

s390: Lowcore mapping helper.

Create a lowcore mapping helper that includes a check for sufficient
length.

Signed-off-by: Cornelia Huck <>
Signed-off-by: Alexander Graf <>

38322ed6 01/29/2013 10:50 pm Cornelia Huck

s390: Add mapping helper functions.

Add s390_cpu_physical_memory_{map,unmap} with special handling
for the lowcore.

Signed-off-by: Cornelia Huck <>
Signed-off-by: Alexander Graf <>

db1c8f53 01/29/2013 10:50 pm Cornelia Huck

s390: Channel I/O basic definitions.

Basic channel I/O structures and helper function.

Signed-off-by: Cornelia Huck <>
Signed-off-by: Alexander Graf <>

5d69c547 01/29/2013 10:50 pm Cornelia Huck

s390: I/O interrupt and machine check injection.

I/O interrupts are queued per isc. Only crw pending machine checks
are supported.

Signed-off-by: Cornelia Huck <>
Signed-off-by: Alexander Graf <>

7b18aad5 01/29/2013 10:50 pm Cornelia Huck

s390: Add channel I/O instructions.

Provide handlers for (most) channel I/O instructions.

Signed-off-by: Cornelia Huck <>
Signed-off-by: Alexander Graf <>

df1fe5bb 01/29/2013 10:50 pm Cornelia Huck

s390: Virtual channel subsystem support.

Provide a mechanism for qemu to provide fully virtual subchannels to
the guest.

Signed-off-by: Cornelia Huck <>
Signed-off-by: Alexander Graf <>

09b99878 01/29/2013 10:50 pm Cornelia Huck

s390: Wire up channel I/O in kvm.

Trigger the code for our virtual css in case of instruction
intercepts for I/O instructions.

Handle the tsch exit for the subchannel-related part of tsch.

Signed-off-by: Cornelia Huck <>
Signed-off-by: Alexander Graf <>

b164e48e 01/27/2013 03:34 pm Eduardo Habkost

kvm: Create kvm_arch_vcpu_id() function

This will allow each architecture to define how the VCPU ID is set on
the KVM_CREATE_VCPU ioctl call.

Signed-off-by: Eduardo Habkost <>
Acked-by: Gleb Natapov <>
Signed-off-by: Andreas Färber <>

ccb084d3 01/18/2013 08:07 pm Christian Borntraeger

s390: new contributions GPLv2 or later

IBMs s390 contributions were meant to to be gplv2 or later (since
we were contributing to qemu). Several of the s390 specific files
link to gpl code anyway, so lets clarify the licence statement for
new contributions for those files that we have touched multiple...

904e5fd5 01/18/2013 08:07 pm Viktor Mihajlovski

S390: Enable -cpu help and QMP query-cpu-definitions

This enables qemu -cpu help to return a list of supported CPU models
on s390 and also to query for cpu definitions in the monitor.
Initially only cpu model = host is returned. This needs to be reworked...

a158986d 01/18/2013 08:07 pm Stefan Weil

s390x: Remove inline function ebcdic_put and related data from cpu.h

The function is only used in misc_helper.c, so move it to that file.

This reduces the size of debug executables (compiled without optimization)
because they get unused code and data for each compilation which includes...

70bada03 01/18/2013 08:07 pm Jens Freimann

s390: Add CPU reset handler

Add a CPU reset handler to have all CPUs in a PoP compliant
state.

Signed-off-by: Jens Freimann <>
[agraf: move hw/hw.h into existing ifdef]
Signed-off-by: Alexander Graf <>

419831d7 01/18/2013 08:07 pm Alexander Graf

s390x: fix indentation

In one of the last commits we accidently got 3-space indentation into
the tree. Fix it up so it's 4 spaces wide.

Reported-by: Andreas Faerber <>
Signed-off-by: Alexander Graf <>

d5627ce8 01/18/2013 08:07 pm Andreas Färber

target-s390x: Unregister reset callback on finalization

Since commit "s390: Add CPU reset handler" the CPU's instance_init
registers a reset callback. Unregister that on instance_finalize.

Signed-off-by: Andreas Färber <>
Signed-off-by: Alexander Graf <>

28e942f8 01/18/2013 08:07 pm Cornelia Huck

s390: Add a hypercall registration interface.

Allow virtio machines to register for different diag500 function
codes and convert s390-virtio to use it.

Signed-off-by: Cornelia Huck <>
Signed-off-by: Alexander Graf <>

55e5c285 01/15/2013 05:09 am Andreas Färber

cpu: Move cpu_index field to CPUState

Note that target-alpha accesses this field from TCG, now using a
negative offset. Therefore the field is placed last in CPUState.

Pass PowerPCCPU to [kvm]ppc_fixup_cpu() to facilitate this change.

Move common parts of mips cpu_state_reset() to mips_cpu_reset()....

c95ec459 01/05/2013 10:18 pm Richard Henderson

target-s390: Optimize ADDC/SUBB

Giving the proper mask to disas_jcc allows us to generate an inline
comparison generating the carry/borrow with setcond.

In the very worst case, when we must use the external helper to compute
a value for CC, we generate (cc > 1) instead of (cc >> 1), which is only...

bacf43c6 01/05/2013 10:18 pm Richard Henderson

target-s390: Optimize get_address

Don't load the displacement into a register first, add it second
so that tcg_gen_addi_i64 can eliminate zeros. Don't mask the
displacement first so that we don't turn small negative numbers
into large positive numbers.
...

b7886de3 01/05/2013 10:18 pm Richard Henderson

target-s390: Perform COMPARE AND SWAP inline

Still no proper solution for CONFIG_USER_ONLY, but the system
version is significantly better.

Signed-off-by: Richard Henderson <>

d918a65c 01/05/2013 10:18 pm Richard Henderson

target-s390: Use TCG_CALL_NO_WG for memory helpers

Those that do not read or write tcg registers, but can
raise exceptions via memory faults.

Signed-off-by: Richard Henderson <>

c482ea94 01/05/2013 10:18 pm Richard Henderson

target-s390: Use TCG_CALL_NO_WG for floating-point helpers

None of them read or write tcg registers, but most can
raise fp exceptions.

Signed-off-by: Richard Henderson <>

c20fec40 01/05/2013 10:18 pm Richard Henderson

target-s390: Use TCG_CALL_NO_WG for integer helpers

The division routines do not read or write tcg registers,
but can raise fixed-point divide exceptions.

Signed-off-by: Richard Henderson <>

893e1660 01/05/2013 10:18 pm Richard Henderson

target-s390: Use TCG_CALL_NO_WG for misc helpers

Signed-off-by: Richard Henderson <>

26cc0a3f 01/05/2013 10:18 pm Richard Henderson

target-s390: Use noreturn for exception and load_psw

Both always exit the cpu loop.

Signed-off-by: Richard Henderson <>

99b4f24b 01/05/2013 10:18 pm Richard Henderson

target-s390: Implement POPCNT

Signed-off-by: Richard Henderson <>

2db014b5 01/05/2013 10:18 pm Richard Henderson

target-s390: Implement CPSDR

Signed-off-by: Richard Henderson <>

49f7ee80 01/05/2013 10:18 pm Richard Henderson

target-s390: Check insn operand specifications

Removes all the fixmes for even register numbers, etc.

Signed-off-by: Richard Henderson <>

1d1f6301 01/05/2013 10:18 pm Richard Henderson

target-s390: Implement LCDFR

Signed-off-by: Richard Henderson <>

d2d9feac 01/05/2013 10:18 pm Richard Henderson

target-s390: Use uint64_to_float128

Signed-off-by: Richard Henderson <>

a12000b9 01/05/2013 10:18 pm Richard Henderson

target-s390: Implement SET ROUNDING MODE

Signed-off-by: Richard Henderson <>

411edc22 01/05/2013 10:18 pm Richard Henderson

target-s390: Implement LOAD/SET FP AND SIGNAL

Signed-off-by: Richard Henderson <>

90b4f8ad 01/05/2013 10:18 pm Richard Henderson

target-s390: Fix cpu_clone_regs

R2 is the syscall return register, not R0.

Signed-off-by: Richard Henderson <>

d074ac6d 01/05/2013 10:18 pm Richard Henderson

target-s390: Optimize XC

Notice XC with same address and convert that to store of zero.

Signed-off-by: Richard Henderson <>

f24c49c2 01/05/2013 10:18 pm Richard Henderson

target-s390: Optmize emitting discards

While they aren't expensive, they aren't free to process. When we
know that the three cc helper variables are dead, don't kill them.

Signed-off-by: Richard Henderson <>

de379661 01/05/2013 10:18 pm Richard Henderson

target-s390: Tidy comparisons

After full conversion, we can audit the uses of LTGT cc ops
and see that none of the instructions can ever set CC=3.
Thus we can extend the table to treat that bit as ignored.

This fixes a regression wrt the pre-conversion translation...

a359b770 01/05/2013 10:18 pm Richard Henderson

target-s390: Optimize ADDU/SUBU CC testing

We can easily generate some masks for logical add/subtract inline.

Signed-off-by: Richard Henderson <>

2cf5e350 01/05/2013 10:18 pm Richard Henderson

target-s390: Implement BRANCH ON INDEX

Signed-off-by: Richard Henderson <>

7a6c7067 01/05/2013 10:18 pm Richard Henderson

target-s390: Tidy s->op_cc handling

There's no need to force computation of the true cc_op when taking an
exception or single stepping. In either case we'll enter the next TB
with s->cc_op = DYNAMIC and recompute anyway. Just make sure that
s->cc_op is stored back to env->cc_op as needed....

5550359f 01/05/2013 10:18 pm Richard Henderson

target-s390: Implement COMPARE AND BRANCH

Signed-off-by: Richard Henderson <>

2d6a8698 01/05/2013 10:18 pm Richard Henderson

target-s390: Implement RISBG

Signed-off-by: Richard Henderson <>

143cbbc5 01/05/2013 10:18 pm Richard Henderson

target-s390: Implement LDGR, LGDR

Signed-off-by: Richard Henderson <>

d6c6372e 01/05/2013 10:18 pm Richard Henderson

target-s390: Implement R[NOX]SBG

Signed-off-by: Richard Henderson <>

e0def909 01/05/2013 10:18 pm Richard Henderson

target-s390: Implement PREFETCH

Signed-off-by: Richard Henderson <>

403e217f 01/05/2013 10:18 pm Richard Henderson

target-s390: Implement COMPARE RELATIVE LONG

Signed-off-by: Richard Henderson <>

1c268751 01/05/2013 10:18 pm Richard Henderson

target-s390: Implement COMPARE AND TRAP

Signed-off-by: Richard Henderson <>

632086da 01/05/2013 10:18 pm Richard Henderson

target-s390: Implement LOAD ON CONDITION

Signed-off-by: Richard Henderson <>

b92fa334 01/05/2013 10:18 pm Richard Henderson

target-s390: Implement STORE ON CONDITION

Signed-off-by: Richard Henderson <>

6ac1b45f 01/05/2013 10:18 pm Richard Henderson

target-s390: Implement CONVERT TO LOGICAL

Signed-off-by: Richard Henderson <>

2112bf1b 01/05/2013 10:18 pm Richard Henderson

target-s390: Implement CONVERT FROM LOGICAL

Signed-off-by: Richard Henderson <>

e805a0d3 01/05/2013 10:18 pm Richard Henderson

target-s390: Convert SPX, STPX

Signed-off-by: Richard Henderson <>

411fea3d 01/05/2013 10:18 pm Richard Henderson

target-s390: Convert STAP

Signed-off-by: Richard Henderson <>

cfef53e3 01/05/2013 10:18 pm Richard Henderson

target-s390: Convert IPTE

Signed-off-by: Richard Henderson <>

8026417c 01/05/2013 10:18 pm Richard Henderson

target-s390: Convert ISKE

Signed-off-by: Richard Henderson <>

2bbde27f 01/05/2013 10:18 pm Richard Henderson

target-s390: Convert SSKE

Signed-off-by: Richard Henderson <>

5cc69c54 01/05/2013 10:18 pm Richard Henderson

target-s390: Convert RRBE

Signed-off-by: Richard Henderson <>

2c423fc0 01/05/2013 10:18 pm Richard Henderson

target-s390: Convert subchannel instructions

While we're at it, list all of the chapter 14 subchannel insns.
Which is easy since all merely need indicate non-operation.

Signed-off-by: Richard Henderson <>

204504e2 01/05/2013 10:18 pm Richard Henderson

target-s390: Convert STURA

Signed-off-by: Richard Henderson <>

3d596f49 01/05/2013 10:18 pm Richard Henderson

target-s390: Convert CSP

Signed-off-by: Richard Henderson <>

39a5003c 01/05/2013 10:18 pm Richard Henderson

target-s390: Convert STCKE

Signed-off-by: Richard Henderson <>

14244b21 01/05/2013 10:18 pm Richard Henderson

target-s390: Convert SACF

Signed-off-by: Richard Henderson <>

d14b3e09 01/05/2013 10:18 pm Richard Henderson

target-s390: Convert STSI

Signed-off-by: Richard Henderson <>

fc778b55 01/05/2013 10:18 pm Richard Henderson

target-s390: Convert STFL

Signed-off-by: Richard Henderson <>

7ab938d7 01/05/2013 10:18 pm Richard Henderson

target-s390: Convert LPSWE

Signed-off-by: Richard Henderson <>

dc458df9 01/05/2013 10:18 pm Richard Henderson

target-s390: Convert SERVC

Signed-off-by: Richard Henderson <>

4f3adfb2 01/05/2013 10:18 pm Richard Henderson

target-s390: Delete dead code from old translator

The use of inline restricts detection of static functions that are
no longer used. Limit the use of inline to those functions that
are conditionally used based on CONFIG_USER_ONLY.

Signed-off-by: Richard Henderson <>

6e2704e7 01/05/2013 10:18 pm Richard Henderson

target-s390: Convert IPM

Note that the previous placement of the PM field was incorrect.

Signed-off-by: Richard Henderson <>

374724f9 01/05/2013 10:18 pm Richard Henderson

target-s390: Convert CKSM

Signed-off-by: Richard Henderson <>

d62a4c97 01/05/2013 10:18 pm Richard Henderson

target-s390: Convert EAR, SAR

Signed-off-by: Richard Henderson <>

ee6c38d5 01/05/2013 10:18 pm Richard Henderson

target-s390: Convert MVPG

Signed-off-by: Richard Henderson <>

aa31bf60 01/05/2013 10:18 pm Richard Henderson

target-s390: Convert CLST, MVST

Signed-off-by: Richard Henderson <>

4600c994 01/05/2013 10:18 pm Richard Henderson

target-s390: Convert SRST

Signed-off-by: Richard Henderson <>

71bd6669 01/05/2013 10:18 pm Richard Henderson

target-s390: Convert STIDP

Signed-off-by: Richard Henderson <>

35289799 01/05/2013 10:18 pm Richard Henderson

target-s390: Convert SCK

Signed-off-by: Richard Henderson <>

434c91a5 01/05/2013 10:18 pm Richard Henderson

target-s390: Convert STCK

Signed-off-by: Richard Henderson <>

dd3eb7b5 01/05/2013 10:18 pm Richard Henderson

target-s390: Convert SCKC, STCKC

Signed-off-by: Richard Henderson <>

c4f0a863 01/05/2013 10:18 pm Richard Henderson

target-s390: Convert SPT, STPT

Signed-off-by: Richard Henderson <>

28d55556 01/05/2013 10:18 pm Richard Henderson

target-s390: Convert SPKA

Signed-off-by: Richard Henderson <>

0568d8aa 01/05/2013 10:18 pm Richard Henderson

target-s390: Convert PTLB

Signed-off-by: Richard Henderson <>

5d7fd045 01/05/2013 10:18 pm Richard Henderson

target-s390: Convert FP LOAD COMPLIMENT, NEGATIVE, POSITIVE

Signed-off-by: Richard Henderson <>

16d7b2a4 01/05/2013 10:18 pm Richard Henderson

target-s390: Convert FP SQUARE ROOT

Signed-off-by: Richard Henderson <>

24db8412 01/05/2013 10:18 pm Richard Henderson

target-s390: Convert LOAD ZERO

Signed-off-by: Richard Henderson <>

68c8bd93 01/05/2013 10:18 pm Richard Henderson

target-s390: Convert CONVERT TO FIXED

Signed-off-by: Richard Henderson <>

683bb9a8 01/05/2013 10:18 pm Richard Henderson

target-s390: Convert CONVERT FROM FIXED

Signed-off-by: Richard Henderson <>

102bf2c6 01/05/2013 10:18 pm Richard Henderson

target-s390: Convert FLOGR

Signed-off-by: Richard Henderson <>

8379bfdb 01/05/2013 10:18 pm Richard Henderson

target-s390: Convert LFPC, SFPC

Note that we were failing to set the rounding mode in fpu_status.

Signed-off-by: Richard Henderson <>