linux-mips
[Top] [All Lists]

Re: Question about kimage_alloc_page in kexec.c, bug?

To: "wilbur.chan" <wilbur512@gmail.com>
Subject: Re: Question about kimage_alloc_page in kexec.c, bug?
From: Américo Wang <xiyou.wangcong@gmail.com>
Date: Mon, 18 Oct 2010 18:26:39 +0800
Cc: linux-kernel <Linux-kernel@zh-kernel.org>, Linux MIPS Mailing List <linux-mips@linux-mips.org>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=rmwI80ooueWTuKDCnyYFChow+KsAs1xHct1Y3Sh8fwE=; b=uUIJcgXUZkittRebHCZdWnnvaQ6i+AL/m5BoKwdpwfZntotADGiv4iBI8v7qMIGlmu 2PEaet54pXiLpEeOKgIxUKObllzyFJicSAf27dvIFj//n/6/stnaTFvnE/IdEDfKogQA lB/v8LK4QEreNbF/cVgywgJCRGYyJvkJlUKGE=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=uKTO7BPtoT2gy4YWj8Vm2ykPmENXCJbHwq5ck0Ch3SUPmdNGRO0g5sLJHkVRmBRI7V 1T2H4n/XSsQ+FR//QYiT4RPT6cYok1X3QlT18TCMvvjv9MOCPPw/AY/PpfVJfPLdK7Vj Mkf7UCUQmUsiR4O8+uKVBx/w7RuXSac4561Gc=
In-reply-to: <AANLkTi=ST1v55skkQbfsNQsmiBpOARwAnTxCpptsTdtB@mail.gmail.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <AANLkTi=ST1v55skkQbfsNQsmiBpOARwAnTxCpptsTdtB@mail.gmail.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.20 (2009-06-14)
On Mon, Oct 11, 2010 at 10:46:59PM +0800, wilbur.chan wrote:
>Hi all !
>
>I have a question on kimage_alloc_page:
>
...

You can Cc me on kexec/kdump issues. :)

>
>
>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;
>

No, this could break x86_64.

IMHO, what needs to fix is the definition of KEXEC_SOURCE_MEMORY_LIMIT
on MIPS, something like:

- #define KEXEC_SOURCE_MEMORY_LIMIT (0x20000000)
+ #define KEXEC_SOURCE_MEMORY_LIMIT (0x1FFFFFFF)


Thanks.

<Prev in Thread] Current Thread [Next in Thread>