summaryrefslogtreecommitdiff
path: root/target-s390x
AgeCommit message (Collapse)AuthorFilesLines
2013-01-18s390: Add a hypercall registration interface.Cornelia Huck3-3/+3
Allow virtio machines to register for different diag500 function codes and convert s390-virtio to use it. Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-01-18target-s390x: Unregister reset callback on finalizationAndreas Färber1-0/+10
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 <afaerber@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-01-18s390x: fix indentationAlexander Graf1-5/+5
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 <afaerber@suse.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-01-18s390: Add CPU reset handlerJens Freimann2-3/+41
Add a CPU reset handler to have all CPUs in a PoP compliant state. Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com> [agraf: move hw/hw.h into existing ifdef] Signed-off-by: Alexander Graf <agraf@suse.de>
2013-01-18s390x: Remove inline function ebcdic_put and related data from cpu.hStefan Weil2-81/+81
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 cpu.h. Executables with optimization don't change their size. ebcdic2ascii is currently unused and could be removed (not done here). The array ascii2ebcdic must be accessed with an unsigned index, therefore (int)ascii[i] was replaced by (uint8_t)ascii[i]. The old code would have failed for a signed char less than 0. The current code only converts "QEMU" and spaces to EBCDIC, so there is no problem today. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-01-18S390: Enable -cpu help and QMP query-cpu-definitionsViktor Mihajlovski2-0/+29
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 into a full-fledged CPU model handling later on. This change is needed to allow libvirt exploiters (like OpenStack) to specify a CPU model. Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com> Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com> Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com> [agraf: fix s390x-linux-user, adjust header locations] Signed-off-by: Alexander Graf <agraf@suse.de>
2013-01-18s390: new contributions GPLv2 or laterChristian Borntraeger2-2/+9
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 times or will likely touch again. This patch does not touch files that mostly deal with tcg. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-01-15cpu: Move cpu_index field to CPUStateAndreas Färber1-1/+1
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(). Acked-by: Richard Henderson <rth@twiddle.net> (for alpha) [AF: Rebased onto ppc CPU subclasses and openpic changes] Signed-off-by: Andreas Färber <afaerber@suse.de>
2013-01-05target-s390: Use noreturn for exception and load_pswRichard Henderson1-2/+2
Both always exit the cpu loop. Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Use TCG_CALL_NO_WG for misc helpersRichard Henderson1-1/+1
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Use TCG_CALL_NO_WG for integer helpersRichard Henderson1-4/+4
The division routines do not read or write tcg registers, but can raise fixed-point divide exceptions. Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Use TCG_CALL_NO_WG for floating-point helpersRichard Henderson1-39/+39
None of them read or write tcg registers, but most can raise fp exceptions. Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Use TCG_CALL_NO_WG for memory helpersRichard Henderson1-15/+15
Those that do not read or write tcg registers, but can raise exceptions via memory faults. Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Perform COMPARE AND SWAP inlineRichard Henderson4-96/+124
Still no proper solution for CONFIG_USER_ONLY, but the system version is significantly better. Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Optimize get_addressRichard Henderson1-26/+18
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. Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Optimize ADDC/SUBBRichard Henderson1-19/+37
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 very slightly slower on common cpus. In the very best case, when the CC comes from a COMPARE insn and the compiler is using ALCG with zero, everything folds out to become just the setcond that the compiler wanted. Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Optimize ADDU/SUBU CC testingRichard Henderson1-0/+68
We can easily generate some masks for logical add/subtract inline. Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Tidy comparisonsRichard Henderson1-22/+17
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 in which NE was used for both m=6 and m=7. Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Optmize emitting discardsRichard Henderson1-6/+24
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 <rth@twiddle.net>
2013-01-05target-s390: Optimize XCRichard Henderson2-4/+48
Notice XC with same address and convert that to store of zero. Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Fix cpu_clone_regsRichard Henderson1-1/+1
R2 is the syscall return register, not R0. Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Implement LOAD/SET FP AND SIGNALRichard Henderson4-8/+40
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Implement SET ROUNDING MODERichard Henderson2-0/+44
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Use uint64_to_float128Richard Henderson1-2/+1
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Implement LCDFRRichard Henderson1-0/+1
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Check insn operand specificationsRichard Henderson1-36/+159
Removes all the fixmes for even register numbers, etc. Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Implement CPSDRRichard Henderson2-0/+19
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Implement POPCNTRichard Henderson4-0/+22
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Implement CONVERT FROM LOGICALRichard Henderson4-0/+66
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Implement CONVERT TO LOGICALRichard Henderson4-0/+133
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Implement STORE ON CONDITIONRichard Henderson2-0/+32
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Implement LOAD ON CONDITIONRichard Henderson2-0/+35
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Implement COMPARE AND TRAPRichard Henderson2-0/+40
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Implement COMPARE RELATIVE LONGRichard Henderson1-0/+4
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Implement PREFETCHRichard Henderson1-0/+5
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Implement R[NOX]SBGRichard Henderson2-0/+57
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Implement LDGR, LGDRRichard Henderson1-0/+4
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Implement RISBGRichard Henderson2-0/+88
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Implement COMPARE AND BRANCHRichard Henderson2-0/+47
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Tidy s->op_cc handlingRichard Henderson1-40/+55
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. Delete some dead functions, avoid allocating unused TCG temps, drop the old s->is_jmp setting. Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Implement BRANCH ON INDEXRichard Henderson2-0/+62
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Delete dead code from old translatorRichard Henderson1-291/+27
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 <rth@twiddle.net>
2013-01-05target-s390: Convert SERVCRichard Henderson4-25/+14
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Convert LPSWERichard Henderson2-19/+20
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Convert STFLRichard Henderson2-9/+16
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Convert STSIRichard Henderson4-17/+15
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Convert SACFRichard Henderson2-13/+10
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Convert STCKERichard Henderson4-24/+24
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Convert CSPRichard Henderson4-16/+18
Signed-off-by: Richard Henderson <rth@twiddle.net>
2013-01-05target-s390: Convert STURARichard Henderson4-15/+13
Signed-off-by: Richard Henderson <rth@twiddle.net>