WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] arch_init_memory() change

To: "Altobelli, David" <david.altobelli@xxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] arch_init_memory() change
From: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Date: Sat, 23 Jun 2007 16:18:59 +0100
Delivery-date: Sat, 23 Jun 2007 08:17:01 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <BA0B6AD5674AAB47A8B4C949A56F911801701CF2@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Ace06mbWQQp4xXv+Rxe5UnP7edz9UQAv2u6c
Thread-topic: [Xen-devel] arch_init_memory() change
User-agent: Microsoft-Entourage/11.3.3.061214
The code in arch/x86/setup.c with comment "Ensure all E820 RAM regions are
page-aligned and -sized" is supposed to fix this. In this case it should
turn the E820 entry into a zero-sized entry that is then discarded when the
e820 map is sanitized. Are you running a version of Xen that's missing this
code?

 -- Keir

On 22/6/07 17:28, "Altobelli, David" <david.altobelli@xxxxxx> wrote:

> In xen/arch/x86/mm.c, arch_init_memory() does not follow the same logic
> as find_max_pfn().  If a 4k non page aligned E820_RAM entry exists as
> the last RAM entry in the e820 map, it will be skipped by
> find_max_pfn(), but not by arch_init_memory(), triggering BUG_ON(pfn !=
> max_page).
> 
> The logic in arch_init_memory() could be changed to mirror
> find_max_pfn():
> --- xen/arch/x86/mm.c.orig      2007-06-22 10:10:19.000000000 -0500
> +++ xen/arch/x86/mm.c   2007-06-22 10:11:39.000000000 -0500
> @@ -220,6 +220,8 @@ void arch_init_memory(void)
>          /* Every page from cursor to start of next RAM region is I/O.
> */
>          rstart_pfn = PFN_UP(e820.map[i].addr);
>          rend_pfn   = PFN_DOWN(e820.map[i].addr + e820.map[i].size);
> +        if (rstart_pfn >= rend_pfn)
> +            continue;
>          for ( ; pfn < rstart_pfn; pfn++ )
>          {
>              BUG_ON(!mfn_valid(pfn));
> 
> But I think this breaks the sharing logic.  It might be better to just
> remove the BUG_ON():
> --- xen/arch/x86/mm.c.orig      2007-06-22 10:10:19.000000000 -0500
> +++ xen/arch/x86/mm.c   2007-06-22 11:20:42.000000000 -0500
> @@ -229,7 +229,6 @@ void arch_init_memory(void)
>          /* Skip the RAM region. */
>          pfn = rend_pfn;
>      }
> -    BUG_ON(pfn != max_page);
> 
>      subarch_init_memory();
>  }
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

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