* Re: [openib-general] Re: [PATCH] arch/xx/pci: remap_pfn_range -> io_remap_pfn_range
2005-07-28 4:26 ` Greg KH
@ 2005-07-28 4:30 ` Roland Dreier
2005-07-28 4:50 ` Greg KH
0 siblings, 1 reply; 7+ messages in thread
From: Roland Dreier @ 2005-07-28 4:30 UTC (permalink / raw)
To: Greg KH; +Cc: Michael S. Tsirkin, linux-pci, openib-general, linux-kernel, mj
Greg> Hm, you do realize that io_remap_pfn_range() is the same
Greg> thing as remap_pfn_range() on i386, right?
Greg> So, why would this patch change anything?
It's not the same thing under Xen. I think this patch fixes userspace
access to PCI memory for XenLinux.
- R.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [openib-general] Re: [PATCH] arch/xx/pci: remap_pfn_range -> io_remap_pfn_range
2005-07-28 4:30 ` [openib-general] " Roland Dreier
@ 2005-07-28 4:50 ` Greg KH
0 siblings, 0 replies; 7+ messages in thread
From: Greg KH @ 2005-07-28 4:50 UTC (permalink / raw)
To: Roland Dreier
Cc: Michael S. Tsirkin, linux-pci, openib-general, linux-kernel, mj
On Wed, Jul 27, 2005 at 09:30:17PM -0700, Roland Dreier wrote:
> Greg> Hm, you do realize that io_remap_pfn_range() is the same
> Greg> thing as remap_pfn_range() on i386, right?
>
> Greg> So, why would this patch change anything?
>
> It's not the same thing under Xen. I think this patch fixes userspace
> access to PCI memory for XenLinux.
But Xen is a separate arch, and hence, will get different pci arch
specific functions, right?
In short, what is this patch trying to fix? What is the problem anyone
is seeing with the existing code?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [openib-general] Re: [PATCH] arch/xx/pci: remap_pfn_range -> io_remap_pfn_range
@ 2005-07-28 11:57 Ian Pratt
2005-07-28 14:18 ` Randy.Dunlap
2005-07-28 16:17 ` Greg KH
0 siblings, 2 replies; 7+ messages in thread
From: Ian Pratt @ 2005-07-28 11:57 UTC (permalink / raw)
To: Greg KH, Roland Dreier
Cc: Michael S. Tsirkin, linux-pci, openib-general, linux-kernel, mj,
ian.pratt
> > Greg> Hm, you do realize that io_remap_pfn_range() is the same
> > Greg> thing as remap_pfn_range() on i386, right?
> >
> > Greg> So, why would this patch change anything?
> >
> > It's not the same thing under Xen. I think this patch
> fixes userspace
> > access to PCI memory for XenLinux.
>
> But Xen is a separate arch, and hence, will get different pci
> arch specific functions, right?
>
> In short, what is this patch trying to fix? What is the
> problem anyone is seeing with the existing code?
As I understand it, remap_pfn_range should be used for mapping pages
that are backed by memory, and io_remap_pfn_range should be used for
mapping MMIO regions.
There's a distinciton between the two for architectures like Sparc and
xen/x86.
For example, drivers/char/mem.c uses io_remap_pfn_range for mmap'ing
/dev/mem
Ian
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [openib-general] Re: [PATCH] arch/xx/pci: remap_pfn_range -> io_remap_pfn_range
2005-07-28 11:57 [openib-general] Re: [PATCH] arch/xx/pci: remap_pfn_range -> io_remap_pfn_range Ian Pratt
@ 2005-07-28 14:18 ` Randy.Dunlap
2005-07-28 16:17 ` Greg KH
1 sibling, 0 replies; 7+ messages in thread
From: Randy.Dunlap @ 2005-07-28 14:18 UTC (permalink / raw)
To: Ian Pratt
Cc: gregkh, rolandd, mst, linux-pci, openib-general, linux-kernel, mj,
ian.pratt
On Thu, 28 Jul 2005 12:57:51 +0100 Ian Pratt wrote:
> > > Greg> Hm, you do realize that io_remap_pfn_range() is the same
> > > Greg> thing as remap_pfn_range() on i386, right?
> > >
> > > Greg> So, why would this patch change anything?
> > >
> > > It's not the same thing under Xen. I think this patch
> > fixes userspace
> > > access to PCI memory for XenLinux.
> >
> > But Xen is a separate arch, and hence, will get different pci
> > arch specific functions, right?
> >
> > In short, what is this patch trying to fix? What is the
> > problem anyone is seeing with the existing code?
>
> As I understand it, remap_pfn_range should be used for mapping pages
> that are backed by memory, and io_remap_pfn_range should be used for
> mapping MMIO regions.
> There's a distinciton between the two for architectures like Sparc and
> xen/x86.
>
> For example, drivers/char/mem.c uses io_remap_pfn_range for mmap'ing
> /dev/mem
That is my (limited) understanding also, but when I built
io_remap_pfn_range(), I didn't search all callers of
remap_pfn_range() to see which ones that I could fix (or break)
by changing them. Mostly due to the possible breakage part.
---
~Randy
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [openib-general] Re: [PATCH] arch/xx/pci: remap_pfn_range -> io_remap_pfn_range
@ 2005-07-28 14:40 Ian Pratt
0 siblings, 0 replies; 7+ messages in thread
From: Ian Pratt @ 2005-07-28 14:40 UTC (permalink / raw)
To: Randy.Dunlap
Cc: gregkh, rolandd, mst, linux-pci, openib-general, linux-kernel, mj,
ian.pratt, ian.pratt
> > For example, drivers/char/mem.c uses io_remap_pfn_range for
> mmap'ing
> > /dev/mem
>
> That is my (limited) understanding also, but when I built
> io_remap_pfn_range(), I didn't search all callers of
> remap_pfn_range() to see which ones that I could fix (or
> break) by changing them. Mostly due to the possible breakage part.
Yep, its not entirely trivial to determine the intended usage. In
particular, some of the sound drivers require both versions in the same
file.
It's probably best to rely on Xen/Sparc users to find them on a case by
case basis and ask for them to be fixed (unless someone's feeling
brave...)
Ian
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [openib-general] Re: [PATCH] arch/xx/pci: remap_pfn_range -> io_remap_pfn_range
2005-07-28 11:57 [openib-general] Re: [PATCH] arch/xx/pci: remap_pfn_range -> io_remap_pfn_range Ian Pratt
2005-07-28 14:18 ` Randy.Dunlap
@ 2005-07-28 16:17 ` Greg KH
2005-07-31 8:51 ` Michael S. Tsirkin
1 sibling, 1 reply; 7+ messages in thread
From: Greg KH @ 2005-07-28 16:17 UTC (permalink / raw)
To: Ian Pratt
Cc: Roland Dreier, Michael S. Tsirkin, linux-pci, openib-general,
linux-kernel, mj, ian.pratt
On Thu, Jul 28, 2005 at 12:57:51PM +0100, Ian Pratt wrote:
> > > Greg> Hm, you do realize that io_remap_pfn_range() is the same
> > > Greg> thing as remap_pfn_range() on i386, right?
> > >
> > > Greg> So, why would this patch change anything?
> > >
> > > It's not the same thing under Xen. I think this patch
> > fixes userspace
> > > access to PCI memory for XenLinux.
> >
> > But Xen is a separate arch, and hence, will get different pci
> > arch specific functions, right?
> >
> > In short, what is this patch trying to fix? What is the
> > problem anyone is seeing with the existing code?
>
> As I understand it, remap_pfn_range should be used for mapping pages
> that are backed by memory, and io_remap_pfn_range should be used for
> mapping MMIO regions.
> There's a distinciton between the two for architectures like Sparc and
> xen/x86.
I agree, but not for i386, which is what the patch was trying to change.
If this is a fix for xen, fine, then say so in the changelog information
for the patch, as it is, no such information was given.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] arch/xx/pci: remap_pfn_range -> io_remap_pfn_range
2005-07-28 16:17 ` Greg KH
@ 2005-07-31 8:51 ` Michael S. Tsirkin
0 siblings, 0 replies; 7+ messages in thread
From: Michael S. Tsirkin @ 2005-07-31 8:51 UTC (permalink / raw)
To: Greg KH
Cc: Ian Pratt, Roland Dreier, linux-pci, openib-general, linux-kernel,
mj, ian.pratt
Quoting r. Greg KH <gregkh@suse.de>:
> Subject: Re: [openib-general] Re: [PATCH] arch/xx/pci: remap_pfn_range -> io_remap_pfn_range
> If this is a fix for xen, fine, then say so in the changelog information
> for the patch, as it is, no such information was given.
>
> thanks,
>
> greg k-h
>
Like this?
---
Convert i386/pci to use io_remap_pfn_range instead of remap_pfn_range.
This is good for Xen which reuses i386/pci/i386.c for domain 0 code.
Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il>
Index: linux-2.6.12.2/arch/i386/pci/i386.c
===================================================================
--- linux-2.6.12.2.orig/arch/i386/pci/i386.c
+++ linux-2.6.12.2/arch/i386/pci/i386.c
@@ -295,9 +295,9 @@ int pci_mmap_page_range(struct pci_dev *
/* Write-combine setting is ignored, it is changed via the mtrr
* interfaces on this platform.
*/
- if (remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff,
- vma->vm_end - vma->vm_start,
- vma->vm_page_prot))
+ if (io_remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff,
+ vma->vm_end - vma->vm_start,
+ vma->vm_page_prot))
return -EAGAIN;
return 0;
--
MST
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2005-07-31 8:51 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-28 11:57 [openib-general] Re: [PATCH] arch/xx/pci: remap_pfn_range -> io_remap_pfn_range Ian Pratt
2005-07-28 14:18 ` Randy.Dunlap
2005-07-28 16:17 ` Greg KH
2005-07-31 8:51 ` Michael S. Tsirkin
-- strict thread matches above, loose matches on Subject: below --
2005-07-28 14:40 [openib-general] " Ian Pratt
2005-07-25 22:32 Michael S. Tsirkin
2005-07-28 4:26 ` Greg KH
2005-07-28 4:30 ` [openib-general] " Roland Dreier
2005-07-28 4:50 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox