aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2010-08-24 09:48:50 -0400
committerAvi Kivity <avi@redhat.com>2010-10-24 04:51:29 -0400
commitfc678d67fee1acccf21322318dd833b892a572e4 (patch)
treef5ab551bbecdb38f877e933dbf3d600627eeb113 /drivers/s390
parent189be38db3dde12699a8b9dc22d33e8c95efe110 (diff)
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: Alexander Graf <agraf@suse.de> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/kvm/kvm_virtio.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/s390/kvm/kvm_virtio.c b/drivers/s390/kvm/kvm_virtio.c
index 4e298bc8949d..68cef4da15e8 100644
--- a/drivers/s390/kvm/kvm_virtio.c
+++ b/drivers/s390/kvm/kvm_virtio.c
@@ -334,7 +334,7 @@ static void kvm_extint_handler(u16 code)
334{ 334{
335 struct virtqueue *vq; 335 struct virtqueue *vq;
336 u16 subcode; 336 u16 subcode;
337 int config_changed; 337 u32 param;
338 338
339 subcode = S390_lowcore.cpu_addr; 339 subcode = S390_lowcore.cpu_addr;
340 if ((subcode & 0xff00) != VIRTIO_SUBCODE_64) 340 if ((subcode & 0xff00) != VIRTIO_SUBCODE_64)
@@ -343,18 +343,25 @@ static void kvm_extint_handler(u16 code)
343 /* The LSB might be overloaded, we have to mask it */ 343 /* The LSB might be overloaded, we have to mask it */
344 vq = (struct virtqueue *)(S390_lowcore.ext_params2 & ~1UL); 344 vq = (struct virtqueue *)(S390_lowcore.ext_params2 & ~1UL);
345 345
346 /* We use the LSB of extparam, to decide, if this interrupt is a config 346 /* We use ext_params to decide what this interrupt means */
347 * change or a "standard" interrupt */ 347 param = S390_lowcore.ext_params & VIRTIO_PARAM_MASK;
348 config_changed = S390_lowcore.ext_params & 1;
349 348
350 if (config_changed) { 349 switch (param) {
350 case VIRTIO_PARAM_CONFIG_CHANGED:
351 {
351 struct virtio_driver *drv; 352 struct virtio_driver *drv;
352 drv = container_of(vq->vdev->dev.driver, 353 drv = container_of(vq->vdev->dev.driver,
353 struct virtio_driver, driver); 354 struct virtio_driver, driver);
354 if (drv->config_changed) 355 if (drv->config_changed)
355 drv->config_changed(vq->vdev); 356 drv->config_changed(vq->vdev);
356 } else 357
358 break;
359 }
360 case VIRTIO_PARAM_VRING_INTERRUPT:
361 default:
357 vring_interrupt(0, vq); 362 vring_interrupt(0, vq);
363 break;
364 }
358} 365}
359 366
360/* 367/*