From: Jerone Young Subject: [PATCH] xen/arch/x86/x86_32/mm.c Date: Thu, 11 Aug 2005 16:15:31 -0500 Message-ID: <1123794931.3043.57.camel@thinkpad> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel List-Id: xen-devel@lists.xenproject.org Well this is a bug. Iterator i is being used in both top & embeded for loops. Signed-off-by: Jerone Young --- xen/arch/x86/x86_32/mm.c.old 2005-08-11 13:53:44.000000000 -0500 +++ xen/arch/x86/x86_32/mm.c 2005-08-11 13:55:20.000000000 -0500 @@ -67,7 +67,7 @@ void __init paging_init(void) void *ioremap_pt; unsigned long v; struct pfn_info *pg; - int i, mapcache_order; + int i,n,mapcache_order; #ifdef CONFIG_X86_PAE printk("PAE enabled, limit: %d GB\n", MACHPHYS_MBYTES); @@ -170,10 +170,10 @@ void subarch_init_memory(struct domain * } /* M2P table is mappable read-only by privileged domains. */ - for ( i = 0; i < (mpt_size >> L2_PAGETABLE_SHIFT); i++ ) + for ( n = 0; n < (mpt_size >> L2_PAGETABLE_SHIFT); n++ ) { m2p_start_mfn = l2e_get_pfn( - idle_pg_table_l2[l2_linear_offset(RDWR_MPT_VIRT_START) + i]); + idle_pg_table_l2[l2_linear_offset(RDWR_MPT_VIRT_START) + n]); for ( i = 0; i < L2_PAGETABLE_ENTRIES; i++ ) { frame_table[m2p_start_mfn+i].count_info = PGC_allocated | 1; -- Jerone Young IBM Linux Technology Center jyoung5@us.ibm.com 512-838-1157 (T/L: 678-1157)