From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH 0/6] prefer is_..._domain() over is_..._vcpu() Date: Thu, 11 Jun 2015 11:33:58 +0100 Message-ID: <55796416.5090708@citrix.com> References: <55797BF702000078000838AF@mail.emea.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 1Z2zoE-0004Z5-VB for xen-devel@lists.xenproject.org; Thu, 11 Jun 2015 10:34:07 +0000 In-Reply-To: <55797BF702000078000838AF@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 , xen-devel List-Id: xen-devel@lists.xenproject.org On 11/06/15 11:15, Jan Beulich wrote: > ... when the domain pointer is already available or such operations occur > frequently in a function. There's no particular ordering requirement > between the individual patches, they only all do the same thing to > different areas of code. > > 1: domctl: prefer is_..._domain() over is_..._vcpu() > 2: x86: prefer is_..._domain() over is_..._vcpu() > 3: x86/HVM: prefer is_..._domain() over is_..._vcpu() > 4: x86/mm: prefer is_..._domain() over is_..._vcpu() > 5: x86/context-switch: prefer is_..._domain() over is_..._vcpu() > 6: x86/HAP: prefer is_..._domain() over is_..._vcpu() > > Signed-off-by: Jan Beulich The entire series, Reviewed-by: Andrew Cooper With two further suggestions: Patch 2: > --- a/xen/arch/x86/traps.c > +++ b/xen/arch/x86/traps.c > @@ -798,7 +798,7 @@ int cpuid_hypervisor_leaves( uint32_t id > *ebx = 0x40000200; > *ecx = 0; /* Features 1 */ > *edx = 0; /* Features 2 */ > - if ( is_pv_vcpu(current) ) > + if ( is_pv_domain(d) ) > *ecx |= XEN_CPUID_FEAT1_MMU_PT_UPDATE_PRESERVE_AD; > break; It would be clearer to s/d/currd/ in this functions. It won't make the patch much larger. Patch 5: > --- a/xen/arch/x86/domain.c > +++ b/xen/arch/x86/domain.c > @@ -1429,9 +1429,9 @@ static void _update_runstate_area(struct > v->arch.pv_vcpu.need_update_runstate_area = 1; > } > > -static inline int need_full_gdt(struct vcpu *v) > +static inline int need_full_gdt(const struct domain *d) As you area already changing this, you might as well switch int for bool_t. ~Andrew