]> git.proxmox.com Git - mirror_qemu.git/blame - target-s390x/interrupt.c
iotests, parallels: test for newly created parallels image via qemu-img
[mirror_qemu.git] / target-s390x / interrupt.c
CommitLineData
000a1a38
CB
1/*
2 * QEMU S/390 Interrupt support
3 *
79afc36d 4 * Copyright IBM Corp. 2012, 2014
000a1a38
CB
5 *
6 * This work is licensed under the terms of the GNU GPL, version 2 or (at your
7 * option) any later version. See the COPYING file in the top-level directory.
8 */
9
10#include "cpu.h"
9c17d615 11#include "sysemu/kvm.h"
000a1a38 12
79afc36d
CH
13/*
14 * All of the following interrupts are floating, i.e. not per-vcpu.
de13d216
CH
15 * We just need a dummy cpustate in order to be able to inject in the
16 * non-kvm case.
79afc36d 17 */
000a1a38 18#if !defined(CONFIG_USER_ONLY)
000a1a38
CB
19void s390_sclp_extint(uint32_t parm)
20{
000a1a38 21 if (kvm_enabled()) {
de13d216 22 kvm_s390_service_interrupt(parm);
000a1a38 23 } else {
de13d216 24 S390CPU *dummy_cpu = s390_cpu_addr2state(0);
de13d216 25
f9466733 26 cpu_inject_ext(dummy_cpu, EXT_SERVICE, parm, 0);
000a1a38
CB
27 }
28}
79afc36d 29
de13d216 30void s390_virtio_irq(int config_change, uint64_t token)
79afc36d
CH
31{
32 if (kvm_enabled()) {
de13d216 33 kvm_s390_virtio_irq(config_change, token);
79afc36d 34 } else {
de13d216
CH
35 S390CPU *dummy_cpu = s390_cpu_addr2state(0);
36
37 cpu_inject_ext(dummy_cpu, EXT_VIRTIO, config_change, token);
79afc36d
CH
38 }
39}
40
de13d216
CH
41void s390_io_interrupt(uint16_t subchannel_id, uint16_t subchannel_nr,
42 uint32_t io_int_parm, uint32_t io_int_word)
79afc36d
CH
43{
44 if (kvm_enabled()) {
de13d216 45 kvm_s390_io_interrupt(subchannel_id, subchannel_nr, io_int_parm,
79afc36d
CH
46 io_int_word);
47 } else {
de13d216
CH
48 S390CPU *dummy_cpu = s390_cpu_addr2state(0);
49
50 cpu_inject_io(dummy_cpu, subchannel_id, subchannel_nr, io_int_parm,
79afc36d
CH
51 io_int_word);
52 }
53}
54
de13d216 55void s390_crw_mchk(void)
79afc36d
CH
56{
57 if (kvm_enabled()) {
de13d216 58 kvm_s390_crw_mchk();
79afc36d 59 } else {
de13d216
CH
60 S390CPU *dummy_cpu = s390_cpu_addr2state(0);
61
62 cpu_inject_crw_mchk(dummy_cpu);
79afc36d
CH
63 }
64}
65
000a1a38 66#endif