* [PATCH] page_to_phys() fix for >4GB pages (i386)
@ 2002-03-15 22:57 Badari Pulavarty
2002-03-18 8:18 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: Badari Pulavarty @ 2002-03-15 22:57 UTC (permalink / raw)
To: linux-kernel, marcelo, alan, axboe, andrea; +Cc: pbadari
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);
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] page_to_phys() fix for >4GB pages (i386)
2002-03-15 22:57 [PATCH] page_to_phys() fix for >4GB pages (i386) Badari Pulavarty
@ 2002-03-18 8:18 ` Jens Axboe
0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2002-03-18 8:18 UTC (permalink / raw)
To: Badari Pulavarty; +Cc: linux-kernel, marcelo, alan, andrea
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-03-18 8:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-15 22:57 [PATCH] page_to_phys() fix for >4GB pages (i386) Badari Pulavarty
2002-03-18 8:18 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).