qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/3] vhost/scsi: Enable virtio 1.0 host_feature bits
@ 2015-01-30  8:35 Nicholas A. Bellinger
  2015-01-30  8:35 ` [Qemu-devel] [PATCH 1/3] vhost/scsi: Add VIRTIO_SCSI_F_HOTPLUG host_feature bit Nicholas A. Bellinger
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Nicholas A. Bellinger @ 2015-01-30  8:35 UTC (permalink / raw)
  To: target-devel, qemu-devel
  Cc: Paolo Bonzini, Nicholas Bellinger, kvm-devel, Michael S. Tsirkin

From: Nicholas Bellinger <nab@linux-iscsi.org>

Hi MST & Paolo,

Here are the associated QEMU vhost/scsi changes to enable KVM host
for expose F_HOTPLUG, F_T10_PI, and ANY_LAYOUT feature bits into
virtio 1.0 compatible guests.

Note this does not include VIRTIO_SCSI_F_CHANGE, which is currently
not supported by vhost/scsi kernel code host_feature bits.

Thank you,

--nab

Nicholas Bellinger (3):
  vhost/scsi: Add VIRTIO_SCSI_F_HOTPLUG host_feature bit
  vhost/scsi: Add VIRTIO_SCSI_F_T10_PI host_feature bit
  vhost/scsi: Add VIRTIO_F_ANY_LAYOUT host_feature bit

 hw/scsi/vhost-scsi.c            |  2 ++
 hw/scsi/virtio-scsi.c           |  3 +++
 hw/virtio/virtio-pci.c          |  6 ++++++
 include/hw/i386/pc.h            | 18 +++++++++++++++++-
 include/hw/virtio/virtio-scsi.h |  5 ++++-
 5 files changed, 32 insertions(+), 2 deletions(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PATCH 1/3] vhost/scsi: Add VIRTIO_SCSI_F_HOTPLUG host_feature bit
  2015-01-30  8:35 [Qemu-devel] [PATCH 0/3] vhost/scsi: Enable virtio 1.0 host_feature bits Nicholas A. Bellinger
@ 2015-01-30  8:35 ` Nicholas A. Bellinger
  2015-01-30  8:35 ` [Qemu-devel] [PATCH 2/3] vhost/scsi: Add VIRTIO_SCSI_F_T10_PI " Nicholas A. Bellinger
  2015-01-30  8:35 ` [Qemu-devel] [PATCH 3/3] vhost/scsi: Add VIRTIO_F_ANY_LAYOUT " Nicholas A. Bellinger
  2 siblings, 0 replies; 4+ messages in thread
From: Nicholas A. Bellinger @ 2015-01-30  8:35 UTC (permalink / raw)
  To: target-devel, qemu-devel
  Cc: Paolo Bonzini, Nicholas Bellinger, kvm-devel, Michael S. Tsirkin

From: Nicholas Bellinger <nab@linux-iscsi.org>

Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
---
 hw/virtio/virtio-pci.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index dde1d73..5127efb 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1198,6 +1198,8 @@ static const TypeInfo virtio_scsi_pci_info = {
 static Property vhost_scsi_pci_properties[] = {
     DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors,
                        DEV_NVECTORS_UNSPECIFIED),
+    DEFINE_PROP_BIT("hotplug", VirtIOPCIProxy, host_features,
+                       VIRTIO_SCSI_F_HOTPLUG, true),
     DEFINE_PROP_END_OF_LIST(),
 };
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PATCH 2/3] vhost/scsi: Add VIRTIO_SCSI_F_T10_PI host_feature bit
  2015-01-30  8:35 [Qemu-devel] [PATCH 0/3] vhost/scsi: Enable virtio 1.0 host_feature bits Nicholas A. Bellinger
  2015-01-30  8:35 ` [Qemu-devel] [PATCH 1/3] vhost/scsi: Add VIRTIO_SCSI_F_HOTPLUG host_feature bit Nicholas A. Bellinger
@ 2015-01-30  8:35 ` Nicholas A. Bellinger
  2015-01-30  8:35 ` [Qemu-devel] [PATCH 3/3] vhost/scsi: Add VIRTIO_F_ANY_LAYOUT " Nicholas A. Bellinger
  2 siblings, 0 replies; 4+ messages in thread
From: Nicholas A. Bellinger @ 2015-01-30  8:35 UTC (permalink / raw)
  To: target-devel, qemu-devel
  Cc: Paolo Bonzini, Nicholas Bellinger, kvm-devel, Michael S. Tsirkin

From: Nicholas Bellinger <nab@linux-iscsi.org>

Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
---
 hw/scsi/vhost-scsi.c            |  1 +
 hw/scsi/virtio-scsi.c           |  3 +++
 hw/virtio/virtio-pci.c          |  2 ++
 include/hw/i386/pc.h            | 13 ++++++++++++-
 include/hw/virtio/virtio-scsi.h |  5 ++++-
 5 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c
index dcb2bc5..95f7b99 100644
--- a/hw/scsi/vhost-scsi.c
+++ b/hw/scsi/vhost-scsi.c
@@ -31,6 +31,7 @@ static const int kernel_feature_bits[] = {
     VIRTIO_RING_F_INDIRECT_DESC,
     VIRTIO_RING_F_EVENT_IDX,
     VIRTIO_SCSI_F_HOTPLUG,
+    VIRTIO_SCSI_F_T10_PI,
     VHOST_INVALID_FEATURE_BIT
 };
 
diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c
index 9e2c718..61e9988 100644
--- a/hw/scsi/virtio-scsi.c
+++ b/hw/scsi/virtio-scsi.c
@@ -887,6 +887,9 @@ static void virtio_scsi_device_realize(DeviceState *dev, Error **errp)
         return;
     }
 
+    /* Protection information is not supported yet.  */
+    vdev->guest_features &= ~VIRTIO_SCSI_F_T10_PI;
+
     scsi_bus_new(&s->bus, sizeof(s->bus), dev,
                  &virtio_scsi_scsi_info, vdev->bus_name);
     /* override default SCSI bus hotplug-handler, with virtio-scsi's one */
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 5127efb..861ec95 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1200,6 +1200,8 @@ static Property vhost_scsi_pci_properties[] = {
                        DEV_NVECTORS_UNSPECIFIED),
     DEFINE_PROP_BIT("hotplug", VirtIOPCIProxy, host_features,
                        VIRTIO_SCSI_F_HOTPLUG, true),
+    DEFINE_PROP_BIT("prot_info", VirtIOPCIProxy, host_features,
+		    VIRTIO_SCSI_F_T10_PI, true),
     DEFINE_PROP_END_OF_LIST(),
 };
 
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 69d9cf8..c81e2e9 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -315,7 +315,18 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *);
             .driver   = "virtio-scsi-pci",\
             .property = "any_layout",\
             .value    = "off",\
-        },{\
+        },\
+        {\
+            .driver   = "virtio-scsi-pci",\
+            .property = "prot_info",\
+            .value    = "off",\
+        },\
+        {\
+            .driver   = "vhost-scsi-pci",\
+            .property = "prot_info",\
+            .value    = "off",\
+        },\
+        {\
             .driver   = "PIIX4_PM",\
             .property = "memory-hotplug-support",\
             .value    = "off",\
diff --git a/include/hw/virtio/virtio-scsi.h b/include/hw/virtio/virtio-scsi.h
index bf17cc9..08bc54a 100644
--- a/include/hw/virtio/virtio-scsi.h
+++ b/include/hw/virtio/virtio-scsi.h
@@ -36,6 +36,7 @@
 #define VIRTIO_SCSI_F_INOUT                    0
 #define VIRTIO_SCSI_F_HOTPLUG                  1
 #define VIRTIO_SCSI_F_CHANGE                   2
+#define VIRTIO_SCSI_F_T10_PI                   3
 
 #define VIRTIO_SCSI_VQ_SIZE     128
 #define VIRTIO_SCSI_CDB_SIZE    32
@@ -258,7 +259,9 @@ QEMU_BUILD_BUG_ON(offsetof(VirtIOSCSIReq, req.cdb) !=
     DEFINE_PROP_BIT("hotplug", _state, _feature_field, VIRTIO_SCSI_F_HOTPLUG,  \
                                                        true),                  \
     DEFINE_PROP_BIT("param_change", _state, _feature_field,                    \
-                                            VIRTIO_SCSI_F_CHANGE, true)
+                                            VIRTIO_SCSI_F_CHANGE, true),       \
+    DEFINE_PROP_BIT("prot_info", _state, _feature_field,                       \
+                                            VIRTIO_SCSI_F_T10_PI, true)
 
 typedef void (*HandleOutput)(VirtIODevice *, VirtQueue *);
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PATCH 3/3] vhost/scsi: Add VIRTIO_F_ANY_LAYOUT host_feature bit
  2015-01-30  8:35 [Qemu-devel] [PATCH 0/3] vhost/scsi: Enable virtio 1.0 host_feature bits Nicholas A. Bellinger
  2015-01-30  8:35 ` [Qemu-devel] [PATCH 1/3] vhost/scsi: Add VIRTIO_SCSI_F_HOTPLUG host_feature bit Nicholas A. Bellinger
  2015-01-30  8:35 ` [Qemu-devel] [PATCH 2/3] vhost/scsi: Add VIRTIO_SCSI_F_T10_PI " Nicholas A. Bellinger
@ 2015-01-30  8:35 ` Nicholas A. Bellinger
  2 siblings, 0 replies; 4+ messages in thread
From: Nicholas A. Bellinger @ 2015-01-30  8:35 UTC (permalink / raw)
  To: target-devel, qemu-devel
  Cc: Paolo Bonzini, Nicholas Bellinger, kvm-devel, Michael S. Tsirkin

From: Nicholas Bellinger <nab@linux-iscsi.org>

Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
---
 hw/scsi/vhost-scsi.c   | 1 +
 hw/virtio/virtio-pci.c | 2 ++
 include/hw/i386/pc.h   | 5 +++++
 3 files changed, 8 insertions(+)

diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c
index 95f7b99..bfb7005 100644
--- a/hw/scsi/vhost-scsi.c
+++ b/hw/scsi/vhost-scsi.c
@@ -32,6 +32,7 @@ static const int kernel_feature_bits[] = {
     VIRTIO_RING_F_EVENT_IDX,
     VIRTIO_SCSI_F_HOTPLUG,
     VIRTIO_SCSI_F_T10_PI,
+    VIRTIO_F_ANY_LAYOUT,
     VHOST_INVALID_FEATURE_BIT
 };
 
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 861ec95..7863dcc 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1198,6 +1198,8 @@ static const TypeInfo virtio_scsi_pci_info = {
 static Property vhost_scsi_pci_properties[] = {
     DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors,
                        DEV_NVECTORS_UNSPECIFIED),
+    DEFINE_PROP_BIT("any_layout", VirtIOPCIProxy, host_features,
+                       VIRTIO_F_ANY_LAYOUT, true),
     DEFINE_PROP_BIT("hotplug", VirtIOPCIProxy, host_features,
                        VIRTIO_SCSI_F_HOTPLUG, true),
     DEFINE_PROP_BIT("prot_info", VirtIOPCIProxy, host_features,
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index c81e2e9..16f52bd 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -322,6 +322,11 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *);
             .value    = "off",\
         },\
         {\
+            .driver   = "vhost-scsi-pci", \
+            .property = "any_layout",\
+            .value    = "off",\
+        },\
+        {\
             .driver   = "vhost-scsi-pci",\
             .property = "prot_info",\
             .value    = "off",\
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-01-30  9:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-30  8:35 [Qemu-devel] [PATCH 0/3] vhost/scsi: Enable virtio 1.0 host_feature bits Nicholas A. Bellinger
2015-01-30  8:35 ` [Qemu-devel] [PATCH 1/3] vhost/scsi: Add VIRTIO_SCSI_F_HOTPLUG host_feature bit Nicholas A. Bellinger
2015-01-30  8:35 ` [Qemu-devel] [PATCH 2/3] vhost/scsi: Add VIRTIO_SCSI_F_T10_PI " Nicholas A. Bellinger
2015-01-30  8:35 ` [Qemu-devel] [PATCH 3/3] vhost/scsi: Add VIRTIO_F_ANY_LAYOUT " Nicholas A. Bellinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).