From: Wei Wang2 <wei.wang2@amd.com>
To: xen-devel@lists.xensource.com
Cc: "allen.m.kay@intel.com" <allen.m.kay@intel.com>,
"Tim (Xen.org)" <tim@xen.org>,
Jean Guyader <jean.guyader@eu.citrix.com>,
Jan Beulich <JBeulich@suse.com>,
Jean Guyader <Jean.Guyader@citrix.com>
Subject: Re: [PATCH 2/6] iommu: Introduce iommu_flush and iommu_flush_all.
Date: Tue, 8 Nov 2011 11:39:15 +0100 [thread overview]
Message-ID: <201111081139.15943.wei.wang2@amd.com> (raw)
In-Reply-To: <20111108102515.GA7818@spongy.cam.xci-test.com>
On Tuesday 08 November 2011 11:25:15 Jean Guyader wrote:
> On 08/11 08:24, Jan Beulich wrote:
> > >>> On 07.11.11 at 18:06, Jean Guyader <jean.guyader@eu.citrix.com>
> > >>> wrote:
> > >
> > > On 07/11 04:42, Jan Beulich wrote:
> > >> >>> On 07.11.11 at 16:16, Jean Guyader <jean.guyader@eu.citrix.com>
> > >> >>> wrote:
> > >> >
> > >> > Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
> > >> > ---
> > >> > xen/drivers/passthrough/iommu.c | 20 ++++++++++++++++++++
> > >> > xen/drivers/passthrough/vtd/iommu.c | 12 ++++++++++++
> > >> > xen/include/xen/iommu.h | 5 +++++
> > >> > 3 files changed, 37 insertions(+), 0 deletions(-)
> > >>
> > >> In iommu_iotlb_flush() you check whether the to-be-called function
> > >> pointer is NULL, whereas in iommu_iotlb_flush_all() you don't. I
> > >> actually think the second behavior is the correct one, but that
> > >> implies that you need to also implement respective AMD IOMMU
> > >> functions.
> > >
> > > Yes, It's an error on my part. I've updated the patch to check
> > > for the present of iotlb_flush_all before I call it now.
> >
> > But as said, I don't think this is the right solution: How can it be
> > correct on non-Intel hardware to have these functions simply do
> > nothing?
>
> These functions are only here to counter balance the dont_flush_iotlb_flag.
> If they don't acknowlage this flag doing nothing is the right thing to do.
>
> That said I can probably implement a naive version for the AMD iommu
> that will use amd_iommu_flush_pages once or in a loop.
There are some pending patches that enable ats / iotlb flush for amd iommu.
Then, you might want to use functions: amd_iommu_flush_iotlb and
amd_iommu_flush_all_iotlbs for this.
Thanks,
Wei
> Obviously I will remove the check for the non existing callback if I do
> that as it become mandatory.
>
> Jean
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
next prev parent reply other threads:[~2011-11-08 10:39 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-07 15:16 IOMMU, vtd and iotlb flush rework (v2) Jean Guyader
2011-11-07 15:16 ` [PATCH 1/6] vtd: Refactor iotlb flush code Jean Guyader
2011-11-07 15:16 ` [PATCH 2/6] iommu: Introduce iommu_flush and iommu_flush_all Jean Guyader
2011-11-07 15:16 ` [PATCH 3/6] add_to_physmap: Move the code for XENMEM_add_to_physmap Jean Guyader
2011-11-07 15:16 ` [PATCH 4/6] mm: New XENMEM, XENMEM_add_to_physmap_gmfn_range Jean Guyader
2011-11-07 15:16 ` [PATCH 5/6] hvmloader: Change memory relocation loop when overlap with PCI hole Jean Guyader
2011-11-07 15:16 ` [PATCH 6/6] Introduce per cpu flag (iommu_dont_flush_iotlb) to avoid unnecessary iotlb flush Jean Guyader
2011-11-07 16:45 ` [PATCH 4/6] mm: New XENMEM, XENMEM_add_to_physmap_gmfn_range Jan Beulich
2011-11-07 16:58 ` Jean Guyader
2011-11-07 16:42 ` [PATCH 2/6] iommu: Introduce iommu_flush and iommu_flush_all Jan Beulich
2011-11-07 17:06 ` Jean Guyader
2011-11-08 8:24 ` Jan Beulich
2011-11-08 10:25 ` Jean Guyader
2011-11-08 10:39 ` Jan Beulich
2011-11-08 10:39 ` Wei Wang2 [this message]
2011-11-08 10:38 ` Jean Guyader
-- strict thread matches above, loose matches on Subject: below --
2011-11-16 19:25 [PATCH 0/6] IOMMU, vtd and iotlb flush rework (v8) Jean Guyader
2011-11-16 19:25 ` [PATCH 1/6] vtd: Refactor iotlb flush code Jean Guyader
2011-11-16 19:25 ` [PATCH 2/6] iommu: Introduce iommu_flush and iommu_flush_all Jean Guyader
2011-11-13 17:40 [PATCH 0/6] IOMMU, vtd and iotlb flush rework (v7) Jean Guyader
2011-11-13 17:40 ` [PATCH 1/6] vtd: Refactor iotlb flush code Jean Guyader
2011-11-13 17:40 ` [PATCH 2/6] iommu: Introduce iommu_flush and iommu_flush_all Jean Guyader
2011-11-10 8:43 [PATCH 0/6] IOMMU, vtd and iotlb flush rework (v5) Jean Guyader
2011-11-10 8:43 ` [PATCH 1/6] vtd: Refactor iotlb flush code Jean Guyader
2011-11-10 8:44 ` [PATCH 2/6] iommu: Introduce iommu_flush and iommu_flush_all Jean Guyader
2011-11-08 20:04 [PATCH 0/6] IOMMU, vtd and iotlb flush rework (v4) Jean Guyader
2011-11-08 20:04 ` [PATCH 1/6] vtd: Refactor iotlb flush code Jean Guyader
2011-11-08 20:04 ` [PATCH 2/6] iommu: Introduce iommu_flush and iommu_flush_all Jean Guyader
2011-11-07 18:25 IOMMU, vtd and iotlb flush rework (v3) Jean Guyader
2011-11-07 18:25 ` [PATCH 1/6] vtd: Refactor iotlb flush code Jean Guyader
2011-11-07 18:25 ` [PATCH 2/6] iommu: Introduce iommu_flush and iommu_flush_all Jean Guyader
2011-11-04 10:38 [PATCH 0/6] IOMMU, vtd and iotlb flush rework Jean Guyader
2011-11-04 10:38 ` [PATCH 1/6] vtd: Refactor iotlb flush code Jean Guyader
2011-11-04 10:38 ` [PATCH 2/6] iommu: Introduce iommu_flush and iommu_flush_all Jean Guyader
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=201111081139.15943.wei.wang2@amd.com \
--to=wei.wang2@amd.com \
--cc=JBeulich@suse.com \
--cc=Jean.Guyader@citrix.com \
--cc=allen.m.kay@intel.com \
--cc=jean.guyader@eu.citrix.com \
--cc=tim@xen.org \
--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 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).