From 7e7494627f43b26c565a132639d82de260c26cc8 Mon Sep 17 00:00:00 2001 From: Cornelia Huck Date: Wed, 6 Feb 2013 10:31:37 +0100 Subject: s390x/virtio-ccw: Adapter interrupt support. Handle the new CCW_CMD_SET_IND_ADAPTER command enabling adapter interrupts on guest request. When active, host->guest notifications will be handled via global_indicator -> queue indicators instead of queue indicators + subchannel I/O interrupt. Indicators for virtqueues may be present at an offset. Acked-by: Christian Borntraeger Signed-off-by: Cornelia Huck --- target-s390x/ioinst.h | 2 ++ target-s390x/kvm.c | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'target-s390x') diff --git a/target-s390x/ioinst.h b/target-s390x/ioinst.h index 613da49..5bbc67d 100644 --- a/target-s390x/ioinst.h +++ b/target-s390x/ioinst.h @@ -212,6 +212,8 @@ typedef struct IOIntCode { #define IO_INT_WORD_ISC(_int_word) ((_int_word & 0x38000000) >> 24) #define ISC_TO_ISC_BITS(_isc) ((0x80 >> _isc) << 24) +#define IO_INT_WORD_AI 0x80000000 + int ioinst_disassemble_sch_ident(uint32_t value, int *m, int *cssid, int *ssid, int *schid); void ioinst_handle_xsch(S390CPU *cpu, uint64_t reg1); diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c index 11feda9..56b9af7 100644 --- a/target-s390x/kvm.c +++ b/target-s390x/kvm.c @@ -891,8 +891,12 @@ void kvm_s390_io_interrupt(S390CPU *cpu, uint16_t subchannel_id, { uint32_t type; - type = ((subchannel_id & 0xff00) << 24) | - ((subchannel_id & 0x00060) << 22) | (subchannel_nr << 16); + if (io_int_word & IO_INT_WORD_AI) { + type = KVM_S390_INT_IO(1, 0, 0, 0); + } else { + type = ((subchannel_id & 0xff00) << 24) | + ((subchannel_id & 0x00060) << 22) | (subchannel_nr << 16); + } kvm_s390_interrupt_internal(cpu, type, ((uint32_t)subchannel_id << 16) | subchannel_nr, ((uint64_t)io_int_parm << 32) | io_int_word, 1); -- cgit v1.1