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

[Xen-devel] Comment & code inconsistency?

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] Comment & code inconsistency?
From: "陈诚" <concretechen@xxxxxxxxx>
Date: Sun, 18 Nov 2007 22:20:15 +0800
Delivery-date: Sun, 18 Nov 2007 06:20:56 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=W+cOEUMVcXTH2r4XZp1Ew3uqec8pgA4tixNVApblONc=; b=AcUizuruSXCcort4PZ7Ohq5pM/tDNfkeF2v78FZy+llPtZpY9Cc1BUvc6KL7dNsUa4E0b6KjVp40AjVJj8hoXxYyXTiNoE3UAFK0DbimKGd4y2wBUkkQNaG3TLXYyEJFYK7S6VSEN/1O5ndSSXtIm3UGp6kfu1J/QSgY9iAW8C0=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=HWKAa6qNhiLqqZ5EgpRrS3+0SKrnfSFycZQckRVLTalOshXts3kMDM/DKiLoKAIeU/egUmjBOQgvEFGHQ23ZKdTdQZs/PuQ+yENIWnnNmnc7/dlk/OuEugLT1y0VVpKNvb069cWqKJ3Jr7OdvksDzQ2cs4/UH/FOIqwlyK27fXY=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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
Hi all,
    in arch_init_memory() we have the following code:

    ...

    /* Any areas not specified as RAM by the e820 map are considered I/O. */
    for ( i = 0, pfn = 0; pfn < max_page; i++ )
    {
        while ( (i < e820.nr_map) && (e820.map[i].type != E820_RAM) )
            i++;

        if ( i >= e820.nr_map )
        {
            /* No more RAM regions: mark as I/O right to end of memory map. */
            rstart_pfn = rend_pfn = max_page;
        }
        else
        {
            /* Mark as I/O just up as far as next RAM region. */
            rstart_pfn = min_t(unsigned long, max_page,
                               PFN_UP(e820.map[i].addr));
            rend_pfn   = max_t(unsigned long, rstart_pfn,
                               PFN_DOWN(e820.map[i].addr + e820.map[i].size));
        }

        /* Mark as I/O up to next RAM region. */
        for ( ; pfn < rstart_pfn; pfn++ )
        {
            BUG_ON(!mfn_valid(pfn));
            share_xen_page_with_guest(
                mfn_to_page(pfn), dom_io, XENSHARE_writable);
        }

        /* Skip the RAM region. */
        pfn = rend_pfn;
    }

    ...

    it seems that the while loop skips all the areas that are not
specified as RAM and the areas which are specified as RAM are
considered I/O, which contradicts with the comment, or do I
misunderstand this piece of code?

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

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