From patchwork Tue May 24 15:40:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 575736 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:c603:0:0:0:0 with SMTP id jv3csp2413431mab; Tue, 24 May 2022 08:47:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJD68Mn/+oUakjR+Zlw54wOFNFekZz0rB4cC8DT7SuJ11qWeGFV6+nJvTKbkDP+qRyNbb/ X-Received: by 2002:a05:6214:2aaf:b0:45b:9f:8752 with SMTP id js15-20020a0562142aaf00b0045b009f8752mr21895482qvb.9.1653407227226; Tue, 24 May 2022 08:47:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653407227; cv=none; d=google.com; s=arc-20160816; b=kGykIG3V9BhGRIkLpy7TS3cwQYPwxS7AXmKf5o85v0JMUXIZyzux7vXh9/pxZSBpJ0 Ed6s34o2X7INucQlpGizjH1itVXjluLWt4Z3M1EzmXEL9fGHmfgb6o1jb+/dE5gxESJh pmmIgGC/QOzEsPLxI+JQQgC/L/hCA7xG9/oVMg/F7abFMZYonYscpaoPG+Fg1wxwAKes VsBY/CSnlb0dYTvISgZ0syiSSbu0Yfb+WdRDH4RhCsP09rRQND8yDuXham1PcorSBds2 GCs0cy3WhPBblHz7BlVbQl6VbwAsaj0GRVWOMv/PjDdTPiUFWQ4zbXJm9dRby5tci0hq c9Nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=FgzK20NI+E0P86TSvhLUf2mlqYDXY7EcnmvPOs0iPUg=; b=ADFoz+Wbf5B3/Vbe7jDUR0+gXTTPoXCSzPByY+Va5UaJJqcw4FNaGPrqUJk/EZSbzY GmSTfo8mRxKLf4l6JpqN76U/P+00OzUvTBmOudFqIQ1HvS8W+eQTrhDGgzqWK2zWnstJ T95E18QLOVZ456+FzOjltAgs1wtRcvxY6R5BF216DmhmpdZ3s/TnlYc06Ddml5PHP859 jQOD7vXRHviSq6ksChfDI8/2k4LD3j1dhq5rrXNyY8DoVuqhDeh7cb7bCRH5wXILqKQD /vV7KDIU0zl/BOk1BtZf8W1Wh39JPn1sYTYUrxXf3819UXtBxp3u0YI8y/+AzFVHNtva 6nAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=em1GXJ6f; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id jn4-20020ad45de4000000b004625dbfa797si619963qvb.165.2022.05.24.08.47.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 May 2022 08:47:07 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=em1GXJ6f; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:49918 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ntWkU-0001OE-Qh for patch@linaro.org; Tue, 24 May 2022 11:47:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42960) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntWek-00043s-OZ for qemu-devel@nongnu.org; Tue, 24 May 2022 11:41:10 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:56300) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ntWed-0005M5-LB for qemu-devel@nongnu.org; Tue, 24 May 2022 11:41:10 -0400 Received: by mail-wm1-x329.google.com with SMTP id y24so3091467wmq.5 for ; Tue, 24 May 2022 08:41:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FgzK20NI+E0P86TSvhLUf2mlqYDXY7EcnmvPOs0iPUg=; b=em1GXJ6ftMhEHLwhpn8kbH22HgOaqz4WxzXaq2dmxd+QYbkkAlL9KGx3JekCiN0O4n pBst2/i5nDilULaxPtrA2LhUTg1ZSWHQL43WHZEE6URO0xtXGLWX8g3/Ii/zDSFimfXj mNtXlGUGqoc2a6woXUO2LAcO1/lPLwVr8uzeQ1WWbwbY1djJaYit1yZ6/HB94HAZ7u+J Ch16Qe8UtLOshHIo/WrKnUGZsrYqhmGWOOysZmsgQ01I6RK0JtS5xzVlpPt5hI9eeE7I X/+SIB0N8e0ahca+P+i2z656zZjlHrFul/ocPXR/wlg8KHGs2NCfEkN7FXTfvamI0CEy qhYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FgzK20NI+E0P86TSvhLUf2mlqYDXY7EcnmvPOs0iPUg=; b=pr+BsvnPq0U/CKZXAiY9zgFU8uj8s3mJ4oq3g4etozV3kgUE+apFCnVvHOcHtOVYt5 39N+xjYygHCbQMrR6Z+lZMFDddh3D/ZL/BpK5waSZT8zmL2ZxKDf1yzTUvn781XLJT7I PIicKnJ+eZFJLp1OhCTfdQpc4zlslxBvpkTXoCUvmsC8cfafcx+In/S1YMQuXfqTjftk BdcH8UBTzXrP1+evR7y7/d2NKgBXx2l2Wl3b+GckfFXZPHy5GsGLHI10E+yiGDspzspb BdKEvyna47FOLeAGp3u7fUKjiamuCN4uo0PTKEpWsRgK7yIBOtgedjkTwu9b/bju2R8Z y9VQ== X-Gm-Message-State: AOAM5332xroz9tv5EYFN4aCaopU6dz9f1oTsWKn+auhqxknMaUZ4gu+7 JfXLaiQS3mSWsRQq0+SvFDWiag== X-Received: by 2002:a05:600c:1504:b0:397:4d98:8b85 with SMTP id b4-20020a05600c150400b003974d988b85mr4375845wmg.39.1653406862290; Tue, 24 May 2022 08:41:02 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id n32-20020a05600c3ba000b003942a244ecbsm2678034wms.16.2022.05.24.08.40.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 May 2022 08:41:00 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A3B811FFBB; Tue, 24 May 2022 16:40:56 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: slp@redhat.com, mst@redhat.com, marcandre.lureau@redhat.com, stefanha@redhat.com, mathieu.poirier@linaro.org, viresh.kumar@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v2 03/15] include/hw/virtio: document vhost_get_features Date: Tue, 24 May 2022 16:40:44 +0100 Message-Id: <20220524154056.2896913-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220524154056.2896913-1-alex.bennee@linaro.org> References: <20220524154056.2896913-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x329.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Alex Bennée Reviewed-by: Stefan Hajnoczi --- include/hw/virtio/vhost.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/hw/virtio/vhost.h b/include/hw/virtio/vhost.h index b291fe4e24..9f9f57c46e 100644 --- a/include/hw/virtio/vhost.h +++ b/include/hw/virtio/vhost.h @@ -246,6 +246,17 @@ bool vhost_virtqueue_pending(struct vhost_dev *hdev, int n); */ void vhost_virtqueue_mask(struct vhost_dev *hdev, VirtIODevice *vdev, int n, bool mask); + +/** + * vhost_get_features() - return a sanitised set of feature bits + * @hdev: common vhost_dev structure + * @feature_bits: pointer to terminated table of feature bits + * @features: original feature set + * + * This returns a set of features bits that is an intersection of what + * is supported by the vhost backend (hdev->features), the supported + * feature_bits and the requested feature set. + */ uint64_t vhost_get_features(struct vhost_dev *hdev, const int *feature_bits, uint64_t features); void vhost_ack_features(struct vhost_dev *hdev, const int *feature_bits,