Make drivers/char/mem.c use remap_pfn_range()
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 8 lines · Linux Kernel Mailing List
ChangeSet 1.2036.1.25, 2004/10/21 15:25:17-07:00, [email protected]
Makedrivers/char/mem.cuseremap_pfn_range()
Rather than the deprecatedremap_page_range()function that can't handle all of the PFN range anyway.
Also, since that will now mark the vma as being special, there's no need to do it inmmap_mem()any more.mem.c | 19 +++++++------------ 1 files changed, 7 insertions(+), 12 deletions(-)
Odd. I doublechecked the patches I submitted and they actually covered this.
-- wli
Quoted 3 lines · William Lee Irwin III
Odd. I doublechecked the patches I submitted and they actually covered this.
Andrew had a broken patch that shifted the wrong argument by PAGE_SHIFT, do you want to take the blame for that one (it shifted the size, not the pfn)?
Linus
Quoted 2 lines · William Lee Irwin III
Quoted 2 lines
Odd. I doublechecked the patches I submitted and they actually covered this.
Quoted 3 lines · Linus Torvalds
Andrew had a broken patch that shifted the wrong argument by
PAGE_SHIFT, do you want to take the blame for that one (it shifted the size, not the pfn)?
What I posted shifted the correct argument, though vma->vm_pgoff would have been been better, as it shifted offset right by PAGE_SHIFT, where offset could have overflowed. I have no idea what you're referring to about shifting the wrong argument.
This hunk appeared verbatim in my posted patch,
Message-ID: <[email protected]>:
drivers/char/mem.c +1 -1
@@ -227,7 +227,7 @@*/ vma->vm_flags |=VM_RESERVED |VM_IO ; -if (remap_page_range (vma, vma->vm_start, offset, +if (remap_pfn_range (vma, vma->vm_start, offset >>PAGE_SHIFT , vma->vm_end-vma->vm_start, vma->vm_page_prot))return -EAGAIN ;return 0 ;
Quoted 5 lines · William Lee Irwin III
What I posted shifted the correct argument, though
vma->vm_pgoffwould have been been better, as it shifted offset right byPAGE_SHIFT, where offset could have overflowed. I have no idea what you're referring to about shifting the wrong argument.
Ok, that patch just got lost.
Quite as well, actually. The whole point of changing remap_page_range() to remap_pfn_range() is to give the full range of page frame numbers, and just shifting "offset" back down thus seems to be a bug to me. Otherwise we migth as well just have continued with the old code.
Linus
Quoted 4 lines · William Lee Irwin III
Quoted 4 lines
What I posted shifted the correct argument, though
vma->vm_pgoffwould have been been better, as it shifted offset right byPAGE_SHIFT, where offset could have overflowed. I have no idea what you're referring to about shifting the wrong argument.
Quoted 5 lines · Linus Torvalds
Ok, that patch just got lost.
Quite as well, actually. The whole point of changingremap_page_range()toremap_pfn_range()is to give the full range of page frame numbers, and just shifting "offset" back down thus seems to be a bug to me. Otherwise we migth as well just have continued with the old code.
What I had intended to be the functional improvements were in the arch code for pci_mmap_page_range(), but I would say the mem.c change beyond my own changes is an improvement. All is well.
-- wli