From patchwork Mon Nov 6 06:57:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Longpeng(Mike)" X-Patchwork-Id: 10042653 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 EC099601EB for ; Mon, 6 Nov 2017 07:01:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DC418298FE for ; Mon, 6 Nov 2017 07:01:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D15DB29907; Mon, 6 Nov 2017 07:01:24 +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 86D23298FE for ; Mon, 6 Nov 2017 07:01:24 +0000 (UTC) Received: from localhost ([::1]:46722 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eBbPP-000058-NJ for patchwork-qemu-devel@patchwork.kernel.org; Mon, 06 Nov 2017 02:01:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49779) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eBbLa-0006Gj-6y for qemu-devel@nongnu.org; Mon, 06 Nov 2017 01:57:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eBbLV-0008F3-Ii for qemu-devel@nongnu.org; Mon, 06 Nov 2017 01:57:26 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:2328) by eggs.gnu.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71) (envelope-from ) id 1eBbLV-00088Z-0B for qemu-devel@nongnu.org; Mon, 06 Nov 2017 01:57:21 -0500 Received: from 172.30.72.58 (EHLO DGGEMS406-HUB.china.huawei.com) ([172.30.72.58]) by dggrg04-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id DKI32699; Mon, 06 Nov 2017 14:57:18 +0800 (CST) Received: from localhost (10.177.246.209) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.361.1; Mon, 6 Nov 2017 14:57:10 +0800 From: "Longpeng(Mike)" To: , Date: Mon, 6 Nov 2017 14:57:02 +0800 Message-ID: <1509951422-20060-11-git-send-email-longpeng2@huawei.com> X-Mailer: git-send-email 1.8.4.msysgit.0 In-Reply-To: <1509951422-20060-1-git-send-email-longpeng2@huawei.com> References: <1509951422-20060-1-git-send-email-longpeng2@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.177.246.209] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020201.5A0007CE.0097, 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: 0028352d428785b848405f97456a9424 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] [fuzzy] X-Received-From: 45.249.212.190 Subject: [Qemu-devel] [RFC 10/10] 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: wangxinxin.wang@huawei.com, weidong.huang@huawei.com, qemu-devel@nongnu.org, jianjay.zhou@huawei.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Gonglei 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 e46c4a3..8f27a86 100644 --- a/hw/virtio/virtio-crypto.c +++ b/hw/virtio/virtio-crypto.c @@ -1069,6 +1069,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; } @@ -1184,6 +1189,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_LINK("cryptodev", VirtIOCrypto, conf.cryptodev, TYPE_CRYPTODEV_BACKEND, CryptoDevBackend *), 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 */