From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ed White Subject: Re: [PATCH 00/11] Alternate p2m: support multiple copies of host p2m Date: Wed, 25 Mar 2015 10:41:55 -0700 Message-ID: <5512F363.4040706@intel.com> References: <1420838801-11704-1-git-send-email-edmund.h.white@intel.com> <20150115161519.GA57240@deinos.phlegethon.org> <54B805B0.8090604@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <54B805B0.8090604@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: Tim Deegan Cc: keir@xen.org, ian.jackson@eu.citrix.com, ian.campbell@citrix.com, jbeulich@suse.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org >> >> The second thing is how similar some of this is to nested p2m code, >> making me wonder whether it could share more code with that. It's not >> as much duplication as I had feared, but e.g. altp2m_write_p2m_entry() >> is _identical_ to nestedp2m_write_p2m_entry(), (making the >> copyright claim at the top of the file quite dubious, BTW). >> > > I did initially use nestedp2m_write_p2m_entry directly, but I knew > that wouldn't be acceptable! On this specific point, I would be more > inclined to refactor the normal write entry routine so you can call > it everywhere, since both the nested and alternate ones are simply > a copy of a part of the normal one. > I started to look into this again. What I described as the normal write routine is the one for HAP, and that is actually a domain-level routine (akin to the paging mode-specific ones), and takes a domain as its first parameter. The nestedp2m routine is a p2m-level routine that takes a p2m as its first parameter, and that's what I had copied. However, looking at the code, the p2m-level write routine is only ever called from the domain-level one, but the HAP routine doesn't make such calls, and nestedp2m and altp2m are only available in HAP mode. Therefore, I have dropped the altp2m write routine with no ill effects. I don't think the nestedp2m one can ever be called. Ed