From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: Re: [PATCH v5 05/15] x86/altp2m: basic data structures and support routines. Date: Tue, 14 Jul 2015 15:45:29 +0100 Message-ID: <55A52089.1050007@eu.citrix.com> References: <1436832903-12639-1-git-send-email-edmund.h.white@intel.com> <1436832903-12639-6-git-send-email-edmund.h.white@intel.com> <55A527140200007800090B74@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <55A527140200007800090B74@mail.emea.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 , Ed White Cc: Tim Deegan , Ravi Sahita , Wei Liu , Andrew Cooper , Ian Jackson , xen-devel@lists.xen.org, tlengyel@novetta.com, Daniel De Graaf List-Id: xen-devel@lists.xenproject.org On 07/14/2015 02:13 PM, Jan Beulich wrote: >>>> On 14.07.15 at 02:14, wrote: >> +void >> +altp2m_vcpu_initialise(struct vcpu *v) >> +{ >> + if ( v != current ) >> + vcpu_pause(v); >> + >> + altp2m_vcpu_reset(v); >> + vcpu_altp2m(v).p2midx = 0; >> + atomic_inc(&p2m_get_altp2m(v)->active_vcpus); >> + >> + altp2m_vcpu_update_eptp(v); >> + >> + if ( v != current ) >> + vcpu_unpause(v); >> +} >> + >> +void >> +altp2m_vcpu_destroy(struct vcpu *v) >> +{ >> + struct p2m_domain *p2m; >> + >> + if ( v != current ) >> + vcpu_pause(v); >> + >> + if ( (p2m = p2m_get_altp2m(v)) ) >> + atomic_dec(&p2m->active_vcpus); >> + >> + altp2m_vcpu_reset(v); >> + >> + altp2m_vcpu_update_eptp(v); >> + altp2m_vcpu_update_vmfunc_ve(v); >> + >> + if ( v != current ) >> + vcpu_unpause(v); >> +} > > There not being any caller of altp2m_vcpu_initialise() I can't judge > about its pausing requirements, but for the destroy case I can't > see what the pausing is good for. Considering its sole user it's also > not really clear why the two update operations need to be done > while destroying. So looking at this after all the patches have been applied, it looks like initialise() and destroy() are called from the altp2m_set_domain_state(), which the guest uses to enable or disable the altp2m functionality. In that case, it seems like pausing is probably appropriate. -George