diff options
author | Andreas Färber <afaerber@suse.de> | 2012-05-03 04:28:14 +0200 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2012-06-11 00:23:04 +0200 |
commit | 45fa769b32861573409bceff53251cffafcf10a9 (patch) | |
tree | 9ae783217ed7c73f6685bf9bffb75b9c3020b86b /target-s390x | |
parent | 6fc150de80ffa9d3a7eba3e4f26793eb44347eda (diff) |
s390-virtio: Let s390_cpu_addr2state() return S390CPU
Convert ipi_states to S390CPU**.
Needed for s390_cpu_restart() in handle_sigp().
Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'target-s390x')
-rw-r--r-- | target-s390x/cpu.h | 2 | ||||
-rw-r--r-- | target-s390x/kvm.c | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/target-s390x/cpu.h b/target-s390x/cpu.h index 10bfab0bf3..c30ac3a0e1 100644 --- a/target-s390x/cpu.h +++ b/target-s390x/cpu.h @@ -316,7 +316,7 @@ static inline void kvm_s390_interrupt_internal(CPUS390XState *env, int type, { } #endif -CPUS390XState *s390_cpu_addr2state(uint16_t cpu_addr); +S390CPU *s390_cpu_addr2state(uint16_t cpu_addr); void s390_add_running_cpu(CPUS390XState *env); unsigned s390_del_running_cpu(CPUS390XState *env); diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c index 90aad61eb0..2153e387ce 100644 --- a/target-s390x/kvm.c +++ b/target-s390x/kvm.c @@ -333,6 +333,7 @@ static int handle_sigp(CPUS390XState *env, struct kvm_run *run, uint8_t ipa1) uint16_t cpu_addr; uint8_t t; int r = -1; + S390CPU *target_cpu; CPUS390XState *target_env; cpu_synchronize_state(env); @@ -353,10 +354,11 @@ static int handle_sigp(CPUS390XState *env, struct kvm_run *run, uint8_t ipa1) parameter = env->regs[t] & 0x7ffffe00; cpu_addr = env->regs[ipa1 & 0x0f]; - target_env = s390_cpu_addr2state(cpu_addr); - if (!target_env) { + target_cpu = s390_cpu_addr2state(cpu_addr); + if (target_cpu == NULL) { goto out; } + target_env = &target_cpu->env; switch (order_code) { case SIGP_RESTART: |