From: "Jan Beulich" Subject: Re: [PATCH v5 2/4] xen/shadow: fix shadow_track_dirty_vram to work on hvm guests Date: Fri, 08 May 2015 16:28:45 +0100 Message-ID: <554CF24D02000078000786A4@mail.emea.novell.com> References: <1431095651-25935-1-git-send-email-roger.pau@citrix.com> <1431095651-25935-3-git-send-email-roger.pau@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YqkCl-00029K-B4 for xen-devel@lists.xenproject.org; Fri, 08 May 2015 15:28:47 +0000 In-Reply-To: <1431095651-25935-3-git-send-email-roger.pau@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Roger Pau Monne , Tim Deegan Cc: Andrew Cooper , xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org >>> On 08.05.15 at 16:34, wrote: > @@ -3668,21 +3671,19 @@ int shadow_track_dirty_vram(struct domain *d, > if ( map_sl1p ) > sh_unmap_domain_page(map_sl1p); > > - rc = -EFAULT; > - if ( copy_to_guest(dirty_bitmap, dirty_vram->dirty_bitmap, dirty_size) == 0 ) { > - memset(dirty_vram->dirty_bitmap, 0, dirty_size); > - if (dirty_vram->last_dirty + SECONDS(2) < NOW()) > + memcpy(dirty_bitmap, dirty_vram->dirty_bitmap, dirty_size); > + memset(dirty_vram->dirty_bitmap, 0, dirty_size); This is certainly a behavioral change; I'm only uncertain whether it's acceptable. Previously the memset() was done only when the copying to guest memory succeeded, while now it happens unconditionally. Jan