From nobody Sun Feb 8 12:42:49 2026 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1656393625411915.1099775336586; Mon, 27 Jun 2022 22:20:25 -0700 (PDT) Received: from localhost ([::1]:49674 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o63eB-0006Ep-Kx for importer@patchew.org; Tue, 28 Jun 2022 01:20:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41500) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o633o-0007my-9h for qemu-devel@nongnu.org; Tue, 28 Jun 2022 00:42:48 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:24669) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o633b-0006nQ-KQ for qemu-devel@nongnu.org; Tue, 28 Jun 2022 00:42:46 -0400 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-249-nr2UytLEPf-FbeDS67OXKQ-1; Tue, 28 Jun 2022 00:42:31 -0400 Received: by mail-wm1-f69.google.com with SMTP id k32-20020a05600c1ca000b0039c4cf75023so8316215wms.9 for ; Mon, 27 Jun 2022 21:42:31 -0700 (PDT) Received: from redhat.com ([2.52.23.204]) by smtp.gmail.com with ESMTPSA id w9-20020a5d6089000000b0020e5b4ebaecsm12341291wrt.4.2022.06.27.21.42.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jun 2022 21:42:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656391353; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=YLp/mOxNxnF8DObHBmdL/z0ALK0H7bOTQmMQTKlLt8Q=; b=eWBmjzvq0nBSRScWho9Jq0JdF1OKIxf71MVlwlBSetnRjn8RoKY8G4uKk9yJIh3Sx+cREJ ydWH4yO52nib2OUMqY1qJQnq7otCNzul/Totlz8EeDAPtWmV09InstXohgG8I7hXH+fKs2 gxjpHd3w7ITNabhuFwYaeJVajsRgDfo= X-MC-Unique: nr2UytLEPf-FbeDS67OXKQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=YLp/mOxNxnF8DObHBmdL/z0ALK0H7bOTQmMQTKlLt8Q=; b=RBw6JyQK0JA8bI4rQRIAzHjC/W15Rs1SLFkVkIrB4Y3/Ia28VyNhS+b9Gl1hpe2pc5 vGQrj0jKf6JKzFyA3nsagExEuazV5EAikVHM05UQlm1KRWkqbkqeNjKQGIlnPlDWgRwW i8eDFm3f0F7Yw+0guC5ovS4QVygykuuMICfK6JC0gC5CVnTbMgsoBs+30oWejZhLhZZ4 Zcmn6zNQQlx0OIBiUJRZvJLL+C+0LIkYqccXwIGa1BY5fNS5Yn442PPX70F16a7IRNLf ypI09Kpm9qW6tV+LbtXmK1mF5xr5uVJWesKA/Nl9Ijurkf2tnMvrGLuVme7LpPM/T0LH 9FqQ== X-Gm-Message-State: AJIora+lCIB9N08jK3HxJiTzsNx8vyNh7uE25/jreSw+Tru6Y4CP2Zsr 9LBDdSrsTdbyrIdo6oHS0mX2QlisIqSV4DxxkOU4NBjM8lIz95xvSR1yXpNEhIvSGI2pPSfc8Pq SJKJLC73jTu/1dNcuqgi7d3ycu7LvHoh3x6NLWa1DbITzEtwvxvd0/djx8nHC X-Received: by 2002:a5d:59a4:0:b0:218:4a29:f12b with SMTP id p4-20020a5d59a4000000b002184a29f12bmr14812326wrr.145.1656391350415; Mon, 27 Jun 2022 21:42:30 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tBnMmDxviq/tnboUWtDs7Pw8mOVebCD+6EONITBiEpSCNZGjEX3AYdnfiCHHmVObM97mdz2A== X-Received: by 2002:a5d:59a4:0:b0:218:4a29:f12b with SMTP id p4-20020a5d59a4000000b002184a29f12bmr14812303wrr.145.1656391350097; Mon, 27 Jun 2022 21:42:30 -0700 (PDT) Date: Tue, 28 Jun 2022 00:42:27 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Zhenzhong Duan , Jean-Philippe Brucker , Eric Auger Subject: [PULL 01/12] virtio-iommu: Fix the partial copy of probe request Message-ID: <20220628044201.217173-2-mst@redhat.com> References: <20220628044201.217173-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220628044201.217173-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, 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 @redhat.com) X-ZM-MESSAGEID: 1656393627304100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Zhenzhong Duan The structure of probe request doesn't include the tail, this leads to a few field missed to be copied. Currently this isn't an issue as those missed field belong to reserved field, just in case reserved field will be used in the future. Changed 4th parameter of virtio_iommu_iov_to_req() to receive size of device-readable part. Fixes: 1733eebb9e75b ("virtio-iommu: Implement RESV_MEM probe request") Signed-off-by: Zhenzhong Duan Message-Id: <20220623023152.3473231-1-zhenzhong.duan@intel.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Jean-Philippe Brucker Reviewed-by: Eric Auger --- hw/virtio/virtio-iommu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/virtio/virtio-iommu.c b/hw/virtio/virtio-iommu.c index 7c122ab957..08b227e828 100644 --- a/hw/virtio/virtio-iommu.c +++ b/hw/virtio/virtio-iommu.c @@ -675,11 +675,10 @@ static int virtio_iommu_probe(VirtIOIOMMU *s, =20 static int virtio_iommu_iov_to_req(struct iovec *iov, unsigned int iov_cnt, - void *req, size_t req_sz) + void *req, size_t payload_sz) { - size_t sz, payload_sz =3D req_sz - sizeof(struct virtio_iommu_req_tail= ); + size_t sz =3D iov_to_buf(iov, iov_cnt, 0, req, payload_sz); =20 - sz =3D iov_to_buf(iov, iov_cnt, 0, req, payload_sz); if (unlikely(sz !=3D payload_sz)) { return VIRTIO_IOMMU_S_INVAL; } @@ -692,7 +691,8 @@ static int virtio_iommu_handle_ ## __req(VirtIOIOMMU *s= , \ unsigned int iov_cnt) \ { \ struct virtio_iommu_req_ ## __req req; \ - int ret =3D virtio_iommu_iov_to_req(iov, iov_cnt, &req, sizeof(req)); \ + int ret =3D virtio_iommu_iov_to_req(iov, iov_cnt, &req, \ + sizeof(req) - sizeof(struct virtio_iommu_req_tail));\ \ return ret ? ret : virtio_iommu_ ## __req(s, &req); \ } --=20 MST From nobody Sun Feb 8 12:42:49 2026 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1656397949764155.82498005245816; Mon, 27 Jun 2022 23:32:29 -0700 (PDT) Received: from localhost ([::1]:58930 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o64lw-0008Ie-OV for importer@patchew.org; Tue, 28 Jun 2022 02:32:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41476) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o633k-0007fN-In for qemu-devel@nongnu.org; Tue, 28 Jun 2022 00:42:44 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:21987) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o633h-0006p5-1i for qemu-devel@nongnu.org; Tue, 28 Jun 2022 00:42:43 -0400 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-369-ED25ewKCM7GCinrWMNmHpA-1; Tue, 28 Jun 2022 00:42:35 -0400 Received: by mail-wm1-f71.google.com with SMTP id o28-20020a05600c511c00b003a04f97f27aso1086383wms.9 for ; Mon, 27 Jun 2022 21:42:35 -0700 (PDT) Received: from redhat.com ([2.52.23.204]) by smtp.gmail.com with ESMTPSA id h6-20020adffd46000000b0021b96cdf68fsm12205741wrs.97.2022.06.27.21.42.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jun 2022 21:42:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656391357; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=rsJM2XN1k5xLdA4WoRw6Yh/T9zUNL7IrEHO/2qKbDbs=; b=YRn2wZN9SStIVGJ6iuEssRpUltERM0W8apWdI5YWHYBzWIFf1DDMmdUdIbYHz5uFVMflkV QHO8I3h4EljWQuI2F+bfkAZMYYXXwKgdGst+PKh1tNVunhr4hpZ6cb1X3PAzFoGyuW8F2c Hm0pXXr8sfisrT9+1Wzw/VOG8QhJdQE= X-MC-Unique: ED25ewKCM7GCinrWMNmHpA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=rsJM2XN1k5xLdA4WoRw6Yh/T9zUNL7IrEHO/2qKbDbs=; b=P2MmAYLXklgoLm5KcJQmLQVx4AXlZ637jfkPwWVIRoKDMbgAD5DNPeeRTSDr4BXJm1 7n6kcvO1na5K1qkSnHYS5Vt/wKfuiOmsvfmyVk8dfQoLSKE2Fw1hnm0WLZedN9db/vWn NuGLEFJpx6NsnZMJKPS71stCzTswZla+bUXIHtc3lOWI3dcwIZLNODBB8wfhewKgvORs Za4fLgx1BOSeLWhV/lF5AV1C1W8T7+ggmDWROmOOo4bVKwrSDFic5stLUgRuHWN7SpjN xW/x6YQ7NdcxixX7XLlLuuPb6hvyafxFBCYNY2AhxmVAD7n4wiM38g7MAC/dBVQM3v+t xZeA== X-Gm-Message-State: AJIora8PdOcX1YqvtJCYBLuzb+ylMH3HnagUuv59SHB3JiA2XCf8cWws tO5OUjKur6TMCAfpNeXeggjSoAobMLZCA4zjStUQ19yqtMOmB1fVcpTciHVTn8UDodQnK12ZtYC cMQIJfdB7q83/ibCaAf8UtCvrhIG0mx8xsjbpvn3mad04of4T9cK2TgX96K8O X-Received: by 2002:a5d:5846:0:b0:21b:c444:9913 with SMTP id i6-20020a5d5846000000b0021bc4449913mr11574698wrf.128.1656391353857; Mon, 27 Jun 2022 21:42:33 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vu0Nflzc4Jnpn+LuoVvZFzkCDywq1wI1GzHq2Kcfcr1TF2qOv9jng9LPQbzxlvzx7GWQA1kw== X-Received: by 2002:a5d:5846:0:b0:21b:c444:9913 with SMTP id i6-20020a5d5846000000b0021bc4449913mr11574684wrf.128.1656391353636; Mon, 27 Jun 2022 21:42:33 -0700 (PDT) Date: Tue, 28 Jun 2022 00:42:30 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Jagannathan Raman , Stefan Hajnoczi , Marcel Apfelbaum Subject: [PULL 02/12] msi: fix MSI vector limit check in msi_set_mask() Message-ID: <20220628044201.217173-3-mst@redhat.com> References: <20220628044201.217173-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220628044201.217173-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, 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 @redhat.com) X-ZM-MESSAGEID: 1656397951834100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Jagannathan Raman MSI supports a maximum of PCI_MSI_VECTORS_MAX vectors - from 0 to PCI_MSI_VECTORS_MAX - 1. msi_set_mask() was previously using PCI_MSI_VECTORS_MAX as the upper limit for MSI vectors. Fix the upper limit to PCI_MSI_VECTORS_MAX - 1. Fixes: Coverity CID 1490141 Fixes: 08cf3dc61199 vfio-user: handle device interrupts Signed-off-by: Jagannathan Raman Message-Id: <20220623153844.7367-1-jag.raman@oracle.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Stefan Hajnoczi --- hw/pci/msi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/pci/msi.c b/hw/pci/msi.c index 5c471b9616..058d1d1ef1 100644 --- a/hw/pci/msi.c +++ b/hw/pci/msi.c @@ -322,9 +322,9 @@ void msi_set_mask(PCIDevice *dev, int vector, bool mask= , Error **errp) bool msi64bit =3D flags & PCI_MSI_FLAGS_64BIT; uint32_t irq_state, vector_mask, pending; =20 - if (vector > PCI_MSI_VECTORS_MAX) { + if (vector >=3D PCI_MSI_VECTORS_MAX) { error_setg(errp, "msi: vector %d not allocated. max vector is %d", - vector, PCI_MSI_VECTORS_MAX); + vector, (PCI_MSI_VECTORS_MAX - 1)); return; } =20 --=20 MST From nobody Sun Feb 8 12:42:49 2026 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1656398422934548.490333040659; Mon, 27 Jun 2022 23:40:22 -0700 (PDT) Received: from localhost ([::1]:39526 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o64tZ-0006Rk-O8 for importer@patchew.org; Tue, 28 Jun 2022 02:40:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41484) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o633k-0007gS-Qq for qemu-devel@nongnu.org; Tue, 28 Jun 2022 00:42:44 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:54928) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o633h-0006pc-1Y for qemu-devel@nongnu.org; Tue, 28 Jun 2022 00:42:43 -0400 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-576-VJr4phEhMka0UNWYXIvFmA-1; Tue, 28 Jun 2022 00:42:38 -0400 Received: by mail-wr1-f72.google.com with SMTP id q15-20020a5d61cf000000b0021bc2461141so841863wrv.5 for ; Mon, 27 Jun 2022 21:42:38 -0700 (PDT) Received: from redhat.com ([2.52.23.204]) by smtp.gmail.com with ESMTPSA id id18-20020a05600ca19200b0039c871d3191sm11668511wmb.3.2022.06.27.21.42.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jun 2022 21:42:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656391360; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=n81oF0HqSDqpCv8m7EVTIj7PetZ5T/FjkogtpV7T6sg=; b=DS/DEF1Y40X0QiT0nL9OAQLUvwgFPq3MKSDp6h6lRC+SAudsjPIme1VPbKcRMn/M5sxlWd HasCApCWLjdhVj4ENvKwgfi+28cy8C+Y2TKjmJnKbniXUWh2xvsRn6oYMtEe8bRCFca9Ha Jo4PA8gjyXP4ubtpth3Fgw4nlpNkIU0= X-MC-Unique: VJr4phEhMka0UNWYXIvFmA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=n81oF0HqSDqpCv8m7EVTIj7PetZ5T/FjkogtpV7T6sg=; b=hgsNVa+U2Q2/w6bOo4axqA/wRXbVcqU0xDa8s0tzDjiAlQoYLYHdiCjTp8rQpu6KlJ 6u5WKOpnVHznuy5cA2iJJwUZfztPdvM1fXVWha2vJbOxASCtDk1DjI6h36XbWoPngcDn QAb4gWCs5QVd03lfmg+Wgjab2+tOd2WkYlA5bBF992YPj4V1mHIQgW8lCbaXaqgXpxvZ x1/Exa1LfUGj3z5HKblMvXvejZdP4/z6njvbn2V70mLGHmrsqzbjkck6wg1nD6rmw24p /uY8291Qn2AgI5UgfQpJ2EwieB+jUAiObNizo2e1E3dyocbqsLBQDweY9LPZ5KrcUJdt FcFg== X-Gm-Message-State: AJIora8Tf+5truZTSCAgEYOCuBDr/iyN3JDmunsS/iiLAN5/dw/y0xcr YXjQ/lzaiKMJsgcqmQrXAzWxG6W54EBfNir4+GnbQuI6ALrqAQr9kfn24M2QdyqXgG4vyqebh1T bKJeRHLr2sdofP5kvitlJ24VpYPJueLiI/E1FDdmatmv7acgAC3W/dBWFRqcv X-Received: by 2002:a5d:604a:0:b0:21b:9517:66eb with SMTP id j10-20020a5d604a000000b0021b951766ebmr15407058wrt.494.1656391356917; Mon, 27 Jun 2022 21:42:36 -0700 (PDT) X-Google-Smtp-Source: AGRyM1unuOoJw7QfbqbO3TU6MR2TrNeJIA1+5Ui0mD4hpLgMgbyIZADc7bydBwdthjAPUIuFd12YSg== X-Received: by 2002:a5d:604a:0:b0:21b:9517:66eb with SMTP id j10-20020a5d604a000000b0021b951766ebmr15407042wrt.494.1656391356618; Mon, 27 Jun 2022 21:42:36 -0700 (PDT) Date: Tue, 28 Jun 2022 00:42:33 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Konstantin Khlebnikov , Roman Kagan Subject: [PULL 03/12] vhost: add method vhost_set_vring_err Message-ID: <20220628044201.217173-4-mst@redhat.com> References: <20220628044201.217173-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220628044201.217173-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, 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 @redhat.com) X-ZM-MESSAGEID: 1656398424022100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Konstantin Khlebnikov Kernel and user vhost may report virtqueue errors via eventfd. This is only reliable way to get notification about protocol error. Signed-off-by: Konstantin Khlebnikov Message-Id: <20220623161325.18813-2-vsementsov@yandex-team.ru> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Roman Kagan --- include/hw/virtio/vhost-backend.h | 3 +++ hw/virtio/vhost-backend.c | 7 +++++++ hw/virtio/vhost-user.c | 6 ++++++ 3 files changed, 16 insertions(+) diff --git a/include/hw/virtio/vhost-backend.h b/include/hw/virtio/vhost-ba= ckend.h index 81bf3109f8..eab46d7f0b 100644 --- a/include/hw/virtio/vhost-backend.h +++ b/include/hw/virtio/vhost-backend.h @@ -69,6 +69,8 @@ typedef int (*vhost_set_vring_kick_op)(struct vhost_dev *= dev, struct vhost_vring_file *file); typedef int (*vhost_set_vring_call_op)(struct vhost_dev *dev, struct vhost_vring_file *file); +typedef int (*vhost_set_vring_err_op)(struct vhost_dev *dev, + struct vhost_vring_file *file); typedef int (*vhost_set_vring_busyloop_timeout_op)(struct vhost_dev *dev, struct vhost_vring_stat= e *r); typedef int (*vhost_set_features_op)(struct vhost_dev *dev, @@ -145,6 +147,7 @@ typedef struct VhostOps { vhost_get_vring_base_op vhost_get_vring_base; vhost_set_vring_kick_op vhost_set_vring_kick; vhost_set_vring_call_op vhost_set_vring_call; + vhost_set_vring_err_op vhost_set_vring_err; vhost_set_vring_busyloop_timeout_op vhost_set_vring_busyloop_timeout; vhost_set_features_op vhost_set_features; vhost_get_features_op vhost_get_features; diff --git a/hw/virtio/vhost-backend.c b/hw/virtio/vhost-backend.c index 4de8b6b3b0..8e581575c9 100644 --- a/hw/virtio/vhost-backend.c +++ b/hw/virtio/vhost-backend.c @@ -146,6 +146,12 @@ static int vhost_kernel_set_vring_call(struct vhost_de= v *dev, return vhost_kernel_call(dev, VHOST_SET_VRING_CALL, file); } =20 +static int vhost_kernel_set_vring_err(struct vhost_dev *dev, + struct vhost_vring_file *file) +{ + return vhost_kernel_call(dev, VHOST_SET_VRING_ERR, file); +} + static int vhost_kernel_set_vring_busyloop_timeout(struct vhost_dev *dev, struct vhost_vring_stat= e *s) { @@ -309,6 +315,7 @@ const VhostOps kernel_ops =3D { .vhost_get_vring_base =3D vhost_kernel_get_vring_base, .vhost_set_vring_kick =3D vhost_kernel_set_vring_kick, .vhost_set_vring_call =3D vhost_kernel_set_vring_call, + .vhost_set_vring_err =3D vhost_kernel_set_vring_err, .vhost_set_vring_busyloop_timeout =3D vhost_kernel_set_vring_busyloop_timeout, .vhost_set_features =3D vhost_kernel_set_features, diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index 4b9be26e84..75b8df21a4 100644 --- a/hw/virtio/vhost-user.c +++ b/hw/virtio/vhost-user.c @@ -1313,6 +1313,11 @@ static int vhost_user_set_vring_call(struct vhost_de= v *dev, return vhost_set_vring_file(dev, VHOST_USER_SET_VRING_CALL, file); } =20 +static int vhost_user_set_vring_err(struct vhost_dev *dev, + struct vhost_vring_file *file) +{ + return vhost_set_vring_file(dev, VHOST_USER_SET_VRING_ERR, file); +} =20 static int vhost_user_get_u64(struct vhost_dev *dev, int request, uint64_t= *u64) { @@ -2616,6 +2621,7 @@ const VhostOps user_ops =3D { .vhost_get_vring_base =3D vhost_user_get_vring_base, .vhost_set_vring_kick =3D vhost_user_set_vring_kick, .vhost_set_vring_call =3D vhost_user_set_vring_call, + .vhost_set_vring_err =3D vhost_user_set_vring_err, .vhost_set_features =3D vhost_user_set_features, .vhost_get_features =3D vhost_user_get_features, .vhost_set_owner =3D vhost_user_set_owner, --=20 MST From nobody Sun Feb 8 12:42:49 2026 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1656393273045753.8387886218762; Mon, 27 Jun 2022 22:14:33 -0700 (PDT) Received: from localhost ([::1]:40944 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o63YV-0008FV-SC for importer@patchew.org; Tue, 28 Jun 2022 01:14:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41496) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o633l-0007je-Ga for qemu-devel@nongnu.org; Tue, 28 Jun 2022 00:42:45 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:25982) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o633j-0006qG-Kz for qemu-devel@nongnu.org; Tue, 28 Jun 2022 00:42:44 -0400 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-221-8TcyTF7bNXaRPSV0LCSezA-1; Tue, 28 Jun 2022 00:42:41 -0400 Received: by mail-wm1-f72.google.com with SMTP id h125-20020a1c2183000000b003a03a8475c6so4070247wmh.8 for ; Mon, 27 Jun 2022 21:42:41 -0700 (PDT) Received: from redhat.com ([2.52.23.204]) by smtp.gmail.com with ESMTPSA id l8-20020a7bc448000000b003a0332760c0sm15298238wmi.16.2022.06.27.21.42.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jun 2022 21:42:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656391363; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Gbt2IiGiHkBeCQ5UhW7nCSDaGcZcoE+4TJvIBEuZXJY=; b=OvEuR0wiHn84vy0t/HgYYiQp3hiYpcicu3jnDeAG0JlTGYINr6PALi3vnbFmRlDNPMh5aE N4CzAVGxXnw718c8MJcbbTJAurr2tDfHitQOrRj366jgJMKViJDWXIu9A2UlVvgdUNZFd/ gmZ6yjYyfWUIohqVRyNRhPm7oTf6VzI= X-MC-Unique: 8TcyTF7bNXaRPSV0LCSezA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Gbt2IiGiHkBeCQ5UhW7nCSDaGcZcoE+4TJvIBEuZXJY=; b=oM2GQjnZ8QWu3xbbMu3EtGPNM1JBwXHfcD0qo2SPP80gdJFyG7ChSQoObbw9SiXeL8 mBlTNYZJxfPso3ImrRH3br3S40Aqdf9CSzVTG9WfyaSs5+rxevFM4sH7UDRD6zo3wbZ6 jzhqsG/EEzQtEOUxKRJOiJ2qe34/Ba2HpTS+OewECq3jG2GDdY2ebekDKDhyeChrtkau DsoGAY54d9aA2B7IFU+wV822Oerfw/+vl00xxVZk3oT1j47yEDLHZMX6GaPU39PM1Sou tT6j449C6azLomQEXzvbwSbQTqRboiYSJoDBxlONvmfCSF9ddyuJsy0fodkV1uP+Wt8X +cFQ== X-Gm-Message-State: AJIora886MClCkv1KclwScrtRi76U+8bkGFGkfLt5OJHcckmlbHMeVMk OiZYihxe4NvKgL5UWQLKnCvD0rTXTIbmNnrP8/lh3fVUsIu4U66hUzC5RZPYEJoulv7Cj7oAKsX h4cBHuD2rT2XXztPgfqCbOETotpXd/A4//iHvHimKK77OOpZshImuZoDZ3rWk X-Received: by 2002:adf:e502:0:b0:21b:8de6:7f14 with SMTP id j2-20020adfe502000000b0021b8de67f14mr15255452wrm.3.1656391360048; Mon, 27 Jun 2022 21:42:40 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vrH5jG1jR4SPG61pD/07fAwiSYK30nkWUnxb79Rur2xlOjEev/TSJ6pRN5cbM3My6iR8q9zg== X-Received: by 2002:adf:e502:0:b0:21b:8de6:7f14 with SMTP id j2-20020adfe502000000b0021b8de67f14mr15255434wrm.3.1656391359710; Mon, 27 Jun 2022 21:42:39 -0700 (PDT) Date: Tue, 28 Jun 2022 00:42:36 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Konstantin Khlebnikov , Vladimir Sementsov-Ogievskiy , Roman Kagan Subject: [PULL 04/12] vhost: setup error eventfd and dump errors Message-ID: <20220628044201.217173-5-mst@redhat.com> References: <20220628044201.217173-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220628044201.217173-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, 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 @redhat.com) X-ZM-MESSAGEID: 1656393274183100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Konstantin Khlebnikov Vhost has error notifications, let's log them like other errors. For each virt-queue setup eventfd for vring error notifications. Signed-off-by: Konstantin Khlebnikov [vsementsov: rename patch, change commit message and dump error like other errors in the file] Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id: <20220623161325.18813-3-vsementsov@yandex-team.ru> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Roman Kagan --- include/hw/virtio/vhost.h | 1 + hw/virtio/vhost.c | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/include/hw/virtio/vhost.h b/include/hw/virtio/vhost.h index b291fe4e24..1e7cbd9a10 100644 --- a/include/hw/virtio/vhost.h +++ b/include/hw/virtio/vhost.h @@ -29,6 +29,7 @@ struct vhost_virtqueue { unsigned long long used_phys; unsigned used_size; EventNotifier masked_notifier; + EventNotifier error_notifier; struct vhost_dev *dev; }; =20 diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index 6c41fa13e3..0827d631c0 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -1278,6 +1278,19 @@ static int vhost_virtqueue_set_busyloop_timeout(stru= ct vhost_dev *dev, return 0; } =20 +static void vhost_virtqueue_error_notifier(EventNotifier *n) +{ + struct vhost_virtqueue *vq =3D container_of(n, struct vhost_virtqueue, + error_notifier); + struct vhost_dev *dev =3D vq->dev; + int index =3D vq - dev->vqs; + + if (event_notifier_test_and_clear(n) && dev->vdev) { + VHOST_OPS_DEBUG(-EINVAL, "vhost vring error in virtqueue %d", + dev->vq_index + index); + } +} + static int vhost_virtqueue_init(struct vhost_dev *dev, struct vhost_virtqueue *vq, int n) { @@ -1299,7 +1312,27 @@ static int vhost_virtqueue_init(struct vhost_dev *de= v, =20 vq->dev =3D dev; =20 + if (dev->vhost_ops->vhost_set_vring_err) { + r =3D event_notifier_init(&vq->error_notifier, 0); + if (r < 0) { + goto fail_call; + } + + file.fd =3D event_notifier_get_fd(&vq->error_notifier); + r =3D dev->vhost_ops->vhost_set_vring_err(dev, &file); + if (r) { + VHOST_OPS_DEBUG(r, "vhost_set_vring_err failed"); + goto fail_err; + } + + event_notifier_set_handler(&vq->error_notifier, + vhost_virtqueue_error_notifier); + } + return 0; + +fail_err: + event_notifier_cleanup(&vq->error_notifier); fail_call: event_notifier_cleanup(&vq->masked_notifier); return r; @@ -1308,6 +1341,10 @@ fail_call: static void vhost_virtqueue_cleanup(struct vhost_virtqueue *vq) { event_notifier_cleanup(&vq->masked_notifier); + if (vq->dev->vhost_ops->vhost_set_vring_err) { + event_notifier_set_handler(&vq->error_notifier, NULL); + event_notifier_cleanup(&vq->error_notifier); + } } =20 int vhost_dev_init(struct vhost_dev *hdev, void *opaque, --=20 MST From nobody Sun Feb 8 12:42:49 2026 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1656394295885165.98024015239264; Mon, 27 Jun 2022 22:31:35 -0700 (PDT) Received: from localhost ([::1]:39858 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o63oz-0002SW-8K for importer@patchew.org; Tue, 28 Jun 2022 01:31:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41528) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o633o-0007t9-GH for qemu-devel@nongnu.org; Tue, 28 Jun 2022 00:42:48 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:35042) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o633m-0006sA-UV for qemu-devel@nongnu.org; Tue, 28 Jun 2022 00:42:48 -0400 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-504-BIxnsr47OQm2Q59WjAkLRQ-1; Tue, 28 Jun 2022 00:42:44 -0400 Received: by mail-wm1-f70.google.com with SMTP id n15-20020a05600c4f8f00b0039c3e76d646so6628494wmq.7 for ; Mon, 27 Jun 2022 21:42:44 -0700 (PDT) Received: from redhat.com ([2.52.23.204]) by smtp.gmail.com with ESMTPSA id v24-20020a5d5918000000b0021b9870049dsm12126567wrd.82.2022.06.27.21.42.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jun 2022 21:42:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656391366; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=NHP12tfV7UxG8H2z/KoGcDapZ2Sz7muWVetmqH96y00=; b=G866nxnFdqWuOponSwZnFU7RFB2tWYSLYcKtY48jaCHVm4gEKowhI2SYSYQuGh0+kZTn9N mIuQFS3tyK0/6TyvVr9a74fP2NEnzwlnZHpSuFnY1Aw/52WSi52DBfFsWjT6NWzqNqEemH gIrrxudRZwQqlGBXKbvnDFwI8SIU8TU= X-MC-Unique: BIxnsr47OQm2Q59WjAkLRQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=NHP12tfV7UxG8H2z/KoGcDapZ2Sz7muWVetmqH96y00=; b=DPm173njT1Z3WnAtm6rL5+I5+6JBd9FW9qxsO+G9LJgeCxrKEe0df8O8aBQBdiRbsv qKrkixYM+JCYDkdvhdfRzXUwEeSBGHOaxsxURKDLP66uft0GoAKXZumaEeh5Z82CRZMK 63WvmxG9JW2YGhlM8byxWjNI8j6DWVSzUo8cMJWHmP1TeK2a6m7aeUzrb/kRhguOI4GP /U+xjoJ5er32tSBNXhz85fkx+CwL36KflIpi/in21wryUtDfxUjudLWKRSzNdYKwn4zN 4jVgJBrspbXCFZPdQUUQ6CE6YP3lyc/nHglh6erYPkIzOOhzQubJk8EBZf8hhWGh4Tvc 9Dvw== X-Gm-Message-State: AJIora+XvO6TE0ZPM5qOS6ZVEDTjD9mIv1KxU6IY9z4smHvjonbSk9ky leFmwLi07DjPB0nuaOrOaZt1+5iTiFJA98hmzvyTKFsHIMjTs+itIu9nqUiMKyRE4paj8qMgMj1 aF/r1WGOVdKoP7wTfylXHYiTHHVq7qO8pFkI9xCjejnPOmyjATTSXa5BWY2Lw X-Received: by 2002:adf:d1c6:0:b0:21b:ca9b:23d8 with SMTP id b6-20020adfd1c6000000b0021bca9b23d8mr9960039wrd.692.1656391362982; Mon, 27 Jun 2022 21:42:42 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ti+RNDpi4zcodfTL7s1KpGnwthzjqu2WCejBT7k2C6fk5vUBplAXQgyFHARhJyMPFE6GHSpA== X-Received: by 2002:adf:d1c6:0:b0:21b:ca9b:23d8 with SMTP id b6-20020adfd1c6000000b0021bca9b23d8mr9960028wrd.692.1656391362773; Mon, 27 Jun 2022 21:42:42 -0700 (PDT) Date: Tue, 28 Jun 2022 00:42:40 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Zhenzhong Duan , Eric Auger Subject: [PULL 05/12] virtio-iommu: Fix migration regression Message-ID: <20220628044201.217173-6-mst@redhat.com> References: <20220628044201.217173-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220628044201.217173-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, 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 @redhat.com) X-ZM-MESSAGEID: 1656394296598100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Zhenzhong Duan We also need to switch to the right address space on dest side after loading the device status. DMA to wrong address space is destructive. Fixes: 3facd774962fd ("virtio-iommu: Add bypass mode support to assigned de= vice") Suggested-by: Eric Auger Signed-off-by: Zhenzhong Duan Message-Id: <20220624093740.3525267-1-zhenzhong.duan@intel.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Eric Auger --- hw/virtio/virtio-iommu.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hw/virtio/virtio-iommu.c b/hw/virtio/virtio-iommu.c index 08b227e828..281152d338 100644 --- a/hw/virtio/virtio-iommu.c +++ b/hw/virtio/virtio-iommu.c @@ -1322,6 +1322,14 @@ static int iommu_post_load(void *opaque, int version= _id) VirtIOIOMMU *s =3D opaque; =20 g_tree_foreach(s->domains, reconstruct_endpoints, s); + + /* + * Memory regions are dynamically turned on/off depending on + * 'config.bypass' and attached domain type if there is. After + * migration, we need to make sure the memory regions are + * still correct. + */ + virtio_iommu_switch_address_space_all(s); return 0; } =20 --=20 MST From nobody Sun Feb 8 12:42:49 2026 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1656398909994524.3296070833287; Mon, 27 Jun 2022 23:48:29 -0700 (PDT) Received: from localhost ([::1]:50718 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o651P-00066b-Sw for importer@patchew.org; Tue, 28 Jun 2022 02:48:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41542) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o633s-00080d-B3 for qemu-devel@nongnu.org; Tue, 28 Jun 2022 00:42:54 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:53347) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o633q-0006sX-Qw for qemu-devel@nongnu.org; Tue, 28 Jun 2022 00:42:52 -0400 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-324-8kBQuNccPKGH2FwlH34eiA-1; Tue, 28 Jun 2022 00:42:48 -0400 Received: by mail-wm1-f70.google.com with SMTP id h125-20020a1c2183000000b003a0374f1eb8so7225708wmh.8 for ; Mon, 27 Jun 2022 21:42:47 -0700 (PDT) Received: from redhat.com ([2.52.23.204]) by smtp.gmail.com with ESMTPSA id l15-20020a05600c1d0f00b003a04962ad3esm8828303wms.31.2022.06.27.21.42.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jun 2022 21:42:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656391370; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=WNc6s5hGnqp3J7IBUoI5eL8DC+L+SCRZwVqehYETRFc=; b=M8/DHHRAfbK+0rLrwM9SsushR7ZticP3oeKeK4BPJS+8sORzFvtR3skfjba6T2WDVKPdjj y3AvFChubgGsvMf6d1KOkBSYgqmTzvMkbWfCXXv3957Ifo0cbqWZaiUCEZ2uk0gsrPfnBn nYJHNFP8eRE95YwcCxwjMObbFbEX1sk= X-MC-Unique: 8kBQuNccPKGH2FwlH34eiA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=WNc6s5hGnqp3J7IBUoI5eL8DC+L+SCRZwVqehYETRFc=; b=vLD1aS1k0mD7Mo7AwwML1lv/Bg/28iTVa3qDk4FA0qUrI1AAudP2fJoZ5d+4kTtR00 4btCCkSVbG1HBAclf1la6ZJc3OYSsuufmBf9iAxfy/RpbVlWjlVjcOSj0UXyIXh57Lvc SXiNs1xEjZvx34JmcLnsNzsdizXDXoUdTOI/UmWgmmuJ0o7oiqFt6bhySwVJWCUhsQdc BKSMJLrEKKg4+n2sE406fbToo1BtouTe9K9g/zlIhxEHoOOioZWsGhl3g4YmlFvdunMV DdE0iY/M5EbGCJJpY1Q60HcY7pjFRc5P1YKuJAhXQFsW81zu9vNgLiq8uqIJ+yW8FEDp +CRA== X-Gm-Message-State: AJIora8roK5ILiOJzmiWOcUzVzGLREFARodyr3pZXXK2w3Y5aaVnoRdp 3DmGmX1J1+Bh7tolzIvT8DnIOGZ6ypPL85t4hdtNrYnGbMNtb6iBA5CwvqXbnvw7yTLC3I4qh7h uqPlgbUM5nOS9RN4zSm4C4YtCLrGL4HXFv6h2Cw38f89c5n7OHKxvx96jHHwC X-Received: by 2002:a5d:6a0b:0:b0:21a:3a8e:d5ae with SMTP id m11-20020a5d6a0b000000b0021a3a8ed5aemr16237534wru.79.1656391366547; Mon, 27 Jun 2022 21:42:46 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sWo0GgTpTDfLhzbw6FzQCibqIBPjJbo6VPPnU515fBC+E4KUrTQDARiVO3SSnketoE51o8Nw== X-Received: by 2002:a5d:6a0b:0:b0:21a:3a8e:d5ae with SMTP id m11-20020a5d6a0b000000b0021a3a8ed5aemr16237517wru.79.1656391366230; Mon, 27 Jun 2022 21:42:46 -0700 (PDT) Date: Tue, 28 Jun 2022 00:42:43 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Kevin Wolf Subject: [PULL 06/12] docs/vhost-user: Fix mismerge Message-ID: <20220628044201.217173-7-mst@redhat.com> References: <20220628044201.217173-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220628044201.217173-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, 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 @redhat.com) X-ZM-MESSAGEID: 1656398911724100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Kevin Wolf This reverts commit 76b1b64370007234279ea4cc8b09c98cbd2523de. The commit only duplicated some text that had already been merged in commit 31009d13cc5. Signed-off-by: Kevin Wolf Message-Id: <20220627134500.94842-2-kwolf@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Peter Maydell --- docs/interop/vhost-user.rst | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/docs/interop/vhost-user.rst b/docs/interop/vhost-user.rst index d7cf904f7f..3f18ab424e 100644 --- a/docs/interop/vhost-user.rst +++ b/docs/interop/vhost-user.rst @@ -1376,14 +1376,6 @@ Front-end message types For further details on postcopy, see ``VHOST_USER_SET_MEM_TABLE``. They apply to ``VHOST_USER_ADD_MEM_REG`` accordingly. =20 - Exactly one file descriptor from which the memory is mapped is - passed in the ancillary data. - - In postcopy mode (see ``VHOST_USER_POSTCOPY_LISTEN``), the back-end - replies with the bases of the memory mapped region to the front-end. - For further details on postcopy, see ``VHOST_USER_SET_MEM_TABLE``. - They apply to ``VHOST_USER_ADD_MEM_REG`` accordingly. - ``VHOST_USER_REM_MEM_REG`` :id: 38 :equivalent ioctl: N/A @@ -1408,14 +1400,6 @@ Front-end message types accept messages with one file descriptor. If a file descriptor is passed, the back-end MUST close it without using it otherwise. =20 - The memory region to be removed is identified by its guest address, - user address and size. The mmap offset is ignored. - - No file descriptors SHOULD be passed in the ancillary data. For - compatibility with existing incorrect implementations, the back-end MAY - accept messages with one file descriptor. If a file descriptor is - passed, the back-end MUST close it without using it otherwise. - ``VHOST_USER_SET_STATUS`` :id: 39 :equivalent ioctl: VHOST_VDPA_SET_STATUS --=20 MST From nobody Sun Feb 8 12:42:49 2026 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1656393833380496.694451522652; Mon, 27 Jun 2022 22:23:53 -0700 (PDT) Received: from localhost ([::1]:55784 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o63hX-0002E6-Qv for importer@patchew.org; Tue, 28 Jun 2022 01:23:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41556) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o633v-00081y-04 for qemu-devel@nongnu.org; Tue, 28 Jun 2022 00:42:55 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:28677) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o633t-0006sg-Eb for qemu-devel@nongnu.org; Tue, 28 Jun 2022 00:42:54 -0400 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-641-wR21qW39OKuzMFR7IT33zQ-1; Tue, 28 Jun 2022 00:42:51 -0400 Received: by mail-wm1-f72.google.com with SMTP id 6-20020a1c0206000000b003a02cd754d1so4549997wmc.9 for ; Mon, 27 Jun 2022 21:42:51 -0700 (PDT) Received: from redhat.com ([2.52.23.204]) by smtp.gmail.com with ESMTPSA id e3-20020adfef03000000b0021bbd525b8esm10779320wro.45.2022.06.27.21.42.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jun 2022 21:42:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656391372; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=jIPXKtPDOIaKtveN4KYmlBLs9WGMDzIvtvcv0OAZQ6o=; b=ZOFb8FolBq2EjSmY2PlU53ov0APi9fVuE04Ho1yqBCXpFkdhySs3F0mIIj625Y7iabRAlV EE8j25IEjMLZnDC17q+Et/w5w2VJzroXnshJlGbGrE5LlQdRHZXlHpkn2/FTLrI5vQ/oX0 Xsu8NQxk6uMEGZ2BatjXWnthlI/tQlo= X-MC-Unique: wR21qW39OKuzMFR7IT33zQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=jIPXKtPDOIaKtveN4KYmlBLs9WGMDzIvtvcv0OAZQ6o=; b=Dj2GfU2gx0exSOGhDYO282IJvwwHgkj8CW3yCbpI7ajc7aBoaTGB4ReLtunXzMssbW 1wpKLPC4ucVvYDZz/bAS6cfL1K8v5do9R9oBPUt2uOhvMLlUvWmWIiFmLkJf83F5HAk1 cmy7ULoKkHL0goCHUgUjFisjQ5OiyAgOq74YejLTCV4THUsx7MR6rHRLMzASr7X2jx1w fRvzyN2L8+0eo8opntwD4cL0/xG1/+A2qbQiL8bzhaUQNkr4pUc/pb/e88gfimHdniUu Jft48+65I/gXc6holzl6FE9SH+jxGB2kylgUIGC5G7LlMmMSuyJnykHQphuEMA2yTLnm fU+Q== X-Gm-Message-State: AJIora+jRZ34JlqUgFYfUe9R9MYNlx4wpAWZ/ujkmEXAH775AXMDctIe NVXnmoKPtVNMVJMYg44+ZsMohbnW2sVPpP3NL2Yvatsm2w5IDhTfrCYiBR6oLPw8CPTtOK3Wwpr xrGQ278+5oLhh4Xl2ApEXLlsV5xOT0JKkU0S46E953lZi5++bxpuBrECGuyYV X-Received: by 2002:a05:600c:1c27:b0:3a0:5098:c8b6 with SMTP id j39-20020a05600c1c2700b003a05098c8b6mr2886294wms.69.1656391369942; Mon, 27 Jun 2022 21:42:49 -0700 (PDT) X-Google-Smtp-Source: AGRyM1usNK1Zoq/Xl5vxBmD7SNQJjRVmlBjOR7hjBEBT56or67xmOst7eDQ01YgvjENxw7m0bOA8JA== X-Received: by 2002:a05:600c:1c27:b0:3a0:5098:c8b6 with SMTP id j39-20020a05600c1c2700b003a05098c8b6mr2886270wms.69.1656391369647; Mon, 27 Jun 2022 21:42:49 -0700 (PDT) Date: Tue, 28 Jun 2022 00:42:46 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Kevin Wolf , Raphael Norwitz , David Hildenbrand , Stefan Hajnoczi Subject: [PULL 07/12] libvhost-user: Fix VHOST_USER_GET_MAX_MEM_SLOTS reply Message-ID: <20220628044201.217173-8-mst@redhat.com> References: <20220628044201.217173-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220628044201.217173-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, 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 @redhat.com) X-ZM-MESSAGEID: 1656393834912100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Kevin Wolf With REPLY_NEEDED, libvhost-user sends both the acutal result and an additional ACK reply for VHOST_USER_GET_MAX_MEM_SLOTS. This is incorrect, the spec mandates that it behave the same with and without REPLY_NEEDED because it always sends a reply. Fixes: 6fb2e173d20c9bbb5466183d33a3ad7dcd0375fa Signed-off-by: Kevin Wolf Message-Id: <20220627134500.94842-3-kwolf@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- subprojects/libvhost-user/libvhost-user.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/subprojects/libvhost-user/libvhost-user.c b/subprojects/libvho= st-user/libvhost-user.c index b4cc3c2d68..cfa1bcc334 100644 --- a/subprojects/libvhost-user/libvhost-user.c +++ b/subprojects/libvhost-user/libvhost-user.c @@ -1827,18 +1827,11 @@ vu_handle_vring_kick(VuDev *dev, VhostUserMsg *vmsg) =20 static bool vu_handle_get_max_memslots(VuDev *dev, VhostUserMsg *vmsg) { - vmsg->flags =3D VHOST_USER_REPLY_MASK | VHOST_USER_VERSION; - vmsg->size =3D sizeof(vmsg->payload.u64); - vmsg->payload.u64 =3D VHOST_USER_MAX_RAM_SLOTS; - vmsg->fd_num =3D 0; - - if (!vu_message_write(dev, dev->sock, vmsg)) { - vu_panic(dev, "Failed to send max ram slots: %s\n", strerror(errno= )); - } + vmsg_set_reply_u64(vmsg, VHOST_USER_MAX_RAM_SLOTS); =20 DPRINT("u64: 0x%016"PRIx64"\n", (uint64_t) VHOST_USER_MAX_RAM_SLOTS); =20 - return false; + return true; } =20 static bool --=20 MST From nobody Sun Feb 8 12:42:49 2026 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1656395327647118.8462448750463; Mon, 27 Jun 2022 22:48:47 -0700 (PDT) Received: from localhost ([::1]:57758 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o645e-0007b3-Ee for importer@patchew.org; Tue, 28 Jun 2022 01:48:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41716) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o634o-0001V3-4o for qemu-devel@nongnu.org; Tue, 28 Jun 2022 00:43:50 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:37479) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o634b-0006vw-9T for qemu-devel@nongnu.org; Tue, 28 Jun 2022 00:43:49 -0400 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-382-Fqy_c0klPO2cO1LNusdC_Q-1; Tue, 28 Jun 2022 00:42:54 -0400 Received: by mail-wm1-f71.google.com with SMTP id i184-20020a1c3bc1000000b003a026f48333so4559144wma.4 for ; Mon, 27 Jun 2022 21:42:54 -0700 (PDT) Received: from redhat.com ([2.52.23.204]) by smtp.gmail.com with ESMTPSA id o19-20020a1c7513000000b0039c18d3fe27sm14870702wmc.19.2022.06.27.21.42.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jun 2022 21:42:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656391416; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=/uz+NIpqA1Ges9cF9Ryn/nd/sEhvnK9SiL8Zxw0pHR8=; b=D1CwfFNYiGNHuBT5BD+3YFWAQqZlN4nAfwXTCyhe7hSIbJ6mBCz93EMAtlDN+MzBANhwsY j+ZuRwCYevsTpTwwCy8XrNi4CmP5A8gJmvvhP7mvoNnSLbxZsLGlcnz35rU4mpl9c1Jyzo jWvPs6zkvpcCg3Y/bCclZHpgVWKhBes= X-MC-Unique: Fqy_c0klPO2cO1LNusdC_Q-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=/uz+NIpqA1Ges9cF9Ryn/nd/sEhvnK9SiL8Zxw0pHR8=; b=voyRLrBC3rv1xMODMlxzOHlx2VyF6e2f48JqoUDN6ECkPznT4i2tZ1X6R5Qg1qUff/ x2bnEb0BjaesaR46F0sEGln93uPRDNyFIsQsSLCUIoYfnSpaPLL567cmz/OvDHdw0Wy/ L8ob7JGtVTskZ9RYS02eBbCT9KOSbZqxcuc0XKoskSC8lcZdcZxE9uGUmgdhbzn1yCNt gxCwyrmxIH+IEf4XPgIXElUTZ+UtjV3uSRRHl4cyET+/TgiLPm7XXv66m2N4sMvNwTFO 5nG2JCqonuNJstJ345oO1E1ZSCwK94/2FX6H9HLd1PMTTC9C7fhjuIUUnMjOFcmQ/Hu5 E2gQ== X-Gm-Message-State: AJIora8GWHgyD4uT5PtiFVil5Cfo1rPiyqrKHbfEmLwVGdqO2IJ7AFuZ af+4iu5v1VdpQy+41CiB48Aaugntft2hsq9IO+VOyoPDPUM/g9ytb7k4wl5TGnwMLG0cxBw6J88 ynLgoke1Tw041zNxePXmr3iXTbuBAVM0pxMuar4uIePW4TlQhWsUh9OTy1Lfu X-Received: by 2002:adf:e196:0:b0:219:f3c7:fd88 with SMTP id az22-20020adfe196000000b00219f3c7fd88mr15260279wrb.402.1656391373392; Mon, 27 Jun 2022 21:42:53 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s9t74qCC63D4MQz7F7bLKdTudVwfl4ZQAxnNluqoGm1cMgfu84eyFFTK9aGlDjd5L566464A== X-Received: by 2002:adf:e196:0:b0:219:f3c7:fd88 with SMTP id az22-20020adfe196000000b00219f3c7fd88mr15260262wrb.402.1656391373118; Mon, 27 Jun 2022 21:42:53 -0700 (PDT) Date: Tue, 28 Jun 2022 00:42:50 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Kevin Wolf , Raphael Norwitz , David Hildenbrand , Stefan Hajnoczi Subject: [PULL 08/12] libvhost-user: Fix VHOST_USER_ADD_MEM_REG reply Message-ID: <20220628044201.217173-9-mst@redhat.com> References: <20220628044201.217173-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220628044201.217173-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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 @redhat.com) X-ZM-MESSAGEID: 1656395329489100001 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Kevin Wolf With REPLY_NEEDED, libvhost-user sends both the acutal result and an additional ACK reply for VHOST_USER_ADD_MEM_REG. This is incorrect, the spec mandates that it behave the same with and without REPLY_NEEDED because it always sends a reply. Fixes: ec94c8e621de96c50c2d381c8c9ec94f5beec7c1 Signed-off-by: Kevin Wolf Message-Id: <20220627134500.94842-4-kwolf@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- subprojects/libvhost-user/libvhost-user.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/subprojects/libvhost-user/libvhost-user.c b/subprojects/libvho= st-user/libvhost-user.c index cfa1bcc334..ffed4729a3 100644 --- a/subprojects/libvhost-user/libvhost-user.c +++ b/subprojects/libvhost-user/libvhost-user.c @@ -779,15 +779,9 @@ vu_add_mem_reg(VuDev *dev, VhostUserMsg *vmsg) { =20 /* Send the message back to qemu with the addresses filled in. */ vmsg->fd_num =3D 0; - if (!vu_send_reply(dev, dev->sock, vmsg)) { - vu_panic(dev, "failed to respond to add-mem-region for postcop= y"); - return false; - } - DPRINT("Successfully added new region in postcopy\n"); dev->nregions++; - return false; - + return true; } else { for (i =3D 0; i < dev->max_queues; i++) { if (dev->vq[i].vring.desc) { --=20 MST From nobody Sun Feb 8 12:42:49 2026 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16563939224821015.0019237525833; Mon, 27 Jun 2022 22:25:22 -0700 (PDT) Received: from localhost ([::1]:58176 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o63iz-0003qZ-CE for importer@patchew.org; Tue, 28 Jun 2022 01:25:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41572) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6342-0008SP-Gx for qemu-devel@nongnu.org; Tue, 28 Jun 2022 00:43:02 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:30547) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6340-0006t1-Pv for qemu-devel@nongnu.org; Tue, 28 Jun 2022 00:43:02 -0400 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-516-i1cxhx1TMJeaAyQkTD2dkA-1; Tue, 28 Jun 2022 00:42:58 -0400 Received: by mail-wm1-f69.google.com with SMTP id n15-20020a05600c4f8f00b0039c3e76d646so6628738wmq.7 for ; Mon, 27 Jun 2022 21:42:58 -0700 (PDT) Received: from redhat.com ([2.52.23.204]) by smtp.gmail.com with ESMTPSA id r13-20020adfe68d000000b0021018642ff8sm12998494wrm.76.2022.06.27.21.42.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jun 2022 21:42:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656391380; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8OTkQgtTVoAIMM+akL7xPG2VzUScDdMLXQogm2uIas4=; b=Hs9RJfqY43LLC1pWhGuxfgCIF7bpFTxaF1MSNDo0XYOPc+NJa85iepx+SP6P7iGp93xAzX Qm0lFBdbrbd1UNegq9mdZp8qZPpjru03nuXq2BgwfD6kIddsdo524C57o0ED1pMrHfW4Tz dKt+EGtoDwIPnRVvSFKlaiithky3i00= X-MC-Unique: i1cxhx1TMJeaAyQkTD2dkA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=8OTkQgtTVoAIMM+akL7xPG2VzUScDdMLXQogm2uIas4=; b=fujAfTxP1PL+sUoPJ869n+JfVyLwp1C2xt3RjtneAy06sXn+pAyRL75GT97RwnrV+/ L/MNK+6kg3cFaVBgx8W/SXJM9rdUhDWAoMoIw4AIkJtfdrkF5E9VRbvLB1jDTNQUTE8d MkCvgCYTZwtLXaE5mA5shAttBd1j2QkQ9tbKxI1EA+gAiYW6gvYjypX3jCuUuBhBW5Wd aD5JJa/fAbT7iNKE+EpjXm79xFehE+4xOQgflklntPcbxXHJ7HL2UsrD6BkMrs+2IGxy UVls20rry+OL+9k3PfyetmDxW7VmjfpL4vVGukDzkjuG2TdlvErU1KO9XiqHLTGH4FOx UHZA== X-Gm-Message-State: AJIora8osQDVLkYMy4p9OxaxjhfmDiBHYLDC7BIx47j2pdf7PQWrIbNf eG0IAb+meFRjinTilqKan/WA1/X3eAmJTSH3i2BiLkq6vH5YYKD5uZzbfthQsgzYtjGicutmclj u5QchLIIdwf4g6ZQQSpvfCA424ZMh9BNb6xkg7B9gD3gO7UdkVFb/N/WHLWT9 X-Received: by 2002:a05:600c:3516:b0:39c:8091:31b6 with SMTP id h22-20020a05600c351600b0039c809131b6mr25662268wmq.164.1656391377452; Mon, 27 Jun 2022 21:42:57 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sgVZQRb16LOQpSFJsdABabmdpby2Ygj6gmilwC250ym169PVt3+K9UG2SDYBTzHDPTj3vcGA== X-Received: by 2002:a05:600c:3516:b0:39c:8091:31b6 with SMTP id h22-20020a05600c351600b0039c809131b6mr25662238wmq.164.1656391377215; Mon, 27 Jun 2022 21:42:57 -0700 (PDT) Date: Tue, 28 Jun 2022 00:42:53 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , David Hildenbrand , Ben Widawsky , Jonathan Cameron , Igor Mammedov , Ani Sinha , Xiao Guangrong , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Richard Henderson , Julia Suvorova , Thomas Huth , Gerd Hoffmann Subject: [PULL 09/12] MAINTAINERS: Collect memory device files in "Memory devices" Message-ID: <20220628044201.217173-10-mst@redhat.com> References: <20220628044201.217173-1-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20220628044201.217173-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, 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 @redhat.com) X-ZM-MESSAGEID: 1656393923924100003 From: David Hildenbrand Xiao Guangrong doesn't have enough time to actively review or contribute to our NVDIMM implementation. Let's dissolve the "NVDIMM" section, moving relevant ACPI parts to "ACPI/SMBIOS" and moving memory device stuff into a new "Memory devices" section. Make that new section cover other memory device stuff as well. We can now drop the "hw/mem/*" rule from "ACPI/SMBIOS". Note that hw/acpi/nvdimm.c is already covered by "ACPI/SMBIOS". The following files in hw/mem don't fall into the TYPE_MEMPORY_DEVICE category: * hw/mem/cxl_type3.c is CXL specific and belongs to "Compute Express Link" * hw/mem/sparse-mem.c is already covered by "Device Fuzzing" * hw/mem/npcm7xx_mc.c is already covered by "Nuvoton NPCM7xx" Thanks Xiao for your work on NVDIMM! Cc: Ben Widawsky Cc: Jonathan Cameron Cc: Michael S. Tsirkin Cc: Igor Mammedov Cc: Ani Sinha Cc: Xiao Guangrong Cc: "Philippe Mathieu-Daud=C3=A9" Cc: Richard Henderson Cc: Peter Maydell Cc: Julia Suvorova Signed-off-by: David Hildenbrand Message-Id: <20220617123151.103033-1-david@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- MAINTAINERS | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 1cbd6b72fa..05cf84b58c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1840,7 +1840,6 @@ R: Ani Sinha S: Supported F: include/hw/acpi/* F: include/hw/firmware/smbios.h -F: hw/mem/* F: hw/acpi/* F: hw/smbios/* F: hw/i386/acpi-build.[hc] @@ -1851,6 +1850,7 @@ F: tests/qtest/acpi-utils.[hc] F: tests/data/acpi/ F: docs/specs/acpi_cpu_hotplug.rst F: docs/specs/acpi_mem_hotplug.rst +F: docs/specs/acpi_nvdimm.rst F: docs/specs/acpi_pci_hotplug.rst F: docs/specs/acpi_hw_reduced_hotplug.rst =20 @@ -2158,15 +2158,6 @@ F: qapi/rocker.json F: tests/rocker/ F: docs/specs/rocker.txt =20 -NVDIMM -M: Xiao Guangrong -S: Maintained -F: hw/acpi/nvdimm.c -F: hw/mem/nvdimm.c -F: include/hw/mem/nvdimm.h -F: docs/nvdimm.txt -F: docs/specs/acpi_nvdimm.rst - e1000x M: Dmitry Fleytman S: Maintained @@ -2588,6 +2579,7 @@ M: Ben Widawsky M: Jonathan Cameron S: Supported F: hw/cxl/ +F: hw/mem/cxl_type3.c F: include/hw/cxl/ =20 Dirty Bitmaps @@ -2704,6 +2696,19 @@ F: softmmu/physmem.c F: include/exec/memory-internal.h F: scripts/coccinelle/memory-region-housekeeping.cocci =20 +Memory devices +M: David Hildenbrand +M: Igor Mammedov +R: Xiao Guangrong +S: Supported +F: hw/mem/memory-device.c +F: hw/mem/nvdimm.c +F: hw/mem/pc-dimm.c +F: include/hw/mem/memory-device.h +F: include/hw/mem/nvdimm.h +F: include/hw/mem/pc-dimm.h +F: docs/nvdimm.txt + SPICE M: Gerd Hoffmann S: Odd Fixes --=20 MST From nobody Sun Feb 8 12:42:49 2026 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1656394131776906.1478227365292; Mon, 27 Jun 2022 22:28:51 -0700 (PDT) Received: from localhost ([::1]:36352 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o63mL-0008TL-Vm for importer@patchew.org; Tue, 28 Jun 2022 01:28:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41628) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o634E-0000PN-6W for qemu-devel@nongnu.org; Tue, 28 Jun 2022 00:43:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:44523) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o634C-0006td-Ec for qemu-devel@nongnu.org; Tue, 28 Jun 2022 00:43:13 -0400 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-524-8BfHnBxZMECElNPyUegGFg-1; Tue, 28 Jun 2022 00:43:02 -0400 Received: by mail-wm1-f71.google.com with SMTP id az40-20020a05600c602800b003a048edf007so2174085wmb.5 for ; Mon, 27 Jun 2022 21:43:01 -0700 (PDT) Received: from redhat.com ([2.52.23.204]) by smtp.gmail.com with ESMTPSA id r11-20020a05600c35cb00b0039c4ba160absm2364281wmq.2.2022.06.27.21.42.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jun 2022 21:42:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656391391; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PephaWAYB4wWrCOWcp9B8RIb1PHmOnQGuhXQJ5K1XL0=; b=ScNsksgfAPCvTSN4UVSyBaiIAUDfhMr9m6KdkS2+K6RF/YoyKU3BWh7sqQHuy/vorQFmSp FsQprPXAe8MINfo8rIKevepGfLzs3ttZ9fcJ1lmhEnVg3iptpsN8ctoY9Ch/lqD0wkj5bd utD0cqiFti41T3e1WivGvUHjdwIhdz4= X-MC-Unique: 8BfHnBxZMECElNPyUegGFg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=PephaWAYB4wWrCOWcp9B8RIb1PHmOnQGuhXQJ5K1XL0=; b=L+Fv01Rv+MVEHOi47s5vUr6Fnpsfp+gYiApmfYF8DM4xY27ILNHydPExqPdxfBR1OT PGpkErFoGaD2e6HpBMcltZNErohAO3tzRFyHGJfON0N5X2vLhOT4gjkj0xL5l8jdmw2n WGwSwi570gYQC6onA7+8CjujBTCPi8ihrGjJH7K2deyZOUjGD9z8nntl0u/47bUCez8T j9jh90EmB6eZRlBXDnwxK2qNW5T9XhEpy1TBksHw/tnWkMpkcORuDX/4OEPepaAGFoFt sh9UQmpgHbIgCrVQFMW8wk8XAv2Tdy7wpfe3aujDNO7VWLEc2revqK+E5xzhpQYDRtLI OFNQ== X-Gm-Message-State: AJIora+KEvh/Nti2cnrBWM/CHU5neiSTyze8GrrTOxQN2Ib9XuNclW48 VEZJzwtFdnsFZzoqWBfGxr5aYu2rkf3XZLW9bhmGzsAGNqydTmgGFL04TEc+yQLbSwlip2O+jvo 96yBKk8yAzQCGUyPew8CfLO0WKiZWgZqjUpPPdM6jC0je+z3YvbLbJjDQADdB X-Received: by 2002:a05:6000:1f87:b0:21b:970b:e88c with SMTP id bw7-20020a0560001f8700b0021b970be88cmr15772685wrb.320.1656391380595; Mon, 27 Jun 2022 21:43:00 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vzOJdQ43H7Q5hAEdMAHuROCe4UJS36sYSBGnJ6MtcxP0Ha/glT3yethjbrQDi57um2vtlqTQ== X-Received: by 2002:a05:6000:1f87:b0:21b:970b:e88c with SMTP id bw7-20020a0560001f8700b0021b970be88cmr15772664wrb.320.1656391380283; Mon, 27 Jun 2022 21:43:00 -0700 (PDT) Date: Tue, 28 Jun 2022 00:42:57 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Alex =?utf-8?Q?Benn=C3=A9e?= , Stefan Hajnoczi , Raphael Norwitz Subject: [PULL 10/12] contrib/vhost-user-blk: fix 32 bit build and enable Message-ID: <20220628044201.217173-11-mst@redhat.com> References: <20220628044201.217173-1-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20220628044201.217173-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, 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 @redhat.com) X-ZM-MESSAGEID: 1656394133813100001 From: Alex Benn=C3=A9e We were not building the vhost-user-blk server due to 32 bit compilation problems. The problem was due to format string types so fix that and then enable the build. Tweak the rule to follow the same rules as other vhost-user daemons. Signed-off-by: Alex Benn=C3=A9e Message-Id: <20220321153037.3622127-12-alex.bennee@linaro.org> Message-Id: <20220524154056.2896913-2-alex.bennee@linaro.org> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Stefan Hajnoczi Reviewed-by: Raphael Norwitz --- contrib/vhost-user-blk/vhost-user-blk.c | 6 +++--- contrib/vhost-user-blk/meson.build | 3 +-- meson.build | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/contrib/vhost-user-blk/vhost-user-blk.c b/contrib/vhost-user-b= lk/vhost-user-blk.c index cd4a5d7335..9cb78ca1d0 100644 --- a/contrib/vhost-user-blk/vhost-user-blk.c +++ b/contrib/vhost-user-blk/vhost-user-blk.c @@ -146,7 +146,7 @@ vub_readv(VubReq *req, struct iovec *iov, uint32_t iovc= nt) req->size =3D vub_iov_size(iov, iovcnt); rc =3D preadv(vdev_blk->blk_fd, iov, iovcnt, req->sector_num * 512); if (rc < 0) { - fprintf(stderr, "%s, Sector %"PRIu64", Size %lu failed with %s\n", + fprintf(stderr, "%s, Sector %"PRIu64", Size %zu failed with %s\n", vdev_blk->blk_name, req->sector_num, req->size, strerror(errno)); return -1; @@ -169,7 +169,7 @@ vub_writev(VubReq *req, struct iovec *iov, uint32_t iov= cnt) req->size =3D vub_iov_size(iov, iovcnt); rc =3D pwritev(vdev_blk->blk_fd, iov, iovcnt, req->sector_num * 512); if (rc < 0) { - fprintf(stderr, "%s, Sector %"PRIu64", Size %lu failed with %s\n", + fprintf(stderr, "%s, Sector %"PRIu64", Size %zu failed with %s\n", vdev_blk->blk_name, req->sector_num, req->size, strerror(errno)); return -1; @@ -188,7 +188,7 @@ vub_discard_write_zeroes(VubReq *req, struct iovec *iov= , uint32_t iovcnt, =20 size =3D vub_iov_size(iov, iovcnt); if (size !=3D sizeof(*desc)) { - fprintf(stderr, "Invalid size %ld, expect %ld\n", size, sizeof(*de= sc)); + fprintf(stderr, "Invalid size %zd, expect %zd\n", size, sizeof(*de= sc)); return -1; } buf =3D g_new0(char, size); diff --git a/contrib/vhost-user-blk/meson.build b/contrib/vhost-user-blk/me= son.build index 601ea15ef5..dcb9e2ffcd 100644 --- a/contrib/vhost-user-blk/meson.build +++ b/contrib/vhost-user-blk/meson.build @@ -1,5 +1,4 @@ -# FIXME: broken on 32-bit architectures executable('vhost-user-blk', files('vhost-user-blk.c'), dependencies: [qemuutil, vhost_user], - build_by_default: false, + build_by_default: targetos =3D=3D 'linux', install: false) diff --git a/meson.build b/meson.build index a113078f1a..65a885ea69 100644 --- a/meson.build +++ b/meson.build @@ -1516,7 +1516,7 @@ have_vhost_user_blk_server =3D get_option('vhost_user= _blk_server') \ error_message: 'vhost_user_blk_server requires linux') \ .require(have_vhost_user, error_message: 'vhost_user_blk_server requires vhost-user suppo= rt') \ - .disable_auto_if(not have_system) \ + .disable_auto_if(not have_tools and not have_system) \ .allowed() =20 if get_option('fuse').disabled() and get_option('fuse_lseek').enabled() --=20 MST From nobody Sun Feb 8 12:42:49 2026 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1656394176727551.3893372623887; Mon, 27 Jun 2022 22:29:36 -0700 (PDT) Received: from localhost ([::1]:38672 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o63n5-0001fA-Df for importer@patchew.org; Tue, 28 Jun 2022 01:29:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41598) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6348-0000GB-JJ for qemu-devel@nongnu.org; Tue, 28 Jun 2022 00:43:11 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:40564) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6347-0006tL-3C for qemu-devel@nongnu.org; Tue, 28 Jun 2022 00:43:08 -0400 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-671-xyduXKGIP9KdeBm5qPU2tw-1; Tue, 28 Jun 2022 00:43:05 -0400 Received: by mail-wm1-f72.google.com with SMTP id m17-20020a05600c3b1100b003a04a2f4936so2607222wms.6 for ; Mon, 27 Jun 2022 21:43:04 -0700 (PDT) Received: from redhat.com ([2.52.23.204]) by smtp.gmail.com with ESMTPSA id t11-20020adff60b000000b0021b962f4256sm12109445wrp.80.2022.06.27.21.43.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jun 2022 21:43:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656391386; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0F75Xkg7ztQgcowiItypu8oAqV/zHE5jhJdNwWc/ppM=; b=I+23pb1/J8Xp/Zl59+7LUKyFuIfxTt6faj+qiz9OkqDI+VYzeaXeOj0jQeix7Wd6BIktbL VB1WGLhv2O/o5GZpGNVgzmASvLk2Jdy32qcPfoM187bTQYKu7T866NZLHpVkhp2EP6vxzd OCLiZvGNOYdeH3U2/2wKkFAwzf1X3Ls= X-MC-Unique: xyduXKGIP9KdeBm5qPU2tw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=0F75Xkg7ztQgcowiItypu8oAqV/zHE5jhJdNwWc/ppM=; b=t74tFIi8vJTytdCHiPRVshqVeJYwKvZm3wDGNf87vv54jYsaepfphCiF/Y+Afnr4sb O7mJD+HGs+ZmF1btBz/ctq+BR3UzoVCB9Bb1hFmRsI5Jybij6u9zitwNFO5q75IdSOH8 lbsfqMPATrf+c+bVidMcSlGNmDkxNAN88z+Yiav2ukXDMwiNx39Y6EBi5f9qDkTZhLzh VWIa2EqL4rrZ3E51Eyubjn3wpnL3fTIWyoeZghM7XY/2my9/c1wGtwq43rQGBR7Wr5Fc cd+RHieQVlCUoC2TWSa2oyd/vNwqniDmkwZMTvUOH/HsaBZ6zR0ENmChEjTHN8QC9ycC e4BQ== X-Gm-Message-State: AJIora8Mp9nyqbzaXUTbenD2OHcpQe2nB5LuyX+L9V7qxbqMRi8hvdg5 cM7OrWZnwhb32jHPJlQ05b/xD/tpFcYy8QSvQC60oAY0hPCS5ihITuJTBjGNk1OHrz3oErAyJ2C 4p1ORk2cIfJbKcqqYOtxPeBz/uYRcLJtrV2FJufqDr7hHv4Z7omu7eQm2plUn X-Received: by 2002:a1c:7414:0:b0:3a0:201c:5b7f with SMTP id p20-20020a1c7414000000b003a0201c5b7fmr24007167wmc.170.1656391383667; Mon, 27 Jun 2022 21:43:03 -0700 (PDT) X-Google-Smtp-Source: AGRyM1srcrLEVaiyObgcmdm4XbmtUr4ngnjxYt7JtwuhrlXLXUw5GjwM6d4EG5rd+4h69owrDYru6Q== X-Received: by 2002:a1c:7414:0:b0:3a0:201c:5b7f with SMTP id p20-20020a1c7414000000b003a0201c5b7fmr24007146wmc.170.1656391383453; Mon, 27 Jun 2022 21:43:03 -0700 (PDT) Date: Tue, 28 Jun 2022 00:43:00 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Alex =?utf-8?Q?Benn=C3=A9e?= , Stefan Hajnoczi Subject: [PULL 11/12] include/hw/virtio: document vhost_get_features Message-ID: <20220628044201.217173-12-mst@redhat.com> References: <20220628044201.217173-1-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20220628044201.217173-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, 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 @redhat.com) X-ZM-MESSAGEID: 1656394177967100001 From: Alex Benn=C3=A9e Signed-off-by: Alex Benn=C3=A9e Message-Id: <20220524154056.2896913-4-alex.bennee@linaro.org> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin 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 1e7cbd9a10..bfc71b7c50 100644 --- a/include/hw/virtio/vhost.h +++ b/include/hw/virtio/vhost.h @@ -247,6 +247,17 @@ bool vhost_virtqueue_pending(struct vhost_dev *hdev, i= nt 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_bit= s, uint64_t features); void vhost_ack_features(struct vhost_dev *hdev, const int *feature_bits, --=20 MST From nobody Sun Feb 8 12:42:49 2026 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1656394732770958.2410783037149; Mon, 27 Jun 2022 22:38:52 -0700 (PDT) Received: from localhost ([::1]:48494 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o63w2-00005t-Mk for importer@patchew.org; Tue, 28 Jun 2022 01:38:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41624) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o634D-0000NF-Jv for qemu-devel@nongnu.org; Tue, 28 Jun 2022 00:43:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:37865) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o634C-0006tY-1a for qemu-devel@nongnu.org; Tue, 28 Jun 2022 00:43:13 -0400 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-593-m4bKAoQ-OyCNv69Ot8YPZA-1; Tue, 28 Jun 2022 00:43:08 -0400 Received: by mail-wm1-f69.google.com with SMTP id z11-20020a05600c0a0b00b003a043991610so4282223wmp.8 for ; Mon, 27 Jun 2022 21:43:08 -0700 (PDT) Received: from redhat.com ([2.52.23.204]) by smtp.gmail.com with ESMTPSA id n12-20020a5d6b8c000000b0020c5253d8fcsm14641936wrx.72.2022.06.27.21.43.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jun 2022 21:43:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656391391; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Mn/g7m0RmM5cceBjPMwfMkeTDlaWZwcXKTll3LlqMLQ=; b=N90Ej6LPlPewDm/o07wgXGkw6l9omowsS31ACDq7OZbyUiKO6VMaIEax2GARAUWCJo8s8Q EQWZcU/QNdFbfsBbOJ6K0Yb034tF2LCr/Gi9inho2sbYS4pEUCW9lbxJl92heE+cPS/sJf NFL6BDAvvpi36OO7Skr0dl87EZ+dfIY= X-MC-Unique: m4bKAoQ-OyCNv69Ot8YPZA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=Mn/g7m0RmM5cceBjPMwfMkeTDlaWZwcXKTll3LlqMLQ=; b=kIQoQcvlHHPsF2+cJ6WmZbKv5IS7lbRj1iEMcHIELNVLZxWvEm+3D5Fr/bf95QjMpB zksYuJf0b8VmlDv/3NIgKKIC0J3FZIsy4FqsZWqCYzHs9Vcelv54jIq+qravJRI9DQl+ aZE59w76ImlwM/Q0WUbhN4goUjbPwL4ZuOSHnhf0R9Jja27k6CA41NOXndqns60qGFgX VAD2D2fif3JRakjoN8JsSZFNPcVWycwZVnFpMQ3KFLFeVKS6qATUWDt5RmkklT9ntPFQ Xl9Hk1ey4lxEeHi2SpPfBRyWWbOx4QI7s8JyeoIyRMKrYJx3I3YHRSxUkeQhIkIKpr0O Jmmw== X-Gm-Message-State: AJIora+UIa0hksoSAQ13fQEi8CC6lNVJQsBia4A9qs0vn+Fyekk48mwl 1UkXgIg4rMK9ItHR2Pv+Snr3mhWwVNg+LPANJ49mw28p3M7DScRL+XR74geUvksXGNoa17fQtwS 0JNt8+rCCKkKD1bhIRpQcpzj9ksU02sk7VjVJPNFvTHw+BZRsfvVug7uJmy5U X-Received: by 2002:a05:6000:911:b0:21d:2100:b97b with SMTP id bz17-20020a056000091100b0021d2100b97bmr274225wrb.649.1656391387402; Mon, 27 Jun 2022 21:43:07 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uK/vJbCO7r6NO0Sxj35m9uOgC2de0/4dOqiJVgJdT6jA+3FVCc9igC4VbvmRliQ75a4K4ydA== X-Received: by 2002:a05:6000:911:b0:21d:2100:b97b with SMTP id bz17-20020a056000091100b0021d2100b97bmr274209wrb.649.1656391387143; Mon, 27 Jun 2022 21:43:07 -0700 (PDT) Date: Tue, 28 Jun 2022 00:43:03 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Alex =?utf-8?Q?Benn=C3=A9e?= , Stefan Hajnoczi Subject: [PULL 12/12] include/hw/virtio: document vhost_ack_features Message-ID: <20220628044201.217173-13-mst@redhat.com> References: <20220628044201.217173-1-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20220628044201.217173-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent 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=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, 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 @redhat.com) X-ZM-MESSAGEID: 1656394734644100003 From: Alex Benn=C3=A9e Signed-off-by: Alex Benn=C3=A9e Message-Id: <20220524154056.2896913-5-alex.bennee@linaro.org> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Stefan Hajnoczi --- include/hw/virtio/vhost.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/hw/virtio/vhost.h b/include/hw/virtio/vhost.h index bfc71b7c50..a346f23d13 100644 --- a/include/hw/virtio/vhost.h +++ b/include/hw/virtio/vhost.h @@ -260,6 +260,16 @@ void vhost_virtqueue_mask(struct vhost_dev *hdev, Virt= IODevice *vdev, int n, */ uint64_t vhost_get_features(struct vhost_dev *hdev, const int *feature_bit= s, uint64_t features); + +/** + * vhost_ack_features() - set vhost acked_features + * @hdev: common vhost_dev structure + * @feature_bits: pointer to terminated table of feature bits + * @features: requested feature set + * + * This sets the internal hdev->acked_features to the intersection of + * the backends advertised features and the supported feature_bits. + */ void vhost_ack_features(struct vhost_dev *hdev, const int *feature_bits, uint64_t features); bool vhost_has_free_slot(void); --=20 MST