* [PATCH] asm-generic: make simd.h a mandatory include/asm header
@ 2019-07-29 9:55 Ard Biesheuvel
2019-07-29 10:32 ` Arnd Bergmann
0 siblings, 1 reply; 4+ messages in thread
From: Ard Biesheuvel @ 2019-07-29 9:55 UTC (permalink / raw)
To: linux-crypto; +Cc: herbert, geert, linux-arch, arnd, Ard Biesheuvel
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(+)
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
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] asm-generic: make simd.h a mandatory include/asm header
2019-07-29 9:55 [PATCH] asm-generic: make simd.h a mandatory include/asm header Ard Biesheuvel
@ 2019-07-29 10:32 ` Arnd Bergmann
2019-07-29 10:45 ` Ard Biesheuvel
0 siblings, 1 reply; 4+ messages in thread
From: Arnd Bergmann @ 2019-07-29 10:32 UTC (permalink / raw)
To: Ard Biesheuvel
Cc: open list:HARDWARE RANDOM NUMBER GENERATOR CORE, Herbert Xu,
Geert Uytterhoeven, linux-arch, Masahiro Yamada
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] asm-generic: make simd.h a mandatory include/asm header
2019-07-29 10:32 ` Arnd Bergmann
@ 2019-07-29 10:45 ` Ard Biesheuvel
2019-07-29 12:19 ` Arnd Bergmann
0 siblings, 1 reply; 4+ messages in thread
From: Ard Biesheuvel @ 2019-07-29 10:45 UTC (permalink / raw)
To: Arnd Bergmann
Cc: open list:HARDWARE RANDOM NUMBER GENERATOR CORE, Herbert Xu,
Geert Uytterhoeven, linux-arch, Masahiro Yamada
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)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] asm-generic: make simd.h a mandatory include/asm header
2019-07-29 10:45 ` Ard Biesheuvel
@ 2019-07-29 12:19 ` Arnd Bergmann
0 siblings, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2019-07-29 12:19 UTC (permalink / raw)
To: Ard Biesheuvel
Cc: open list:HARDWARE RANDOM NUMBER GENERATOR CORE, Herbert Xu,
Geert Uytterhoeven, linux-arch, Masahiro Yamada
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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-07-29 12:19 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-29 9:55 [PATCH] asm-generic: make simd.h a mandatory include/asm header Ard Biesheuvel
2019-07-29 10:32 ` Arnd Bergmann
2019-07-29 10:45 ` Ard Biesheuvel
2019-07-29 12:19 ` Arnd Bergmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).