Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1314429
| From | "H. Peter Anvin" <hpa@zytor.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 2/5] x86/cpufeature: Remove static_cpu_has() |
| Date | 2016-01-21 20:10 +0100 |
| Message-ID | <qTsMi-19q-23@gated-at.bofh.it> (permalink) |
| References | <qTsjf-I1-7@gated-at.bofh.it> <qTsjg-I1-35@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 01/21/16 10:34, Borislav Petkov wrote: > From: Borislav Petkov <bp@suse.de> > > Well, this one doesn't work properly before alternatives have run. And > it was supposed to provide an optimized JMP because the assumption was > that the offset it is jumping to is within a signed byte and thus a > two-byte JMP. > > So I did an x86_64 allyesconfig build and dumped all possible sites > where static_cpu_has() was used. The optimization amounted to all in all > 12(!) places where static_cpu_has() had generated a 2-byte JMP. Which > has saved us a whopping 36 bytes! > > This clearly is not worth the trouble so we can remove it. The only > place where the optimization might count - in __switch_to() - we will > handle differently. But that's not subject of this patch. > > diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h > index 3cce9f3c5cb1..2b0abb241205 100644 > --- a/arch/x86/include/asm/cpufeature.h > +++ b/arch/x86/include/asm/cpufeature.h > @@ -125,103 +125,20 @@ extern const char * const x86_bug_flags[NBUGINTS*32]; > #define cpu_has_osxsave boot_cpu_has(X86_FEATURE_OSXSAVE) > #define cpu_has_hypervisor boot_cpu_has(X86_FEATURE_HYPERVISOR) > /* > - * Do not add any more of those clumsy macros - use static_cpu_has_safe() for > + * Do not add any more of those clumsy macros - use static_cpu_has() for > * fast paths and boot_cpu_has() otherwise! > */ > > #if __GNUC__ >= 4 && defined(CONFIG_X86_FAST_FEATURE_TESTS) Just replace the __GNUC__ >= 4 with CC_HACE_ASM_GOTO in this test and get rid of the tests of CC_HAVE_ASM_GOTO in the rest of the code. > /* > * gcc 3.x is too stupid to do the static test; fall back to dynamic. > */ ... and modify this comment accordingly. -hpa
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH 2/5] x86/cpufeature: Remove static_cpu_has() Borislav Petkov <bp@alien8.de> - 2016-01-21 19:40 +0100
Re: [PATCH 2/5] x86/cpufeature: Remove static_cpu_has() Andy Lutomirski <luto@amacapital.net> - 2016-01-21 20:10 +0100
Re: [PATCH 2/5] x86/cpufeature: Remove static_cpu_has() Borislav Petkov <bp@alien8.de> - 2016-01-21 20:40 +0100
Re: [PATCH 2/5] x86/cpufeature: Remove static_cpu_has() "H. Peter Anvin" <hpa@zytor.com> - 2016-01-21 20:50 +0100
Re: [PATCH 2/5] x86/cpufeature: Remove static_cpu_has() Borislav Petkov <bp@alien8.de> - 2016-01-21 21:00 +0100
Re: [PATCH 2/5] x86/cpufeature: Remove static_cpu_has() "H. Peter Anvin" <hpa@zytor.com> - 2016-01-21 20:10 +0100
csiph-web