lkml.org 
[lkml]   [2002]   [Mar]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] page_to_phys() fix for >4GB pages (i386)
On Fri, Mar 15 2002, Badari Pulavarty wrote:
> Hi,
>
> I found that page_to_phys() is broken for pages > 4GB on x86.
> It is truncating the physical addresses to 32bit, loosing higher
> bits. (pci_map_sg() uses this).
>
> Here is the patch to fix it. Marcelo, could you consider this
> patch ? I have not looked at 2.5 yet, it may be needed there also.
>
> Thanks,
> Badari
>
>
> --- linux/include/asm-i386/io.h Fri Mar 15 11:19:28 2002
> +++ linux.new/include/asm-i386/io.h Fri Mar 15 11:20:38 2002
> @@ -76,7 +76,11 @@
> /*
> * Change "struct page" to physical address.
> */
> +#ifdef CONFIG_HIGHMEM64G
> +#define page_to_phys(page) ((u64)(page - mem_map) << PAGE_SHIFT)
> +#else
> #define page_to_phys(page) ((page - mem_map) << PAGE_SHIFT)
> +#endif
>
> extern void * __ioremap(unsigned long offset, unsigned long size, unsigned long flags);

Ugh, this would indeed explain an unfixed problem with compaq arrays
corrupting data with > 4gb of ram. Thanks, good spotting!

--
Jens Axboe

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:25    [W:0.040 / U:0.684 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site