Re: [RFC PATCH v2 08/32] x86: Use PAGE_KERNEL protection for ioremap of memory page

2017-03-17 Thread Tom Lendacky
On 3/16/2017 3:04 PM, Tom Lendacky wrote: On 3/7/2017 8:59 AM, Borislav Petkov wrote: On Thu, Mar 02, 2017 at 10:13:32AM -0500, Brijesh Singh wrote: From: Tom Lendacky In order for memory pages to be properly mapped when SEV is active, we need to use the PAGE_KERNEL

Re: [PATCH 4/4] crypto: s5p-sss - Use mutex instead of spinlock

2017-03-17 Thread Bartlomiej Zolnierkiewicz
Hi, On Friday, March 17, 2017 04:49:22 PM Krzysztof Kozlowski wrote: > Driver uses threaded interrupt handler so there is no real need for > using spinlocks for synchronization. Mutexes would do fine and are > friendlier for overall system preemptivness and real-time behavior. Are you sure

[PATCH 1/4] crypto: s5p-sss - Close possible race for completed requests

2017-03-17 Thread Krzysztof Kozlowski
Driver is capable of handling only one request at a time and it stores it in its state container struct s5p_aes_dev. This stored request must be protected between concurrent invocations (e.g. completing current request and scheduling new one). Combination of lock and "busy" field is used for

[PATCH 2/4] crypto: s5p-sss - Remove unused variant field from state container

2017-03-17 Thread Krzysztof Kozlowski
The driver uses type of device (variant) only during probe so there is no need to store it for later. Signed-off-by: Krzysztof Kozlowski --- drivers/crypto/s5p-sss.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/crypto/s5p-sss.c b/drivers/crypto/s5p-sss.c index

Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array

2017-03-17 Thread Alexander Potapenko
On Fri, Mar 17, 2017 at 1:31 PM, Alexander Potapenko wrote: > On Fri, Mar 17, 2017 at 1:08 PM, Peter Zijlstra wrote: >> On Thu, Mar 16, 2017 at 05:15:19PM -0700, Michael Davidson wrote: >>> Replace a variable length array in a struct by allocating >>> the

Re: [ANNOUNCE] /dev/random - a new approach (code for 4.11-rc1)

2017-03-17 Thread Jason A. Donenfeld
Hey Stephan, Have you considered submitting this without so many options? For example -- just unconditionally using ChaCha20 instead of the configurable crypto API functions? And either removing the FIPS140 compliance code, and either unconditionally including it, or just getting rid of it? And

Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array

2017-03-17 Thread Peter Zijlstra
On Fri, Mar 17, 2017 at 08:05:16PM +0100, Dmitry Vyukov wrote: > You can also find some reasons in the Why section of LLVM-Linux project: > http://llvm.linuxfoundation.org/index.php/Main_Page >From that: - LLVM/Clang is a fast moving project with many things fixed quickly and features added.

Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array

2017-03-17 Thread Peter Zijlstra
On Fri, Mar 17, 2017 at 08:26:42PM +0100, Peter Zijlstra wrote: > On Fri, Mar 17, 2017 at 08:05:16PM +0100, Dmitry Vyukov wrote: > > You can also find some reasons in the Why section of LLVM-Linux project: > > http://llvm.linuxfoundation.org/index.php/Main_Page > > From that: > > - LLVM/Clang

Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array

2017-03-17 Thread Peter Zijlstra
On Fri, Mar 17, 2017 at 11:52:01AM -0700, Michael Davidson wrote: > On Fri, Mar 17, 2017 at 5:44 AM, Peter Zijlstra wrote: > > > > Be that as it may; what you construct above is disgusting. Surely the > > code can be refactored to not look like dog vomit? > > > > Also; its

[PATCH] crypto: zip - Memory corruption in zip_clear_stats()

2017-03-17 Thread Dan Carpenter
There is a typo here. It should be "stats" instead of "state". The impact is that we clear 224 bytes instead of 80 and we zero out memory that we shouldn't. Fixes: 09ae5d37e093 ("crypto: zip - Add Compression/Decompression statistics") Signed-off-by: Dan Carpenter

Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array

2017-03-17 Thread hpa
On March 17, 2017 12:27:46 PM PDT, Peter Zijlstra wrote: >On Fri, Mar 17, 2017 at 11:52:01AM -0700, Michael Davidson wrote: >> On Fri, Mar 17, 2017 at 5:44 AM, Peter Zijlstra > wrote: >> > >> > Be that as it may; what you construct above is disgusting.

Re: [PATCH 2/7] Makefile, x86, LLVM: disable unsupported optimization flags

2017-03-17 Thread H. Peter Anvin
On 03/17/17 14:32, H. Peter Anvin wrote: > > NAK. Fix your compiler, or use a wrapper script or something. It is > absolutely *not* acceptable to disable this since future versions of > clang *should* support that. > > That being said, it might make sense to look for a key pattern like >

Re: [PATCH 4/4] crypto: s5p-sss - Use mutex instead of spinlock

2017-03-17 Thread Krzysztof Kozlowski
On Fri, Mar 17, 2017 at 06:28:29PM +0100, Bartlomiej Zolnierkiewicz wrote: > > Hi, > > On Friday, March 17, 2017 04:49:22 PM Krzysztof Kozlowski wrote: > > Driver uses threaded interrupt handler so there is no real need for > > using spinlocks for synchronization. Mutexes would do fine and are

Re: [PATCH 1/4] crypto: s5p-sss - Close possible race for completed requests

2017-03-17 Thread Bartlomiej Zolnierkiewicz
On Friday, March 17, 2017 04:49:19 PM Krzysztof Kozlowski wrote: > Driver is capable of handling only one request at a time and it stores > it in its state container struct s5p_aes_dev. This stored request must be > protected between concurrent invocations (e.g. completing current > request and

Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array

2017-03-17 Thread Dmitry Vyukov
On Fri, Mar 17, 2017 at 7:03 PM, Borislav Petkov wrote: > On Fri, Mar 17, 2017 at 01:32:00PM +0100, Alexander Potapenko wrote: >> > IIUC there's only a handful of VLAIS instances in LLVM code, why not >> Sorry, "kernel code", not "LLVM code". >> > just drop them for the sake of

Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array

2017-03-17 Thread Borislav Petkov
On Fri, Mar 17, 2017 at 07:47:33PM +0100, Dmitry Vyukov wrote: > This problem is more general and is not specific to clang. It equally > applies to different versions of gcc, different arches and different > configs (namely, anything else than what a developer used for > testing). I guess. We do

Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array

2017-03-17 Thread Dmitry Vyukov
On Fri, Mar 17, 2017 at 7:57 PM, Borislav Petkov wrote: > On Fri, Mar 17, 2017 at 07:47:33PM +0100, Dmitry Vyukov wrote: >> This problem is more general and is not specific to clang. It equally >> applies to different versions of gcc, different arches and different >> configs

Re: [PATCH v3 1/3] clk: meson-gxbb: expose clock CLKID_RNG0

2017-03-17 Thread Kevin Hilman
Herbert Xu writes: > On Thu, Mar 16, 2017 at 11:24:31AM -0700, Kevin Hilman wrote: >> Hi Herbert, >> >> Herbert Xu writes: >> >> > On Wed, Feb 22, 2017 at 07:55:24AM +0100, Heiner Kallweit wrote: >> >> Expose clock CLKID_RNG0 which is

Re: [PATCH 3/7] x86, LLVM: suppress clang warnings about unaligned accesses

2017-03-17 Thread hpa
On March 16, 2017 5:15:16 PM PDT, Michael Davidson wrote: >Suppress clang warnings about potential unaliged accesses >to members in packed structs. This gets rid of almost 10,000 >warnings about accesses to the ring 0 stack pointer in the TSS. > >Signed-off-by: Michael Davidson

Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array

2017-03-17 Thread Fengguang Wu
Hi Dmitry, On Fri, Mar 17, 2017 at 08:05:16PM +0100, Dmitry Vyukov wrote: On Fri, Mar 17, 2017 at 7:57 PM, Borislav Petkov wrote: On Fri, Mar 17, 2017 at 07:47:33PM +0100, Dmitry Vyukov wrote: This problem is more general and is not specific to clang. It equally applies to

Re: [PATCH 1/1] ARM: dts: NSP: Add crypto (SPU) to dtsi

2017-03-17 Thread Florian Fainelli
On 03/06/2017 11:22 AM, Florian Fainelli wrote: > On 02/28/2017 12:31 PM, Florian Fainelli wrote: >> On 02/22/2017 01:22 PM, Steve Lin wrote: >>> Adds crypto hardware (SPU) to Northstar Plus device tree file. >>> >>> Signed-off-by: Steve Lin >> >> Applied, thanks! > >

[PATCH 3/4] crypto: s5p-sss - Document the struct s5p_aes_dev

2017-03-17 Thread Krzysztof Kozlowski
Add kernel-doc to s5p_aes_dev structure. Signed-off-by: Krzysztof Kozlowski --- drivers/crypto/s5p-sss.c | 27 ++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/s5p-sss.c b/drivers/crypto/s5p-sss.c index

[PATCH 4/4] crypto: s5p-sss - Use mutex instead of spinlock

2017-03-17 Thread Krzysztof Kozlowski
Driver uses threaded interrupt handler so there is no real need for using spinlocks for synchronization. Mutexes would do fine and are friendlier for overall system preemptivness and real-time behavior. Signed-off-by: Krzysztof Kozlowski --- drivers/crypto/s5p-sss.c | 35

Re: [RFC PATCH v2 08/32] x86: Use PAGE_KERNEL protection for ioremap of memory page

2017-03-17 Thread Tom Lendacky
On 3/17/2017 9:32 AM, Tom Lendacky wrote: On 3/16/2017 3:04 PM, Tom Lendacky wrote: On 3/7/2017 8:59 AM, Borislav Petkov wrote: On Thu, Mar 02, 2017 at 10:13:32AM -0500, Brijesh Singh wrote: From: Tom Lendacky In order for memory pages to be properly mapped when SEV

[PATCH 0/4] crypto: s5p-sss - Fix and minor improvements

2017-03-17 Thread Krzysztof Kozlowski
Hi, I still did not fix the NULL pointer dereference reported by Nathan Royce [1], but I got some other improvements. Testing done on Odroid U3 (Exynos4412) with tcrypt and cryptsetup. Best regards, Krzysztof [1] https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1351149.html

Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array

2017-03-17 Thread Michael Davidson
On Fri, Mar 17, 2017 at 5:44 AM, Peter Zijlstra wrote: > > Be that as it may; what you construct above is disgusting. Surely the > code can be refactored to not look like dog vomit? > > Also; its not immediately obvious conf->copies is 'small' and this > doesn't blow up the

Re: [PATCH 0/7] LLVM: make x86_64 kernel build with clang.

2017-03-17 Thread Dmitry Vyukov
On Fri, Mar 17, 2017 at 1:15 AM, Michael Davidson wrote: > This patch set is sufficient to get the x86_64 kernel to build > and boot correctly with clang-3.8 or greater. > > The resulting build still has about 300 warnings, very few of > which appear to be significant. Most of

Re: [PATCH v3 1/3] clk: meson-gxbb: expose clock CLKID_RNG0

2017-03-17 Thread Herbert Xu
On Thu, Mar 16, 2017 at 11:24:31AM -0700, Kevin Hilman wrote: > Hi Herbert, > > Herbert Xu writes: > > > On Wed, Feb 22, 2017 at 07:55:24AM +0100, Heiner Kallweit wrote: > >> Expose clock CLKID_RNG0 which is needed for the HW random number generator. > >> > >>

[PATCH 0/7] crypto: caam - add Queue Interface (QI) support

2017-03-17 Thread Horia Geantă
RFC -> v1: -rebased on latest cryptodev-2.6 tree open-code tsk_cpus_allowed() - sync with commit 0c98d344fe5c "sched/core: Remove the tsk_cpus_allowed() wrapper" -addressed Scott's feedback - removed most of the accessors added in soc/qman (patch 4) and instead open-coded them in caam/qi The

Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array

2017-03-17 Thread Peter Zijlstra
On Thu, Mar 16, 2017 at 05:15:19PM -0700, Michael Davidson wrote: > Replace a variable length array in a struct by allocating > the memory for the entire struct in a char array on the stack. > > Signed-off-by: Michael Davidson > --- > drivers/md/raid10.c | 9 - > 1 file

Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array

2017-03-17 Thread Peter Zijlstra
On Fri, Mar 17, 2017 at 01:31:23PM +0100, Alexander Potapenko wrote: > On Fri, Mar 17, 2017 at 1:08 PM, Peter Zijlstra wrote: > > On Thu, Mar 16, 2017 at 05:15:19PM -0700, Michael Davidson wrote: > >> Replace a variable length array in a struct by allocating > >> the memory

Re: [PATCH 5/7] x86, boot, LLVM: Use regparm=0 for memcpy and memset

2017-03-17 Thread Peter Zijlstra
On Thu, Mar 16, 2017 at 05:15:18PM -0700, Michael Davidson wrote: > Use the standard regparm=0 calling convention for memcpy and > memset when building with clang. > > This is a work around for a long standing clang bug > (see https://llvm.org/bugs/show_bug.cgi?id=3997) where > clang always uses

Re: [PATCH 6/7] md/raid10, LLVM: get rid of variable length array

2017-03-17 Thread Alexander Potapenko
On Fri, Mar 17, 2017 at 1:08 PM, Peter Zijlstra wrote: > On Thu, Mar 16, 2017 at 05:15:19PM -0700, Michael Davidson wrote: >> Replace a variable length array in a struct by allocating >> the memory for the entire struct in a char array on the stack. >> >> Signed-off-by:

[PATCH v2] dt-bindings: rng: clocks property on omap_rng not always mandatory

2017-03-17 Thread Thomas Petazzoni
Commit 52060836f79 ("dt-bindings: omap-rng: Document SafeXcel IP-76 device variant") update the omap_rng Device Tree binding to add support for the IP-76 variation of the IP. As part of this change, a "clocks" property was added, but is indicated as "Required", without indicated it's actually only

[PATCH 7/7] crypto: caam/qi - add ablkcipher and authenc algorithms

2017-03-17 Thread Horia Geantă
Add support to submit ablkcipher and authenc algorithms via the QI backend: -ablkcipher: cbc({aes,des,des3_ede}) ctr(aes), rfc3686(ctr(aes)) xts(aes) -authenc: authenc(hmac(md5),cbc({aes,des,des3_ede})) authenc(hmac(sha*),cbc({aes,des,des3_ede})) caam/qi being a new driver, let's wait some time

[PATCH 6/7] crypto: caam - add Queue Interface (QI) backend support

2017-03-17 Thread Horia Geantă
CAAM engine supports two interfaces for crypto job submission: -job ring interface - already existing caam/jr driver -Queue Interface (QI) - caam/qi driver added in current patch QI is present in CAAM engines found on DPAA platforms. QI gets its I/O (frame descriptors) from QMan (Queue Manager)

[PATCH 1/7] soc/qman: export volatile dequeue related structs

2017-03-17 Thread Horia Geantă
Since qman_volatile_dequeue() is already exported, move the related structures into the public header too. Signed-off-by: Horia Geantă --- drivers/soc/fsl/qbman/qman_priv.h | 36 include/soc/fsl/qman.h| 36

[PATCH 2/7] soc/qman: add dedicated channel ID for CAAM

2017-03-17 Thread Horia Geantă
Add and export the ID of the channel serviced by the CAAM (Cryptographic Acceleration and Assurance Module) DCP. Signed-off-by: Horia Geantă --- drivers/soc/fsl/qbman/qman_ccsr.c | 6 +- include/soc/fsl/qman.h| 3 +++ 2 files changed, 8 insertions(+), 1

[PATCH 3/7] soc/qman: export non-programmable FQD fields query

2017-03-17 Thread Horia Geantă
Export qman_query_fq_np() function and related structures. This will be needed in the caam/qi driver, where "queue empty" condition will be decided based on the frm_cnt. Signed-off-by: Horia Geantă --- drivers/soc/fsl/qbman/qman.c | 4 +--

[PATCH 5/7] crypto: caam - avoid double inclusion in desc_constr.h

2017-03-17 Thread Horia Geantă
Signed-off-by: Horia Geantă --- drivers/crypto/caam/desc_constr.h | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/crypto/caam/desc_constr.h b/drivers/crypto/caam/desc_constr.h index b9c8d98ef826..d8e83ca104e0 100644 --- a/drivers/crypto/caam/desc_constr.h

[PATCH 4/7] soc/qman: add macros needed by caam/qi driver

2017-03-17 Thread Horia Geantă
A few other things need to be added in soc/qman, such that caam/qi won't open-code them. Signed-off-by: Horia Geantă --- include/soc/fsl/qman.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/soc/fsl/qman.h b/include/soc/fsl/qman.h index

Re: [RFC PATCH v2 29/32] kvm: svm: Add support for SEV DEBUG_DECRYPT command

2017-03-17 Thread Paolo Bonzini
On 16/03/2017 19:41, Brijesh Singh wrote: >> >> Please do add it, it doesn't seem very different from what you're doing >> in LAUNCH_UPDATE_DATA. There's no need for a separate >> __sev_dbg_decrypt_page function, you can just pin/unpin here and do a >> per-page loop as in LAUNCH_UPDATE_DATA. >

Re: [PATCH] dt-bindings: rng: clocks property on omap_rng is optional

2017-03-17 Thread Thomas Petazzoni
Hello, On Wed, 15 Mar 2017 12:57:37 -0500, Rob Herring wrote: > > diff --git a/Documentation/devicetree/bindings/rng/omap_rng.txt > > b/Documentation/devicetree/bindings/rng/omap_rng.txt > > index 4714772..20d435da 100644 > > --- a/Documentation/devicetree/bindings/rng/omap_rng.txt > > +++