Question about kimage_alloc_page in kexec.c, bug?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all !

I have a question on kimage_alloc_page:


page = kimage_alloc_pages(gfp_mask, 0);
...

/* If the page cannot be used file it away */
if (page_to_pfn(page) > (KEXEC_SOURCE_MEMORY_LIMIT >> PAGE_SHIFT)) {
	list_add(&page->lru, &image->unuseable_pages);
	continue;
}


If  a page frame is right at physical address 0x20000000 ,  then when calling

machine_kexec , the following code:

*ptr = (unsigned long) phys_to_virt(*ptr);

will generate an virtual address of 0xa0000000 = 0x20000000+0x80000000 , which

results in physical address 0.



should it be like this?  :

--- kexec.c     2010-08-27 07:47:12.000000000 +0800
+++ kexec.changed.c     2010-10-11 22:04:08.000000000 +0800
@@ -723,7 +723,7 @@
                if (!page)
                        return NULL;
                /* If the page cannot be used file it away */
-               if (page_to_pfn(page) >
+               if (page_to_pfn(page) >=
                                (KEXEC_SOURCE_MEMORY_LIMIT >> PAGE_SHIFT)) {
                        list_add(&page->lru, &image->unuseable_pages);
                        continue;


Thank you



[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux