[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [RFC] Dom0 PV IOMMU control design (draft A)



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

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.