From: Tim Deegan Subject: Re: [V9 PATCH 6/8] pvh dom0: Add and remove foreign pages Date: Mon, 28 Apr 2014 11:09:00 +0200 Message-ID: <20140428090900.GA4656@deinos.phlegethon.org> References: <534EC5430200007800009ADD@nat28.tlf.novell.com> <20140416183742.50a98472@mantra.us.oracle.com> <534F95E00200007800009D40@nat28.tlf.novell.com> <20140417123653.GA25395@deinos.phlegethon.org> <534FFA32020000780000A077@nat28.tlf.novell.com> <20140423192151.0b05a91b@mantra.us.oracle.com> <20140424094641.GA48969@deinos.phlegethon.org> <20140424190925.62843681@mantra.us.oracle.com> <20140425183431.0251a6ca@mantra.us.oracle.com> <535E3350020000780000CB70@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WehYn-00061F-RL for xen-devel@lists.xenproject.org; Mon, 28 Apr 2014 09:09:14 +0000 Content-Disposition: inline In-Reply-To: <535E3350020000780000CB70@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: George.Dunlap@eu.citrix.com, eddie.dong@intel.com, keir.xen@gmail.com, jun.nakajima@intel.com, xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org At 09:54 +0100 on 28 Apr (1398675248), Jan Beulich wrote: > >>> On 26.04.14 at 03:34, wrote: > > Ok, so far: > > > > option 1, Jan's suggestion: > > - Use my latest patch, but add explicit set of p2m type for intermediate > > entries in ept_set_middle_entry() like Jan said. > > > > Good: we won't need to then worry about checking for leaf entries. > > Bad: future code can't use the bits for interm entries. > > > > option 2, Tim's suggestion: > > - Use my latest patch, but add sp = 1 in leaf entries. Then use level > > to figure if we are in superpage. Will work too, but will change the > > definition of sp bit, and superpage check will always require checking > > for level. > > > > option 3: > > - Pass level to atomic_write_ept_entry() and check for foreign only in > > case of level == 0, ie leaf entries where foreign can be set. > > > > It appears that information is available at all call sites, and would > > be least intrusive in terms of using bits for non-leaf entries. > > > > option 4: > > - each call site checks for level and calls either macro for leaf entry > > or macro for non-leaf entry. same as 3, but the check is in call site. > > I think my preference would go backwards from 4 to 1, but I think > Tim would - like you - prefer 3 over 4, which I wouldn't object to. My order would be 2, 3, 4, 1, but really only objecting to #1; so that sounds like consensus for option 3. Tim.