From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tim Deegan Subject: Re: [PATCH 09/10] log-dirty: Refine common code to support PML Date: Thu, 9 Apr 2015 13:27:51 +0100 Message-ID: <20150409122751.GI17031@deinos.phlegethon.org> References: <1427423754-11841-1-git-send-email-kai.huang@linux.intel.com> <1427423754-11841-10-git-send-email-kai.huang@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1427423754-11841-10-git-send-email-kai.huang@linux.intel.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: Kai Huang Cc: yang.z.zhang@intel.com, andrew.cooper3@citrix.com, kevin.tian@intel.com, jbeulich@suse.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org At 10:35 +0800 on 27 Mar (1427452553), Kai Huang wrote: > --- a/xen/arch/x86/mm/paging.c > +++ b/xen/arch/x86/mm/paging.c > @@ -411,7 +411,18 @@ static int paging_log_dirty_op(struct domain *d, > int i4, i3, i2; > > if ( !resuming ) > + { > domain_pause(d); > + > + /* > + * Only need to flush when not resuming, as domain was paused in > + * resuming case therefore it's not possible to have any new dirty > + * page. > + */ > + if ( d->arch.paging.log_dirty.flush_cached_dirty ) > + d->arch.paging.log_dirty.flush_cached_dirty(d); I think there are too many layers of indirection here. :) How about: - don't add a flush_cached_dirty() function to the log_dirty ops. - just call p2m_flush_hardware_cached_dirty(d) here. Would that work OK? Cheers, Tim.