Re: crypto API - async semantics

2017-10-11 Thread Herbert Xu
On Wed, Oct 11, 2017 at 12:36:11PM +, Horia Geantă wrote: > Hi Herbert, > > I am evaluating whether ahash implementation in caam crypto driver > behaves correctly. > One thing I've noticed is that for each ahash tfm there is support for > at most two in-flight requests, and I would like to kno

Re: Fostering linux community collaboration on hardware accelerators

2017-10-11 Thread Andrew Donnellan
On 10/10/17 22:28, Jonathan Cameron wrote: Hi All, Please forward this email to anyone you think may be interested. Have forwarded this to a number of relevant IBMers. On behalf of Huawei, I am looking into options to foster a wider community around the various ongoing projects related to Ac

Re: [Part2 PATCH v5.1 12.4/31] crypto: ccp: Implement SEV_PLATFORM_STATUS ioctl command

2017-10-11 Thread Borislav Petkov
On Wed, Oct 11, 2017 at 03:45:00PM -0500, Brijesh Singh wrote: > OK, if userspace is going to pick bits apart then how about this: > > struct sev_data_status { > u8 api_major; /* Out */ > u8 api_minor; /* Out */ > u8 s

Re: [Part2 PATCH v5.1 12.4/31] crypto: ccp: Implement SEV_PLATFORM_STATUS ioctl command

2017-10-11 Thread Brijesh Singh
On 10/11/2017 03:45 PM, Brijesh Singh wrote: On 10/11/2017 03:28 PM, Borislav Petkov wrote: On Wed, Oct 11, 2017 at 03:10:49PM -0500, Brijesh Singh wrote: The current 'struct sev_data_status' matches with the firmware names and the bit fields. Only thing I did was the fields with no name i

Re: [Part2 PATCH v5.1 12.4/31] crypto: ccp: Implement SEV_PLATFORM_STATUS ioctl command

2017-10-11 Thread Brijesh Singh
On 10/11/2017 03:28 PM, Borislav Petkov wrote: On Wed, Oct 11, 2017 at 03:10:49PM -0500, Brijesh Singh wrote: The current 'struct sev_data_status' matches with the firmware names and the bit fields. Only thing I did was the fields with no name is called as "reservedX" Ok, I see it. So what y

Re: [Part2 PATCH v5.1 12.4/31] crypto: ccp: Implement SEV_PLATFORM_STATUS ioctl command

2017-10-11 Thread Borislav Petkov
On Wed, Oct 11, 2017 at 03:10:49PM -0500, Brijesh Singh wrote: > The current 'struct sev_data_status' matches with the firmware names and the > bit fields. Only thing I did was the fields with no name is called as > "reservedX" Ok, I see it. So what you actually wanna do is: struct sev_data_statu

Re: [Part2 PATCH v5.1 12.4/31] crypto: ccp: Implement SEV_PLATFORM_STATUS ioctl command

2017-10-11 Thread Borislav Petkov
On Wed, Oct 11, 2017 at 10:04:44PM +0200, Borislav Petkov wrote: > Then it is easy: > >&= GENMASK(23, 1); [1:23] range cleared, of course: &= ~GENMASK(23, 1); -- Regards/Gruss, Boris. SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nür

Re: [Part2 PATCH v5.1 12.4/31] crypto: ccp: Implement SEV_PLATFORM_STATUS ioctl command

2017-10-11 Thread Brijesh Singh
On 10/11/2017 03:04 PM, Borislav Petkov wrote: On Wed, Oct 11, 2017 at 02:49:55PM -0500, Brijesh Singh wrote: This is OK for now. But in future if FW steals another bit from reserved1 field to expose a new flag then 'owner' name will no longer be valid. If you don't to use bit field then we ha

Re: [Part2 PATCH v5.1 12.4/31] crypto: ccp: Implement SEV_PLATFORM_STATUS ioctl command

2017-10-11 Thread Borislav Petkov
On Wed, Oct 11, 2017 at 02:49:55PM -0500, Brijesh Singh wrote: > This is OK for now. But in future if FW steals another bit from reserved1 > field to expose a new flag then 'owner' name will no longer be valid. If you > don't to use bit field then we have to use some generic name instead of > namin

Re: [Part2 PATCH v5.1 12.4/31] crypto: ccp: Implement SEV_PLATFORM_STATUS ioctl command

2017-10-11 Thread Brijesh Singh
On 10/11/2017 12:02 PM, Borislav Petkov wrote: ... What's with the curly brackets around the case: statements? I will remove the curly braces. Anyway, here are some more improvements: * you can get rid of the struct copying into out and the bitfields by doing something like this:

Re: [Part2 PATCH v5.1 12.4/31] crypto: ccp: Implement SEV_PLATFORM_STATUS ioctl command

2017-10-11 Thread Borislav Petkov
On Fri, Oct 06, 2017 at 08:06:02PM -0500, Brijesh Singh wrote: > The SEV_PLATFORM_STATUS command can be used by the platform owner to > get the current status of the platform. The command is defined in > SEV spec section 5.5. > > Cc: Paolo Bonzini > Cc: "Radim Krčmář" > Cc: Borislav Petkov > Cc

[Part2 PATCH v5.2 12.4/31] crypto: ccp: Implement SEV_PLATFORM_STATUS ioctl command

2017-10-11 Thread Brijesh Singh
The SEV_PLATFORM_STATUS command can be used by the platform owner to get the current status of the platform. The command is defined in SEV spec section 5.5. Cc: Paolo Bonzini Cc: "Radim Krčmář" Cc: Borislav Petkov Cc: Herbert Xu Cc: Gary Hook Cc: Tom Lendacky Cc: linux-crypto@vger.kernel.org

[Part2 PATCH v5.2 12.3/31] crypto: ccp: Implement SEV_FACTORY_RESET ioctl command

2017-10-11 Thread Brijesh Singh
The SEV_FACTORY_RESET command can be used by the platform owner to reset the non-volatile SEV related data. The command is defined in SEV spec section 5.4 Cc: Paolo Bonzini Cc: "Radim Krčmář" Cc: Borislav Petkov Cc: Herbert Xu Cc: Gary Hook Cc: Tom Lendacky Cc: linux-crypto@vger.kernel.org C

Re: Fostering linux community collaboration on hardware accelerators

2017-10-11 Thread Jonathan Cameron
On Wed, 11 Oct 2017 11:51:49 -0400 Sandy Harris wrote: > I shortened the cc list radically. If the discussion continues, it may > be a good idea to add people back. I added John Gilmore since I cite > one of his posts below. Fair enough - I have cc'd back in our internal list for now. I cynicall

[Part2 PATCH v5.2 12.2/31] crypto: ccp: Add Secure Encrypted Virtualization (SEV) command support

2017-10-11 Thread Brijesh Singh
AMD's new Secure Encrypted Virtualization (SEV) feature allows the memory contents of virtual machines to be transparently encrypted with a key unique to the VM. The programming and management of the encryption keys are handled by the AMD Secure Processor (AMD-SP) which exposes the commands for the

[Part2 PATCH v5.2 12.1/31] crypto: ccp: Define SEV userspace ioctl and command id

2017-10-11 Thread Brijesh Singh
Add a include file which defines the ioctl and command id used for issuing SEV platform management specific commands. Cc: Paolo Bonzini Cc: "Radim Krčmář" Cc: Borislav Petkov Cc: Herbert Xu Cc: Gary Hook Cc: Tom Lendacky Cc: linux-crypto@vger.kernel.org Cc: k...@vger.kernel.org Cc: linux-ker

Re: Fostering linux community collaboration on hardware accelerators

2017-10-11 Thread Sandy Harris
I shortened the cc list radically. If the discussion continues, it may be a good idea to add people back. I added John Gilmore since I cite one of his posts below. Jonathan Cameron wrote: > On behalf of Huawei, I am looking into options to foster a wider community > around the various ongoing pr

Re: Fostering linux community collaboration on hardware accelerators

2017-10-11 Thread Jonathan Cameron
On Tue, 10 Oct 2017 16:55:06 +0200 Francois Ozog wrote: > Hi, Hi Francois, Firstly, to anyone seeing this on the mailing lists, there was an attachment so it presumably bounced. > > I am really happy you started this thread. I think we need to have Grant > Likely from Arm involved in the topic

Re: [Part2 PATCH v5.1 12.3/31] crypto: ccp: Implement SEV_FACTORY_RESET ioctl command

2017-10-11 Thread Borislav Petkov
On Fri, Oct 06, 2017 at 08:06:01PM -0500, Brijesh Singh wrote: > The SEV_FACTORY_RESET command can be used by the platform owner to > reset the non-volatile SEV related data. The command is defined in > SEV spec section 5.4 > > Cc: Paolo Bonzini > Cc: "Radim Krčmář" > Cc: Borislav Petkov > Cc:

Re: [Part2 PATCH v5.1 12.1/31] crypto: ccp: Add Secure Encrypted Virtualization (SEV) command support

2017-10-11 Thread Brijesh Singh
On 10/11/2017 09:19 AM, Borislav Petkov wrote: On Sun, Oct 08, 2017 at 08:30:47AM -0500, Brijesh Singh wrote: Basically we need some variable which is outside the per-device structure so that we don't end up creating multiple /dev/sev nodes. If needed, I think we can remove 'has_sev_fops' vari

Re: [Part2 PATCH v5.1 12.1/31] crypto: ccp: Add Secure Encrypted Virtualization (SEV) command support

2017-10-11 Thread Borislav Petkov
On Sun, Oct 08, 2017 at 08:30:47AM -0500, Brijesh Singh wrote: > Basically we need some variable which is outside the per-device > structure so that we don't end up creating multiple /dev/sev nodes. If > needed, I think we can remove 'has_sev_fops' variable from struct > psp_device if we decide to

Re: [PATCH 0/3] crypto: marvell - Remove the old CESA driver

2017-10-11 Thread Jason Cooper
Hey Boris, On Wed, Oct 11, 2017 at 03:16:16PM +0200, Boris Brezillon wrote: > Hello, > > It's been several releases since we added a new driver to support the > CESA IP (the new driver was introduced in 4.2). It seems most major > bugs have been discovered and fixed and now is probably a good tim

[PATCH 3/3] crypto: marvell - Remove the old mv_cesa driver

2017-10-11 Thread Boris Brezillon
All defconfigs selecting the old driver have been patched to select the new one instead. We can now remove the old driver along with the allhwsupports module parameter in the new driver that was used to check whether the new driver was allowed to take control of the CESA engine or not. Signed-off-

[PATCH 0/3] crypto: marvell - Remove the old CESA driver

2017-10-11 Thread Boris Brezillon
Hello, It's been several releases since we added a new driver to support the CESA IP (the new driver was introduced in 4.2). It seems most major bugs have been discovered and fixed and now is probably a good time to kill the old driver and force remaining users to switch to the new one. This seri

[PATCH 1/3] crypto: marvell - Add a platform_device_id table

2017-10-11 Thread Boris Brezillon
Add a platform_device_id table to allow using this driver on orion platforms that have not been converted to DT. Signed-off-by: Boris Brezillon --- drivers/crypto/marvell/cesa.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/crypto/marvell/cesa.c b/drivers/crypto/marvell/cesa.

[PATCH 2/3] ARM: configs: Stop selecting the old CESA driver

2017-10-11 Thread Boris Brezillon
A new driver has been developed to support the CESA IP. Switch remaining users of the old driver to the new driver in order to remove the old one. Signed-off-by: Boris Brezillon --- arch/arm/configs/dove_defconfig | 2 +- arch/arm/configs/multi_v5_defconfig | 2 +- arch/arm/configs/orion5x_d

crypto API - async semantics

2017-10-11 Thread Horia Geantă
Hi Herbert, I am evaluating whether ahash implementation in caam crypto driver behaves correctly. One thing I've noticed is that for each ahash tfm there is support for at most two in-flight requests, and I would like to know whether this is an issue or not. In this context, could you please clar