On Wed, 2009-07-29 at 18:43 +1000, Dave Airlie wrote:> >> don''t suppose we want page_to_gart or is the double function nicer? > > > > I pondered that briefly. But then observed that phys_to_gart() and > > gart_to_phys() _always_ describe an identity mapping, so perhaps they > > could just be ditched completely? > > Yeah that could work too, no idea why they were introduced, well before my time.http://git.infradead.org/users/dwmw2/iommu-agp.git?a=commitdiff;h=8bf2f3a9 It was introduced by Keir in 2005 for Xen (commit 07eee78e). I suspect it can die though, and that the right answer there is also to use the DMA API correctly. -- David Woodhouse Open Source Technology Centre David.Woodhouse@intel.com Intel Corporation _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 2009.07.29 17:36:45 +0800, David Woodhouse wrote:> On Wed, 2009-07-29 at 18:43 +1000, Dave Airlie wrote: > > >> don''t suppose we want page_to_gart or is the double function nicer? > > > > > > I pondered that briefly. But then observed that phys_to_gart() and > > > gart_to_phys() _always_ describe an identity mapping, so perhaps they > > > could just be ditched completely? > > > > Yeah that could work too, no idea why they were introduced, well before my time. > > http://git.infradead.org/users/dwmw2/iommu-agp.git?a=commitdiff;h=8bf2f3a9 > > It was introduced by Keir in 2005 for Xen (commit 07eee78e). I suspect > it can die though, and that the right answer there is also to use the > DMA API correctly. >The commits on that tree looks fine to me. Thanks David! I''ve also done some testing on G45 here, I''ve also seen the write faults before graphics device init or after dma unmap pages. I tried to look it up in my memo, which turns out one message like this should be a BIOS bug that doesn''t initialize the GTT table correctly. But I''m quite sure about it now, better to ask our chipset people to verify if this problem has been fixed or not. -- Open Source Technology Center, Intel ltd. $gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Mon, 2009-08-03 at 14:50 +0800, Zhenyu Wang wrote:> > The commits on that tree looks fine to me. Thanks David! > I''ve also done some testing on G45 here, I''ve also seen the write > faults before graphics device init or after dma unmap pages. I tried > to look it up in my memo, which turns out one message like this should > be a BIOS bug that doesn''t initialize the GTT table correctly. But I''m > quite sure about it now, better to ask our chipset people to verify if > this problem has been fixed or not.Thanks. I''ve rebased the tree so that it isn''t based on my other iommu changes, which are largely irrelevant. Since the drm-2.6.git tree as advertised in MAINTAINERS seems to be a pristine 2.6.29-rc2, I''ve done it based on 2.6.31-rc5 instead. Dave, please pull from git://git.infradead.org/~dwmw2/iommu-agp.git David Woodhouse (6): agp: Switch mask_memory() method to take address argument again, not page agp: tidy up handling of scratch pages w.r.t. DMA API agp: Switch agp_{un,}map_page() to take struct page * argument intel-agp: Move repeated sglist free into separate function intel-agp: fix sglist allocation to avoid vmalloc() agp: kill phys_to_gart() and gart_to_phys() Zhenyu Wang (2): agp: Add generic support for graphics dma remapping intel_agp: Use PCI DMA API correctly on chipsets new enough to have IOMMU arch/alpha/include/asm/agp.h | 4 - arch/ia64/include/asm/agp.h | 4 - arch/parisc/include/asm/agp.h | 4 - arch/powerpc/include/asm/agp.h | 4 - arch/sparc/include/asm/agp.h | 4 - arch/x86/include/asm/agp.h | 4 - drivers/char/agp/agp.h | 15 ++-- drivers/char/agp/ali-agp.c | 4 +- drivers/char/agp/amd-k7-agp.c | 10 ++- drivers/char/agp/amd64-agp.c | 7 +- drivers/char/agp/ati-agp.c | 7 +- drivers/char/agp/backend.c | 32 ++++++- drivers/char/agp/efficeon-agp.c | 4 +- drivers/char/agp/generic.c | 20 ++++- drivers/char/agp/hp-agp.c | 8 +- drivers/char/agp/i460-agp.c | 17 +--- drivers/char/agp/intel-agp.c | 167 +++++++++++++++++++++++++++++++++++---- drivers/char/agp/nvidia-agp.c | 2 +- drivers/char/agp/parisc-agp.c | 12 +--- drivers/char/agp/sgi-agp.c | 8 +- drivers/char/agp/sworks-agp.c | 10 ++- drivers/char/agp/uninorth-agp.c | 2 +- include/linux/agp_backend.h | 5 +- 23 files changed, 247 insertions(+), 107 deletions(-) -- David Woodhouse Open Source Technology Centre David.Woodhouse@intel.com Intel Corporation _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Jeremy Fitzhardinge
2009-Aug-04 23:52 UTC
Re: [Xen-devel] Re: [RFC] Make AGP work with IOMMU
On 07/29/09 02:36, David Woodhouse wrote:> On Wed, 2009-07-29 at 18:43 +1000, Dave Airlie wrote: > >>>> don''t suppose we want page_to_gart or is the double function nicer? >>>> >>> I pondered that briefly. But then observed that phys_to_gart() and >>> gart_to_phys() _always_ describe an identity mapping, so perhaps they >>> could just be ditched completely? >>> >> Yeah that could work too, no idea why they were introduced, well before my time. >> > > http://git.infradead.org/users/dwmw2/iommu-agp.git?a=commitdiff;h=8bf2f3a9 > > It was introduced by Keir in 2005 for Xen (commit 07eee78e). I suspect > it can die though, and that the right answer there is also to use the > DMA API correctly. >And just when I have patches to use them for their original purpose... Looking back over the thread, are you saying that most users are already using the DMA API correctly for AGP accesses? If that''s true then we should be just fine. J _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Tue, 2009-08-04 at 16:52 -0700, Jeremy Fitzhardinge wrote:> And just when I have patches to use them for their original purpose... > > Looking back over the thread, are you saying that most users are already > using the DMA API correctly for AGP accesses? If that''s true then we > should be just fine.No, not ''most users''. But perhaps we should. All we''ve done so far is make intel-agp use the DMA API correctly. And that''s conditional on CONFIG_DMAR. But we could make it unconditional, and make the other drivers do it too. The code is all fairly generic. Without an IOMMU, the overhead would be fairly minimal. -- David Woodhouse Open Source Technology Centre David.Woodhouse@intel.com Intel Corporation _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Wed, Aug 5, 2009 at 4:44 PM, David Woodhouse<dwmw2@infradead.org> wrote:> On Tue, 2009-08-04 at 16:52 -0700, Jeremy Fitzhardinge wrote: >> And just when I have patches to use them for their original purpose... >> >> Looking back over the thread, are you saying that most users are already >> using the DMA API correctly for AGP accesses? If that''s true then we >> should be just fine. > > No, not ''most users''. But perhaps we should. > > All we''ve done so far is make intel-agp use the DMA API correctly. And > that''s conditional on CONFIG_DMAR. But we could make it unconditional, > and make the other drivers do it too. The code is all fairly generic. > > Without an IOMMU, the overhead would be fairly minimal. >I''m not sure how prevalent Xen is on AGP systems, I''m going to guess not enough that anyone cares. Intel integrated chips are the only AGP codebase user that are made any more, and they don''t really use AGP its just a legacy of the previous designs. Dave. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Wed, 2009-08-05 at 16:57 +1000, Dave Airlie wrote:> On Wed, Aug 5, 2009 at 4:44 PM, David Woodhouse<dwmw2@infradead.org> wrote: > > On Tue, 2009-08-04 at 16:52 -0700, Jeremy Fitzhardinge wrote: > >> And just when I have patches to use them for their original purpose... > >> > >> Looking back over the thread, are you saying that most users are already > >> using the DMA API correctly for AGP accesses? If that''s true then we > >> should be just fine. > > > > No, not ''most users''. But perhaps we should. > > > > All we''ve done so far is make intel-agp use the DMA API correctly. And > > that''s conditional on CONFIG_DMAR. But we could make it unconditional, > > and make the other drivers do it too. The code is all fairly generic. > > > > Without an IOMMU, the overhead would be fairly minimal. > > > > I''m not sure how prevalent Xen is on AGP systems, I''m going to guess > not enough that anyone cares. Intel integrated chips are the only AGP > codebase user that are made any more, and they don''t really use AGP > its just a legacy of the previous designs.On the other hand, extending the existing code so that it uses the DMA API correctly _unconditionally_ rather than only for the Intel driver would be fairly simple and should be harmless... -- dwmw2 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Jeremy Fitzhardinge
2009-Aug-05 18:26 UTC
Re: [Xen-devel] Re: [RFC] Make AGP work with IOMMU
On 08/04/09 23:57, Dave Airlie wrote:>> All we''ve done so far is make intel-agp use the DMA API correctly. And >> that''s conditional on CONFIG_DMAR. But we could make it unconditional, >> and make the other drivers do it too. The code is all fairly generic. >> >> Without an IOMMU, the overhead would be fairly minimal. >> >> > > I''m not sure how prevalent Xen is on AGP systems, I''m going to guess > not enough that anyone cares.What do you mean by AGP here? Do you mean "machine with physical AGP port", or "machine with graphics using the AGP aperature"? There''s an increasing interest in putting Xen on desktop machines, so the former is debatable, but the latter (I think?) definitely isn''t true.> Intel integrated chips are the only AGP > codebase user that are made any more, and they don''t really use AGP > its just a legacy of the previous designs. > >Plenty of people are using older machines for testing, etc, so I wouldn''t want to exclude them too lightly. I''ve got bug reports from people using older Radeons, etc. J _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Thu, Aug 6, 2009 at 4:26 AM, Jeremy Fitzhardinge<jeremy@goop.org> wrote:> On 08/04/09 23:57, Dave Airlie wrote: >>> All we''ve done so far is make intel-agp use the DMA API correctly. And >>> that''s conditional on CONFIG_DMAR. But we could make it unconditional, >>> and make the other drivers do it too. The code is all fairly generic. >>> >>> Without an IOMMU, the overhead would be fairly minimal. >>> >>> >> >> I''m not sure how prevalent Xen is on AGP systems, I''m going to guess >> not enough that anyone cares. > > What do you mean by AGP here? Do you mean "machine with physical AGP > port", or "machine with graphics using the AGP aperature"? There''s an > increasing interest in putting Xen on desktop machines, so the former is > debatable, but the latter (I think?) definitely isn''t true. >I split my mail along those lines already, an AGP system is one with a physical AGP port, I think you''ll probably find a few people still running some Athlons with VIA chipset and radeon 9200s I think, The graphics using AGP-like apertures are only Intel and we''ve fixed those.>> Intel integrated chips are the only AGP >> codebase user that are made any more, and they don''t really use AGP >> its just a legacy of the previous designs. >> >> > > Plenty of people are using older machines for testing, etc, so I > wouldn''t want to exclude them too lightly. I''ve got bug reports from > people using older Radeons, etc.My main problem with doing this is getting testing coverage on older systems, if we change all the AGP drivers, the time to find we busted something is probably not until the next major distro release with this code in it. So people can run stuff on 5 year old hardware in 6 months? I''m not sure the gains justify the costs, but if you guys really want to do it I''ll take the patch, just be prepared to have it ripped out the minute we get a regression we can''t figure out because we haven''t got the hw anymore. Dave. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Jeremy Fitzhardinge
2009-Aug-06 19:32 UTC
Re: [Xen-devel] Re: [RFC] Make AGP work with IOMMU
On 08/05/09 16:12, Dave Airlie wrote:> My main problem with doing this is getting testing coverage on older > systems, if we change all the AGP drivers, the time to find we busted > something is probably not until the next major distro release with this code > in it. So people can run stuff on 5 year old hardware in 6 months? I''m > not sure the gains justify the costs, but if you guys really want to do it > I''ll take the patch, just be prepared to have it ripped out the minute > we get a regression we can''t figure out because we haven''t got the hw anymore. >Can you point to some changesets/patches to act as an example/template for the changes needed? If we come up with someone reporting crashes when using old hardware, we can then make change then get them to test both native and Xen. J _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Thu, 2009-08-06 at 12:32 -0700, Jeremy Fitzhardinge wrote:> On 08/05/09 16:12, Dave Airlie wrote: > > My main problem with doing this is getting testing coverage on older > > systems, if we change all the AGP drivers, the time to find we busted > > something is probably not until the next major distro release with this code > > in it. So people can run stuff on 5 year old hardware in 6 months? I''m > > not sure the gains justify the costs, but if you guys really want to do it > > I''ll take the patch, just be prepared to have it ripped out the minute > > we get a regression we can''t figure out because we haven''t got the hw anymore. > > > > Can you point to some changesets/patches to act as an example/template > for the changes needed?http://git.infradead.org/users/dwmw2/iommu-agp.git/shortlog/ba3139f2577eee24479db73b8dfc7d78eaf4c486 Some of the code added to intel-agp should probably be generic. -- David Woodhouse Open Source Technology Centre David.Woodhouse@intel.com Intel Corporation _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel