From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753621AbbIKTPw (ORCPT ); Fri, 11 Sep 2015 15:15:52 -0400 Received: from mail.eperm.de ([89.247.134.16]:34112 "EHLO mail.eperm.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752850AbbIKTPq (ORCPT ); Fri, 11 Sep 2015 15:15:46 -0400 From: Stephan Mueller To: Tim Chen Cc: Herbert Xu , "H. Peter Anvin" , "David S.Miller" , Sean Gulley , Chandramouli Narayanan , Vinodh Gopal , James Guilford , Wajdi Feghali , Jussi Kivilinna , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/4] crypto: [sha] glue code for Intel SHA extensions optimized SHA1 & SHA256 Date: Fri, 11 Sep 2015 21:15:40 +0200 Message-ID: <10793794.Du4Jcu9jOE@tauon.atsec.com> User-Agent: KMail/4.14.9 (Linux/4.1.6-200.fc22.x86_64; KDE/4.14.9; x86_64; ; ) In-Reply-To: <1441997372.4322.37.camel@schen9-desk2.jf.intel.com> References: <1671234.vBOzL28The@tauon.atsec.com> <1441997372.4322.37.camel@schen9-desk2.jf.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Freitag, 11. September 2015, 11:49:32 schrieb Tim Chen: Hi Tim, >On Fri, 2015-09-11 at 19:02 +0200, Stephan Mueller wrote: >> Am Donnerstag, 10. September 2015, 17:04:31 schrieb Tim Chen: >> >> Hi Tim, >> >> >Is there a scenario you can think of >> >when a lower performing sha1 transform needs to >> >be exposed as a separate driver? >> >> My immediate concern is testing: it is hard to test the individual >> implementations. > >Not hard, just one line in the glue code to set the transform >to the one you need it you really want to test individual >implementation. Usually user of sha don't care which sha driver >they got, but just the highest priority one. >So you will anyway need to patch and change the priority of the sha >driver to expose a specific one for testing. Sure, it is not hard when you recompile. But when you have to test one given kernel binary, it is a challenge. > >> >Otherwise the glue code logic will only expose the >> >best performing one for a cpu and hide the others, which was intentional >> >on our part to prevent a lower performing sha from getting used. >> >> Agreed, but the kernel crypto API does that already using the priorities -- >> IMHO a very clean and easy to interpret solution. >> >> Furthermore, if somebody really has a need to not use the fastest HW >> implementation, the kernel crypto API allows him to do that. With the hard- >> wired approach in the glue file, you are stuck. > >Still, why would some kernel module specifically not want to >use the fastest HW implementation, and explicitly ask for >a slower driver? I have seen one instance where a hardware driver was broken on one particular hardware. So, the only way was to disable it. In our case here, disabling means to go back to the software implementation of SHA. Ciao Stephan