Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1314407 > unrolled thread

[RFC PATCH 0/5] x86/cpufeature: Cleanups and improvements

Started byBorislav Petkov <bp@alien8.de>
First post2016-01-21 19:40 +0100
Last post2016-01-21 23:30 +0100
Articles 6 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [RFC PATCH 0/5] x86/cpufeature: Cleanups and improvements Borislav Petkov <bp@alien8.de> - 2016-01-21 19:40 +0100
    Re: [PATCH 1/5] x86/cpufeature: Carve out X86_FEATURE_* "H. Peter Anvin" <hpa@zytor.com> - 2016-01-21 20:00 +0100
      Re: [PATCH 1/5] x86/cpufeature: Carve out X86_FEATURE_* Borislav Petkov <bp@alien8.de> - 2016-01-21 20:10 +0100
        Re: [PATCH 1/5] x86/cpufeature: Carve out X86_FEATURE_* Borislav Petkov <bp@alien8.de> - 2016-01-22 12:30 +0100
    Re: [RFC PATCH 0/5] x86/cpufeature: Cleanups and improvements Brian Gerst <brgerst@gmail.com> - 2016-01-21 23:00 +0100
      Re: [RFC PATCH 0/5] x86/cpufeature: Cleanups and improvements Borislav Petkov <bp@alien8.de> - 2016-01-21 23:30 +0100

#1314407 — [RFC PATCH 0/5] x86/cpufeature: Cleanups and improvements

FromBorislav Petkov <bp@alien8.de>
Date2016-01-21 19:40 +0100
Subject[RFC PATCH 0/5] x86/cpufeature: Cleanups and improvements
Message-ID<qTsjf-I1-7@gated-at.bofh.it>
From: Borislav Petkov <bp@suse.de>

So here's the first version of what we talked about. I've ran randbuilds
on it for a night because of patch 1 with all the header reorg and we
all know how that can be painful. So this version passes all randbuild
configs I had generated.

In talking about patch 1, it is a bit big but if you look at the
diffstat, it basically is fixing a bunch of includes and the meat of it
being the carving out of the X86_FEATURE_* things to a separate file.

Rest of the patches should be pretty self-explanatory, check the
respective commit messages.

I haven't tested it functionally yet (booting in kvm doesn't really
count) - thus the RFC tag. I thought I should send it out first so that
people can doublecheck me on the direction this is going.

Thanks!

Borislav Petkov (4):
  x86/cpufeature: Carve out X86_FEATURE_*
  x86/cpufeature: Remove static_cpu_has()
  x86/cpufeature: Get rid of the non-asm goto variant
  x86/alternatives: Add an auxilary section

Brian Gerst (1):
  x86/alternatives: Discard dynamic check after init

 Documentation/kernel-parameters.txt      |   2 +-
 arch/x86/Kconfig.debug                   |  10 -
 arch/x86/boot/cpuflags.h                 |   2 +-
 arch/x86/boot/mkcpustr.c                 |   2 +-
 arch/x86/crypto/crc32-pclmul_glue.c      |   2 +-
 arch/x86/crypto/crc32c-intel_glue.c      |   2 +-
 arch/x86/crypto/crct10dif-pclmul_glue.c  |   2 +-
 arch/x86/entry/common.c                  |   1 +
 arch/x86/entry/entry_32.S                |   2 +-
 arch/x86/entry/vdso/vdso32-setup.c       |   1 -
 arch/x86/entry/vdso/vdso32/system_call.S |   2 +-
 arch/x86/entry/vdso/vma.c                |   1 +
 arch/x86/include/asm/alternative.h       |   6 -
 arch/x86/include/asm/apic.h              |   1 -
 arch/x86/include/asm/arch_hweight.h      |   2 +
 arch/x86/include/asm/cpufeature.h        | 431 ++-----------------------------
 arch/x86/include/asm/cpufeatures.h       | 287 ++++++++++++++++++++
 arch/x86/include/asm/fpu/internal.h      |  15 +-
 arch/x86/include/asm/irq_work.h          |   2 +-
 arch/x86/include/asm/mwait.h             |   2 +
 arch/x86/include/asm/processor.h         |   3 +-
 arch/x86/include/asm/smap.h              |   2 +-
 arch/x86/include/asm/smp.h               |   1 -
 arch/x86/include/asm/thread_info.h       |   2 +-
 arch/x86/include/asm/tlbflush.h          |   1 +
 arch/x86/include/asm/uaccess_64.h        |   2 +-
 arch/x86/kernel/apic/apic_numachip.c     |   4 +-
 arch/x86/kernel/cpu/Makefile             |   2 +-
 arch/x86/kernel/cpu/centaur.c            |   2 +-
 arch/x86/kernel/cpu/common.c             |   6 -
 arch/x86/kernel/cpu/cyrix.c              |   1 +
 arch/x86/kernel/cpu/intel.c              |   2 +-
 arch/x86/kernel/cpu/intel_cacheinfo.c    |   2 +-
 arch/x86/kernel/cpu/match.c              |   2 +-
 arch/x86/kernel/cpu/mkcapflags.sh        |   6 +-
 arch/x86/kernel/cpu/mtrr/main.c          |   2 +-
 arch/x86/kernel/cpu/transmeta.c          |   2 +-
 arch/x86/kernel/e820.c                   |   1 +
 arch/x86/kernel/head_32.S                |   2 +-
 arch/x86/kernel/hpet.c                   |   1 +
 arch/x86/kernel/msr.c                    |   2 +-
 arch/x86/kernel/verify_cpu.S             |   2 +-
 arch/x86/kernel/vm86_32.c                |   2 +-
 arch/x86/kernel/vmlinux.lds.S            |   9 +
 arch/x86/lib/clear_page_64.S             |   2 +-
 arch/x86/lib/copy_page_64.S              |   2 +-
 arch/x86/lib/copy_user_64.S              |   2 +-
 arch/x86/lib/memcpy_64.S                 |   2 +-
 arch/x86/lib/memmove_64.S                |   2 +-
 arch/x86/lib/memset_64.S                 |   2 +-
 arch/x86/mm/setup_nx.c                   |   1 +
 arch/x86/oprofile/op_model_amd.c         |   1 -
 arch/x86/um/asm/barrier.h                |   2 +-
 drivers/cpufreq/intel_pstate.c           |   2 +-
 fs/btrfs/disk-io.c                       |   2 +-
 lib/atomic64_test.c                      |   2 +-
 56 files changed, 371 insertions(+), 487 deletions(-)
 create mode 100644 arch/x86/include/asm/cpufeatures.h

-- 
2.3.5

[toc] | [next] | [standalone]


#1314422 — Re: [PATCH 1/5] x86/cpufeature: Carve out X86_FEATURE_*

From"H. Peter Anvin" <hpa@zytor.com>
Date2016-01-21 20:00 +0100
SubjectRe: [PATCH 1/5] x86/cpufeature: Carve out X86_FEATURE_*
Message-ID<qTsCD-Pl-15@gated-at.bofh.it>
In reply to#1314407
On 01/21/16 10:34, Borislav Petkov wrote:
> +#ifndef _ASM_X86_REQUIRED_FEATURES_H

Why do we have all these include guards at the point of the #include?
This is not standard procedure.

	-hpa

[toc] | [prev] | [next] | [standalone]


#1314431 — Re: [PATCH 1/5] x86/cpufeature: Carve out X86_FEATURE_*

FromBorislav Petkov <bp@alien8.de>
Date2016-01-21 20:10 +0100
SubjectRe: [PATCH 1/5] x86/cpufeature: Carve out X86_FEATURE_*
Message-ID<qTsMj-19q-29@gated-at.bofh.it>
In reply to#1314422
On Thu, Jan 21, 2016 at 10:57:06AM -0800, H. Peter Anvin wrote:
> On 01/21/16 10:34, Borislav Petkov wrote:
> > +#ifndef _ASM_X86_REQUIRED_FEATURES_H
>
> Why do we have all these include guards at the point of the #include?
> This is not standard procedure.

Some uapi monkey business:

abbf1590de22 ("UAPI: Partition the header include path sets and add uapi/ header directories")

The funny thing is, the headers themselves have the guards too. I'll try
to remove them to see what breaks.

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.

[toc] | [prev] | [next] | [standalone]


#1314918 — Re: [PATCH 1/5] x86/cpufeature: Carve out X86_FEATURE_*

FromBorislav Petkov <bp@alien8.de>
Date2016-01-22 12:30 +0100
SubjectRe: [PATCH 1/5] x86/cpufeature: Carve out X86_FEATURE_*
Message-ID<qTI4G-3lg-27@gated-at.bofh.it>
In reply to#1314431
On Thu, Jan 21, 2016 at 08:03:40PM +0100, Borislav Petkov wrote:
> On Thu, Jan 21, 2016 at 10:57:06AM -0800, H. Peter Anvin wrote:
> > On 01/21/16 10:34, Borislav Petkov wrote:
> > > +#ifndef _ASM_X86_REQUIRED_FEATURES_H
> >
> > Why do we have all these include guards at the point of the #include?
> > This is not standard procedure.
> 
> Some uapi monkey business:
> 
> abbf1590de22 ("UAPI: Partition the header include path sets and add uapi/ header directories")
> 
> The funny thing is, the headers themselves have the guards too. I'll try
> to remove them to see what breaks.

Ah, here it is:

In file included from arch/x86/boot/mkcpustr.c:20:0:
arch/x86/boot/../include/asm/cpufeatures.h:4:35: fatal error: asm/required-features.h: No such file or directory
compilation terminated.
make[1]: *** [arch/x86/boot/mkcpustr] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [bzImage] Error 2
make: *** Waiting for unfinished jobs....

That's when you remove the #ifndef guards.

And I think the commit above does this special dancing to keep
cpufeature.h a kernel-only header and not make it an uapi one. David, am
I close?

Thanks.

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.

[toc] | [prev] | [next] | [standalone]


#1314562

FromBrian Gerst <brgerst@gmail.com>
Date2016-01-21 23:00 +0100
Message-ID<qTvqP-2KT-29@gated-at.bofh.it>
In reply to#1314407
On Thu, Jan 21, 2016 at 1:34 PM, Borislav Petkov <bp@alien8.de> wrote:
> From: Borislav Petkov <bp@suse.de>
>
> So here's the first version of what we talked about. I've ran randbuilds
> on it for a night because of patch 1 with all the header reorg and we
> all know how that can be painful. So this version passes all randbuild
> configs I had generated.
>
> In talking about patch 1, it is a bit big but if you look at the
> diffstat, it basically is fixing a bunch of includes and the meat of it
> being the carving out of the X86_FEATURE_* things to a separate file.
>
> Rest of the patches should be pretty self-explanatory, check the
> respective commit messages.
>
> I haven't tested it functionally yet (booting in kvm doesn't really
> count) - thus the RFC tag. I thought I should send it out first so that
> people can doublecheck me on the direction this is going.
>
> Thanks!
>
> Borislav Petkov (4):
>   x86/cpufeature: Carve out X86_FEATURE_*
>   x86/cpufeature: Remove static_cpu_has()
>   x86/cpufeature: Get rid of the non-asm goto variant
>   x86/alternatives: Add an auxilary section
>
> Brian Gerst (1):
>   x86/alternatives: Discard dynamic check after init

Tested it and it works.  Looks good to me.  Only thing was it didn't
apply to tip/master due to a new cpuid flag added.

--
Brian Gerst

[toc] | [prev] | [next] | [standalone]


#1314570

FromBorislav Petkov <bp@alien8.de>
Date2016-01-21 23:30 +0100
Message-ID<qTvTQ-3bF-15@gated-at.bofh.it>
In reply to#1314562
On Thu, Jan 21, 2016 at 04:53:12PM -0500, Brian Gerst wrote:
> Tested it and it works.  Looks good to me.

Cool, thanks for testing! I'm going to send a v2 at some point, though.

> Only thing was it didn't apply to tip/master due to a new cpuid flag
> added.

Yeah, I'm going to rebase everything to 4.5-rc1 anyway, once it comes
out. I have a bunch of other branches pending too.

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web