From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH v2 22/30] x86/domctl: Update PV domain cpumasks when setting cpuid policy Date: Wed, 17 Feb 2016 12:13:57 +0000 Message-ID: <56C46405.8030607@citrix.com> References: <1454679743-18133-1-git-send-email-andrew.cooper3@citrix.com> <1454679743-18133-23-git-send-email-andrew.cooper3@citrix.com> <56C43BBB02000078000D2F1E@prv-mh.provo.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <56C43BBB02000078000D2F1E@prv-mh.provo.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: Xen-devel List-Id: xen-devel@lists.xenproject.org On 17/02/16 08:22, Jan Beulich wrote: >>>> On 05.02.16 at 14:42, wrote: >> @@ -87,6 +88,93 @@ static void update_domain_cpuid_info(struct domain *d, >> d->arch.x86_model = (ctl->eax >> 4) & 0xf; >> if ( d->arch.x86 >= 0x6 ) >> d->arch.x86_model |= (ctl->eax >> 12) & 0xf0; >> + >> + if ( is_pv_domain(d) ) > For clarity, wouldn't it be reasonable to check the respective > capability flag in all of these conditionals, even if without such > checks what gets set below simply won't ever get used? Even > more, the earlier patch allocating d->arch.pv_domain.cpuidmasks > could skip this allocation if none of the masking capability bits > are set (in which case checking the pointer to be non-NULL would > seem to be the right check here then). Can do. ~Andrew