Re: [RFC] treewide: cleanup unreachable breaks

2020-10-18 Thread Hans de Goede
Hi Tom, Quick self intro: I have take over drivers/platform/x86 maintainership from Andy. On 10/17/20 6:09 PM, t...@redhat.com wrote: > From: Tom Rix > > This is a upcoming change to clean up a new warning treewide. > I am wondering if the change could be one mega patch (see below) or > normal

Re: [PATCH 0/4] crypto: add sha256() function

2020-07-08 Thread Hans de Goede
: 57c8aa43b9f272c382c253573c82be5cb68fe22d I've done some quick tests on this series to make sure that the efi embedded-firmware support did not regress. That still works fine, so this series is; Tested-by: Hans de Goede Regards, Hans

Re: [PATCH v2 5.4 regression fix] x86/boot: Provide memzero_explicit

2019-10-07 Thread Hans de Goede
that works fine (as expected). So your patch is: Reviewed-by: Hans de Goede Tested-by: Hans de Goede Since this is a bit of a core change though, I think it is best if you send it to the linux-kernel list (with my tags from above added) as is normally done for kernel patches. Then others, who

[tip: x86/urgent] x86/boot: Provide memzero_explicit()

2019-10-07 Thread tip-bot2 for Hans de Goede
The following commit has been merged into the x86/urgent branch of tip: Commit-ID: ee008a19f1c72c37ffa54326a592035dddb66fd6 Gitweb: https://git.kernel.org/tip/ee008a19f1c72c37ffa54326a592035dddb66fd6 Author:Hans de Goede AuthorDate:Mon, 07 Oct 2019 15:47:24 +02:00

[tip: x86/urgent] x86/boot: Provide memzero_explicit()

2019-10-07 Thread tip-bot2 for Hans de Goede
The following commit has been merged into the x86/urgent branch of tip: Commit-ID: ee008a19f1c72c37ffa54326a592035dddb66fd6 Gitweb: https://git.kernel.org/tip/ee008a19f1c72c37ffa54326a592035dddb66fd6 Author:Hans de Goede AuthorDate:Mon, 07 Oct 2019 15:47:24 +02:00

Re: [PATCH v2 5.4 regression fix] x86/boot: Provide memzero_explicit

2019-10-07 Thread Hans de Goede
Hi, On 07-10-2019 16:22, Ingo Molnar wrote: * Hans de Goede wrote: Hi, On 07-10-2019 16:00, Ingo Molnar wrote: * Hans de Goede wrote: The purgatory code now uses the shared lib/crypto/sha256.c sha256 implementation. This needs memzero_explicit, implement this. Reported-by: Arvind

Re: [PATCH v2 5.4 regression fix] x86/boot: Provide memzero_explicit

2019-10-07 Thread Hans de Goede
Hi, On 07-10-2019 16:00, Ingo Molnar wrote: * Hans de Goede wrote: The purgatory code now uses the shared lib/crypto/sha256.c sha256 implementation. This needs memzero_explicit, implement this. Reported-by: Arvind Sankar Fixes: 906a4bb97f5d ("crypto: sha256 - Use get/put_unaligned_be

[PATCH v2 5.4 regression fix] x86/boot: Provide memzero_explicit

2019-10-07 Thread Hans de Goede
The purgatory code now uses the shared lib/crypto/sha256.c sha256 implementation. This needs memzero_explicit, implement this. Reported-by: Arvind Sankar Fixes: 906a4bb97f5d ("crypto: sha256 - Use get/put_unaligned_be32 to get input, memzero_explicit") Signed-off-by: Hans de Goede -

Re: [PATCH 5.4 regression fix] x86/boot: Provide memzero_explicit

2019-10-07 Thread Hans de Goede
Hi Stephan, On 07-10-2019 11:34, Stephan Mueller wrote: Am Montag, 7. Oktober 2019, 11:06:04 CEST schrieb Hans de Goede: Hi Hans, Hi Stephan, On 07-10-2019 10:59, Stephan Mueller wrote: Am Montag, 7. Oktober 2019, 10:55:01 CEST schrieb Hans de Goede: Hi Hans, The purgatory code now uses

Re: [PATCH 5.4 regression fix] x86/boot: Provide memzero_explicit

2019-10-07 Thread Hans de Goede
Hi Stephan, On 07-10-2019 10:59, Stephan Mueller wrote: Am Montag, 7. Oktober 2019, 10:55:01 CEST schrieb Hans de Goede: Hi Hans, The purgatory code now uses the shared lib/crypto/sha256.c sha256 implementation. This needs memzero_explicit, implement this. Reported-by: Arvind Sankar Fixes

[PATCH 5.4 regression fix] x86/boot: Provide memzero_explicit

2019-10-07 Thread Hans de Goede
The purgatory code now uses the shared lib/crypto/sha256.c sha256 implementation. This needs memzero_explicit, implement this. Reported-by: Arvind Sankar Fixes: 906a4bb97f5d ("crypto: sha256 - Use get/put_unaligned_be32 to get input, memzero_explicit") Signed-off-by: Hans de Goede

Re: [PATCH 5/9] crypto: ccree - Rename arrays to avoid conflict with crypto/sha256.h

2019-09-03 Thread Hans de Goede
Hi, On 03-09-19 09:45, Gilad Ben-Yossef wrote: On Sun, Sep 1, 2019 at 11:36 PM Hans de Goede wrote: Rename the algo_init arrays to cc_algo_init so that they do not conflict with the functions declared in crypto/sha256.h. This is a preparation patch for folding crypto/sha256.h into crypto

[PATCH 7/9] crypto: n2 - Rename arrays to avoid conflict with crypto/sha256.h

2019-09-01 Thread Hans de Goede
Rename the sha*_init arrays to n2_sha*_init so that they do not conflict with the functions declared in crypto/sha256.h. Also rename md5_init to n2_md5_init for consistency. This is a preparation patch for folding crypto/sha256.h into crypto/sha.h. Signed-off-by: Hans de Goede --- drivers

[PATCH 8/9] crypto: sha256 - Merge crypto/sha256.h into crypto/sha.h

2019-09-01 Thread Hans de Goede
The generic sha256 implementation from lib/crypto/sha256.c uses data structs defined in crypto/sha.h, so lets move the function prototypes there too. Signed-off-by: Hans de Goede --- arch/s390/purgatory/purgatory.c | 2 +- arch/x86/purgatory/purgatory.c | 2 +- crypto/sha256_generic.c

[PATCH 9/9] crypto: sha256 - Remove sha256/224_init code duplication

2019-09-01 Thread Hans de Goede
functions from include/crypto/sha256_base.h wrappers around the now also static inline include/crypto/sha.h functions. Signed-off-by: Hans de Goede --- include/crypto/sha.h | 30 -- include/crypto/sha256_base.h | 24 ++-- lib/crypto/sha256

[PATCH 6/9] crypto: chelsio - Rename arrays to avoid conflict with crypto/sha256.h

2019-09-01 Thread Hans de Goede
Rename the sha*_init arrays to chcr_sha*_init so that they do not conflict with the functions declared in crypto/sha256.h. This is a preparation patch for folding crypto/sha256.h into crypto/sha.h. Signed-off-by: Hans de Goede --- drivers/crypto/chelsio/chcr_algo.h | 20 ++-- 1

[PATCH 5/9] crypto: ccree - Rename arrays to avoid conflict with crypto/sha256.h

2019-09-01 Thread Hans de Goede
Rename the algo_init arrays to cc_algo_init so that they do not conflict with the functions declared in crypto/sha256.h. This is a preparation patch for folding crypto/sha256.h into crypto/sha.h. Signed-off-by: Hans de Goede --- drivers/crypto/ccree/cc_hash.c | 153

[PATCH 4/9] crypto: x86 - Rename functions to avoid conflict with crypto/sha256.h

2019-09-01 Thread Hans de Goede
Rename static / file-local functions so that they do not conflict with the functions declared in crypto/sha256.h. This is a preparation patch for folding crypto/sha256.h into crypto/sha.h. Signed-off-by: Hans de Goede --- arch/x86/crypto/sha256_ssse3_glue.c | 12 ++-- 1 file changed, 6

[PATCH 2/9] crypto: arm64 - Rename functions to avoid conflict with crypto/sha256.h

2019-09-01 Thread Hans de Goede
Rename static / file-local functions so that they do not conflict with the functions declared in crypto/sha256.h. This is a preparation patch for folding crypto/sha256.h into crypto/sha.h. Signed-off-by: Hans de Goede --- arch/arm64/crypto/sha256-glue.c | 24 1 file

[PATCH 1/9] crypto: arm - Rename functions to avoid conflict with crypto/sha256.h

2019-09-01 Thread Hans de Goede
Rename static / file-local functions so that they do not conflict with the functions declared in crypto/sha256.h. This is a preparation patch for folding crypto/sha256.h into crypto/sha.h. Signed-off-by: Hans de Goede --- arch/arm/crypto/sha256_glue.c | 8 arch/arm/crypto

[PATCH 3/9] crypto: s390 - Rename functions to avoid conflict with crypto/sha256.h

2019-09-01 Thread Hans de Goede
Rename static / file-local functions so that they do not conflict with the functions declared in crypto/sha256.h. This is a preparation patch for folding crypto/sha256.h into crypto/sha.h. Signed-off-by: Hans de Goede --- arch/s390/crypto/sha256_s390.c | 8 1 file changed, 4

[PATCH 0/9] crypto: sha256 - Merge crypto/sha256.h into crypto/sha.h

2019-09-01 Thread Hans de Goede
Hi All, As promised here is a follow-up series to my earlier sha256 series. Note I have only compiled and tested this series on x86_64 !! All changes to architecture specific code on other archs have not even been tested to compile! With that said most of these changes were done using my editor

[PATCH] crypto: sha256 - Add missing MODULE_LICENSE() to lib/crypto/sha256.c

2019-08-25 Thread Hans de Goede
lib/crypto/sha256.c / lib/crypto/libsha256.o may end up being a module, so it needs a MODULE_LICENSE() line, add this. Signed-off-by: Hans de Goede --- lib/crypto/sha256.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/crypto/sha256.c b/lib/crypto/sha256.c index 45ad87520769

Re: linux-next: build warning after merge of the crypto tree

2019-08-25 Thread Hans de Goede
Hi, On 23-08-19 05:14, Stephen Rothwell wrote: Hi all, After merging the crypto tree, today's linux-next build (arm multi_v7_defconfig) produced this warning: WARNING: modpost: missing MODULE_LICENSE() in lib/crypto/libsha256.o see include/linux/module.h for more information Presumably introd

Re: [PATCH v2 0/7] crypto: sha256 - Merge 2 separate C implementations into 1, put into separate library

2019-08-19 Thread Hans de Goede
Hi, On 19-08-19 17:08, Ard Biesheuvel wrote: On Sat, 17 Aug 2019 at 17:24, Hans de Goede wrote: Hi All, Here is v2 of my patch series refactoring the current 2 separate SHA256 C implementations into 1 and put it into a separate library. There are 3 reasons for this: 1) Remove the code

Re: [PATCH 3/6] crypto: sha256 - Move lib/sha256.c to lib/crypto

2019-08-18 Thread Hans de Goede
Hi, On 18-08-19 17:54, Eric Biggers wrote: On Sat, Aug 17, 2019 at 10:28:04AM +0200, Hans de Goede wrote: Hi, On 17-08-19 07:19, Eric Biggers wrote: On Fri, Aug 16, 2019 at 11:16:08PM +0200, Hans de Goede wrote: diff --git a/include/linux/sha256.h b/include/crypto/sha256.h similarity index

[PATCH v2 0/7] crypto: sha256 - Merge 2 separate C implementations into 1, put into separate library

2019-08-17 Thread Hans de Goede
Hi All, Here is v2 of my patch series refactoring the current 2 separate SHA256 C implementations into 1 and put it into a separate library. There are 3 reasons for this: 1) Remove the code duplication of having 2 separate implementations 2) Offer a separate library SHA256 implementation which

[PATCH v2 7/7] crypto: sha256_generic - Switch to the generic lib/crypto/sha256.c lib code

2019-08-17 Thread Hans de Goede
the other code is functionally identical too. Suggested-by: Eric Biggers Signed-off-by: Hans de Goede --- Changes in v2: - Not only switch to sha256_transform from lib/crypto/sha256.c but also switch to using sha256_init, sha256_update and sha256_final from there so that the crypto subsys

[PATCH v2 3/7] crypto: sha256 - Move lib/sha256.c to lib/crypto

2019-08-17 Thread Hans de Goede
code. Making it suitable for generic use is done in further patches in this series. Signed-off-by: Hans de Goede --- arch/s390/purgatory/Makefile | 2 +- arch/s390/purgatory/purgatory.c| 2 +- arch/x86/purgatory/Makefile| 2 +- arch/x86/purgatory/purgatory.c | 2 +- include

[PATCH v2 2/7] crypto: sha256_generic - Fix some coding style issues

2019-08-17 Thread Hans de Goede
hanges are made when further patches in this series consolidate the 2 implementations into 1. Signed-off-by: Hans de Goede --- crypto/sha256_generic.c | 268 1 file changed, 134 insertions(+), 134 deletions(-) diff --git a/crypto/sha256_generic.

[PATCH v2 4/7] crypto: sha256 - Use get/put_unaligned_be32 to get input, memzero_explicit

2019-08-17 Thread Hans de Goede
to the sha256 code as used by the purgatory code. This fully aligns the lib/crypto/sha256.c sha256 implementation with the one from crypto/sha256_generic.c allowing us to remove the latter in further patches in this series. Signed-off-by: Hans de Goede --- Changes in v2: - Also switch to

[PATCH v2 5/7] crypto: sha256 - Make lib/crypto/sha256.c suitable for generic use

2019-08-17 Thread Hans de Goede
/Makefile and crypto/Kconfig Signed-off-by: Hans de Goede --- Changes in v2: - Add a comment to include/crypto/sha256.h explaining that these functions now may be used outside of the purgatory too (and that using the crypto API instead is preferred) --- arch/s390/purgatory/Makefile | 2 ++ arch/x86

[PATCH v2 6/7] crypto: sha256 - Add sha224 support to sha256 library code

2019-08-17 Thread Hans de Goede
Add sha224 support to the lib/crypto/sha256 library code. This will allow us to replace both the sha256 and sha224 parts of crypto/sha256_generic.c when we remove the code duplication in further patches in this series. Suggested-by: Eric Biggers Signed-off-by: Hans de Goede --- include/crypto

[PATCH v2 1/7] crypto: sha256 - Fix some coding style issues

2019-08-17 Thread Hans de Goede
the 2 implementations into 1. Signed-off-by: Hans de Goede --- lib/sha256.c | 98 ++-- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/lib/sha256.c b/lib/sha256.c index d9af148d4349..ba4dce0b3711 100644 --- a/lib/sha256.c +++ b/l

Re: [PATCH 6/6] crypto: sha256_generic - Use sha256_transform from generic sha256 lib

2019-08-17 Thread Hans de Goede
Hi Eric, Thank you for the review and for the quick turn around time on the review. On 17-08-19 07:35, Eric Biggers wrote: On Fri, Aug 16, 2019 at 10:13:18PM -0700, Eric Biggers wrote: On Fri, Aug 16, 2019 at 11:16:11PM +0200, Hans de Goede wrote: Drop the duplicate sha256_transform function

Re: [PATCH 3/6] crypto: sha256 - Move lib/sha256.c to lib/crypto

2019-08-17 Thread Hans de Goede
Hi, On 17-08-19 07:19, Eric Biggers wrote: On Fri, Aug 16, 2019 at 11:16:08PM +0200, Hans de Goede wrote: diff --git a/include/linux/sha256.h b/include/crypto/sha256.h similarity index 100% rename from include/linux/sha256.h rename to include/crypto/sha256.h already has the declarations for

[PATCH 4/6] crypto: sha256 - Use get_unaligned_be32 to get input, memzero_explicit

2019-08-16 Thread Hans de Goede
functional changes to the sha256 code as used by the purgatory code. This fully aligns the lib/crypto/sha256.c sha256_transform() implementation with the one from crypto/sha256_generic.c allowing us to remove the latter in further patches in this series. Signed-off-by: Hans de Goede --- lib/crypto

[PATCH 6/6] crypto: sha256_generic - Use sha256_transform from generic sha256 lib

2019-08-16 Thread Hans de Goede
Drop the duplicate sha256_transform function from crypto/sha256_generic.c and use the implementation from lib/crypto/sha256.c instead. "diff -u lib/crypto/sha256.c sha256_generic.c" shows that both implementations are identical. Signed-off-by: Hans de Goede --- crypto/Kconfig

[PATCH 2/6] crypto: sha256_generic - Fix some coding style issues

2019-08-16 Thread Hans de Goede
hanges are made when further patches in this series consolidate the 2 implementations into 1. Signed-off-by: Hans de Goede --- crypto/sha256_generic.c | 268 1 file changed, 134 insertions(+), 134 deletions(-) diff --git a/crypto/sha256_generic.

[PATCH 5/6] crypto: sha256 - Make lib/crypto/sha256.c suitable for generic use

2019-08-16 Thread Hans de Goede
/Makefile and crypto/Kconfig Signed-off-by: Hans de Goede --- arch/s390/purgatory/Makefile | 2 ++ arch/x86/purgatory/Makefile | 2 ++ crypto/Kconfig | 3 +++ include/crypto/sha256.h | 1 + lib/crypto/Makefile | 3 +++ lib/crypto/sha256.c | 7 ++- 6 files

[PATCH 3/6] crypto: sha256 - Move lib/sha256.c to lib/crypto

2019-08-16 Thread Hans de Goede
code. Making it suitable for generic use is done in further patches in this series. Signed-off-by: Hans de Goede --- arch/s390/purgatory/Makefile | 2 +- arch/s390/purgatory/purgatory.c| 2 +- arch/x86/purgatory/Makefile| 2 +- arch/x86/purgatory/purgatory.c | 2 +- include

[PATCH 1/6] crypto: sha256 - Fix some coding style issues

2019-08-16 Thread Hans de Goede
the 2 implementations into 1. Signed-off-by: Hans de Goede --- lib/sha256.c | 98 ++-- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/lib/sha256.c b/lib/sha256.c index d9af148d4349..ba4dce0b3711 100644 --- a/lib/sha256.c +++ b/l

[PATCH 0/6] crypto: sha256 - Merge 2 separate C implementations into 1, put into separate library

2019-08-16 Thread Hans de Goede
Hi All, Here is a patch series refactoring the current 2 separate SHA256 C implementations into 1 and put it into a separate library. There are 2 reasons for this: 1) Remove the code duplication of having 2 separate implementations 2) Offer a separate library SHA256 implementation which can be

Re: [RFC 3/3] crypto/sha256: Build the SHA256 core separately from the crypto module

2019-07-31 Thread Hans de Goede
Hi, On 30-07-19 22:07, Eric Biggers wrote: On Tue, Jul 30, 2019 at 06:07:54PM +0200, Hans de Goede wrote: Hi, On 30-07-19 18:03, Eric Biggers wrote: On Tue, Jul 30, 2019 at 03:15:35PM +0200, Stephan Mueller wrote: Am Dienstag, 30. Juli 2019, 14:38:35 CEST schrieb Hans de Goede: Hi Hans

Re: [RFC 3/3] crypto/sha256: Build the SHA256 core separately from the crypto module

2019-07-30 Thread Hans de Goede
Hi, On 30-07-19 18:03, Eric Biggers wrote: On Tue, Jul 30, 2019 at 03:15:35PM +0200, Stephan Mueller wrote: Am Dienstag, 30. Juli 2019, 14:38:35 CEST schrieb Hans de Goede: Hi Hans, From: Andy Lutomirski This just moves code around -- no code changes in this patch. This wil let BPF-based

Re: [RFC 3/3] crypto/sha256: Build the SHA256 core separately from the crypto module

2019-07-30 Thread Hans de Goede
Hi, On 30-07-19 15:15, Stephan Mueller wrote: Am Dienstag, 30. Juli 2019, 14:38:35 CEST schrieb Hans de Goede: Hi Hans, From: Andy Lutomirski This just moves code around -- no code changes in this patch. This wil let BPF-based tracing link against the SHA256 core code without depending on

[RFC 0/3] Making a secure hash function avaiable during early boot?

2019-07-30 Thread Hans de Goede
Hi All, During the first half of 2018 I wrote a patch series to the Linux EFI and firmware-loader code, which allows loading peripheral firmware which is embedded/hidden inside the EFI firmware through the standard firmware-loading mechanism. The main motivation for this is to get the touchscreen

[RFC 2/3] crypto/sha256: Export a sha256_{init,update,final}_direct() API

2019-07-30 Thread Hans de Goede
From: Andy Lutomirski This provides a very simple interface for kernel code to use to do synchronous, unaccelerated, virtual-address-based SHA256 hashing without needing to create a crypto context. Subsequent patches will make this work without building the crypto core and will use to avoid maki

[RFC 3/3] crypto/sha256: Build the SHA256 core separately from the crypto module

2019-07-30 Thread Hans de Goede
From: Andy Lutomirski This just moves code around -- no code changes in this patch. This wil let BPF-based tracing link against the SHA256 core code without depending on the crypto core. Cc: Ard Biesheuvel Cc: Herbert Xu Signed-off-by: Andy Lutomirski --- crypto/Kconfig

[RFC 1/3] crypto/sha256: Factor out the parts of base API that don't use shash_desc

2019-07-30 Thread Hans de Goede
From: Andy Lutomirski I want to expose a minimal SHA256 API that can be used without the depending on the crypto core. To prepare for this, factor out the meat of the sha256_base_*() helpers. Cc: Ard Biesheuvel Cc: Herbert Xu Signed-off-by: Andy Lutomirski --- include/crypto/sha256_base.h |