From patchwork Mon May 8 11:38:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gonglei (Arei)" X-Patchwork-Id: 9716069 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 087A960364 for ; Mon, 8 May 2017 11:40:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E2920265B9 for ; Mon, 8 May 2017 11:40:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D3FC226B41; Mon, 8 May 2017 11:40:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A301F265B9 for ; Mon, 8 May 2017 11:40:31 +0000 (UTC) Received: from localhost ([::1]:58911 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d7h1h-0002xl-ER for patchwork-qemu-devel@patchwork.kernel.org; Mon, 08 May 2017 07:40:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50684) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d7h0T-0002x9-Dz for qemu-devel@nongnu.org; Mon, 08 May 2017 07:39:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d7h0O-0004Ub-JS for qemu-devel@nongnu.org; Mon, 08 May 2017 07:39:13 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:3976) by eggs.gnu.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71) (envelope-from ) id 1d7h0N-0004TF-Vy for qemu-devel@nongnu.org; Mon, 08 May 2017 07:39:08 -0400 Received: from 172.30.72.53 (EHLO DGGEML402-HUB.china.huawei.com) ([172.30.72.53]) by dggrg01-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id AOD07405; Mon, 08 May 2017 19:38:48 +0800 (CST) Received: from localhost (10.177.18.62) by DGGEML402-HUB.china.huawei.com (10.3.17.38) with Microsoft SMTP Server id 14.3.301.0; Mon, 8 May 2017 19:38:39 +0800 From: Gonglei To: Date: Mon, 8 May 2017 19:38:23 +0800 Message-ID: <1494243504-127980-9-git-send-email-arei.gonglei@huawei.com> X-Mailer: git-send-email 2.8.2.windows.1 In-Reply-To: <1494243504-127980-1-git-send-email-arei.gonglei@huawei.com> References: <1494243504-127980-1-git-send-email-arei.gonglei@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.177.18.62] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020206.591058CB.0054, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 2ac349108ea4ea9e00bb06b20f4f275a X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] [fuzzy] X-Received-From: 45.249.212.187 Subject: [Qemu-devel] [RFC v1 8/9] virtio-crypto: add host feature bits support X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pasic@linux.vnet.ibm.com, weidong.huang@huawei.com, mst@redhat.com, xin.zeng@intel.com, luonengjun@huawei.com, linqiangmin@huawei.com, Gonglei , stefanha@redhat.com, cornelia.huck@de.ibm.com, wu.wubin@huawei.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP We enable all feature bits acquiescently. Signed-off-by: Gonglei --- hw/virtio/virtio-crypto.c | 15 +++++++++++++++ include/hw/virtio/virtio-crypto.h | 1 + 2 files changed, 16 insertions(+) diff --git a/hw/virtio/virtio-crypto.c b/hw/virtio/virtio-crypto.c index 5422f25..3dc0ff2 100644 --- a/hw/virtio/virtio-crypto.c +++ b/hw/virtio/virtio-crypto.c @@ -1034,6 +1034,11 @@ static uint64_t virtio_crypto_get_features(VirtIODevice *vdev, uint64_t features, Error **errp) { + VirtIOCrypto *vcrypto = VIRTIO_CRYPTO(vdev); + + /* Firstly sync all virtio-crypto possible supported features */ + features |= vcrypto->host_features; + return features; } @@ -1144,6 +1149,16 @@ static const VMStateDescription vmstate_virtio_crypto = { }; static Property virtio_crypto_properties[] = { + DEFINE_PROP_BIT("mux_mode", VirtIOCrypto, host_features, + VIRTIO_CRYPTO_F_MUX_MODE, true), + DEFINE_PROP_BIT("cipher_stateless_mode", VirtIOCrypto, host_features, + VIRTIO_CRYPTO_F_CIPHER_STATELESS_MODE, true), + DEFINE_PROP_BIT("hash_stateless_mode", VirtIOCrypto, host_features, + VIRTIO_CRYPTO_F_HASH_STATELESS_MODE, true), + DEFINE_PROP_BIT("mac_stateless_mode", VirtIOCrypto, host_features, + VIRTIO_CRYPTO_F_MAC_STATELESS_MODE, true), + DEFINE_PROP_BIT("aead_stateless_mode", VirtIOCrypto, host_features, + VIRTIO_CRYPTO_F_AEAD_STATELESS_MODE, true), DEFINE_PROP_END_OF_LIST(), }; diff --git a/include/hw/virtio/virtio-crypto.h b/include/hw/virtio/virtio-crypto.h index 465ad20..30ea51d 100644 --- a/include/hw/virtio/virtio-crypto.h +++ b/include/hw/virtio/virtio-crypto.h @@ -97,6 +97,7 @@ typedef struct VirtIOCrypto { int multiqueue; uint32_t curr_queues; size_t config_size; + uint32_t host_features; } VirtIOCrypto; #endif /* _QEMU_VIRTIO_CRYPTO_H */