From nobody Wed Nov 27 20:49:23 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1697645277; cv=none; d=zohomail.com; s=zohoarc; b=E+xf/Zmf4kuUT6McIWwJ7Bi/BaXN+P5v1/yH65nJG768cnRfJblR0/zdqAWLGhGRzBc/8qM4bTU3W/CMdDesa+VJg4AcZGtd2OUobpL1HY1ruiHAqYQ3woDAU3V3h+2Ikc2O5Rsgl/gMK0D1h8tORWVZ2ZWxDSXZg03OMafFHBQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697645277; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=JiiYhEn2+u0WRlW+XdV6xUMe7KHlpW6+J9WCJ40wsY8=; b=fLMy7ELJLjulPB02R6Vj1SMJScLsAXAPr5ipDAYps4al8qzQCNf3ScALenMzMe0M8LeXDAqhYR5UfFHNFTSEZKp/LpRLk4f6vBWBRNIQtt6U8fiTzN1R7YqJM0U1tsyL152u7yOl3PeStlNpWf7lMNcTEn4YLb/5gQ8w7JCJ4Bs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1697645277595419.81062602994893; Wed, 18 Oct 2023 09:07:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qt8y3-0003ub-1E; Wed, 18 Oct 2023 12:00:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qt8xt-0003aH-Hg for qemu-devel@nongnu.org; Wed, 18 Oct 2023 12:00:09 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qt8xr-0007pY-Gc for qemu-devel@nongnu.org; Wed, 18 Oct 2023 12:00:09 -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.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-516-1BJL-xzWN1Okq1HdZfQyRQ-1; Wed, 18 Oct 2023 11:59:54 -0400 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-407558fe418so47214185e9.0 for ; Wed, 18 Oct 2023 08:59:54 -0700 (PDT) Received: from redhat.com ([2a02:14f:1f2:2037:f34:d61b:7da0:a7be]) by smtp.gmail.com with ESMTPSA id w4-20020a5d4b44000000b003271be8440csm2385204wrs.101.2023.10.18.08.59.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 08:59:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697644806; 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=JiiYhEn2+u0WRlW+XdV6xUMe7KHlpW6+J9WCJ40wsY8=; b=V8d5lcilz7WBpzpEBr+UFgG53xroF5xBht1u+yTSXEEfyuzho/DuBd0ui+QzmYEuKUWlzP WETW2MexJbIyoKrslP83Y5qd3tLbsuTVX+ToaX7JUK/NzvUMtQzKpEQ46MW9q4FV7ByQ/V uVj54Tq2+7VOlH/W/VOnb3PbDzU3WS0= X-MC-Unique: 1BJL-xzWN1Okq1HdZfQyRQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697644791; x=1698249591; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=JiiYhEn2+u0WRlW+XdV6xUMe7KHlpW6+J9WCJ40wsY8=; b=MdNbTw7h/C2B17hzPvnpaYUQRW8H9sDX6FO7YCx5dGBfKxgqFkTjvHfhRHI4gtR6q5 NCLLXt56i75mnVntui8WTiJZmwugl39Mb7J5ZHam++e20AEODaZlGwqWaucOXylN95Mc A2tJTv4aik3Wb+eUeDvlStOFX8vMjP8h/o3g1l/NzleWwEdUqcAUZGuT07FCKbTTHAaw sqxewCnOqJxRnXwAWAgHpZW91eV1SQCbxwCDgh9gAtEhjExZAcZkHkrWgwZQbMfoOFdt g88j2sYxY9Q4sFdbs9AaQcpH3C46R1SeskTKQNV+WsMuHZw8lO8HeURY3J3MKO55nXnu iNmw== X-Gm-Message-State: AOJu0YyaLWFW88SmUyt83mBJBawAJT4vNAqXRetp7K8/nkc1qopk75RX MTx3evn83nlDzGmLUfMYtjKd+4gK2kvXjyNaBHxjSj6g20D1HcSdiG6/K6l22KW1T0IAcfrQ7rr P1NxFFrNMBqlOS8WBiZ4rjgg8SLxD8uBiMafn1WnoH+rvadPQv+hBtJ6MQwKMwlhve9OwER4= X-Received: by 2002:a05:600c:46c3:b0:407:5adc:4497 with SMTP id q3-20020a05600c46c300b004075adc4497mr4403161wmo.9.1697644791313; Wed, 18 Oct 2023 08:59:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFCBNE6ahs0MfkCRU/T2kOXiCA/qfxDRNFscrUldC7EgTkk5rEjCk5DAZRC1FEGZixORG+2zA== X-Received: by 2002:a05:600c:46c3:b0:407:5adc:4497 with SMTP id q3-20020a05600c46c300b004075adc4497mr4403141wmo.9.1697644790926; Wed, 18 Oct 2023 08:59:50 -0700 (PDT) Date: Wed, 18 Oct 2023 11:59:46 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Hanna Czenczek , Emmanouil Pitsidianakis , Stefano Garzarella , Viresh Kumar , Stefan Hajnoczi Subject: [PULL 81/83] vhost-user: Fix protocol feature bit conflict Message-ID: <7a71e4031156d9b0c3cdf34d4b48d5724da1eeec.1697644299.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: 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: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1697645278853100002 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Hanna Czenczek The VHOST_USER_PROTOCOL_F_XEN_MMAP feature bit was defined in f21e95ee97d, which has been part of qemu's 8.1.0 release. However, it seems it was never added to qemu's code, but it is well possible that it is already used by different front-ends outside of qemu (i.e., Xen). VHOST_USER_PROTOCOL_F_SHARED_OBJECT in contrast was added to qemu's code in 16094766627, but never defined in the vhost-user specification. As a consequence, both bits were defined to be 17, which cannot work. Regardless of whether actual code or the specification should take precedence, F_XEN_MMAP is already part of a qemu release, while F_SHARED_OBJECT is not. Therefore, bump the latter to take number 18 instead of 17, and add this to the specification. Take the opportunity to add at least a little note on the VhostUserShared structure to the specification. This structure is referenced by the new commands introduced in 16094766627, but was not defined. Fixes: 160947666276c5b7f6bca4d746bcac2966635d79 ("vhost-user: add shared_object msg") Signed-off-by: Hanna Czenczek Message-Id: <20231016083201.23736-1-hreitz@redhat.com> Reviewed-by: Emmanouil Pitsidianakis Reviewed-by: Stefano Garzarella Reviewed-by: Viresh Kumar Reviewed-by: Stefan Hajnoczi Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/virtio/vhost-user.h | 3 ++- subprojects/libvhost-user/libvhost-user.h | 3 ++- docs/interop/vhost-user.rst | 11 +++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/include/hw/virtio/vhost-user.h b/include/hw/virtio/vhost-user.h index 6b06ecb1bd..20b69d8e85 100644 --- a/include/hw/virtio/vhost-user.h +++ b/include/hw/virtio/vhost-user.h @@ -29,7 +29,8 @@ enum VhostUserProtocolFeature { VHOST_USER_PROTOCOL_F_INBAND_NOTIFICATIONS =3D 14, VHOST_USER_PROTOCOL_F_CONFIGURE_MEM_SLOTS =3D 15, VHOST_USER_PROTOCOL_F_STATUS =3D 16, - VHOST_USER_PROTOCOL_F_SHARED_OBJECT =3D 17, + /* Feature 17 reserved for VHOST_USER_PROTOCOL_F_XEN_MMAP. */ + VHOST_USER_PROTOCOL_F_SHARED_OBJECT =3D 18, VHOST_USER_PROTOCOL_F_MAX }; =20 diff --git a/subprojects/libvhost-user/libvhost-user.h b/subprojects/libvho= st-user/libvhost-user.h index b36a42a7ca..c2352904f0 100644 --- a/subprojects/libvhost-user/libvhost-user.h +++ b/subprojects/libvhost-user/libvhost-user.h @@ -65,7 +65,8 @@ enum VhostUserProtocolFeature { VHOST_USER_PROTOCOL_F_INBAND_NOTIFICATIONS =3D 14, VHOST_USER_PROTOCOL_F_CONFIGURE_MEM_SLOTS =3D 15, /* Feature 16 is reserved for VHOST_USER_PROTOCOL_F_STATUS. */ - VHOST_USER_PROTOCOL_F_SHARED_OBJECT =3D 17, + /* Feature 17 reserved for VHOST_USER_PROTOCOL_F_XEN_MMAP. */ + VHOST_USER_PROTOCOL_F_SHARED_OBJECT =3D 18, VHOST_USER_PROTOCOL_F_MAX }; =20 diff --git a/docs/interop/vhost-user.rst b/docs/interop/vhost-user.rst index 415bb47a19..768fb5c28c 100644 --- a/docs/interop/vhost-user.rst +++ b/docs/interop/vhost-user.rst @@ -275,6 +275,16 @@ Inflight description =20 :queue size: a 16-bit size of virtqueues =20 +VhostUserShared +^^^^^^^^^^^^^^^ + ++------+ +| UUID | ++------+ + +:UUID: 16 bytes UUID, whose first three components (a 32-bit value, then + two 16-bit values) are stored in big endian. + C structure ----------- =20 @@ -885,6 +895,7 @@ Protocol features #define VHOST_USER_PROTOCOL_F_CONFIGURE_MEM_SLOTS 15 #define VHOST_USER_PROTOCOL_F_STATUS 16 #define VHOST_USER_PROTOCOL_F_XEN_MMAP 17 + #define VHOST_USER_PROTOCOL_F_SHARED_OBJECT 18 =20 Front-end message types ----------------------- --=20 MST