From patchwork Wed Jul 27 15:56:49 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: 593745 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:b345:0:0:0:0 with SMTP id w5csp466646maz; Wed, 27 Jul 2022 08:58:52 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tQQJIhJXDkjkjGktk1mqiwS7ME+F8ruUb5hkP1nG03Q8/4vy+dRUkqhGPWdGj23E5hP1xk X-Received: by 2002:a05:620a:2490:b0:6b5:fa36:c7dc with SMTP id i16-20020a05620a249000b006b5fa36c7dcmr17175229qkn.223.1658937532688; Wed, 27 Jul 2022 08:58:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658937532; cv=none; d=google.com; s=arc-20160816; b=VUxfzGk3UBZ78apYdBTDAg0ReXxicg56YVjVsCBdsCHYldaPMbWdg5ORCudUIo9S4Q 9rYWE3xhxSB+26yX5HFEv5HWafwBxj20NAUmuWkVHaZBAMhXETRxyZKda/EmwhMjQ8pY d6dgMk5Ak53/pUC65u0upfCRGKlkG3NQwEVZGn3Wtf/W2Rk9/2sxSP9+CQT6DS1o57zl IJMWoUssiO5r6qDteyagPPrch5mG1S2P8nCNVAybgZ+2lS11mldu6qbz9XBlkSH3sIOr L/jB4LQVNXUX0TdKO/ShdiP7Em58lHms5iAhIosXd01WZ4mgVEjcMtT7Y4/kSh2ThwoC insw== 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=9mEcK4sO4rPCFZLLkHp1PXNwdldjaLtha6aYBrlBQcI=; b=YX+C1QBkiJr1wiu4FFXBS24mcxAlxDguYkyAX3E+a/FOKvRcaQmbdFXRyldBL/qPcG tANjkd1cu9AidUc7+mxFoxXdTzVJiS+H3rUnEwWPyiDmZ0kZSZm93G59e6xkQ7QVFdEs Q0STH0nvwQDzBsc2Gv/RwZiWepGrcx79rW9oKi0QAH73SAo4lgNu+0qtYRIkIm0TPb4X ZG2GTJD3xWG6VTFJ0n03YeI7ebkDMYPuaWpJmVidVxrHIQusVZ2wF9NWfijYhtjXI7Pe BcI+kEwjmC31Q1/ZhsVqUb9ZE7hGiZ2JUtbys9fVJ5V/Hka9f1hNl4ftSDQ1IgdPM/db WEeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=f2h6jFQK; 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 t22-20020a05622a01d600b0031f2a4b508esi7173944qtw.128.2022.07.27.08.58.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Jul 2022 08:58:52 -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=f2h6jFQK; 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]:51164 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oGjQy-0002As-7n for patch@linaro.org; Wed, 27 Jul 2022 11:58:52 -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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: mst@redhat.com, =?utf-8?q?Alex_Benn=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 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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ée 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 ; if (!vexp->handler.writable) { features |= 1ull << VIRTIO_BLK_F_RO; From patchwork Wed Jul 27 15:56:50 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: 593748 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:b345:0:0:0:0 with SMTP id w5csp472995maz; Wed, 27 Jul 2022 09:03:39 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vrLcd5s/xL945Ro8ksuisyioIunccgu0sveyxNwFH1ApT6tgg/bFYheJ3OWkIyE9hIvZUq X-Received: by 2002:ac8:5c44:0:b0:31f:31b6:6c66 with SMTP id j4-20020ac85c44000000b0031f31b66c66mr15897848qtj.250.1658937819538; Wed, 27 Jul 2022 09:03:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658937819; cv=none; d=google.com; s=arc-20160816; b=pWhZwjzI7cCd9KyOxgy7Han32VhjUgASXSiQzVtRZ1zNC8CE85oxRHO7fY8meUw9TG zPzURN93vNvHSiQvFWm63f1etC0AfM4S3FcPGlguqphYiKSRiUf3JrQHA0La0uZQDTUZ WDxeyRDgUw7J9kiuBNLyCqfav3ki181GvYUG2GplGizRFbqRp5QWqS1/npx2ZTBqaMix 96fhO+xQdjlY5t/+22T0wk2rBxfrVbPYhziDiIR4qViOIq6GGvLkv7GF4rlTbKG6jsGQ 79BCzsYS6/H6QWALqmA2Zdn8A9TiA/F71cB7nBb+O4IcjS+BPlrCCgyuVdwDGQJYADg9 i9aQ== 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=WTel/fQ7Gj1d2ni3sryAwF0T/iksivK0kIXjy8395Xc=; b=zPeOuCEaj0AajR2VUapZW36ZkycHfDoLRDGguwf5Vg91Wo87MQesnI7TdP8u6kJdSV hFUNorEozJooOV+eXz10OtddK+eP+GdPUdo8TVwkblFRULg6lFKPc5u49oIYyqlXx8XI PmEDVqkhNx70k0mcPF5aklUbOUiS3vxqwsT+k59vGF5fwrRCoipCpV0JvTjOVxq1h7IY nczDUEqxXNtPjSEik8g7uMSiEObAvkdlfTFxIhHPNAB6t/ohWDySAk2XcAOQTGbnU5zQ aIn/tL6FZG7jlJLU+XqO8aVXCPjplVfvfRsyCBo01dEy+sZ+S18f8JcfwZFCorlbe+Tz lHyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ActJj0k3; 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 t3-20020a67a243000000b003572ebf7030si2110753vsh.326.2022.07.27.09.03.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Jul 2022 09:03:39 -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=ActJj0k3; 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]:59496 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oGjVZ-0007w4-Lp for patch@linaro.org; Wed, 27 Jul 2022 12:03:38 -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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: mst@redhat.com, =?utf-8?q?Alex_Benn=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 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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ée 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 = features & (0x1ULL << VHOST_F_LOG_ALL); - 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); } From patchwork Wed Jul 27 15:56:51 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: 593749 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:b345:0:0:0:0 with SMTP id w5csp479457maz; Wed, 27 Jul 2022 09:09:37 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vYdBzEhFHlzm/P3ENT/YMvv6P8rMYF4+b2tYQxIaP9im9MqQSM7SskAHoFS3D8+3WOrHt0 X-Received: by 2002:a67:bc10:0:b0:358:5fbd:79e7 with SMTP id t16-20020a67bc10000000b003585fbd79e7mr4947977vsn.24.1658938177373; Wed, 27 Jul 2022 09:09:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658938177; cv=none; d=google.com; s=arc-20160816; b=dBXR1+oGGmjZ+CkEGZdBlh1k0tFaV5HSXQ1fC47UNtxPKzTzmSL3Iu/O1fyiYiXb57 Ros1fYcUgBUINlos5Cob1406rTwZ6cYTkeBbyzHajCuJqiR9oJV10ORwfEfniaftKnqH gpsai0NS4JKBcTaNQ8tXt+sgI9OGgM9OpEujIJiKHY2ZcbXZbgl2c4yJLPoWcOoD7ijI g8Ey7bRJ25tZk/gI1r7LxBhq44REA47igTVR5rTjiWXlCXiQ5E9p+RgTK8Smio0D8RV+ mNrYlCpg/D8bNxwatFNEovHGxbR72ulbrRqT5c6fh5qS9+RqTWK4asBp/kT7QionJK87 Ck/Q== 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=s3nGxeo53LwaMo+sziN/l2Vq3ARUUV/BFGaJ8lB68So=; b=eOPky/xbpeGZMpQBZ6Zok/5phv1cvKNON4GavaNPAYBPCH+XB7Ui6wbiVELxjx36vJ C7ljALLK/H1rFbGoBcn1eQ+ugrUAqpum95c9n5tyiWUpJvnQvTTKaLmpnIBK67ReNbWa bPbk4r75tsipJ6KW9XLpJv/sf/UBYnUa1nLekB/V+XlJkY/DC/PjLpD86erFXypp4+HU W6jBWL/HwjiqP2oeSuDZrd/338+sZRUhX9sLNcVo1u4A426i3fWUkexGSh+AQ2TwIB7v YoXaaqIJt865yMlaR+bQsXprg+CCVOVKZigsoIS/KJtAowCOXORna5RLQHBffT238z2e 5Hdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MPXPZjDP; 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 v63-20020a676142000000b003586d3bea81si754272vsb.357.2022.07.27.09.09.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Jul 2022 09:09:37 -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=MPXPZjDP; 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]:39822 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oGjbM-0005QI-Su for patch@linaro.org; Wed, 27 Jul 2022 12:09:36 -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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: mst@redhat.com, =?utf-8?q?Alex_Benn=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 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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ée 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_dev *dev, uint64_t size) dev->log_size = size; } -static int vhost_dev_has_iommu(struct vhost_dev *dev) +static bool vhost_dev_has_iommu(struct vhost_dev *dev) { VirtIODevice *vdev = dev->vdev; @@ -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; + } } static void *vhost_memory_map(struct vhost_dev *dev, hwaddr addr, From patchwork Wed Jul 27 15:56:52 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: 593746 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:b345:0:0:0:0 with SMTP id w5csp466893maz; Wed, 27 Jul 2022 08:59:13 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vVxvx03yu9ZC8DzK6aQdafmfqr2A95Fsv9pTGBnH+zj7/FW7HHlzGrAgrSEnQjdGwFH9kn X-Received: by 2002:a05:622a:548:b0:31f:4f8b:78fe with SMTP id m8-20020a05622a054800b0031f4f8b78femr903379qtx.546.1658937553309; Wed, 27 Jul 2022 08:59:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658937553; cv=none; d=google.com; s=arc-20160816; b=S2Bkl3+u8tG6YaPZw/x8IJ9/qNMUDwrOdyPXP31H+QXp7uLp+PXgHE/yfpOkusgkQV yoXtzfvq2y4TCiPYfc3ei4BHr2GoL70eudc6eVvDiDwoYyFUnf3UCtWW8FPzA8KrBHnY md+NrzTH2SrDGbX96z5wDNsCQ3jgMHYWeo9kbPCHi4KQL7pYmRcPrkuOVd7vPisnSZTV ecICdF99N7fW8fOFokjPJa07aYqP6oSVQ1oHob2y1e+9QE7PBpEHZI9Phq4PeMxL/xyx rimBfor/FUCzNQfN7jLZsInT0ggqh890DcPulzLMrDg7YynvAIzo0LJfsoS0qgE4IJkC tlQg== 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=qn9sIffAzV9IF+yjjzIzifr78tit+1ZOBIt0UyqO2Rk=; b=grDNI06yATsB0fZEYgcLGoKx5NhUENZVj9Lbz94aIkjH5C0iSI5wXCLk5Q75X4qdeK OSfNFxAyJByDmO2E3AAxxxQeFHM3xLLqNcqj3zNlo9i4KaUaxCBnSEGmc9YnCWb8Fjxo khU5FQ9mUxe0N7JhdDvW6jXAiZ0t1AHuw057smTx4VFHMRRi3RrSexQ/TM9r2z456bJM WjBqb9SIjjrtqhsULUZNn5USMmgAxePIt5CCVM0NCmSeQnSTpO1S4x3VWltaEdd1GHyA IJ0B0AJ1b973UOWKVUV+7AMTdGTT5fPBePVNSu05a+MvB+tBL6Mof0b06NxhX9h3V8Y3 8gfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ut+JAkne; 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 bp16-20020a05620a459000b006b5b1e8431fsi12349026qkb.745.2022.07.27.08.59.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Jul 2022 08:59:13 -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=ut+JAkne; 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]:52904 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oGjRI-0003NS-R4 for patch@linaro.org; Wed, 27 Jul 2022 11:59:12 -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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: mst@redhat.com, =?utf-8?q?Alex_Benn=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 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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ée 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) nvqs = MIN(nvqs, VIRTIO_QUEUE_MAX); - /* 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 == proxy->nvqs_with_notifiers); proxy->nvqs_with_notifiers = nvqs; From patchwork Wed Jul 27 15:56:53 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: 593747 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:b345:0:0:0:0 with SMTP id w5csp467113maz; Wed, 27 Jul 2022 08:59:33 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sj/B4q/OQwn6jSJT3j3rX7hkq8DKJxHeafoqmkZkInvc3nNXxPTm6VcowxpGBPtG4IlgVu X-Received: by 2002:ae9:e704:0:b0:6b5:6bb9:48c3 with SMTP id m4-20020ae9e704000000b006b56bb948c3mr17325234qka.618.1658937573036; Wed, 27 Jul 2022 08:59:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658937573; cv=none; d=google.com; s=arc-20160816; b=RYc8fzts9mVyadYhSeeLhZmSLNb9iw2JNqIlzdyuEtnA9nME+GBqDSWzDPSa3Fg6Fc oPw/ia9hBZ6pAX8pbcMc/3SVbRIAEPSlmUf5LnLvRhru/hhzTLap5h0cPOJu2+KjmrtG 7+UhkbJVSmEyh1q9yfMjoiNEGCWePyxNUho6DMB0aTA9EdEMY9AyuF0O68fxqQqTyTVP yE9/9IHd9/rr4WEkWq8Qp/o40qjkYcPdXR/+l6BEha2l05wMxxoJdOeBTFmqNGgN6SW5 ICtLB1a32j9Lgf4r3qYM7DEU5HXNhJczDI0LBnEiwMNHJKWOfk0jDnMhigq5HrMPv7eo sbIw== 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=4eDTMZuplKv3vlzOJLUiGIKcACQb4M3CCNXBulI4W+E=; b=Kz2Vhgr9ShvtKqg9cWIITb0mVYXM8GrzTn4KJZqOo8zMck6d9T3w7i2ZQXAlChmPGg Yrf84MG3P2ABl8XqDT1KCzdLRJtr4VVfkaIl9z4pzqHeaJOc38EYMfRKnIUfMkPhMsDN VKQnI/WGbIE3Dp1lSlwd4DGqGlrwxFF0dhSG9Vv5ysMUo8PcGV2hKNKWa/oBf68iCGUJ +cyRNWkKuoAo+oxVAMDLThGLE8w17bx+NMt+pX9mvdUrnB0lmSUnpDcUZGQFaDCuXnHA qP7Ky1Sw7v/Z7RhMw5FdJDesUPnFzEzJuff7uZSE6n/KpkCjZSgcT61wweSf8m0nkPW0 u4rQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YvWVUPI3; 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 x205-20020a3763d6000000b006b1a15e4db6si9329650qkb.190.2022.07.27.08.59.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Jul 2022 08:59:33 -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=YvWVUPI3; 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]:53990 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oGjRc-00046g-KR for patch@linaro.org; Wed, 27 Jul 2022 11:59:32 -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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: mst@redhat.com, =?utf-8?q?Alex_Benn=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 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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ée 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; } + trace_vhost_user_read(msg->hdr.request, msg->hdr.flags); + return 0; } @@ -544,8 +546,6 @@ static int vhost_user_set_log_base(struct vhost_dev *dev, uint64_t base, } } - trace_vhost_user_read(msg.hdr.request, msg.hdr.flags); - return 0; }