lkml.org 
[lkml]   [2004]   [Jun]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subjectremap_pte_range
I have no idea what remap_pte_range is trying to do here, but what it
is doing makes no sense (to me at least).

If the pfn is not valid, we CANNOT safely call PageReserved on it -
the *page returned from pfn_to_page is bullshit, and we crash deref'ing
it.

Perhaps this was what it was trying to do? Not sure.

diff -purN -X /home/mbligh/.diff.exclude virgin/mm/memory.c remap_pte_range/mm/memory.c
--- virgin/mm/memory.c 2004-06-16 10:22:15.000000000 -0700
+++ remap_pte_range/mm/memory.c 2004-06-29 17:15:35.000000000 -0700
@@ -908,7 +908,7 @@ static inline void remap_pte_range(pte_t
pfn = phys_addr >> PAGE_SHIFT;
do {
BUG_ON(!pte_none(*pte));
- if (!pfn_valid(pfn) || PageReserved(pfn_to_page(pfn)))
+ if (pfn_valid(pfn) && !PageReserved(pfn_to_page(pfn)))
set_pte(pte, pfn_pte(pfn, prot));
address += PAGE_SIZE;
pfn++;
-
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 14:04    [W:2.770 / U:0.436 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site