From patchwork Tue Apr 25 07:45:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 676807 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a41:0:0:0:0:0 with SMTP id v1csp2562395wrs; Tue, 25 Apr 2023 00:49:26 -0700 (PDT) X-Google-Smtp-Source: AKy350acV43Vw0ypjz31lQVZ1EDc5dPJeZ8cYu0woPj7tpbqA2xJUapYtP+jFzUZ75P8x0x53mqz X-Received: by 2002:a05:6214:4012:b0:5df:4d3e:b8e0 with SMTP id kd18-20020a056214401200b005df4d3eb8e0mr23169122qvb.4.1682408966521; Tue, 25 Apr 2023 00:49:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682408966; cv=none; d=google.com; s=arc-20160816; b=LFEra7fGSelyYcD7xNmNGT/dg1fxa5sZhiAOmvF0cbSI15ASxQavifPSrV/DAHq+f2 mywQVnQJ9bMx1OAqEK1M3dBh3/kL6HRadqRxJc91Mdo9qup7NXhviWhRYgF9oYTbZu0t Gd1O49BvM4+O6x2wo0fxmAB4mcEQ2HV5+GVbYe1C/C4HYUuqQsNxGQHJbIkGz/sMqQ/D SfOXlvM63Zu4D7M83OWL8txD/LAF65ql2AeJbfcndYTjN4G9nJmKp6DrCURiaW2yeSVt g+w1GHLl2Nbg89rcNOA/KLxNsXeo1KSpW7zzj6hhtGBrJuFHMPpkG3+EVLLaYeFbMW2q X4NQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=7XpLwGyAuffmak/eTKXXpWJi44gue+ywAUu/QiqjzQo=; b=VRbc/407mkzd46WW1xAukWO/fQSEYfbT5w8IKOTiyTJG62D6lAlUdDJa8v/KsDBNie wL27H2ZM/9ZRTBAqYfXuyTJYmgtx2ZXOuTEvL5opo7tXVvGW+pWGXBkjb0Owf0/XlAM5 NqcGT+97HcszCchVmUl75Ev3AKIWUQc1uops4bM3lxFEf/sgFQVHxTlsl3UN50kDped8 J7TW3wDRMgiYpMGEfukQjb+pu1TO6GxhAmWPxn/rHI0Ay+qbmmD93cao/OF9bc238Inh RzkFerwQNkPccFnPtRgNWGQ+bzIYDfv84eTl8jsfugFNPiFiwxYmXNt0LsDBxvDKjIh6 zwVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FNz7bSgj; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id dv4-20020ad44ee4000000b0056ea7340b30si8453738qvb.177.2023.04.25.00.49.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 25 Apr 2023 00:49:26 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FNz7bSgj; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prDMd-0006V1-RZ; Tue, 25 Apr 2023 03:45:29 -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 1prDMQ-0006Ks-2a for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:45:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1prDMO-0006c9-AY for qemu-devel@nongnu.org; Tue, 25 Apr 2023 03:45:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682408711; 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=7XpLwGyAuffmak/eTKXXpWJi44gue+ywAUu/QiqjzQo=; b=FNz7bSgjOeUKc5eVafHGJ0K+2DCkjStRnbgMKQcHje8HVKnwJrqh/9AfjDuMpyustDVZQy QZc1yyd7fhZreJzwy/Tf+DeLdT6abPY+wMLdAbIQvY9gA4pHh9CJlDtHqSbntezP85MWM2 lwM2VbDYlx0lZe+NRcYl64pW2EImFqI= 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.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-611-SH2i4_KRMpq1c5qcbfU5Fw-1; Tue, 25 Apr 2023 03:45:10 -0400 X-MC-Unique: SH2i4_KRMpq1c5qcbfU5Fw-1 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-3f195c06507so51448885e9.1 for ; Tue, 25 Apr 2023 00:45:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682408708; x=1685000708; h=in-reply-to:content-transfer-encoding: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=7XpLwGyAuffmak/eTKXXpWJi44gue+ywAUu/QiqjzQo=; b=DTEGNAPs9oTo+lW4NogqRrfg4i7JVSbD+LZ25GGCHQucKvp73CvY1GgDZ6VCZGyRlp GXZBh9gWYtoIpJSLx7RG7g6lxb+kqk25fhIY9orkfVTrSAHuhAUgNy01ucrIvI+LgsVY o2oojotZAibcVwAKOZNKQRr3h/cCMY2aR9xTRIRwTq4qLBy1RxyUtCklEwfxDiXnoroS IXO24Z42CinNzj0z5LgdWCZFiwq7jkppNCpnpvKNKV6s0VtTkZPZEUUWDIfrnQZsc43/ x2PgC1VHO38NUlGsCt/vEZyDdA4iLKOjsaMYHdyjINgiP/NgSn6K7Id5vHGDjGnxMCpj Z07w== X-Gm-Message-State: AAQBX9cwnStfc7pIKQ5Fe6OdPd2snuZwa+KlGTgsGQTcKDcHzZwXaYyp SRw3YKXN0gOF6inLaTwIF345j3tyKce4w6UEYiKRo0znEVpWo5qlqmKgpBd0TVWJAy0WUVIdNUJ JVLpo17OUSdZGtG+7L82gdcRo+1nYiJfmmJEObszXFVJFb5SC8AipzuFHIaiAZMUUJ0je X-Received: by 2002:a7b:cc15:0:b0:3f1:65cb:8156 with SMTP id f21-20020a7bcc15000000b003f165cb8156mr9786377wmh.0.1682408708616; Tue, 25 Apr 2023 00:45:08 -0700 (PDT) X-Received: by 2002:a7b:cc15:0:b0:3f1:65cb:8156 with SMTP id f21-20020a7bcc15000000b003f165cb8156mr9786349wmh.0.1682408708255; Tue, 25 Apr 2023 00:45:08 -0700 (PDT) Received: from redhat.com ([2.55.61.39]) by smtp.gmail.com with ESMTPSA id f22-20020a1c6a16000000b003f17e79d74asm14278190wmc.7.2023.04.25.00.45.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Apr 2023 00:45:07 -0700 (PDT) Date: Tue, 25 Apr 2023 03:45:05 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Viresh Kumar , Stefan Hajnoczi , Alex =?utf-8?q?Benn=C3=A9e?= Subject: [PULL 06/31] docs: vhost-user: Define memory region separately Message-ID: <17c67f6849551b2bbffb7a3a8b490b853df86129.1682408661.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 client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.171, 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_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Viresh Kumar The same layout is defined twice, once in "single memory region description" and then in "memory regions description". Separate out details of memory region from these two and reuse the same definition later on. While at it, also rename "memory regions description" to "multiple memory regions description", to avoid potential confusion around similar names. And define single region before multiple ones. This is just a documentation optimization, the protocol remains the same. Signed-off-by: Viresh Kumar Message-Id: <7c3718e5eb99178b22696682ae73aca6df1899c7.1678351495.git.viresh.kumar@linaro.org> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Stefan Hajnoczi Reviewed-by: Alex Bennée --- docs/interop/vhost-user.rst | 39 +++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/docs/interop/vhost-user.rst b/docs/interop/vhost-user.rst index 8a5924ea75..1720d68126 100644 --- a/docs/interop/vhost-user.rst +++ b/docs/interop/vhost-user.rst @@ -130,18 +130,8 @@ A vring address description Note that a ring address is an IOVA if ``VIRTIO_F_IOMMU_PLATFORM`` has been negotiated. Otherwise it is a user address. -Memory regions description -^^^^^^^^^^^^^^^^^^^^^^^^^^ - -+-------------+---------+---------+-----+---------+ -| num regions | padding | region0 | ... | region7 | -+-------------+---------+---------+-----+---------+ - -:num regions: a 32-bit number of regions - -:padding: 32-bit - -A region is: +Memory region description +^^^^^^^^^^^^^^^^^^^^^^^^^ +---------------+------+--------------+-------------+ | guest address | size | user address | mmap offset | @@ -158,19 +148,26 @@ A region is: Single memory region description ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -+---------+---------------+------+--------------+-------------+ -| padding | guest address | size | user address | mmap offset | -+---------+---------------+------+--------------+-------------+ ++---------+--------+ +| padding | region | ++---------+--------+ :padding: 64-bit -:guest address: a 64-bit guest address of the region +A region is represented by Memory region description. -:size: a 64-bit size +Multiple Memory regions description +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -:user address: a 64-bit user address ++-------------+---------+---------+-----+---------+ +| num regions | padding | region0 | ... | region7 | ++-------------+---------+---------+-----+---------+ -:mmap offset: 64-bit offset where region starts in the mapped memory +:num regions: a 32-bit number of regions + +:padding: 32-bit + +A region is represented by Memory region description. Log description ^^^^^^^^^^^^^^^ @@ -952,8 +949,8 @@ Front-end message types ``VHOST_USER_SET_MEM_TABLE`` :id: 5 :equivalent ioctl: ``VHOST_SET_MEM_TABLE`` - :request payload: memory regions description - :reply payload: (postcopy only) memory regions description + :request payload: multiple memory regions description + :reply payload: (postcopy only) multiple memory regions description Sets the memory map regions on the back-end so it can translate the vring addresses. In the ancillary data there is an array of file