From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ed White Subject: Re: [PATCH 04/11] x86/MM: Improve p2m type checks. Date: Tue, 13 Jan 2015 11:39:26 -0800 Message-ID: <54B5746E.8010307@intel.com> References: <1420838801-11704-1-git-send-email-edmund.h.white@intel.com> <1420838801-11704-5-git-send-email-edmund.h.white@intel.com> <54B408E6.8060404@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <54B408E6.8060404@citrix.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: Andrew Cooper , xen-devel@lists.xen.org Cc: ian.jackson@eu.citrix.com, tim@xen.org, keir@xen.org, ian.campbell@citrix.com, jbeulich@suse.com List-Id: xen-devel@lists.xenproject.org On 01/12/2015 09:48 AM, Andrew Cooper wrote: > On 09/01/15 21:26, Ed White wrote: >> diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h >> index 5f7fe71..8193901 100644 >> --- a/xen/include/asm-x86/p2m.h >> +++ b/xen/include/asm-x86/p2m.h >> @@ -193,6 +193,9 @@ struct p2m_domain { >> * threaded on in LRU order. */ >> struct list_head np2m_list; >> >> + /* Does this p2m belong to the altp2m code? */ >> + bool_t alternate; >> + >> /* Host p2m: Log-dirty ranges registered for the domain. */ >> struct rangeset *logdirty_ranges; >> >> @@ -290,7 +293,9 @@ struct p2m_domain *p2m_get_nestedp2m(struct vcpu *v, uint64_t np2m_base); >> */ >> struct p2m_domain *p2m_get_p2m(struct vcpu *v); >> >> -#define p2m_is_nestedp2m(p2m) ((p2m) != p2m_get_hostp2m((p2m->domain))) >> +#define p2m_is_hostp2m(p2m) ((p2m) == p2m_get_hostp2m((p2m->domain))) >> +#define p2m_is_altp2m(p2m) ((p2m)->alternate) >> +#define p2m_is_nestedp2m(p2m) (!p2m_is_altp2m(p2m) && !p2m_ishostp2m(p2m)) > > Might this be better expressed as a p2m type, currently of the set > {host, alt, nested} ? p2m_is_nestedp2m() is starting to hide some > moderately complicated calculations. > Any suggestions for the name? Unfortunately, p2m_type is already taken, and I can't think of a good alternative. Ed