From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Vrabel Subject: Re: [RFC] Dom0 PV IOMMU control design (draft A) Date: Mon, 14 Apr 2014 12:52:18 +0100 Message-ID: <534BCBF2.9030505@citrix.com> References: <5348264B.1040800@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WZfR0-00073w-MZ for xen-devel@lists.xenproject.org; Mon, 14 Apr 2014 11:52:22 +0000 In-Reply-To: <5348264B.1040800@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Malcolm Crossley Cc: xen-devel List-Id: xen-devel@lists.xenproject.org On 11/04/14 18:28, Malcolm Crossley wrote: > Purpose > ======= > > Allow Xen Domain 0 PV guests to create/modify/destroy IOMMU mappings for > hardware devices that Domain 0 has access to. This enables Domain 0 to > program > a bus address space mapping which matches it's GPFN mapping. Once a 1-1 > mapping of GPFN to bus address space is created then a bounce buffer > region is not required for the IO devices connected to the IOMMU. I think this needs to be expanded on further. Suggest an additional section on the design of the Linux/guest side. > IOMMUOP_map_page > ---------------- > First argument, pointer to array of `struct iommu_map_op` > Second argument, integer count of `struct iommu_map_op` elements in array Perhaps a C function prototype here would be clearer? > The IOMMU TLB will only be flushed when the hypercall completes or a > hypercall > continuation is created. The IOMMU TLB flush should be when all the ops are complete. There's no need to flush when doing a continuation. > Field Purpose > ----- --------------------------------------------------------------- > `bfn` [in] Bus address frame number to mapped to specified mfn > below > > `mfn` [in] Machine address frame number > > `flags` [in] Flags for signalling type of IOMMU mapping to be > created > > `status` [out] Mapping status of this map operation, 0 indicates > success Need to define the failure codes. Perhaps similar to the grant table op status codes? > ------------------------------------------------------------------------------ > > > > Defined bits for flags field > ------------------------------------------------------------------------ > Name Bit Definition > ---- ----- ---------------------------------- > IOMMU_MAP_OP_readable 0 Create readable IOMMU mapping > IOMMU_MAP_OP_writeable 1 Create writeable IOMMU mapping > Reserved for future use 2-31 n/a > ------------------------------------------------------------------------ Should state that it is not possible to create write-only mappings (since not all hardware supports this). > Additional error codes specific to this hypercall: > > Error code Reason > ---------- ------------------------------------------------------------ > EPERM PV IOMMU mode not enabled or calling domain is not domain 0 ENOSYS for PV IOMMU not enabled perhaps? And similarly for unmap. David