From: Joerg Roedel <joerg.roedel-5C7GfCeVMHo@public.gmane.org>
To: Chris Wright <chrisw-69jw2NvuJkxg9hUCZPvPmw@public.gmane.org>
Cc: "Alexandra N. Kossovsky"
<Alexandra.Kossovsky-mK/T7fl7eHLILq5++fvS8w@public.gmane.org>,
iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
Robert Stonehouse
<rstonehouse-s/n/eUQHGBpZroRs9YW3xA@public.gmane.org>
Subject: Re: atomic context for iommu_map call
Date: Mon, 9 Jul 2012 11:42:10 +0200 [thread overview]
Message-ID: <20120709094210.GH2639@amd.com> (raw)
In-Reply-To: <20120626180743.GV15796-JyIX8gxvWYPr2PDY2+4mTGD2FQJk+8+b@public.gmane.org>
On Tue, Jun 26, 2012 at 11:07:43AM -0700, Chris Wright wrote:
> * Joerg Roedel (joerg.roedel-5C7GfCeVMHo@public.gmane.org) wrote:
> > On Fri, Jun 22, 2012 at 03:28:14PM +0400, Alexandra N. Kossovsky wrote:
> > > Hello.
> > >
> > > It is not clear from the documentation if iommu_map()/iommu_unmap()
> > > functions may be called from atomic context.
> > > In case of Intel IOMMU, it works; in case of AMD IOMMU, it does not.
> > >
> > > Was it done by purpose? May I propose a patch for AMD IOMMU replacing
> > > GFP_KERNEL by GFP_ATOMIC to make things better?
> >
> > Well, a better option would be to have an iommu_map_atomic() alongside
> > the current iommu_map API call.
>
> A simple change for ->map to include flags and an iommu_map_atomic helper
> that calls ->map w/ GFP_ATOMIC will hit this in AMD IOMMU:
>
> mutex_lock(&domain->api_lock);
> - ret = iommu_map_page(domain, iova, paddr, prot, page_size);
> + ret = iommu_map_page(domain, iova, paddr, prot, page_size, flags);
> mutex_unlock(&domain->api_lock);
Yes, something like this was in my mind too. Can you send this as a real
patch-set for inclusion or is it better if someone else is picking this
up?
Joerg
--
AMD Operating System Research Center
Advanced Micro Devices GmbH Einsteinring 24 85609 Dornach
General Managers: Alberto Bozzo
Registration: Dornach, Landkr. Muenchen; Registerger. Muenchen, HRB Nr. 43632
prev parent reply other threads:[~2012-07-09 9:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-22 11:28 atomic context for iommu_map call Alexandra N. Kossovsky
[not found] ` <20120622112812.GV8140-mK/T7fl7eHLILq5++fvS8w@public.gmane.org>
2012-06-25 18:35 ` Chris Wright
2012-06-26 8:58 ` Joerg Roedel
[not found] ` <20120626085853.GX2624-5C7GfCeVMHo@public.gmane.org>
2012-06-26 9:08 ` Alexandra N. Kossovsky
2012-06-26 18:07 ` Chris Wright
[not found] ` <20120626180743.GV15796-JyIX8gxvWYPr2PDY2+4mTGD2FQJk+8+b@public.gmane.org>
2012-07-09 9:42 ` Joerg Roedel [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=20120709094210.GH2639@amd.com \
--to=joerg.roedel-5c7gfcevmho@public.gmane.org \
--cc=Alexandra.Kossovsky-mK/T7fl7eHLILq5++fvS8w@public.gmane.org \
--cc=chrisw-69jw2NvuJkxg9hUCZPvPmw@public.gmane.org \
--cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=rstonehouse-s/n/eUQHGBpZroRs9YW3xA@public.gmane.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).