Commit fc678d67 authored by Alexander Graf's avatar Alexander Graf Committed by Avi Kivity

KVM: S390: take a full byte as ext_param indicator

Currenty the ext_param field only distinguishes between "config change" and
"vring interrupt". We can do a lot more with it though, so let's enable a
full byte of possible values and constants to #defines while at it.
Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
Signed-off-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
parent 189be38d
...@@ -54,4 +54,10 @@ struct kvm_vqconfig { ...@@ -54,4 +54,10 @@ struct kvm_vqconfig {
* This is pagesize for historical reasons. */ * This is pagesize for historical reasons. */
#define KVM_S390_VIRTIO_RING_ALIGN 4096 #define KVM_S390_VIRTIO_RING_ALIGN 4096
/* These values are supposed to be in ext_params on an interrupt */
#define VIRTIO_PARAM_MASK 0xff
#define VIRTIO_PARAM_VRING_INTERRUPT 0x0
#define VIRTIO_PARAM_CONFIG_CHANGED 0x1
#endif #endif
...@@ -334,7 +334,7 @@ static void kvm_extint_handler(u16 code) ...@@ -334,7 +334,7 @@ static void kvm_extint_handler(u16 code)
{ {
struct virtqueue *vq; struct virtqueue *vq;
u16 subcode; u16 subcode;
int config_changed; u32 param;
subcode = S390_lowcore.cpu_addr; subcode = S390_lowcore.cpu_addr;
if ((subcode & 0xff00) != VIRTIO_SUBCODE_64) if ((subcode & 0xff00) != VIRTIO_SUBCODE_64)
...@@ -343,18 +343,25 @@ static void kvm_extint_handler(u16 code) ...@@ -343,18 +343,25 @@ static void kvm_extint_handler(u16 code)
/* The LSB might be overloaded, we have to mask it */ /* The LSB might be overloaded, we have to mask it */
vq = (struct virtqueue *)(S390_lowcore.ext_params2 & ~1UL); vq = (struct virtqueue *)(S390_lowcore.ext_params2 & ~1UL);
/* We use the LSB of extparam, to decide, if this interrupt is a config /* We use ext_params to decide what this interrupt means */
* change or a "standard" interrupt */ param = S390_lowcore.ext_params & VIRTIO_PARAM_MASK;
config_changed = S390_lowcore.ext_params & 1;
if (config_changed) { switch (param) {
case VIRTIO_PARAM_CONFIG_CHANGED:
{
struct virtio_driver *drv; struct virtio_driver *drv;
drv = container_of(vq->vdev->dev.driver, drv = container_of(vq->vdev->dev.driver,
struct virtio_driver, driver); struct virtio_driver, driver);
if (drv->config_changed) if (drv->config_changed)
drv->config_changed(vq->vdev); drv->config_changed(vq->vdev);
} else
break;
}
case VIRTIO_PARAM_VRING_INTERRUPT:
default:
vring_interrupt(0, vq); vring_interrupt(0, vq);
break;
}
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment