From patchwork Fri Feb 7 07:40:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Stevens X-Patchwork-Id: 11369901 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DE70F92A for ; Fri, 7 Feb 2020 07:40:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BD42820726 for ; Fri, 7 Feb 2020 07:40:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="a00yJ7l+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726626AbgBGHkw (ORCPT ); Fri, 7 Feb 2020 02:40:52 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:46543 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726136AbgBGHkw (ORCPT ); Fri, 7 Feb 2020 02:40:52 -0500 Received: by mail-pl1-f196.google.com with SMTP id y8so637791pll.13 for ; Thu, 06 Feb 2020 23:40:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/SnnhcW9j2w0zXhHNiNCZH/SGhNXDWdjF8vo2ZrVttU=; b=a00yJ7l+XBLCb3bGDzVE/7Cae2c+1+r8yoXH5HGStzsUPSEHocsZz2/dejlhicpLGF OtRvZikkIRdcMddH34OfDmCSeHAgBewdVkOXTYFnnI6TST3iF8/rIcFpxcJck8wHLf2I algCQguq+ktDwj+91ZQBRqDdqfmfc07yADtus= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/SnnhcW9j2w0zXhHNiNCZH/SGhNXDWdjF8vo2ZrVttU=; b=PDOnORX9UkoeQGUy5pdIslvRF9gDFHwvfGwXvV/4Ua1tSHXYSP2ImfajIhR7Mi9+Uf pMabxuMK2Hcc43P5Lj7hUoPXvE+4bCXxSBFhajz4K9hsfCBbfAxoxhuNHhjvExbIXZ/W sELgaXrvZaqgasdl4Qc0PCw8yHvdNAhXWZbLwU5cQgeXvNq4UxeVQtt8alrA9kMs/cv0 ykfP0dNR2GnxE9im3gGV/BraEyykLWi06QXENMW/5j6gI+XgK5AtRP0CONwT2M70Dy+c BCRBToGbNVcEMYLhu+FqTW+bRvE7/Oey0OYooaMDp1Fh1++5PawD1KxiY6tviDO3t7T7 kUlw== X-Gm-Message-State: APjAAAWUDFrsqNSglzjqupqwcjTKBQ1aQzqpw9eT79YhfJdEcdIhq59d DZi4JjoktDKUpc/0woirMbmAl+BPdNU= X-Google-Smtp-Source: APXvYqw8ntnBPknPgSFy1QDLWy+btnUDt57+Zj0AU/BkHGN0s4uqX8z+48phCu7XPf9wd2i7CfbRTg== X-Received: by 2002:a17:90a:bc41:: with SMTP id t1mr2269084pjv.137.1581061251505; Thu, 06 Feb 2020 23:40:51 -0800 (PST) Received: from localhost ([2401:fa00:8f:203:1f16:51f4:8631:68b2]) by smtp.gmail.com with ESMTPSA id u13sm1474937pjn.29.2020.02.06.23.40.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 06 Feb 2020 23:40:51 -0800 (PST) From: David Stevens To: virtio-comment@lists.oasis-open.org Cc: Gerd Hoffmann , Dylan Reid , Tomasz Figa , Zach Reizner , Keiichi Watanabe , Alexandre Courbot , Alex Lau , =?utf-8?q?St=C3=A9phane_Marchesin?= , Pawel Osciak , Gurchetan Singh , Stefan Hajnoczi , qemu-devel , Linux Media Mailing List , David Stevens Subject: [RFC PATCH v3 1/2] content: define what an exported object is Date: Fri, 7 Feb 2020 16:40:32 +0900 Message-Id: <20200207074033.172289-2-stevensd@chromium.org> X-Mailer: git-send-email 2.25.0.341.g760bfbb309-goog In-Reply-To: <20200207074033.172289-1-stevensd@chromium.org> References: <20200207074033.172289-1-stevensd@chromium.org> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Define a mechanism for sharing objects between different virtio devices. Signed-off-by: David Stevens --- content.tex | 12 ++++++++++++ introduction.tex | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/content.tex b/content.tex index b1ea9b9..ad3723c 100644 --- a/content.tex +++ b/content.tex @@ -373,6 +373,18 @@ \section{Driver Notifications} \label{sec:Virtqueues / Driver notifications} \input{shared-mem.tex} +\section{Exporting Objects}\label{sec:Basic Facilities of a Virtio Device / Exporting Objects} + +When an object created by one virtio device needs to be +shared with a seperate virtio device, the first device can +export the object by generating a UUID which can then +be passed to the second device to identify the object. + +What constitutes an object, how to export objects, and +how to import objects are defined by the individual device +types. It is RECOMMENDED that devices generate version 4 +UUIDs as specified by \hyperref[intro:rfc4122]{[RFC4122]}. + \chapter{General Initialization And Device Operation}\label{sec:General Initialization And Device Operation} We start with an overview of device initialization, then expand on the diff --git a/introduction.tex b/introduction.tex index 40f16f8..fc2aa50 100644 --- a/introduction.tex +++ b/introduction.tex @@ -40,6 +40,10 @@ \section{Normative References}\label{sec:Normative References} \phantomsection\label{intro:rfc2119}\textbf{[RFC2119]} & Bradner S., ``Key words for use in RFCs to Indicate Requirement Levels'', BCP 14, RFC 2119, March 1997. \newline\url{http://www.ietf.org/rfc/rfc2119.txt}\\ + \phantomsection\label{intro:rfc4122}\textbf{[RFC4122]} & +Leach, P., Mealling, M., and R. Salz, ``A Universally Unique +IDentifier (UUID) URN Namespace'', RFC 4122, DOI 10.17487/RFC4122, +July 2005. \newline\url{http://www.ietf.org/rfc/rfc4122.txt}\\ \phantomsection\label{intro:S390 PoP}\textbf{[S390 PoP]} & z/Architecture Principles of Operation, IBM Publication SA22-7832, \newline\url{http://publibfi.boulder.ibm.com/epubs/pdf/dz9zr009.pdf}, and any future revisions\\ \phantomsection\label{intro:S390 Common I/O}\textbf{[S390 Common I/O]} & ESA/390 Common I/O-Device and Self-Description, IBM Publication SA22-7204, \newline\url{http://publibfp.dhe.ibm.com/cgi-bin/bookmgr/BOOKS/dz9ar501/CCONTENTS}, and any future revisions\\ \phantomsection\label{intro:PCI}\textbf{[PCI]} & From patchwork Fri Feb 7 07:40:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Stevens X-Patchwork-Id: 11369903 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C1F1192A for ; Fri, 7 Feb 2020 07:40:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A1BAA214AF for ; Fri, 7 Feb 2020 07:40:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="B2H2rs1r" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726642AbgBGHk6 (ORCPT ); Fri, 7 Feb 2020 02:40:58 -0500 Received: from mail-pj1-f67.google.com ([209.85.216.67]:53634 "EHLO mail-pj1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726136AbgBGHk6 (ORCPT ); Fri, 7 Feb 2020 02:40:58 -0500 Received: by mail-pj1-f67.google.com with SMTP id n96so559636pjc.3 for ; Thu, 06 Feb 2020 23:40:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=K+lFsZ3D7frtdDjFKWe1aGa1gg1H8Ao5Is0znK6p0IQ=; b=B2H2rs1re6i1nnY3F52J+pN3K0qSaFUTXsvR/kHlXEC5q+GAsTwamOojZKavCOw06J 04YDv8/X7jlq0QULXSIqHNVvk6xXg36c/FTbd9jONol/F0ACmVj6f4tkeKEHk4K1ZkIG u5j152fRtHwRIWFWySh1j5lmLHd7OmXZ2TQpA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=K+lFsZ3D7frtdDjFKWe1aGa1gg1H8Ao5Is0znK6p0IQ=; b=K27yKpMtpyDqpJFo5XXXsBMprl1snljdRovFHvQjrg1iewMb/q/3ldigxg+QMI36JF AGXTaNWEQz+aB+lHas47vgIW1pYJU1H4KJ01ZWhHbCMEheBtAadzgL5TLTOls7ub7tth I+wznJIyqcRWWVPiHw636L/dUKAHttOwF87GIvcGsfewYFmngvDG67F6PcAEY7St1vky 1DdPuq3nw001ZGgCrxPMgG4pGCXnGEySjmSNiU/D+PxRcSYi654kiJ4cmrVyE5Gvqpd+ 7huyMF8rbTnN4yJIK4Z7C2/5u9fGd8NJEx/4f9EDoYgKLh3Iwz2H+gOjnDEHN5xjlNNF ntCg== X-Gm-Message-State: APjAAAXTd0A2l+5bfLB5CyRYRuwyowx6JoBbtvfYVyboWWu+6xg4E3Q5 QSQCTpOsoMOmSeQygWxJHZdg1w== X-Google-Smtp-Source: APXvYqwUsuQh7DqVB3QPoHA+aQLMvwcNFHiiFLQVrPJb+M5Yxl0A/kd6Svz1dKsbIQlkD43XLUSFhQ== X-Received: by 2002:a17:90a:a385:: with SMTP id x5mr2366982pjp.102.1581061257481; Thu, 06 Feb 2020 23:40:57 -0800 (PST) Received: from localhost ([2401:fa00:8f:203:1f16:51f4:8631:68b2]) by smtp.gmail.com with ESMTPSA id dw10sm1482749pjb.11.2020.02.06.23.40.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 06 Feb 2020 23:40:57 -0800 (PST) From: David Stevens To: virtio-comment@lists.oasis-open.org Cc: Gerd Hoffmann , Dylan Reid , Tomasz Figa , Zach Reizner , Keiichi Watanabe , Alexandre Courbot , Alex Lau , =?utf-8?q?St=C3=A9phane_Marchesin?= , Pawel Osciak , Gurchetan Singh , Stefan Hajnoczi , qemu-devel , Linux Media Mailing List , David Stevens Subject: [RFC PATCH v3 2/2] virtio-gpu: add the ability to export resources Date: Fri, 7 Feb 2020 16:40:33 +0900 Message-Id: <20200207074033.172289-3-stevensd@chromium.org> X-Mailer: git-send-email 2.25.0.341.g760bfbb309-goog In-Reply-To: <20200207074033.172289-1-stevensd@chromium.org> References: <20200207074033.172289-1-stevensd@chromium.org> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Signed-off-by: David Stevens --- virtio-gpu.tex | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/virtio-gpu.tex b/virtio-gpu.tex index af4ca61..e950ad3 100644 --- a/virtio-gpu.tex +++ b/virtio-gpu.tex @@ -186,12 +186,16 @@ \subsubsection{Device Operation: Request header}\label{sec:Device Types / GPU De VIRTIO_GPU_CMD_UPDATE_CURSOR = 0x0300, VIRTIO_GPU_CMD_MOVE_CURSOR, + /* misc commands */ + VIRTIO_GPU_CMD_RESOURCE_ASSIGN_UUID = 0x0400, + /* success responses */ VIRTIO_GPU_RESP_OK_NODATA = 0x1100, VIRTIO_GPU_RESP_OK_DISPLAY_INFO, VIRTIO_GPU_RESP_OK_CAPSET_INFO, VIRTIO_GPU_RESP_OK_CAPSET, VIRTIO_GPU_RESP_OK_EDID, + VIRTIO_GPU_RESP_OK_RESOURCE_ASSIGN_UUID, /* error responses */ VIRTIO_GPU_RESP_ERR_UNSPEC = 0x1200, @@ -454,6 +458,31 @@ \subsubsection{Device Operation: controlq}\label{sec:Device Types / GPU Device / This detaches any backing pages from a resource, to be used in case of guest swapping or object destruction. +\item[VIRTIO_GPU_CMD_RESOURCE_ASSIGN_UUID] Creates an exported object from + a resource. Request data is \field{struct + virtio_gpu_resource_assign_uuid}. Response type is + VIRTIO_GPU_RESP_OK_RESOURCE_ASSIGN_UUID, response data is \field{struct + virtio_gpu_resp_resource_assign_uuid}. + +\begin{lstlisting} +struct virtio_gpu_resource_assign_uuid { + struct virtio_gpu_ctrl_hdr hdr; + le32 resource_id; + le32 padding; +}; + +struct virtio_gpu_resp_resource_assign_uuid { + struct virtio_gpu_ctrl_hdr hdr; + u8 uuid[16]; +}; +\end{lstlisting} + +The response contains a UUID which identifies the exported object created from +the host private resource. Note that if the resource has an attached backing, +modifications made to the host private resource through the exported object by +other devices are not visible in the attached backing until they are transferred +into the backing. + \end{description} \subsubsection{Device Operation: cursorq}\label{sec:Device Types / GPU Device / Device Operation / Device Operation: cursorq}