xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: David Vrabel <david.vrabel@citrix.com>
To: Malcolm Crossley <malcolm.crossley@citrix.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [RFC] Dom0 PV IOMMU control design (draft A)
Date: Mon, 14 Apr 2014 12:52:18 +0100	[thread overview]
Message-ID: <534BCBF2.9030505@citrix.com> (raw)
In-Reply-To: <5348264B.1040800@citrix.com>

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

  parent reply	other threads:[~2014-04-14 11:52 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-11 17:28 [RFC] Dom0 PV IOMMU control design (draft A) Malcolm Crossley
2014-04-11 17:50 ` Konrad Rzeszutek Wilk
2014-04-14 12:12   ` Malcolm Crossley
2014-04-14 12:51     ` Konrad Rzeszutek Wilk
2014-04-14 15:03       ` Malcolm Crossley
2014-04-14 15:09         ` Konrad Rzeszutek Wilk
2014-04-14 15:48         ` Jan Beulich
2014-04-14 16:38           ` Malcolm Crossley
2014-04-15  6:50             ` Jan Beulich
2014-04-14 11:52 ` David Vrabel [this message]
2014-04-14 13:47 ` Jan Beulich
2014-04-14 15:48   ` Malcolm Crossley
2014-04-14 16:00     ` Jan Beulich
2014-04-14 16:55       ` Malcolm Crossley
2014-04-15  6:56         ` Jan Beulich
2014-05-01 11:56     ` Tim Deegan
2014-04-16 14:13 ` Zhang, Xiantao
2014-04-16 15:35   ` Malcolm Crossley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=534BCBF2.9030505@citrix.com \
    --to=david.vrabel@citrix.com \
    --cc=malcolm.crossley@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).