KVM: s390: virtio-ccw adapter interrupts.
Subsystems (3)
v2 cover KVM: s390: virtio-ccw adapter interrupts.
Hi,
next version of the guest exploitation of virtio-ccw adapter interrupts.
Changes from the last version:
- adapt to latest kvm-next
- changed housekeeping for indicator locations: we now use cacheline-sized and aligned areas
- minor tweaks
Cornelia Huck (2):
KVM: s390: virtio-ccw: Handle command rejects.
KVM: s390: virtio-ccw adapter interrupt support.
arch/s390/include/asm/irq.h | 1 + arch/s390/kernel/irq.c | 1 + drivers/s390/kvm/virtio_ccw.c | 314 ++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 305 insertions(+), 11 deletions(-)
Signature · 1 line
1.8.2.2
RFC PATCH v2 1/2 KVM: s390: virtio-ccw: Handle command rejects.
A command reject for a ccw may happen if we run on a host not supporting a certain feature. We want to be able to handle this as special case of command failure, so let's split this off from the generic -EIO error code.
--- drivers/s390/kvm/virtio_ccw.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/s390/kvm/virtio_ccw.c +9 -2
@@ -639,8 +639,15 @@ static void virtio_ccw_int_handler(struct ccw_device *cdev, (SCSW_STCTL_ALERT_STATUS | SCSW_STCTL_STATUS_PEND))) {/* OK */ } -if (irb_is_error (irb)) - vcdev->err = -EIO ;/* XXX - use real error */ +if (irb_is_error (irb)) { +/* Command reject? */ +if ((scsw_dstat (&irb->scsw) &DEV_STAT_UNIT_CHECK ) && + (irb->ecw[0 ] &SNS0_CMD_REJECT )) + vcdev->err = -EOPNOTSUPP ; +else +/* Map everything else to -EIO. */ + vcdev->err = -EIO ; + }if (vcdev->curr_io & activity) {switch (activity) {case VIRTIO_CCW_DOING_READ_FEAT :
Signature · 1 line
1.8.2.2
RFC PATCH v2 1/2 KVM: s390: virtio-ccw: Handle command rejects.
In reply to Cornelia HuckA command reject for a ccw may happen if we run on a host not supporting a certain feature. We want to be able to handle this as special case of command failure, so let's split this off from the generic -EIO error code.
--- drivers/s390/kvm/virtio_ccw.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/s390/kvm/virtio_ccw.c +9 -2
@@ -639,8 +639,15 @@ static void virtio_ccw_int_handler(struct ccw_device *cdev, (SCSW_STCTL_ALERT_STATUS | SCSW_STCTL_STATUS_PEND))) {/* OK */ } -if (irb_is_error (irb)) - vcdev->err = -EIO ;/* XXX - use real error */ +if (irb_is_error (irb)) { +/* Command reject? */ +if ((scsw_dstat (&irb->scsw) &DEV_STAT_UNIT_CHECK ) && + (irb->ecw[0 ] &SNS0_CMD_REJECT )) + vcdev->err = -EOPNOTSUPP ; +else +/* Map everything else to -EIO. */ + vcdev->err = -EIO ; + }if (vcdev->curr_io & activity) {switch (activity) {case VIRTIO_CCW_DOING_READ_FEAT :
Signature · 1 line
1.8.2.2
RFC PATCH v2 2/2 KVM: s390: virtio-ccw adapter interrupt support.
In reply to Cornelia HuckImplement the new CCW_CMD_SET_IND_ADAPTER command and try to enable adapter interrupts for every device on the first startup. If the host does not support adapter interrupts, fall back to normal I/O interrupts.
virtio-ccw adapter interrupts use the same isc as normal I/O subchannels and share a summary indicator for all devices sharing the same indicator area.
Indicator bits for the individual virtqueues may be contained in the same indicator area for different devices.
--- arch/s390/include/asm/irq.h | 1 + arch/s390/kernel/irq.c | 1 + drivers/s390/kvm/virtio_ccw.c | 303 ++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 296 insertions(+), 9 deletions(-)
arch/s390/include/asm/irq.h +1 -0
@@ -42,6 +42,7 @@ enum interruption_class {IRQIO_PCI ,IRQIO_MSI ,IRQIO_VIR , +IRQIO_VAI ,NMI_NMI ,CPU_RST ,NR_ARCH_IRQS
arch/s390/kernel/irq.c +1 -0
@@ -82,6 +82,7 @@ static const struct irq_class irqclass_sub_desc[NR_ARCH_IRQS] = { [IRQIO_PCI] = {.name = "PCI", .desc = "[I/O] PCI Interrupt" }, [IRQIO_MSI] = {.name = "MSI", .desc = "[I/O] MSI Interrupt" }, [IRQIO_VIR] = {.name = "VIR", .desc = "[I/O] Virtual I/O Devices"}, + [IRQIO_VAI] = {.name = "VAI", .desc = "[I/O] Virtual I/O Devices AI"}, [NMI_NMI] = {.name = "NMI", .desc = "[NMI] Machine Check"}, [CPU_RST] = {.name = "RST", .desc = "[CPU] CPU Restart"}, };
drivers/s390/kvm/virtio_ccw.c +294 -9
401 lines not on this page · raw message
Signature · 1 line
1.8.2.2
RFC PATCH v2 2/2 KVM: s390: virtio-ccw adapter interrupt support.
In reply to Cornelia HuckImplement the new CCW_CMD_SET_IND_ADAPTER command and try to enable adapter interrupts for every device on the first startup. If the host does not support adapter interrupts, fall back to normal I/O interrupts.
virtio-ccw adapter interrupts use the same isc as normal I/O subchannels and share a summary indicator for all devices sharing the same indicator area.
Indicator bits for the individual virtqueues may be contained in the same indicator area for different devices.
--- arch/s390/include/asm/irq.h | 1 + arch/s390/kernel/irq.c | 1 + drivers/s390/kvm/virtio_ccw.c | 303 ++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 296 insertions(+), 9 deletions(-)
arch/s390/include/asm/irq.h +1 -0
@@ -42,6 +42,7 @@ enum interruption_class {IRQIO_PCI ,IRQIO_MSI ,IRQIO_VIR , +IRQIO_VAI ,NMI_NMI ,CPU_RST ,NR_ARCH_IRQS
arch/s390/kernel/irq.c +1 -0
@@ -82,6 +82,7 @@ static const struct irq_class irqclass_sub_desc[NR_ARCH_IRQS] = { [IRQIO_PCI] = {.name = "PCI", .desc = "[I/O] PCI Interrupt" }, [IRQIO_MSI] = {.name = "MSI", .desc = "[I/O] MSI Interrupt" }, [IRQIO_VIR] = {.name = "VIR", .desc = "[I/O] Virtual I/O Devices"}, + [IRQIO_VAI] = {.name = "VAI", .desc = "[I/O] Virtual I/O Devices AI"}, [NMI_NMI] = {.name = "NMI", .desc = "[NMI] Machine Check"}, [CPU_RST] = {.name = "RST", .desc = "[CPU] CPU Restart"}, };
drivers/s390/kvm/virtio_ccw.c +294 -9
401 lines not on this page · raw message
Signature · 1 line
1.8.2.2
Re: [RFC PATCH v2 1/2] KVM: s390: virtio-ccw: Handle command rejects.
In reply to Cornelia HuckQuoted 5 lines · Cornelia Huck
A command reject for a ccw may happen if we run on a host not supporting a certain feature. We want to be able to handle this as special case of command failure, so let's split this off from the generic
-EIOerror code.Signed-off-by Cornelia Huck <[email protected]>
Quoted 27 lines
--- drivers/s390/kvm/virtio_ccw.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)drivers/s390/kvm/virtio_ccw.c +9
-2@@ -639,8 +639,15 @@ static void virtio_ccw_int_handler(struct ccw_device *cdev, (SCSW_STCTL_ALERT_STATUS | SCSW_STCTL_STATUS_PEND))) {/* OK */ } -if (irb_is_error (irb)) - vcdev->err = -EIO ;/* XXX - use real error */ +if (irb_is_error (irb)) { +/* Command reject? */ +if ((scsw_dstat (&irb->scsw) &DEV_STAT_UNIT_CHECK ) && + (irb->ecw[0 ] &SNS0_CMD_REJECT )) + vcdev->err = -EOPNOTSUPP ; +else +/* Map everything else to -EIO. */ + vcdev->err = -EIO ; + }if (vcdev->curr_io & activity) {switch (activity) {case VIRTIO_CCW_DOING_READ_FEAT :
Re: [RFC PATCH v2 1/2] KVM: s390: virtio-ccw: Handle command rejects.
In reply to Cornelia HuckQuoted 5 lines · Cornelia Huck
A command reject for a ccw may happen if we run on a host not supporting a certain feature. We want to be able to handle this as special case of command failure, so let's split this off from the generic
-EIOerror code.Signed-off-by Cornelia Huck <[email protected]>
Quoted 27 lines
--- drivers/s390/kvm/virtio_ccw.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)drivers/s390/kvm/virtio_ccw.c +9
-2@@ -639,8 +639,15 @@ static void virtio_ccw_int_handler(struct ccw_device *cdev, (SCSW_STCTL_ALERT_STATUS | SCSW_STCTL_STATUS_PEND))) {/* OK */ } -if (irb_is_error (irb)) - vcdev->err = -EIO ;/* XXX - use real error */ +if (irb_is_error (irb)) { +/* Command reject? */ +if ((scsw_dstat (&irb->scsw) &DEV_STAT_UNIT_CHECK ) && + (irb->ecw[0 ] &SNS0_CMD_REJECT )) + vcdev->err = -EOPNOTSUPP ; +else +/* Map everything else to -EIO. */ + vcdev->err = -EIO ; + }if (vcdev->curr_io & activity) {switch (activity) {case VIRTIO_CCW_DOING_READ_FEAT :