From: Tim Deegan Subject: Re: [PATCH v2 1/6] x86/EPT: don't walk entire page tables when globally changing types Date: Fri, 25 Apr 2014 10:44:47 +0200 Message-ID: <20140425084447.GB33897@deinos.phlegethon.org> References: <53567B1C020000780000AB8C@nat28.tlf.novell.com> <53567C85020000780000ABA3@nat28.tlf.novell.com> <20140424154103.GH48969@deinos.phlegethon.org> <535955D9020000780000C09D@nat28.tlf.novell.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 1Wdbkb-0004d3-U3 for xen-devel@lists.xenproject.org; Fri, 25 Apr 2014 08:44:54 +0000 Content-Disposition: inline In-Reply-To: <535955D9020000780000C09D@nat28.tlf.novell.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: Jan Beulich Cc: Kevin Tian , Keir Fraser , suravee.suthikulpanit@amd.com, Eddie Dong , Jun Nakajima , xen-devel , Boris Ostrovsky List-Id: xen-devel@lists.xenproject.org At 17:20 +0100 on 24 Apr (1398356409), Jan Beulich wrote: > >>> On 24.04.14 at 17:41, wrote: > > At 13:28 +0100 on 22 Apr (1398169701), Jan Beulich wrote: > >> --- a/xen/arch/x86/mm/hap/hap.c > >> +++ b/xen/arch/x86/mm/hap/hap.c > >> @@ -110,11 +110,18 @@ int hap_track_dirty_vram(struct domain * > >> if ( begin_pfn != dirty_vram->begin_pfn || > >> begin_pfn + nr != dirty_vram->end_pfn ) > >> { > >> + unsigned long ostart = dirty_vram->begin_pfn; > >> + unsigned long oend = dirty_vram->end_pfn; > >> + > >> dirty_vram->begin_pfn = begin_pfn; > >> dirty_vram->end_pfn = begin_pfn + nr; > >> > >> paging_unlock(d); > >> > >> + if ( oend > ostart ) > >> + p2m_change_type_range(d, ostart, oend, > >> + p2m_ram_logdirty, p2m_ram_rw); > >> + > > > > Does this (and the simlar change below) not risk losing updates if > > we're in full log-dirty mode? I think it should be fine to leave > > those entries as log-dirty, since at worst they'll provoke another > > fault-and-fixup. > > I don't think any updates can be lost: When their types get re- > calculated, p2m_is_logdirty_range() (taking p2m->global_logdirty > into account) will still cause them to become p2m_ram_logdirty > again. Right, I see. That's fine then. > > In this case, where needs_sync isn't being passed as a return value, I > > think we'd be fine with two booleans in place of this int. > > I guess I'll make these tristates distinct enums then... Thanks! Tim.