2012-07-24 01:37:05 +04:00
|
|
|
/*
|
|
|
|
* QEMU S/390 Interrupt support
|
|
|
|
*
|
2014-03-11 16:52:06 +04:00
|
|
|
* Copyright IBM Corp. 2012, 2014
|
2012-07-24 01:37:05 +04:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2016-01-26 21:17:00 +03:00
|
|
|
#include "qemu/osdep.h"
|
2012-07-24 01:37:05 +04:00
|
|
|
#include "cpu.h"
|
2012-12-17 21:20:04 +04:00
|
|
|
#include "sysemu/kvm.h"
|
2012-07-24 01:37:05 +04:00
|
|
|
|
2014-03-11 16:52:06 +04:00
|
|
|
/*
|
|
|
|
* All of the following interrupts are floating, i.e. not per-vcpu.
|
2014-03-11 16:19:43 +04:00
|
|
|
* We just need a dummy cpustate in order to be able to inject in the
|
|
|
|
* non-kvm case.
|
2014-03-11 16:52:06 +04:00
|
|
|
*/
|
2012-07-24 01:37:05 +04:00
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
|
|
|
void s390_sclp_extint(uint32_t parm)
|
|
|
|
{
|
|
|
|
if (kvm_enabled()) {
|
2014-03-11 16:19:43 +04:00
|
|
|
kvm_s390_service_interrupt(parm);
|
2012-07-24 01:37:05 +04:00
|
|
|
} else {
|
2014-03-11 16:19:43 +04:00
|
|
|
S390CPU *dummy_cpu = s390_cpu_addr2state(0);
|
|
|
|
|
2013-01-30 16:48:24 +04:00
|
|
|
cpu_inject_ext(dummy_cpu, EXT_SERVICE, parm, 0);
|
2012-07-24 01:37:05 +04:00
|
|
|
}
|
|
|
|
}
|
2014-03-11 16:52:06 +04:00
|
|
|
|
2014-03-11 16:19:43 +04:00
|
|
|
void s390_virtio_irq(int config_change, uint64_t token)
|
2014-03-11 16:52:06 +04:00
|
|
|
{
|
|
|
|
if (kvm_enabled()) {
|
2014-03-11 16:19:43 +04:00
|
|
|
kvm_s390_virtio_irq(config_change, token);
|
2014-03-11 16:52:06 +04:00
|
|
|
} else {
|
2014-03-11 16:19:43 +04:00
|
|
|
S390CPU *dummy_cpu = s390_cpu_addr2state(0);
|
|
|
|
|
|
|
|
cpu_inject_ext(dummy_cpu, EXT_VIRTIO, config_change, token);
|
2014-03-11 16:52:06 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-03-11 16:19:43 +04:00
|
|
|
void s390_io_interrupt(uint16_t subchannel_id, uint16_t subchannel_nr,
|
|
|
|
uint32_t io_int_parm, uint32_t io_int_word)
|
2014-03-11 16:52:06 +04:00
|
|
|
{
|
|
|
|
if (kvm_enabled()) {
|
2014-03-11 16:19:43 +04:00
|
|
|
kvm_s390_io_interrupt(subchannel_id, subchannel_nr, io_int_parm,
|
2014-03-11 16:52:06 +04:00
|
|
|
io_int_word);
|
|
|
|
} else {
|
2014-03-11 16:19:43 +04:00
|
|
|
S390CPU *dummy_cpu = s390_cpu_addr2state(0);
|
|
|
|
|
|
|
|
cpu_inject_io(dummy_cpu, subchannel_id, subchannel_nr, io_int_parm,
|
2014-03-11 16:52:06 +04:00
|
|
|
io_int_word);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-03-11 16:19:43 +04:00
|
|
|
void s390_crw_mchk(void)
|
2014-03-11 16:52:06 +04:00
|
|
|
{
|
|
|
|
if (kvm_enabled()) {
|
2014-03-11 16:19:43 +04:00
|
|
|
kvm_s390_crw_mchk();
|
2014-03-11 16:52:06 +04:00
|
|
|
} else {
|
2014-03-11 16:19:43 +04:00
|
|
|
S390CPU *dummy_cpu = s390_cpu_addr2state(0);
|
|
|
|
|
|
|
|
cpu_inject_crw_mchk(dummy_cpu);
|
2014-03-11 16:52:06 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-07-24 01:37:05 +04:00
|
|
|
#endif
|