I have implemented highmem for ARM. To catch wrong usage of __pa() and __va() with out of range values, I added a range check when CONFIG_DEBUG_HIGHMEM is set. One issue is that bootmem.h uses __pa(MAX_DMA_ADDRESS). However MAX_DMA_ADDRESS on ARM is defined as 0xffffffff because there is usually no restriction on the maximum DMA-able address. RMK suggested that those places should be using ISA_DMA_THRESHOLD instead -- here's an excert of our conversation on this topic:So what about this patch? diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index 95837bf..7a97ffe 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h @@ -96,21 +96,21 @@ extern void *__alloc_bootmem_low_node(pg_data_t *pgdat, unsigned long goal); #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE #define alloc_bootmem(x) \ - __alloc_bootmem(x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) + __alloc_bootmem(x, SMP_CACHE_BYTES, ISA_DMA_THRESHOLD) #define alloc_bootmem_nopanic(x) \ - __alloc_bootmem_nopanic(x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) + __alloc_bootmem_nopanic(x, SMP_CACHE_BYTES, ISA_DMA_THRESHOLD) #define alloc_bootmem_low(x) \ __alloc_bootmem_low(x, SMP_CACHE_BYTES, 0) #define alloc_bootmem_pages(x) \ - __alloc_bootmem(x, PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) + __alloc_bootmem(x, PAGE_SIZE, ISA_DMA_THRESHOLD) #define alloc_bootmem_pages_nopanic(x) \ - __alloc_bootmem_nopanic(x, PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) + __alloc_bootmem_nopanic(x, PAGE_SIZE, ISA_DMA_THRESHOLD) #define alloc_bootmem_low_pages(x) \ __alloc_bootmem_low(x, PAGE_SIZE, 0) #define alloc_bootmem_node(pgdat, x) \ - __alloc_bootmem_node(pgdat, x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) + __alloc_bootmem_node(pgdat, x, SMP_CACHE_BYTES, ISA_DMA_THRESHOLD) #define alloc_bootmem_pages_node(pgdat, x) \ - __alloc_bootmem_node(pgdat, x, PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) + __alloc_bootmem_node(pgdat, x, PAGE_SIZE, ISA_DMA_THRESHOLD) #define alloc_bootmem_low_pages_node(pgdat, x) \ __alloc_bootmem_low_node(pgdat, x, PAGE_SIZE, 0) #endif /* !CONFIG_HAVE_ARCH_BOOTMEM_NODE */ --
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
| david | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Eric Paris | [RFC 0/5] [TALPA] Intro to a linux interface for on access scanning |
| Linus Torvalds | Linux 2.6.25-rc4 |
git: | |
| David Miller | [GIT]: Networking |
| Gerrit Renker | [PATCH 13/37] dccp: Deprecate Ack Ratio sysctl |
| Vladimir Ivashchenko | Re: HTB accuracy for high speed |
| Jarek Poplawski | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
