From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: [PATCH RFC 30/31] x86/domctl: Update PV domain cpumasks when setting cpuid policy Date: Fri, 22 Jan 2016 03:02:59 -0700 Message-ID: <56A20C6302000078000C9F26@prv-mh.provo.novell.com> References: <1450301073-28191-1-git-send-email-andrew.cooper3@citrix.com> <1450301073-28191-31-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1450301073-28191-31-git-send-email-andrew.cooper3@citrix.com> Content-Disposition: inline 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 Cc: Xen-devel List-Id: xen-devel@lists.xenproject.org >>> On 16.12.15 at 22:24, wrote: > --- a/xen/arch/x86/domctl.c > +++ b/xen/arch/x86/domctl.c > @@ -77,6 +77,74 @@ 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) ) > + { > + uint64_t mask = cpumask_defaults._1cd; > + > + if ( boot_cpu_data.x86_vendor == X86_VENDOR_INTEL ) > + mask &= ((uint64_t)ctl->edx << 32) | ctl->ecx; > + else if ( boot_cpu_data.x86_vendor == X86_VENDOR_AMD ) > + mask &= ((uint64_t)ctl->ecx << 32) | ctl->edx; I'd prefer switch() to be used in cases like this, but anyway Reviewed-by: Jan Beulich notwithstanding possible mechanical adjustments to the patch due to changes to earlier ones. Jan