* virtual memmap and page_address
@ 2004-12-15 17:53 Jesse Barnes
2004-12-15 18:07 ` Luck, Tony
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Jesse Barnes @ 2004-12-15 17:53 UTC (permalink / raw)
To: linux-ia64
I've been messing around with some of the drm drivers lately, and in some
cases they'll call pci_map_single on an address returned from page_address().
When virtual memmaps are enabled, page_address will return a region 5
pointer. It looks like all of the ia64 iommu code (swiotlb, sba_iommu and
sn2's pci_dma) assume that the address passed in is an identity mapped
address since they use __pa to get the physical address. This is fast, but
also incorrect when the routines are handed a region 5 address. So we either
have to fix our iommu mapping routines or change some other assumptions
(either about what page_address should return or what __va in general means
for example). Turning on WANT_PAGE_VIRTUAL and populating page->virtual with
an identity mapped address is another option, probably less expensive than
switching to ia64_tpa in the mapping routines.
Comments?
Thanks,
Jesse
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: virtual memmap and page_address
2004-12-15 17:53 virtual memmap and page_address Jesse Barnes
@ 2004-12-15 18:07 ` Luck, Tony
2004-12-15 18:09 ` David Mosberger
2004-12-15 18:11 ` Jesse Barnes
2 siblings, 0 replies; 4+ messages in thread
From: Luck, Tony @ 2004-12-15 18:07 UTC (permalink / raw)
To: linux-ia64
>When virtual memmaps are enabled, page_address will return a region 5
>pointer.
Are you sure? It looks to me that without WANT_PAGE_VIRTUAL that
we end up in lowmem_page_address(), which just gives us:
__va(page_to_pfn(page) << PAGE_SHIFT)
which has got to be a region 7 address.
What's the code path that you are looking at that can return a
region 5 address?
-Tony
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: virtual memmap and page_address
2004-12-15 17:53 virtual memmap and page_address Jesse Barnes
2004-12-15 18:07 ` Luck, Tony
@ 2004-12-15 18:09 ` David Mosberger
2004-12-15 18:11 ` Jesse Barnes
2 siblings, 0 replies; 4+ messages in thread
From: David Mosberger @ 2004-12-15 18:09 UTC (permalink / raw)
To: linux-ia64
>>>>> On Wed, 15 Dec 2004 09:53:32 -0800, Jesse Barnes <jbarnes@engr.sgi.com> said:
Jesse> I've been messing around with some of the drm drivers lately,
Jesse> and in some cases they'll call pci_map_single on an address
Jesse> returned from page_address(). When virtual memmaps are
Jesse> enabled, page_address will return a region 5 pointer.
Huh? The page _descriptor_ is in region 5, but surely not page_address()?
--david
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: virtual memmap and page_address
2004-12-15 17:53 virtual memmap and page_address Jesse Barnes
2004-12-15 18:07 ` Luck, Tony
2004-12-15 18:09 ` David Mosberger
@ 2004-12-15 18:11 ` Jesse Barnes
2 siblings, 0 replies; 4+ messages in thread
From: Jesse Barnes @ 2004-12-15 18:11 UTC (permalink / raw)
To: linux-ia64
On Wednesday, December 15, 2004 9:53 am, Jesse Barnes wrote:
> I've been messing around with some of the drm drivers lately, and in some
> cases they'll call pci_map_single on an address returned from
> page_address(). When virtual memmaps are enabled, page_address will return
> a region 5 pointer. It looks like all of the ia64 iommu code (swiotlb,
> sba_iommu and sn2's pci_dma) assume that the address passed in is an
> identity mapped address since they use __pa to get the physical address.
> This is fast, but also incorrect when the routines are handed a region 5
> address. So we either have to fix our iommu mapping routines or change
> some other assumptions (either about what page_address should return or
> what __va in general means for example). Turning on WANT_PAGE_VIRTUAL and
> populating page->virtual with an identity mapped address is another option,
> probably less expensive than switching to ia64_tpa in the mapping routines.
Nevermind, obviously I haven't had enough coffee this morning. page_address
correctly returns an identity mapped address so my problem lies elsewhere.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-12-15 18:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-15 17:53 virtual memmap and page_address Jesse Barnes
2004-12-15 18:07 ` Luck, Tony
2004-12-15 18:09 ` David Mosberger
2004-12-15 18:11 ` Jesse Barnes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox