diff options
author | Cornelia Huck <cornelia.huck@de.ibm.com> | 2014-03-11 13:52:06 +0100 |
---|---|---|
committer | Cornelia Huck <cornelia.huck@de.ibm.com> | 2014-06-10 09:50:27 +0200 |
commit | 79afc36d91be7550affbe7db227b4552451da41d (patch) | |
tree | f2334185225606c090b0fe73a16e52c926681a27 /target-s390x/interrupt.c | |
parent | bcb2b582f35a34b5aee6bdafd93f3eabd9fca6ff (diff) |
s390x: consolidate floating interrupts
Move the injection code for all floating interrupts to interrupt.c
and add a comment.
Also get rid of the #ifdef CONFIG_KVM for the service interrupt.
Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Diffstat (limited to 'target-s390x/interrupt.c')
-rw-r--r-- | target-s390x/interrupt.c | 44 |
1 files changed, 38 insertions, 6 deletions
diff --git a/target-s390x/interrupt.c b/target-s390x/interrupt.c index 6d6580de3a..c32bdcb0c1 100644 --- a/target-s390x/interrupt.c +++ b/target-s390x/interrupt.c @@ -1,7 +1,7 @@ /* * QEMU S/390 Interrupt support * - * Copyright IBM, Corp. 2012 + * Copyright IBM Corp. 2012, 2014 * * This work is licensed under the terms of the GNU GPL, version 2 or (at your * option) any later version. See the COPYING file in the top-level directory. @@ -10,21 +10,53 @@ #include "cpu.h" #include "sysemu/kvm.h" +/* + * All of the following interrupts are floating, i.e. not per-vcpu. + * We just need a dummy cpustate in order to be able to inject. + */ #if !defined(CONFIG_USER_ONLY) -/* service interrupts are floating therefore we must not pass an cpustate */ void s390_sclp_extint(uint32_t parm) { S390CPU *dummy_cpu = s390_cpu_addr2state(0); CPUS390XState *env = &dummy_cpu->env; if (kvm_enabled()) { -#ifdef CONFIG_KVM - kvm_s390_interrupt_internal(dummy_cpu, KVM_S390_INT_SERVICE, parm, - 0, 1); -#endif + kvm_s390_service_interrupt(dummy_cpu, parm); } else { env->psw.addr += 4; cpu_inject_ext(dummy_cpu, EXT_SERVICE, parm, 0); } } + +void s390_virtio_irq(S390CPU *cpu, int config_change, uint64_t token) +{ + if (kvm_enabled()) { + kvm_s390_virtio_irq(cpu, config_change, token); + } else { + cpu_inject_ext(cpu, EXT_VIRTIO, config_change, token); + } +} + +void s390_io_interrupt(S390CPU *cpu, uint16_t subchannel_id, + uint16_t subchannel_nr, uint32_t io_int_parm, + uint32_t io_int_word) +{ + if (kvm_enabled()) { + kvm_s390_io_interrupt(cpu, subchannel_id, subchannel_nr, io_int_parm, + io_int_word); + } else { + cpu_inject_io(cpu, subchannel_id, subchannel_nr, io_int_parm, + io_int_word); + } +} + +void s390_crw_mchk(S390CPU *cpu) +{ + if (kvm_enabled()) { + kvm_s390_crw_mchk(cpu); + } else { + cpu_inject_crw_mchk(cpu); + } +} + #endif |