public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Alex Williamson <alex.williamson@redhat.com>
To: Stuart Yoder <b08248@gmail.com>
Cc: Alexey Kardashevskiy <aik@au1.ibm.com>,
	Joerg Roedel <joerg.roedel@amd.com>,
	Scott Wood <scottwood@freescale.com>,
	Alexander Graf <agraf@suse.de>,
	kvm@vger.kernel.org, iommu@lists.linux-foundation.org,
	varun.sethi@freescale.com
Subject: Re: RFC: extend iommu_ops with domain attributes API
Date: Thu, 12 Jan 2012 10:14:31 -0700	[thread overview]
Message-ID: <1326388471.2958.2.camel@x201.home> (raw)
In-Reply-To: <CALRxmdDFR0zFaBKHu-Wz750_KtV4TnRdhNhBDcGcSdigiSO4Tw@mail.gmail.com>

On Tue, 2012-01-10 at 10:22 -0600, Stuart Yoder wrote:
> As we work on mapping the Freescale IOMMU (called PAMU) into the existing
> Linux iommu infrastructure, one issue is that we have additional domain
> attributes that need to be set.   This was discussed briefly a month ago
> or so and I believe there was a need for a similar mechanism by IBM.
> 
> We are proposing a couple of APIs to be added to iommu_ops to
> get/set domain attributes:
> 
>    int domain_set_attr(struct iommu_domain *domain, int attr_type, void *data);
>    int domain_get_attr(struct iommu_domain *domain, int attr_type, void *data);
> 
> A couple of the attributes I'm considering PAMU specific with a generic
> enable attribute:
> 
>    enum iommu_attr_type {
>        IOMMU_ATTR_PAMU_GEOMETRY,       // the PAMU geometry for the domain
>        IOMMU_ATTR_PAMU_STASH,          // stash characteristics for a domain
>        IOMMU_ATTR_ENABLE
>    };
> 
>    The data for each attribute value is defined as:
> 
>    IOMMU_ATTR_PAMU_GEOMETRY - data is a struct:
> 
>       struct dma_geometry_attr {
>           u64 iova;          // iova of the DMA domain
>           u32 size;          // must be a power of 2 and be greater
>                              // or equal than 4KB.
>           u32 subwin_cnt;    // power of 2 between 1 and 256

Agree with Joerg's comments.  size/subwin count should probably both be
u64 if generalized and the restrictions would be iommu dependent.  Is
this also where we should expose a bitmap of available mapping sizes?
Thanks,

Alex


      parent reply	other threads:[~2012-01-12 17:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-10 16:22 RFC: extend iommu_ops with domain attributes API Stuart Yoder
2012-01-12 14:47 ` Joerg Roedel
2012-01-12 16:41   ` Scott Wood
2012-01-12 21:28     ` Stuart Yoder
2012-01-12 17:14 ` Alex Williamson [this message]

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=1326388471.2958.2.camel@x201.home \
    --to=alex.williamson@redhat.com \
    --cc=agraf@suse.de \
    --cc=aik@au1.ibm.com \
    --cc=b08248@gmail.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joerg.roedel@amd.com \
    --cc=kvm@vger.kernel.org \
    --cc=scottwood@freescale.com \
    --cc=varun.sethi@freescale.com \
    /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