From patchwork Wed Jan 22 07:16:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Stevens X-Patchwork-Id: 11345117 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 AE4F5109A for ; Wed, 22 Jan 2020 07:17:46 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 852FE24125 for ; Wed, 22 Jan 2020 07:17:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="P8ugtCzb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 852FE24125 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:37818 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuAGn-00028r-8w for patchwork-qemu-devel@patchwork.kernel.org; Wed, 22 Jan 2020 02:17:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38034) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuAFg-0000eb-TD for qemu-devel@nongnu.org; Wed, 22 Jan 2020 02:16:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iuAFf-0003fT-Ta for qemu-devel@nongnu.org; Wed, 22 Jan 2020 02:16:36 -0500 Received: from mail-qv1-xf2d.google.com ([2607:f8b0:4864:20::f2d]:38814) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iuAFf-0003fN-Q3 for qemu-devel@nongnu.org; Wed, 22 Jan 2020 02:16:35 -0500 Received: by mail-qv1-xf2d.google.com with SMTP id t6so2774864qvs.5 for ; Tue, 21 Jan 2020 23:16:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:from:date:message-id:subject:to; bh=IvHhZTaEUivWZW7zpZ8DN7CQvbWtXPcmSa5wCq98Ixw=; b=P8ugtCzbkP+LO9jzvfAgOeaiG9+8w6QYuAgDVCuEBVTCjwol8ntvM1zLsctTH4ueyf 9ROg+UEB9idsIrOVHCdx+ihRYEXdd9tF4dqyB9jChAibTKSNlWptCgmckOb+qppc2lIa qWFGBnuG8IwjSCQ6c0YWH7PbgvLOLfzGR/ddM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=IvHhZTaEUivWZW7zpZ8DN7CQvbWtXPcmSa5wCq98Ixw=; b=q6a9ovvIJEp9yWkiasd65HC0BzvVeIxrAjFI0UvV4Que+sTtC07UbigEBa7oTdCM2z Qu0VuXsT6kKvthjjDuCK8v2qiNhq883QGvgeqs6OICGokyY/ZONKP6ct7eHVia1xt9c/ xBnhtMIZXSL3mmg4zKrq9GastiOL2YVoEZ0OQsXpY/MBJxwzHXhOv59Lp3+74RsK3Vr2 9GCvJQejWcaAgFTj5waY0/Qw7h/EkYjjihEFBQn9AvG5njrYLsPeHtB7KHX89y/gtd4I 18lSIyESgQKEdnDl9EshkgZxgLQZnxEdyDHZ9+eeAvJV07+fr6v75BKS8gIzdHeeIu6T p+NA== X-Gm-Message-State: APjAAAXoyGkOvzUqpaUYWsEfen4YdAEHjaB9HeenAdOnAxyKHv8Rqgv4 Nn0hiro4XDJ9aEFcqMXfh7FhEbACDj1c82YbfMqytA== X-Google-Smtp-Source: APXvYqx4RcN53n670UPjMJvlSwx4cAxbVDFWfbUJ+hfzwTe5JQ7PUS6PtSim2s67oYcZ7Rgpqyh668b+ckkT+d6OFio= X-Received: by 2002:a05:6214:10c1:: with SMTP id r1mr9111779qvs.70.1579677395313; Tue, 21 Jan 2020 23:16:35 -0800 (PST) MIME-Version: 1.0 From: David Stevens Date: Wed, 22 Jan 2020 16:16:24 +0900 Message-ID: Subject: [virtio-dev][RFC PATCH v1 1/2] content: define what an exported object is To: virtio-dev@lists.oasis-open.org, 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 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::f2d X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Define a mechanism for sharing objects between different virtio devices. Signed-off-by: David Stevens --- content.tex | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) Operation}\label{sec:General Initialization And Device Operation} We start with an overview of device initialization, then expand on the diff --git a/content.tex b/content.tex index b1ea9b9..6c6dd59 100644 --- a/content.tex +++ b/content.tex @@ -373,6 +373,24 @@ \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 \field{uuid} which the +guest can pass 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. The generation method of a \field{uuid} is dependent +upon the implementation of the exporting device. + +Whether a particular exported object can be imported into +a device is dependent upon the implementations of the exporting +and importing devices. Generally speaking, the guest should +have some knowledge of the host configuration before trying to +use exported objects. + \chapter{General Initialization And Device From patchwork Wed Jan 22 07:16:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Stevens X-Patchwork-Id: 11345119 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 A47526C1 for ; Wed, 22 Jan 2020 07:18:12 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7B67724125 for ; Wed, 22 Jan 2020 07:18:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="WUTU484r" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7B67724125 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:37822 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuAHD-0002UH-2q for patchwork-qemu-devel@patchwork.kernel.org; Wed, 22 Jan 2020 02:18:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38046) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuAFr-0000sf-Gr for qemu-devel@nongnu.org; Wed, 22 Jan 2020 02:16:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iuAFq-0003yf-EH for qemu-devel@nongnu.org; Wed, 22 Jan 2020 02:16:47 -0500 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]:44820) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iuAFq-0003yZ-An for qemu-devel@nongnu.org; Wed, 22 Jan 2020 02:16:46 -0500 Received: by mail-qk1-x743.google.com with SMTP id v195so5307472qkb.11 for ; Tue, 21 Jan 2020 23:16:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:from:date:message-id:subject:to; bh=ruTth2SibQcS4nk9Gf6g9LTfMVTSZKHhb1gYl0J71UE=; b=WUTU484rqARIGpOr209E6p6EtWXiw3rCoM/7LGnsB+Udc1fuDNKvJnxaPCf3xJct/0 ZBr2o3wgiKDJ7evtT++c3Optb1vklYeurO5XXbe8X8ax3JjPYmIt6yeyEp0iCWiJWi5e 1B/++Q55mz8TxogKqa0W09ib6Fmc8IK7oG1zM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=ruTth2SibQcS4nk9Gf6g9LTfMVTSZKHhb1gYl0J71UE=; b=XYtc7JlEkmYSnr70ZtkK1U/NlaMgzLanH57H2PTl6OB6Wm3RzrDuPWerOsq/MAY9/X lcjn0BeM7XEl8Y9FRG4SP84nuUs/+ggRynx5EQLIGth97d/Qwzap4hOhwdmHg5HFz0Dz QzfjKZ0alR0ZTniAxB3ZcPQrGbUcxH+3kce28lEWqyTe8YuoMkdTsV3vM3vh0TkFCv4+ 3Z9MkbKaQEd9HEn6F/jc8PRvijm52QNfI96nb1WKWVtMuM1SjrU9X0CsqCYW68c3rSlK Cd+tAasrqf1Ra7eU0qu3Efoan5CxilENsQpjCbtb+8uMY4BCvG7UMs8zhUoOqRmrEFDT Rz0w== X-Gm-Message-State: APjAAAUd9VbkX1Aik3mzS/evLfidJ0T1+Ax9S4Pq2oKk9kIv7TNd7cTS BPYVPMfQJl8ZbuTumYkpaMVKjsheShccUJsXCG4sFg== X-Google-Smtp-Source: APXvYqxMdoQBEZzRhyTMnhf8TLG9ar6fdpwRZltYldYlEOkgyU4Jw9cUYTNHnaqSyrJprSWLpXLpo2br6QqFcOdBoYQ= X-Received: by 2002:a05:620a:101b:: with SMTP id z27mr8188226qkj.241.1579677405843; Tue, 21 Jan 2020 23:16:45 -0800 (PST) MIME-Version: 1.0 From: David Stevens Date: Wed, 22 Jan 2020 16:16:35 +0900 Message-ID: Subject: [virtio-dev][RFC PATCH v1 2/2] virtio-gpu: add the ability to export resources To: virtio-dev@lists.oasis-open.org, 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 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::743 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: David Stevens --- virtio-gpu.tex | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) VIRTIO_GPU_RESP_ERR_UNSPEC = 0x1200, @@ -454,6 +458,32 @@ \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; + le64 uuid_low; + le64 uuid_high; +}; +\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} diff --git a/virtio-gpu.tex b/virtio-gpu.tex index af4ca61..a1f0210 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 */