All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Wei Wang2" <wei.wang2@amd.com>
To: Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
Cc: muli@il.ibm.com, xen-devel@lists.xensource.com,
	Michael.Hohmuth@amd.com, thomas.woller@amd.com,
	iommu@lists.linux-foundation.org, Uwe.Dannowski@amd.com
Subject: Re: [XEN-IOMMU] Proposal of DMA protection/isolation support
Date: Thu, 10 Jan 2008 18:31:54 +0100	[thread overview]
Message-ID: <1199986314.4405.157.camel@gran.amd.com> (raw)
In-Reply-To: <C3ABFF33.1A94F%Keir.Fraser@cl.cam.ac.uk>

If a halfway work can trigger any de-initialization routines, perhaps
device driver will deallocate dma pages which are in use and iommu
unmapping can be triggered?

-Wei

On Thu, 2008-01-10 at 16:58 +0000, Keir Fraser wrote:
> Grant mappings will only be triggered for I/O to/from foreign domains. I'm
> not really convinced that protecting a driver domain's own memory against
> errant DMAs is that important anyway. Firstly, there are many other ways
> that a buggy driver can screw its domain, other than errant DMA. Secondly,
> any driver that haflway works will request a DMA mapping from the OS before
> it initiates any DMA (otherwise the driver would *never* work) and that
> would probably be the point at which the OS would set up the iommu mapping.
> That's the problem -- the OS will be trusting the driver to tell it when a
> mapping should be set up, and that request will usually be co-located in the
> driver code with the actual DMA initiation. So if the driver is issuing
> errant DMAs, the OS is rather likely to let them happen!
> 
>  -- Keir
> 
> 
> On 10/1/08 16:52, "Wei Wang2" <wei.wang2@amd.com> wrote:
> 
> > On Thu, 2008-01-10 at 15:54 +0000, Keir Fraser wrote:
> >> Grant table mappings/unmappings are an obvious place where we already trap
> >> to the hypervisor and could make correspodning changes to iommu mappings?
> > Can grant mapping cover the situation in which a device only be accessed
> > by a driver domain other than be shared with any remote domain? In other
> > word, when a device is only access by a driver domain, does grant table
> > mapping still happen? If yes, it is the best way to go.
> > 
> >> It depends if we want the iommu to do any more than prevent arbitrary DMA
> >> access to foreign pages. What's the threat model you are wanting to use the
> >> iommu to protect against?
> > I think IOMMU can help to prevent buggy driver from destroying memory content
> > of both 
> > driver domain itself and foreign domain. Proper IO address which is
> > requested by device driver should only be provided by some pre-defined
> > interfaces/hypercalls.  Arbitrary dma addresses written to a device by a
> > buggy driver will not trigger address translations.
> 
> 
> 
> 

  reply	other threads:[~2008-01-10 17:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-10 15:48 [XEN-IOMMU] Proposal of DMA protection/isolation support Wei Wang2
2008-01-10 15:54 ` Keir Fraser
2008-01-10 16:52   ` Wei Wang2
2008-01-10 16:58     ` Keir Fraser
2008-01-10 17:31       ` Wei Wang2 [this message]
2008-01-16 16:34       ` Wei Wang2
2008-01-16 16:45         ` Keir Fraser
2008-01-16 17:15           ` Wei Wang2
2008-01-16 18:25             ` Keir Fraser
2008-01-17  0:11         ` Re: [XEN-IOMMU] Proposal of DMA protection/isolationsupport Ian Pratt
2008-01-18  8:10           ` tgh
2008-01-12 11:45 ` [XEN-IOMMU] Proposal of DMA protection/isolation support Amit Shah

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=1199986314.4405.157.camel@gran.amd.com \
    --to=wei.wang2@amd.com \
    --cc=Keir.Fraser@cl.cam.ac.uk \
    --cc=Michael.Hohmuth@amd.com \
    --cc=Uwe.Dannowski@amd.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=muli@il.ibm.com \
    --cc=thomas.woller@amd.com \
    --cc=xen-devel@lists.xensource.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.