From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: [PATCH v2 13/30] xen/x86: Clear dependent features when clearing a cpu cap Date: Mon, 15 Feb 2016 07:56:33 -0700 Message-ID: <56C1F53102000078000D22FB@prv-mh.provo.novell.com> References: <1454679743-18133-1-git-send-email-andrew.cooper3@citrix.com> <1454679743-18133-14-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: <1454679743-18133-14-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 05.02.16 at 14:42, wrote: > --- a/xen/arch/x86/cpu/common.c > +++ b/xen/arch/x86/cpu/common.c > @@ -53,8 +53,24 @@ static unsigned int cleared_caps[NCAPINTS]; > > void __init setup_clear_cpu_cap(unsigned int cap) > { > + const uint32_t *dfs; > + unsigned int i; > + > + if ( test_bit(cap, cleared_caps) ) > + return; > + > __clear_bit(cap, boot_cpu_data.x86_capability); > __set_bit(cap, cleared_caps); > + > + dfs = lookup_deep_deps(cap); > + > + if ( !dfs ) > + return; > + > + for ( i = 0; i < FSCAPINTS; ++i ) { > + cleared_caps[i] |= dfs[i]; > + boot_cpu_data.x86_capability[i] &= ~dfs[i]; > + } > } Oh, also - you're mixing styles here (note the stray blanks inside for() and if()) ... Jan