From nobody Sat May 18 23:55:06 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1658937568; cv=none; d=zohomail.com; s=zohoarc; b=R0Mmo1BkTwYrE4knE7ZKTTuztP2oXrvLr4gaouUgR9KVKYfhHFTwBobKK1PnWlsa9gJ4rnxI5SC/AHW5TAlL3CfGqz1uaPuh6HGTJ+9LNFoauONK7bHzOmgpWxKaB+lnehHAWoWxc9zwZ12cDNC1KEyP5NCVoEt/T4/yOlxW2w8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658937568; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=9mEcK4sO4rPCFZLLkHp1PXNwdldjaLtha6aYBrlBQcI=; b=JdXLShDhGpVCYADyLLJQl2LZkd8seImLdhhWvZhzvGeCbKV6rdEuEf+jIObqhZy5Mws0qwywU6/MGoGdFbGVjRa2W6SCwp2NvQPyMd0OtGp9FAo08ASCMRdIra8CUMAe5qtm5gLS6unheS9b5rsu6KTlRTXiEkvPtAfbf1o/6NU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1658937568467259.58503015480585; Wed, 27 Jul 2022 08:59:28 -0700 (PDT) Received: from localhost ([::1]:55348 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oGjRW-00052N-H2 for importer@patchew.org; Wed, 27 Jul 2022 11:59:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45596) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oGjPC-00025Y-7C for qemu-devel@nongnu.org; Wed, 27 Jul 2022 11:57:02 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:45619) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oGjPA-0001sU-JB for qemu-devel@nongnu.org; Wed, 27 Jul 2022 11:57:01 -0400 Received: by mail-wr1-x436.google.com with SMTP id v13so17284291wru.12 for ; Wed, 27 Jul 2022 08:57:00 -0700 (PDT) Received: from zen.linaroharston ([185.81.254.11]) by smtp.gmail.com with ESMTPSA id o17-20020adfead1000000b0021e4536a948sm17704256wrn.79.2022.07.27.08.56.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Jul 2022 08:56:54 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 766191FFB8; Wed, 27 Jul 2022 16:56:53 +0100 (BST) 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=9mEcK4sO4rPCFZLLkHp1PXNwdldjaLtha6aYBrlBQcI=; b=f2h6jFQKRucQhcBji1PCOcCqWcHeYIW1dgWiY9O6sUkdqjZ6tRKf2yPGearSXbewwD JnkmHJMizh2OT47mRwa7k7AGEGRNFnWw11qZylSYPIAedg8CFCAjQqDro9kQeeVQCSRk Ie42fcCDpk4J8rKEJ1FrzuIqBtmeIOmYCX46Ky3zkRuadmOjuIgzzBdSFce8iIM/y/5b TKZpKBujdZiPKTKayo0MIFfsQAj0G8VSwYIjmTTeLtedOxlubXQU7IY3UBKrBOV4XQqu dnWKTRxcj7O/URqpbTNAz/5Zv28vhYs9j9u7SAZxG+Z4QNft25aLUoXqdv0vA25xcjfU WKwA== 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=9mEcK4sO4rPCFZLLkHp1PXNwdldjaLtha6aYBrlBQcI=; b=QdY9GySnF33+9RtUo+WvJgiqtB7RatSrVPQav6ztrqVlkUd66kqivPPZRJID2sgf7e F4MxA28qP/Vxg39ApkPYW3VhwZANgFo1kB5Bsz/7BENncGfPqOlP3zFblMJVxn0ZFGL8 p9aJPtuezFgDEqtF8gFdGRpVeJxsDPQ7DkXr//hLddJ1VFrck2g3qJNbmVRtoTXF8kcA v10j9egpumAX//Arthrx/N1XVAzhDD2S1ALfPFyTPJ/JHQ7EzMpXZl60qUZZChQ2Z9sP TLDofLq6e94+0k5Z+PlAXxS/dCX+SHuwPw1FJ+zdH47ehWqYlGbL8TKOYh+wRFYR1z3R iT6Q== X-Gm-Message-State: AJIora96n+SRmb+rZJVkNSVkUs/Jxac1u4NCiG3KsKxZS5vOdwmJxtGc qINqV09HI/+NX4M377e7qydfsw== X-Google-Smtp-Source: AGRyM1uUTzhkjPQTH3ZtlyBd3Pohty5Tc3ELa8Zil2rKT7vid0Oc7myqlDq+acShgVV77umGdeK+PQ== X-Received: by 2002:adf:f646:0:b0:21d:7000:95b1 with SMTP id x6-20020adff646000000b0021d700095b1mr14574245wrp.486.1658937418222; Wed, 27 Jul 2022 08:56:58 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: mst@redhat.com, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Coiby Xu , Kevin Wolf , Hanna Reitz , qemu-block@nongnu.org (open list:Block layer core) Subject: [PATCH v1 1/5] block/vhost-user-blk-server: don't expose VHOST_USER_F_PROTOCOL_FEATURES Date: Wed, 27 Jul 2022 16:56:49 +0100 Message-Id: <20220727155653.3974426-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220727155653.3974426-1-alex.bennee@linaro.org> References: <20220727155653.3974426-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x436.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=unavailable 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1658937570536100001 This bit is unused in actual VirtIO feature negotiation and should only appear in the vhost-user messages between master and slave. [AJB: experiment, this doesn't break the tests but I'm not super confident of the range of tests] Signed-off-by: Alex Benn=C3=A9e Message-Id: <20220726192150.2435175-6-alex.bennee@linaro.org> --- block/export/vhost-user-blk-server.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/block/export/vhost-user-blk-server.c b/block/export/vhost-user= -blk-server.c index 3409d9e02e..d31436006d 100644 --- a/block/export/vhost-user-blk-server.c +++ b/block/export/vhost-user-blk-server.c @@ -125,8 +125,7 @@ static uint64_t vu_blk_get_features(VuDev *dev) 1ull << VIRTIO_BLK_F_MQ | 1ull << VIRTIO_F_VERSION_1 | 1ull << VIRTIO_RING_F_INDIRECT_DESC | - 1ull << VIRTIO_RING_F_EVENT_IDX | - 1ull << VHOST_USER_F_PROTOCOL_FEATURES; + 1ull << VIRTIO_RING_F_EVENT_IDX ; =20 if (!vexp->handler.writable) { features |=3D 1ull << VIRTIO_BLK_F_RO; --=20 2.30.2 From nobody Sat May 18 23:55:06 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1658938009; cv=none; d=zohomail.com; s=zohoarc; b=grmXyYhbWVTEtzXSBpRUjS3AIzKAPLksxJl3keCS2g1vyqofLF9YEBgYuU4D9I5R7pspJLNxQUHrl3zGZq7qffAhm6txS07wLabXPI/QKb7CMQ8dgsYAW5LaTiL5szI+chJ6XjDnpfw8v0Uf0u4vJeF61NfuXDscIJc4CCWQjpQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658938009; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=WTel/fQ7Gj1d2ni3sryAwF0T/iksivK0kIXjy8395Xc=; b=RcqbPwxwFX2XlRMlUR3ixUZNUyIghzrD7U3w65dMYxKhDgyNfqp5+zZWvsCEwrcEIlPzUr46mYGmUgka0uPak1/hA5UOsPptFgzfldVZ2APke/GOO9sG/ekHZuT4vi4kEYR9bja4E5LzyeBqB1riNbn5E3PX8g/or+22Y7p/MPc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1658938009595254.56739900555544; Wed, 27 Jul 2022 09:06:49 -0700 (PDT) Received: from localhost ([::1]:35620 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oGjYd-0002RR-Sh for importer@patchew.org; Wed, 27 Jul 2022 12:06:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45556) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oGjPA-000225-HG for qemu-devel@nongnu.org; Wed, 27 Jul 2022 11:57:00 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:45612) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oGjP8-0001ru-1H for qemu-devel@nongnu.org; Wed, 27 Jul 2022 11:57:00 -0400 Received: by mail-wr1-x42f.google.com with SMTP id v13so17284113wru.12 for ; Wed, 27 Jul 2022 08:56:57 -0700 (PDT) Received: from zen.linaroharston ([185.81.254.11]) by smtp.gmail.com with ESMTPSA id j11-20020adfe50b000000b0021e4a4fc017sm17415987wrm.34.2022.07.27.08.56.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Jul 2022 08:56:54 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 8D3D61FFBA; Wed, 27 Jul 2022 16:56:53 +0100 (BST) 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=WTel/fQ7Gj1d2ni3sryAwF0T/iksivK0kIXjy8395Xc=; b=ActJj0k3rthL0kOqAKCRJuVtFE8KcDK7jZCxI6bx5PwY2bAVKjN8UQ3J9igIrwYN7J DraBV+iK4OxV8CZJWX8DT6yTBhhRFgcb/+5wQA3btjkHhYmRgv6YlU2s3meh+mqW+HTr c8+7ZD6Upss+GPZjqQyyO2iO7Fru9XqrQPB4ruJBjmUfM+g7mWDQkMP0plT7mwCcSx/Y HU5RkZ2zTie2B0DD/DoVPB6Li102YJcppiHiQmk2NXg71IF2Ug5PQUORvpfleOJO0z4y W60lflpU7qhN1zbl8DQx+T8mMm/RuZ96LEi36KqRDUdM96vK9agQ2d+wD1MKyTiKljlh pgvg== 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=WTel/fQ7Gj1d2ni3sryAwF0T/iksivK0kIXjy8395Xc=; b=bxGC6gf1tpOlwUng+EDfPrqgWrpIHEMPYxJWgEiKevqXMjrEK24lg+8LTSzilgVL3E qjj3LckAujJV5ss5jS4/0d7funABxswEBh/2b1ia6YyS9f6151Qcj+iYfmjwScImARGA TCkQpWLjxzOtk8OAeasY9u2I+fV61w3Pg7T7UdfRvTTknZQSI266DJwTkWZxJHGQREDp Xn42xSmGWgs0x0KEHeSt9OpzpXFV9rRQlF1qfy/qag5mx6vw8lEkOtz/3NDKnPyLCXN9 CCMdMi5fFK5RDuf+Rpgdu/Th62Y3EhxdxRqk7vGQsznFEqqqWgYphy57TT53tXf1P1+z mRCw== X-Gm-Message-State: AJIora9saBj6lj5f+A9QQBwEfZdbcC/BUoPh3n21KxcpdoWJIZYV05g9 DvS//YM3oSw+PgYatzu1a9TRBWhLZoIXZA== X-Google-Smtp-Source: AGRyM1usv0Z+sVaIUtHKgIZkz4fNn+l1Oj0uuFHRYxL7C6ndE3l22PGSvL+/xPXKO3AP28ye5HOkXA== X-Received: by 2002:a05:6000:c3:b0:21e:e081:4cc4 with SMTP id q3-20020a05600000c300b0021ee0814cc4mr1566620wrx.93.1658937416029; Wed, 27 Jul 2022 08:56:56 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: mst@redhat.com, =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH v1 2/5] hw/virtio: incorporate backend features in features Date: Wed, 27 Jul 2022 16:56:50 +0100 Message-Id: <20220727155653.3974426-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220727155653.3974426-1-alex.bennee@linaro.org> References: <20220727155653.3974426-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42f.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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1658938011814100001 There are some extra bits used over a vhost-user connection which are hidden from the device itself. We need to set them here to ensure we enable things like the protocol extensions. Currently net/vhost-user.c has it's own inscrutable way of persisting this data but it really should live in the core vhost_user code. Signed-off-by: Alex Benn=C3=A9e Message-Id: <20220726192150.2435175-7-alex.bennee@linaro.org> --- hw/virtio/vhost-user.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index 75b8df21a4..1936a44e82 100644 --- a/hw/virtio/vhost-user.c +++ b/hw/virtio/vhost-user.c @@ -1460,7 +1460,14 @@ static int vhost_user_set_features(struct vhost_dev = *dev, */ bool log_enabled =3D features & (0x1ULL << VHOST_F_LOG_ALL); =20 - return vhost_user_set_u64(dev, VHOST_USER_SET_FEATURES, features, + /* + * We need to include any extra backend only feature bits that + * might be needed by our device. Currently this includes the + * VHOST_USER_F_PROTOCOL_FEATURES bit for enabling protocol + * features. + */ + return vhost_user_set_u64(dev, VHOST_USER_SET_FEATURES, + features | dev->backend_features, log_enabled); } =20 --=20 2.30.2 From nobody Sat May 18 23:55:06 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1658938227; cv=none; d=zohomail.com; s=zohoarc; b=CeKsXY+uqqQNey3SSTtKEpJSuOrFeEF4makrafIz4qao4NK0GcGdeEV1Um/+TAF0NDP+LfUpW4Jy6ZugB4J5ReTXAXVYQeBliuAFX2Vk9PchGoksUtPvnwGOB/EZjKgUrvW40craN9abYfdF+veq1c9VzwnwiOcT5Z5eowAH6wE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658938227; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=s3nGxeo53LwaMo+sziN/l2Vq3ARUUV/BFGaJ8lB68So=; b=eRzDqOOE7mbwxm8mATa1SASY/YKSMPtSzn4nJXzcY1ZyJzEYmmAGo0RyChexLQqQyd9Q8pG2689II4lAXPznvps7lGehtEe23j64bPUpErWV+3HRsX2pkpF1QpYcWjvsyB+nhuq3vifPiQTgZ9JR0MujkdZXwji/HBIfdouYz7U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1658938227855356.95676111496425; Wed, 27 Jul 2022 09:10:27 -0700 (PDT) Received: from localhost ([::1]:42710 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oGjc9-0007N9-8b for importer@patchew.org; Wed, 27 Jul 2022 12:10:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45600) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oGjPC-00025n-Bc for qemu-devel@nongnu.org; Wed, 27 Jul 2022 11:57:02 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:45612) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oGjPA-0001sf-MK for qemu-devel@nongnu.org; Wed, 27 Jul 2022 11:57:02 -0400 Received: by mail-wr1-x42e.google.com with SMTP id v13so17284387wru.12 for ; Wed, 27 Jul 2022 08:57:00 -0700 (PDT) Received: from zen.linaroharston ([185.81.254.11]) by smtp.gmail.com with ESMTPSA id r8-20020adfdc88000000b0021e13efa17esm17254702wrj.70.2022.07.27.08.56.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Jul 2022 08:56:55 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A3A391FFBB; Wed, 27 Jul 2022 16:56:53 +0100 (BST) 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=s3nGxeo53LwaMo+sziN/l2Vq3ARUUV/BFGaJ8lB68So=; b=MPXPZjDPRWub//Lbn5Vl/VWbjqy0626GIuRBfMBkJiE5lCqJA48YGwDM8c9BY8u4cl FRIx5Z7Ns30kG8v5HYbAHgzJRSKwFEXCe+EUmrfhWqODXOXysLIo3dGWelPIk3Hv15HF aMeCQJChIFkuMBtAfa8qntLcctZ8o/izXobOHshci31ZknqsM5WBkwpzw4nwhNA3hIrm llMMU4GPNJrsI49xqthkB13FyX0wwbhivUc1JgzKI5+jFhQNLdYNs8uwMvCVG/l1UQua 7uIdOK8fU3l926gYAGmEjaOa5IgUvI/LcxTQ3VIreN3p2Sn85izstGxZ50hNB+yvKHgM XZhg== 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=s3nGxeo53LwaMo+sziN/l2Vq3ARUUV/BFGaJ8lB68So=; b=OmVN6U70SZe80vCB87iJVUs0HPKeUlu+OcYX/+ZDUJL68B70RJUNvNZL604ZC4NsTL X8yPvkvcMpS8WB//41qrj3v+ZArcx0+NZg++4eiiE1HweDKkjbdsFD3nfSDY3CVM+++F oif31hCTF/A30Em6Dx5YzDX9Ot+boevy8DnD9e5PIn3Bw4zxZUwT1abb4puOxpk75Wn1 EzS2gfy48F8UXR6xLV8UK83EC5LUXsmgBA34gqTTrndlMdqL17cbD+mqkUfiD7+YbpSc nE0h+6jFTt6rrJHzHvB/M2+FBZwX3s4/n47TEiDPFMj0sh5Oq+WoQSTH+Zm48uj5QnKv 3Pvg== X-Gm-Message-State: AJIora9eoSjulwC9ZO4OUEAqL5Xw8dTadu6gZeUAZRwEnYW9G+7JBceJ xfwmx/SJrIxi0goX2UhxSqHuDg== X-Google-Smtp-Source: AGRyM1vWjvf1oZvLhhLTBTzQUslYUO0lHfb36Xk+7zqOgakOhn8pNOPQfqCkPKC9Bz4V0PugHeCRfw== X-Received: by 2002:a05:600c:4f4f:b0:3a3:3cb5:c02d with SMTP id m15-20020a05600c4f4f00b003a33cb5c02dmr3642025wmq.198.1658937419222; Wed, 27 Jul 2022 08:56:59 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: mst@redhat.com, =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH v1 3/5] hw/virtio: gracefully handle unset vhost_dev vdev Date: Wed, 27 Jul 2022 16:56:51 +0100 Message-Id: <20220727155653.3974426-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220727155653.3974426-1-alex.bennee@linaro.org> References: <20220727155653.3974426-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42e.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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1658938228843100001 I've noticed asserts firing because we query the status of vdev after a vhost connection is closed down. Rather than faulting on the NULL indirect just quietly reply false. Signed-off-by: Alex Benn=C3=A9e Message-Id: <20220726192150.2435175-8-alex.bennee@linaro.org> --- hw/virtio/vhost.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index 0827d631c0..f758f177bb 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -306,7 +306,7 @@ static inline void vhost_dev_log_resize(struct vhost_de= v *dev, uint64_t size) dev->log_size =3D size; } =20 -static int vhost_dev_has_iommu(struct vhost_dev *dev) +static bool vhost_dev_has_iommu(struct vhost_dev *dev) { VirtIODevice *vdev =3D dev->vdev; =20 @@ -316,8 +316,12 @@ static int vhost_dev_has_iommu(struct vhost_dev *dev) * does not have IOMMU, there's no need to enable this feature * which may cause unnecessary IOTLB miss/update transactions. */ - return virtio_bus_device_iommu_enabled(vdev) && - virtio_host_has_feature(vdev, VIRTIO_F_IOMMU_PLATFORM); + if (vdev) { + return virtio_bus_device_iommu_enabled(vdev) && + virtio_host_has_feature(vdev, VIRTIO_F_IOMMU_PLATFORM); + } else { + return false; + } } =20 static void *vhost_memory_map(struct vhost_dev *dev, hwaddr addr, --=20 2.30.2 From nobody Sat May 18 23:55:06 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1658937623; cv=none; d=zohomail.com; s=zohoarc; b=XLQnmfJkSIiZ1zyhM9P52J2KjR6uCtRnK++COir1x9Sse9o6I3ORcT/dVXwAlG8Vu6ZI8PgZkFCnOgcVyoWjZVvHvjlqdM6XAbtZ5UYkyQX4CYrG0/VdlRB0ITEVKcthLdBsuOOU246iu9sLd9hGPpZwAtBmzMTxwWKNUbZ+Io4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658937623; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=qn9sIffAzV9IF+yjjzIzifr78tit+1ZOBIt0UyqO2Rk=; b=fuYa5oYxaZ2eaw5+4iUiWU/f2f1zOMFAvW8OP5KjdPjBOO4hnNBZtOnxLELhjgZQPWlduTjbtKsAy0KOdhHw1ZIg0VXP83Jd59gm3JVWXf7b1NaugNFlG6r8cpCy4bx5+UaUO8RTIxKeoeyVcO8OFeQpxplT1jsxlfIQD9C23ro= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1658937623631661.5504020579451; Wed, 27 Jul 2022 09:00:23 -0700 (PDT) Received: from localhost ([::1]:56906 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oGjSO-00065C-KR for importer@patchew.org; Wed, 27 Jul 2022 12:00:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45618) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oGjPE-0002Bw-BK for qemu-devel@nongnu.org; Wed, 27 Jul 2022 11:57:04 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:41501) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oGjPC-0001rq-RS for qemu-devel@nongnu.org; Wed, 27 Jul 2022 11:57:04 -0400 Received: by mail-wr1-x42b.google.com with SMTP id q18so14644483wrx.8 for ; Wed, 27 Jul 2022 08:57:02 -0700 (PDT) Received: from zen.linaroharston ([185.81.254.11]) by smtp.gmail.com with ESMTPSA id w10-20020adfde8a000000b0021e50971147sm17337016wrl.44.2022.07.27.08.56.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Jul 2022 08:56:56 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id AF42E1FFBC; Wed, 27 Jul 2022 16:56:53 +0100 (BST) 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=qn9sIffAzV9IF+yjjzIzifr78tit+1ZOBIt0UyqO2Rk=; b=ut+JAknea4rQt9AKGfQscWuPNlJ6r1xiDhvUbLU1irq2wMhyqw0J6JTlsIm8sCwYNZ xVnsEePP1haEDvHRCDen/zl/IUYGZYnfyO6BZQbhFU0sJ/8CJx7lugHh6+u2m9GxwlO7 Oq311eBRM2KHU2Kn4UfCfdzrZkkaRdMNwYqf+ztGiC+C25BYvg7eIeAj79/WH+DF15Yd OPwgmElW9+SEJSzeg7UdRA8Rrfz5wR25EAhgrDOk79Q4siMpzit60v2Uxuhf8hd54KtO ha4+geR57RIr6GATMS6hjtitUZpZTuyFPhLHIrpQUsoxomHgQt1iwEwd/20D/+vax/vY gPXw== 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=qn9sIffAzV9IF+yjjzIzifr78tit+1ZOBIt0UyqO2Rk=; b=1AODFBYCMqMwqVkbQBpnsTIxEErO00bp/G+wHI0gtXQnotOKqyKmO5bImpvNaeB4bg I+my12GErKPH9gijvKpH1BMJcK3F6IbjzLk2fmhewkUzss0W7EuDa8Q2Zx0AltFFf1xh lGE5SnGNAGmqOxawSxdNV6zkKQBsJVNnc5AUolLz7UkH2J2xmsEgdVlYgL00jni0fwH3 TyuHwB0BDSLNIFd5IU6YzUSh94yDK8bs4SSUzV7n7whlJe2Y4LH9Kk7i2SRHpRJPhhp3 yx7o1WPLlGbBQ+qngvJvTfpoe1k17wvjHNxTeTi6iGnA623zzBtp5wvcZSy6Ze613Xda pLYA== X-Gm-Message-State: AJIora9AS9fdGqJwANw5UlHPAYwBwpmUEviZKjS18z9igt/lhGoqNvFf dq6NI9+lwJjFif/N60iDuxPjMQ== X-Google-Smtp-Source: AGRyM1uqX+yN5pThZf/4NHdNj940Px3JypPsXfOEnq7L3z5179bBFpB7i0FMdUc05PuRRhm5pIvFQg== X-Received: by 2002:a05:600c:4110:b0:3a3:33cd:3984 with SMTP id j16-20020a05600c411000b003a333cd3984mr3560159wmi.128.1658937422182; Wed, 27 Jul 2022 08:57:02 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: mst@redhat.com, =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH v1 4/5] hw/virtio: handle un-configured shutdown in virtio-pci Date: Wed, 27 Jul 2022 16:56:52 +0100 Message-Id: <20220727155653.3974426-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220727155653.3974426-1-alex.bennee@linaro.org> References: <20220727155653.3974426-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42b.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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1658937624561100001 The assert() protecting against leakage is a little aggressive and causes needless crashes if a device is shutdown without having been configured. In this case no descriptors are lost because none have been assigned. Signed-off-by: Alex Benn=C3=A9e Message-Id: <20220726192150.2435175-9-alex.bennee@linaro.org> --- hw/virtio/virtio-pci.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index 45327f0b31..5ce61f9b45 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -996,9 +996,14 @@ static int virtio_pci_set_guest_notifiers(DeviceState = *d, int nvqs, bool assign) =20 nvqs =3D MIN(nvqs, VIRTIO_QUEUE_MAX); =20 - /* When deassigning, pass a consistent nvqs value - * to avoid leaking notifiers. + /* + * When deassigning, pass a consistent nvqs value to avoid leaking + * notifiers. But first check we've actually been configured, exit + * early if we haven't. */ + if (!assign && !proxy->nvqs_with_notifiers) { + return 0; + } assert(assign || nvqs =3D=3D proxy->nvqs_with_notifiers); =20 proxy->nvqs_with_notifiers =3D nvqs; --=20 2.30.2 From nobody Sat May 18 23:55:06 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1658937713; cv=none; d=zohomail.com; s=zohoarc; b=CnX0Kg76v89NpKzoC+v1CPecR9zZ/A+CfAAWh7Vm2seEc2EhyMKT1iIUbCerSv/qPBQXzWCKAVRecVDfus5w+GmV+Fjo5q7Uvhmb919PPxyriTc56THUhSG964Y8MHwqc9HTgoXph3H+93I5lNvP5hz31VFXMUV9SD+e8tNpDo4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658937713; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=4eDTMZuplKv3vlzOJLUiGIKcACQb4M3CCNXBulI4W+E=; b=YcYsAyNqiabVQpcFHZwC02KGb6Wg6HGwjBHJnVnxUyfGucie/HQWv5zq+wGX06d0NfdcQvUzDwNkyyQf94X+v12eq58lg6O1wEl/py1PYO8bPfxvC/GUkmZB7HGwO21eQ4AecJCwW2mQWoggjUM7iUCGwDAV7UI7W1+dIzv6/1Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1658937713360623.9791428838229; Wed, 27 Jul 2022 09:01:53 -0700 (PDT) Received: from localhost ([::1]:57972 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oGjTs-0006oi-C0 for importer@patchew.org; Wed, 27 Jul 2022 12:01:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45636) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oGjPF-0002I1-S5 for qemu-devel@nongnu.org; Wed, 27 Jul 2022 11:57:05 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:41510) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oGjPE-0001tW-Ar for qemu-devel@nongnu.org; Wed, 27 Jul 2022 11:57:05 -0400 Received: by mail-wr1-x433.google.com with SMTP id q18so14644590wrx.8 for ; Wed, 27 Jul 2022 08:57:03 -0700 (PDT) Received: from zen.linaroharston ([185.81.254.11]) by smtp.gmail.com with ESMTPSA id p12-20020a05600c23cc00b003a2c67aa6c0sm3075944wmb.23.2022.07.27.08.56.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Jul 2022 08:57:01 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id C5DC31FFBD; Wed, 27 Jul 2022 16:56:53 +0100 (BST) 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=4eDTMZuplKv3vlzOJLUiGIKcACQb4M3CCNXBulI4W+E=; b=YvWVUPI3vG9fbc0RtpFuSD3OiJxdNxsB03LeOtR+JfYT+ou1Jni6Oykt736WkS9rRz 2HWD6oY9q+3sFLwEfpf2Ux2pNXbA5ujf8CyU56F15RzQubJC5XugJ5X4gC8/zmp+h3r+ Ymj9MjjxMn7G0IfZe3/SJXzROhlQaRQEhHuMqBIQB0dXTYwESVFFBZM9gccAJWDfvJuY KzFpe8gVCZFl+KpyAMaMQ2OseO2axhYyKBnXdYaJ2BT5cpYtp+oIK39+Y8ThmuZGG99h yGunOxqyemX/v8rviTiJuTNPgnn8+bpihV4UrcRsLJLmxbDoHuZnrsv3pyCBePMD3WJR 2apA== 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=4eDTMZuplKv3vlzOJLUiGIKcACQb4M3CCNXBulI4W+E=; b=dB+Hyq2cIWDJMh6/2FghjlHLvnx30XFwaLrzaN4LxLfnt3AHfUjUUdZWOJbzNkPKqg tzhsX5gJnv1bX50Y7mWpvpuw4Y1cXleXwke4VOr/R/AHukmlybRFs701FxK6Iztyb1xq TWaNtOL7YNir7xk38PUYxBfx89s8aDURe+ctagqInnVE0PK9//+sQ8J/q9Hn8FAyzwFg 8oGqbY344SdT3i8yZxLcpqHNiMyCZJS7UHJM3z+BFIEGJySz/BTvqs9E44Yh+ZXbutK8 Xl9HMSJv/L6OCmwal6d4TI/z5G69Oi3jX23tE9imPd8/cYC4al73KG9nGyx/gOEJa4JP MMew== X-Gm-Message-State: AJIora8bdMd+85htVaIeKrnT/p4HFOq+kMqzG90zONPWXFMPpTO201rz aWgBhOy/zyA4yxFnHriRuUGfew== X-Google-Smtp-Source: AGRyM1sVVUbJ3P3x8nfP2DxMMPeYsm3jKKPyxg5VDB1oFfq3GWVTdf5gDSUNliXPNmMIKjJIEO+0gA== X-Received: by 2002:a05:600c:1d1b:b0:3a3:e2:42d1 with SMTP id l27-20020a05600c1d1b00b003a300e242d1mr3511625wms.137.1658937422833; Wed, 27 Jul 2022 08:57:02 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: mst@redhat.com, =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH v1 5/5] hw/virtio: fix vhost_user_read tracepoint Date: Wed, 27 Jul 2022 16:56:53 +0100 Message-Id: <20220727155653.3974426-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220727155653.3974426-1-alex.bennee@linaro.org> References: <20220727155653.3974426-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x433.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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1658937715201100001 As reads happen in the callback we were never seeing them. We only really care about the header so move the tracepoint to when the header is complete. Fixes: 6ca6d8ee9d (hw/virtio: add vhost_user_[read|write] trace points) Signed-off-by: Alex Benn=C3=A9e Message-Id: <20220726192150.2435175-10-alex.bennee@linaro.org> --- hw/virtio/vhost-user.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index 1936a44e82..c0b50deaf2 100644 --- a/hw/virtio/vhost-user.c +++ b/hw/virtio/vhost-user.c @@ -295,6 +295,8 @@ static int vhost_user_read_header(struct vhost_dev *dev= , VhostUserMsg *msg) return -EPROTO; } =20 + trace_vhost_user_read(msg->hdr.request, msg->hdr.flags); + return 0; } =20 @@ -544,8 +546,6 @@ static int vhost_user_set_log_base(struct vhost_dev *de= v, uint64_t base, } } =20 - trace_vhost_user_read(msg.hdr.request, msg.hdr.flags); - return 0; } =20 --=20 2.30.2