diff mbox series

asm-generic: make simd.h a mandatory include/asm header

Message ID 20190729095521.1916-1-ard.biesheuvel@linaro.org
State Accepted
Commit 82cb54856874b1b374f18420be013ff4057700a9
Headers show
Series asm-generic: make simd.h a mandatory include/asm header | expand

Commit Message

Ard Biesheuvel July 29, 2019, 9:55 a.m. UTC
The generic aegis128 software crypto driver recently gained support
for using SIMD intrinsics to increase performance, for which it
uncondionally #include's the <asm/simd.h> header. Unfortunately,
this header does not exist on many architectures, resulting in
build failures.

Since asm-generic already has a version of simd.h, let's make it
a mandatory header so that it gets instantiated on all architectures
that don't provide their own version.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

---
 include/asm-generic/Kbuild | 2 ++
 1 file changed, 2 insertions(+)

-- 
2.17.1

Comments

Arnd Bergmann July 29, 2019, 10:32 a.m. UTC | #1
On Mon, Jul 29, 2019 at 11:55 AM Ard Biesheuvel
<ard.biesheuvel@linaro.org> wrote:
>

> The generic aegis128 software crypto driver recently gained support

> for using SIMD intrinsics to increase performance, for which it

> uncondionally #include's the <asm/simd.h> header. Unfortunately,

> this header does not exist on many architectures, resulting in

> build failures.

>

> Since asm-generic already has a version of simd.h, let's make it

> a mandatory header so that it gets instantiated on all architectures

> that don't provide their own version.

>

> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>


Looks good to me, if you want this to go through the crypto tree,

Acked-by: Arnd Bergmann <arnd@arndb.de>


I noticed that this is the first such entry here, and went looking for
other candidates:

$ git grep -h generic-y arch/*/include/asm/Kbuild  | sort | uniq -c  |
sort -nr | head -n 30
     24 generic-y += mm-arch-hooks.h
     23 generic-y += trace_clock.h
     22 generic-y += preempt.h
     21 generic-y += mcs_spinlock.h
     21 generic-y += irq_work.h
     21 generic-y += irq_regs.h
     21 generic-y += emergency-restart.h
     20 generic-y += mmiowb.h
     19 generic-y += local.h
     18 generic-y += word-at-a-time.h
     18 generic-y += kvm_para.h
     18 generic-y += exec.h
     18 generic-y += div64.h
     18 generic-y += compat.h
     17 generic-y += xor.h
     17 generic-y += percpu.h
     17 generic-y += local64.h
     17 generic-y += device.h
     16 generic-y += kdebug.h
     15 generic-y += dma-mapping.h
     14 generic-y += vga.h
     14 generic-y += topology.h
     14 generic-y += kmap_types.h
     14 generic-y += hw_irq.h
     13 generic-y += serial.h
     13 generic-y += kprobes.h
     13 generic-y += fb.h
     13 generic-y += extable.h
     13 generic-y += current.h
     12 generic-y += sections.h

It looks like there are a number of these that could be handled the
same way. Should we do that for the asm-generic tree afterwards?

      Arnd
Ard Biesheuvel July 29, 2019, 10:45 a.m. UTC | #2
On Mon, 29 Jul 2019 at 13:32, Arnd Bergmann <arnd@arndb.de> wrote:
>

> On Mon, Jul 29, 2019 at 11:55 AM Ard Biesheuvel

> <ard.biesheuvel@linaro.org> wrote:

> >

> > The generic aegis128 software crypto driver recently gained support

> > for using SIMD intrinsics to increase performance, for which it

> > uncondionally #include's the <asm/simd.h> header. Unfortunately,

> > this header does not exist on many architectures, resulting in

> > build failures.

> >

> > Since asm-generic already has a version of simd.h, let's make it

> > a mandatory header so that it gets instantiated on all architectures

> > that don't provide their own version.

> >

> > Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

>

> Looks good to me, if you want this to go through the crypto tree,

>

> Acked-by: Arnd Bergmann <arnd@arndb.de>

>


Thanks.

> I noticed that this is the first such entry here, and went looking for

> other candidates:

>

> $ git grep -h generic-y arch/*/include/asm/Kbuild  | sort | uniq -c  |

> sort -nr | head -n 30

>      24 generic-y += mm-arch-hooks.h

>      23 generic-y += trace_clock.h

>      22 generic-y += preempt.h

>      21 generic-y += mcs_spinlock.h

>      21 generic-y += irq_work.h

>      21 generic-y += irq_regs.h

>      21 generic-y += emergency-restart.h

>      20 generic-y += mmiowb.h

>      19 generic-y += local.h

>      18 generic-y += word-at-a-time.h

>      18 generic-y += kvm_para.h

>      18 generic-y += exec.h

>      18 generic-y += div64.h

>      18 generic-y += compat.h

>      17 generic-y += xor.h

>      17 generic-y += percpu.h

>      17 generic-y += local64.h

>      17 generic-y += device.h

>      16 generic-y += kdebug.h

>      15 generic-y += dma-mapping.h

>      14 generic-y += vga.h

>      14 generic-y += topology.h

>      14 generic-y += kmap_types.h

>      14 generic-y += hw_irq.h

>      13 generic-y += serial.h

>      13 generic-y += kprobes.h

>      13 generic-y += fb.h

>      13 generic-y += extable.h

>      13 generic-y += current.h

>      12 generic-y += sections.h

>

> It looks like there are a number of these that could be handled the

> same way. Should we do that for the asm-generic tree afterwards?

>


I guess it depends whether any dependencies on those headers exist in
code that is truly generic. If they are only needed by some common
infrastructure that cannot be enabled for a certain architecture
anyway, I don't think making it a mandatory header is appropriate.

So I think the question is whether the first column and the number of
per-arch instances of that header add up to 25 (disregarding the
exception for arch/um for now)
Arnd Bergmann July 29, 2019, 12:19 p.m. UTC | #3
On Mon, Jul 29, 2019 at 12:45 PM Ard Biesheuvel
<ard.biesheuvel@linaro.org> wrote:
> On Mon, 29 Jul 2019 at 13:32, Arnd Bergmann <arnd@arndb.de> wrote:

> > It looks like there are a number of these that could be handled the

> > same way. Should we do that for the asm-generic tree afterwards?

> >

>

> I guess it depends whether any dependencies on those headers exist in

> code that is truly generic. If they are only needed by some common

> infrastructure that cannot be enabled for a certain architecture

> anyway, I don't think making it a mandatory header is appropriate.

>

> So I think the question is whether the first column and the number of

> per-arch instances of that header add up to 25 (disregarding the

> exception for arch/um for now)


Here is a list of how many architectures besides arch/um do not have a
given file
with either generic-y or as a private copy:

$ git grep -h generic-y arch/*/include/asm/Kbuild  | sort | uniq -c  |
sort -nr  | cut -f 2 -d= | while read file ; do for arch in
arch/*/include/asm ; do if [ ! -e ${arch}/${file} ] && ! grep -q
${file} ${arch}/Kbuild  ; then echo ${arch}/${file} ; fi ; done | grep
-v arch/um/ | echo `wc -l` $file ; done | sort -n
0 atomic.h
0 barrier.h
0 bitops.h
0 bug.h
0 bugs.h
0 cacheflush.h
0 checksum.h
0 compat.h
0 current.h
0 delay.h
0 device.h
0 div64.h
0 dma.h
0 dma-mapping.h
0 emergency-restart.h
0 exec.h
0 fb.h
0 ftrace.h
0 futex.h
0 hardirq.h
0 hw_irq.h
0 io.h
0 irq.h
0 irq_regs.h
0 irq_work.h
0 kdebug.h
0 kmap_types.h
0 kprobes.h
0 linkage.h
0 local.h
0 mm-arch-hooks.h
0 mmiowb.h
0 mmu_context.h
0 mmu.h
0 module.h
0 pci.h
0 percpu.h
0 pgalloc.h
0 preempt.h
0 sections.h
0 serial.h
0 shmparam.h
0 switch_to.h
0 timex.h
0 tlbflush.h
0 topology.h
0 trace_clock.h
0 uaccess.h
0 unaligned.h
0 vga.h
0 word-at-a-time.h
0 xor.h
1 asm-offsets.h
1 cmpxchg.h
1 spinlock.h
1 user.h
2 kvm_para.h
3 mcs_spinlock.h
4 extable.h
4 local64.h
9 parport.h
12 syscalls.h
13 param.h
14 seccomp.h
15 export.h
16 dma-contiguous.h
16 flat.h
16 msi.h
17 qrwlock.h
18 gpio.h
18 qspinlock.h
20 early_ioremap.h
20 set_memory.h
20 simd.h
20 vmlinux.lds.h
21 vtime.h
22 iomap.h
23 qrwlock_types.h
23 qspinlock_types.h
24 bpf_perf_event.h

      Arnd
diff mbox series

Patch

diff --git a/include/asm-generic/Kbuild b/include/asm-generic/Kbuild
index 6f4536d70b8e..adff14fcb8e4 100644
--- a/include/asm-generic/Kbuild
+++ b/include/asm-generic/Kbuild
@@ -3,3 +3,5 @@ 
 # asm headers that all architectures except um should have
 # (This file is not included when SRCARCH=um since UML borrows several
 # asm headers from the host architecutre.)
+
+mandatory-y += simd.h