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] [PATCH] e820: fix clip_to_limit()

To: "keir.fraser" <keir.fraser@xxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] e820: fix clip_to_limit()
From: Xiao Guangrong <ericxiao.gr@xxxxxxxxx>
Date: Tue, 10 Nov 2009 04:04:57 +0800
Cc: Xiao Guangrong <xiaoguangrong@xxxxxxxxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Mon, 09 Nov 2009 12:05:30 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:content-type :content-transfer-encoding; bh=ufczINiTfeGnD7hocOj5+WAIueAgS0c2CZlHI4LfFVc=; b=cFdeoyNNGxgqZqfw5aVdcoGJE+2xubKxkWLCH2Z5hFLfcBvyihbMlzLIBF4A6+ILb4 /41qxHeF1TUshNWbVdQwLkSRX7OfBZlZfCIvkZOGrHvZ5r3mZlivIzfVrQyLkuPM3+Pd l5JPmAh1Jjph9E/VuR+vSqNSsywgoS/8R1Sqc=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; b=rzoKW/MSm54butbEKaclthMPzb7BfSQN8+DS7edo82pMh3hpaKGxd0EfGhwHSlB1au Ogk816aOi4wzzt+UPkCeXXZa+5cch4VGYkGk6CP43TFtTxSXYQcm6YIPRoLplGvk3pBi 2IlwNp8jCteMGGbmzO8OFn+XdP/rYm48mBN3w=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.23 (Windows/20090812)
In clip_to_limit(), after memmove(&e820.map[i], &e820.map[i+1], ...), the 
original
e820.map[i+1] become current e820.map[i] but the next loop count is i+1, so the 
original
e820.map[i+1] will be skipped

Actually, e820 is sorted form low to high by sanitize_e820_map(), so we can 
simply break
the loop if we meet the item which overrun "limit"

Signed-off-by: Xiao Guangrong <ericxiao.gr@xxxxxxxxx>

diff -r 93bc06dd1161 -r 5e06f2790d93 xen/arch/x86/e820.c
--- a/xen/arch/x86/e820.c       Tue Nov 10 02:41:59 2009 +0800
+++ b/xen/arch/x86/e820.c       Tue Nov 10 03:51:08 2009 +0800
@@ -389,6 +389,7 @@
                     (e820.nr_map - i - 1) * sizeof(struct e820entry));
             e820.nr_map--;
         }
+       break;
     }

     if ( old_limit )

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