[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f741d8ed1c923ab7dc3d90c8f281b6779efc96c8.camel@redhat.com>
Date: Wed, 22 Jun 2022 18:59:06 +0300
From: Maxim Levitsky <mlevitsk@...hat.com>
To: Dave Hansen <dave.hansen@...el.com>, linux-kernel@...r.kernel.org
Cc: "Chang S. Bae" <chang.seok.bae@...el.com>,
Jiri Olsa <jolsa@...nel.org>, linux-perf-users@...r.kernel.org,
Peter Zijlstra <peterz@...radead.org>,
"H. Peter Anvin" <hpa@...or.com>,
"David S. Miller" <davem@...emloft.net>,
Borislav Petkov <bp@...en8.de>,
Kees Cook <keescook@...omium.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Namhyung Kim <namhyung@...nel.org>,
Tim Chen <tim.c.chen@...ux.intel.com>,
Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>,
Herbert Xu <herbert@...dor.apana.org.au>,
Dave Hansen <dave.hansen@...ux.intel.com>,
"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@...nel.org>,
Jane Malalane <jane.malalane@...rix.com>,
Tony Luck <tony.luck@...el.com>,
Ingo Molnar <mingo@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
"open list:CRYPTO API" <linux-crypto@...r.kernel.org>,
Paolo Bonzini <pbonzini@...hat.com>
Subject: Re: [PATCH 2/4] x86/cpuid: refactor
setup_clear_cpu_cap/clear_feature
On Wed, 2022-06-22 at 08:07 -0700, Dave Hansen wrote:
> On 6/22/22 07:48, Maxim Levitsky wrote:
> > Simplify the code a bit by always passing &boot_cpu_data
> > in case the setup_clear_cpu_cap was called.
> >
> > Also unify clear_cpu_cap and do_clear_cpu_cap.
>
> Please always add a "()" suffix to functions. "foo" is a variable, but
> "foo()" is a function.
Will do next time!
>
> I also really like when a changelog has a clear problem statement. I
> _think_ the problem here is something along the lines of the 'c'
> argument to clear_feature() having different behavior when it is NULL
> versus '&boot_cpu_data'.
To be honest I didn't try to fix any problem here, I just wanted to simplify
clear_feature() a bit by avoiding a recursive call to clear_cpu_cap.
>
> Basically, there's no reason to support clearing a bit in
> '&boot_cpu_data' without also setting that bit in 'cpu_caps_cleared'.
> > {
> > - do_clear_cpu_cap(NULL, feature);
> > + clear_cpu_cap(&boot_cpu_data, feature);
> > }
I'll try to think about a better changelog message for this.
Thank you!
Best regards,
Maxim Levitsky
Powered by blists - more mailing lists