diff options
author | Nicholas Bellinger <nab@linux-iscsi.org> | 2013-03-27 20:23:41 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2013-03-29 02:42:47 -0400 |
commit | 5dade71050e799d8679698a6145e2ba46cdeac2a (patch) | |
tree | 305a6afdd30ea073b0ce6fc8ee952405993bff16 /drivers/vhost | |
parent | 8f27d487bcc2bd603c2d87e1729abcbc301f15db (diff) |
tcm_vhost: Avoid VIRTIO_RING_F_EVENT_IDX feature bit
This patch adds a VHOST_SCSI_FEATURES mask minus VIRTIO_RING_F_EVENT_IDX
so that vhost-scsi-pci userspace will strip this feature bit once
GET_FEATURES reports it as being unsupported on the host.
This is to avoid a bug where ->handle_kicks() are missed when EVENT_IDX
is enabled by default in userspace code.
(mst: Rename to VHOST_SCSI_FEATURES + add comment)
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Asias He <asias@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/vhost')
-rw-r--r-- | drivers/vhost/tcm_vhost.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/vhost/tcm_vhost.c b/drivers/vhost/tcm_vhost.c index 43fb11ee2e8d..2968b4934659 100644 --- a/drivers/vhost/tcm_vhost.c +++ b/drivers/vhost/tcm_vhost.c | |||
@@ -60,6 +60,15 @@ enum { | |||
60 | VHOST_SCSI_VQ_IO = 2, | 60 | VHOST_SCSI_VQ_IO = 2, |
61 | }; | 61 | }; |
62 | 62 | ||
63 | /* | ||
64 | * VIRTIO_RING_F_EVENT_IDX seems broken. Not sure the bug is in | ||
65 | * kernel but disabling it helps. | ||
66 | * TODO: debug and remove the workaround. | ||
67 | */ | ||
68 | enum { | ||
69 | VHOST_SCSI_FEATURES = VHOST_FEATURES & (~VIRTIO_RING_F_EVENT_IDX) | ||
70 | }; | ||
71 | |||
63 | #define VHOST_SCSI_MAX_TARGET 256 | 72 | #define VHOST_SCSI_MAX_TARGET 256 |
64 | #define VHOST_SCSI_MAX_VQ 128 | 73 | #define VHOST_SCSI_MAX_VQ 128 |
65 | 74 | ||
@@ -946,7 +955,7 @@ static void vhost_scsi_flush(struct vhost_scsi *vs) | |||
946 | 955 | ||
947 | static int vhost_scsi_set_features(struct vhost_scsi *vs, u64 features) | 956 | static int vhost_scsi_set_features(struct vhost_scsi *vs, u64 features) |
948 | { | 957 | { |
949 | if (features & ~VHOST_FEATURES) | 958 | if (features & ~VHOST_SCSI_FEATURES) |
950 | return -EOPNOTSUPP; | 959 | return -EOPNOTSUPP; |
951 | 960 | ||
952 | mutex_lock(&vs->dev.mutex); | 961 | mutex_lock(&vs->dev.mutex); |
@@ -992,7 +1001,7 @@ static long vhost_scsi_ioctl(struct file *f, unsigned int ioctl, | |||
992 | return -EFAULT; | 1001 | return -EFAULT; |
993 | return 0; | 1002 | return 0; |
994 | case VHOST_GET_FEATURES: | 1003 | case VHOST_GET_FEATURES: |
995 | features = VHOST_FEATURES; | 1004 | features = VHOST_SCSI_FEATURES; |
996 | if (copy_to_user(featurep, &features, sizeof features)) | 1005 | if (copy_to_user(featurep, &features, sizeof features)) |
997 | return -EFAULT; | 1006 | return -EFAULT; |
998 | return 0; | 1007 | return 0; |