From patchwork Fri Jan 30 08:35:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nicholas A. Bellinger" X-Patchwork-Id: 5747891 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 70396BF440 for ; Fri, 30 Jan 2015 09:08:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9CA7A2025B for ; Fri, 30 Jan 2015 09:08:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6EA9D2025A for ; Fri, 30 Jan 2015 09:08:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752912AbbA3JIy (ORCPT ); Fri, 30 Jan 2015 04:08:54 -0500 Received: from mail-ob0-f172.google.com ([209.85.214.172]:40446 "EHLO mail-ob0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752657AbbA3JIs (ORCPT ); Fri, 30 Jan 2015 04:08:48 -0500 Received: by mail-ob0-f172.google.com with SMTP id nt9so1712312obb.3 for ; Fri, 30 Jan 2015 01:08:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=xQsroxpehGKLVFHZBzUrjb5skGn5iAWf8GHkvH5pOoY=; b=Rl/ykUOl89VCENb8CSoe65bN0Izj6mq9WSaJcU//OC5ke6Oz0N6rn48h342y48W5lc 6cdkgG9KF1+SAU7srGNfuPd38J+GW0Z2uMGFqYTSrK4lhwWY25XsNIokJS/uLYrMlhfP pTA66ew20Ricif8hPKHiKljW3mRIfeRTr+ym8sLGPebOppH8PD28Eywa7ZVkpyBLxQ1i tIAAxP5/fbkEtYvLLPXQLwD4qoQPBRY2FXQqsMdTerfHUpZHcS/vHRJgbfkKDs22gMID rG7pg+bq4K7KVyKx18GWdeyvVKzVQdL9RpKMs8kevK/3zYC/aGjrlUvKCASxz2notUPj s9Xw== X-Gm-Message-State: ALoCoQknY5zDt1FA+VyBcqrB9dDpHUIP6U5QqmNbL5VyL4bJKQUmjFdf8SYd2AyJL5cLcMbJQcDF X-Received: by 10.182.87.202 with SMTP id ba10mr3162476obb.22.1422608927984; Fri, 30 Jan 2015 01:08:47 -0800 (PST) Received: from localhost.localdomain (mail.linux-iscsi.org. [67.23.28.174]) by mx.google.com with ESMTPSA id o5sm5069911obz.9.2015.01.30.01.08.47 (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 30 Jan 2015 01:08:47 -0800 (PST) From: "Nicholas A. Bellinger" To: target-devel , qemu-devel Cc: kvm-devel , Paolo Bonzini , "Michael S. Tsirkin" , Nicholas Bellinger Subject: [PATCH 2/3] vhost/scsi: Add VIRTIO_SCSI_F_T10_PI host_feature bit Date: Fri, 30 Jan 2015 08:35:49 +0000 Message-Id: <1422606950-25291-3-git-send-email-nab@daterainc.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1422606950-25291-1-git-send-email-nab@daterainc.com> References: <1422606950-25291-1-git-send-email-nab@daterainc.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Nicholas Bellinger Signed-off-by: Nicholas Bellinger --- 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 *);