From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH for 4.6 v2 4/5] libxc: don't populate same pfn more than once in populate_pfns Date: Sun, 6 Sep 2015 17:25:30 +0100 Message-ID: <55EC68FA.9010503@citrix.com> References: <1441411167-32440-1-git-send-email-wei.liu2@citrix.com> <1441411167-32440-5-git-send-email-wei.liu2@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZYcl2-0008W9-M1 for xen-devel@lists.xenproject.org; Sun, 06 Sep 2015 16:25:32 +0000 In-Reply-To: <1441411167-32440-5-git-send-email-wei.liu2@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Wei Liu , Xen-devel Cc: Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org On 05/09/15 00:59, Wei Liu wrote: > The original implementation of populate_pfns didn't consider the same > pfn can be present multiple times in the array. The mechanism to prevent > populating the same pfn multiple times only worked if the recurring pfn > appeared in different batches. > > This bug is discovered by Linux 4.1 32 bit kernel save / restore test, > which has several ptes pointing to same pfn, which results in an array > containing recurring pfn. When libxc called x86_pv_localise_page, the > original implementation would populate the same pfn more than once. > > The fix is to set bit in populated bitmap as we generate list of pfns to > be populated. > > Signed-off-by: Wei Liu Reviewed-by: Andrew Cooper