[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sun, 09 Oct 2022 21:51:18 -0700
From: "H. Peter Anvin" <hpa@...or.com>
To: "Li, Xin3" <xin3.li@...el.com>, Brian Gerst <brgerst@...il.com>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"x86@...nel.org" <x86@...nel.org>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"mingo@...hat.com" <mingo@...hat.com>,
"bp@...en8.de" <bp@...en8.de>,
"dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>
Subject: RE: [PATCH 6/6] x86/gsseg: use the LKGS instruction if available for load_gs_index()
On October 9, 2022 9:32:34 PM PDT, "Li, Xin3" <xin3.li@...el.com> wrote:
>> > > There are not that many call sites, so using something like this
>> > > (incorporating Peter Z's suggestion for the exception handler) would
>> > > be better from a code readability perspective vs. a tiny increase in code size.
>> >
>> > The existing approach patches the binary code thus we don't need to check it
>> at runtime.
>>
>> static_cpu_has() uses alternatives to patch the branch, so there is no runtime
>> check after early boot.
>>
>
>Sorry, didn't know it, thanks for point it out.
>
>If we prefer static_cpu_has, are you asking to replace all alternative macros with it?
>
>Xin
>
>
Honestly, it seems to me to be more than a bit excessive. The code might be nontrivial, but *with proper commenting* it should be perfectly understandable...
Powered by blists - more mailing lists