diff options
author | Thomas Huth <thuth@linux.vnet.ibm.com> | 2013-12-17 14:22:08 +0100 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2013-12-18 14:24:10 +0100 |
commit | b8031adba791325907d8a9e19af8d483996974fd (patch) | |
tree | a4ba7d4f38c52212a44092e148183881b5ae1d0c /target-s390x | |
parent | b20a461fcd55d2b05e729c587244eddc60b9527f (diff) | |
download | qemu-b8031adba791325907d8a9e19af8d483996974fd.tar.gz qemu-b8031adba791325907d8a9e19af8d483996974fd.tar.bz2 qemu-b8031adba791325907d8a9e19af8d483996974fd.zip |
s390x/kvm: Simplified the calculation of the SIGP order code
We've already got a helper function for calculating the
base/displacement of RS formatted instructions, so we can
get rid of the manual calculation of the SIGP order code.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'target-s390x')
-rw-r--r-- | target-s390x/kvm.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c index fcc159f72e..0bf3d1f49e 100644 --- a/target-s390x/kvm.c +++ b/target-s390x/kvm.c @@ -626,6 +626,8 @@ static int s390_cpu_initial_reset(S390CPU *cpu) return 0; } +#define SIGP_ORDER_MASK 0x000000ff + static int handle_sigp(S390CPU *cpu, struct kvm_run *run, uint8_t ipa1) { CPUS390XState *env = &cpu->env; @@ -637,11 +639,7 @@ static int handle_sigp(S390CPU *cpu, struct kvm_run *run, uint8_t ipa1) cpu_synchronize_state(CPU(cpu)); /* get order code */ - order_code = run->s390_sieic.ipb >> 28; - if (order_code > 0) { - order_code = env->regs[order_code]; - } - order_code += (run->s390_sieic.ipb & 0x0fff0000) >> 16; + order_code = decode_basedisp_rs(env, run->s390_sieic.ipb) & SIGP_ORDER_MASK; cpu_addr = env->regs[ipa1 & 0x0f]; target_cpu = s390_cpu_addr2state(cpu_addr); |