From: "Jan Beulich" Subject: Re: [PATCH v7 2/4] xen/shadow: fix shadow_track_dirty_vram to work on hvm guests Date: Fri, 22 May 2015 08:59:26 +0100 Message-ID: <555EFDFE020000780007D0FB@mail.emea.novell.com> References: <1431615977-38284-1-git-send-email-roger.pau@citrix.com> <1431615977-38284-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.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Yvhrc-0007rE-Dq for xen-devel@lists.xenproject.org; Fri, 22 May 2015 07:59:28 +0000 In-Reply-To: <1431615977-38284-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 14.05.15 at 17:06, wrote: > @@ -3584,12 +3591,8 @@ int shadow_track_dirty_vram(struct domain *d, > rc = -ENODATA; > } > else if (dirty_vram->last_dirty == -1) > - { > /* still completely clean, just copy our empty bitmap */ > - rc = -EFAULT; > - if ( copy_to_guest(dirty_bitmap, dirty_vram->dirty_bitmap, dirty_size) == 0 ) > - rc = 0; > - } > + memcpy(dirty_bitmap, dirty_vram->dirty_bitmap, dirty_size); Btw, having looked at this again in the context of the coverity issue it causes - wouldn't this (according to the retained comment) be a memset()? And if so, in turn a loop over clear_page()? Which gets me to a second thing: With the large amounts of data being pushed through copy_to_guest() here and in its HAP counterpart, wouldn't it make sense to have a specialized function avoiding cache thrashing along the lines of clear_page() and copy_page()? Jan