Skip to content

convert remap_page_range() to remap_pfn_range() in a patch series shorter than 76 patches

William Lee Irwin III lkml 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6introduce remap_pfn_range() to replace remap_page_range()include/linux/mm.h mm/memory.c mm/nommu.c+18 -140 replies
2/6convert references to remap_page_range() under arch/ and Documentation/ to remap_pfn_range()Documentation/IO-mapping.txt arch/arm/kernel/bios32.c arch/i386/pci/i386.c +8 more+20 -360 replies
3/6convert users of remap_page_range() under drivers/ and net/ to use remap_pfn_range()drivers/char/agp/frontend.c drivers/char/drm/drm_vm.h drivers/char/drm/i810_dma.c +27 more+77 -1940 replies
4/6convert users of remap_page_range() under include/asm-*/ to use remap_pfn_range()include/asm-alpha/pgtable.h include/asm-arm/pgtable.h include/asm-arm26/pgtable.h +13 more+30 -160 replies
5/6convert users of remap_page_range() under sound/ to use remap_pfn_range()sound/oss/ali5455.c sound/oss/au1000.c sound/oss/cmpci.c +15 more+69 -410 replies
6/6for -mm only: remove remap_page_range() completelyinclude/linux/mm.h+0 -70 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [vm 0/6] convert remap_page_range() to remap_pfn_range() in a patch series shorter than 76 patches

Resolve physical address overflow issue in the remap_page_range() API by replacing it with remap_pfn_range(), which accepts its physical address argument as a pfn, hence allowing the use of a single-precision physical address argument without the risk of overflow at the API boundary. The above issue has hobbled support for various 32-bit architectures, including some embedded systems (ppc440 IIRC), caused persistent portability issues for sound drivers for legacy systems (sparc32; unfortunately this patch alone does not fully resolve those), and according to John Fusco's reports, made drivers for some PCI-X hardware infeasible to port to recent ia32 PAE enterprise systems. With this patch series applied, physical address overflows on 32-bit systems caused directly by remap_page_range() are gone forever, and ca. 100LOC of cut-and-waste driver code are swept out of existence alongside them.

-- wli

P.S.: The existing solution to the sparc32 issue was to pass a double
precision representation of the physical address as 2 single- precision arguments in an API (io_remap_page_range()) whose argument corresponding to those two was a single single- precision argument on most/all other architectures. The sparc32-specific issue requires more work beyond these patches to rectify. The most apparent consequence of the API skew is that drivers don't compile on sparc32 when they use io_remap_page_range() due to passing insufficient arguments, or vice-versa for drivers originally written for sparc32.