Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp218717ybi; Fri, 24 May 2019 02:46:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqywOx6PM8jpyELziFfVH3weoKqG12Il6lSEsjkjMUJdD6T9fMQClR8yBS86Ce1IVOt4xna4 X-Received: by 2002:a63:d04b:: with SMTP id s11mr104233354pgi.187.1558691163833; Fri, 24 May 2019 02:46:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558691163; cv=none; d=google.com; s=arc-20160816; b=ZjpF+L1JLUIygwXukJ81lNe1tR6YhLzTZ3fxrF82mrCYYrKwSoAUog/mZ2Tn5+1Cwy reoH6vOFLHcx940frbMz1U98sDHzXT440cwpJ83c4btfYv91nmc4kxYMPYG8cBicm5dS ooXLmGfJHFTrDgAnJFoPrWaqitBctsDRn9Ve3afgt55DdiyBtQR8IZ0JpdAvIW8Yp7I0 nF8aAbTE/wiIjO+XE/tkhR0lWm44NXOzvvEvRxThCuwca71QzjiNJ1OtGSPUamE0WwLx k0HS4m2vahfgW6ABRDuMKvH2oG30rS7RV+5FoSI9N8RY5LZ5++HEuGatXJphBkXxeKlV YNNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=mm7u6ZMplwJx3ZNg0k2j2OUTMi4snU1dJyY1vDxWWsA=; b=yesa7cAm+SxRrCJ17b+k0l9d60qF383p2KIWm8KdhkDQMbhLClqP2J2+vsv1cBNBXH Ta14bYgMt/X2Mob1LlmXEPLzd3MkBg4gGq4XRx9F9KvOvPxKcIEf3Y570pLDl4p5qUjc WsahDmNqXt+hohowGs/HxLR/bA1oZQhRSBJ7WGcBpAH+swuQNUWS55giOVY3CVJF4aOV I8BG5Lks7UHO3/n8WkSypesBpyDv1H6dlDlw3BucDCARNPZniJy6lIvOM4LATD9fbdUi YETF01KrMkVh9RBBVCVGYxBgGr9TgXP5GFj37Go7faoclKVcLovsqnlNe+YaTKxzxVVG zhjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=InVIjS4g; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p24si3081527plr.269.2019.05.24.02.45.46; Fri, 24 May 2019 02:46:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=InVIjS4g; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389776AbfEXJph (ORCPT + 99 others); Fri, 24 May 2019 05:45:37 -0400 Received: from mail-it1-f170.google.com ([209.85.166.170]:54869 "EHLO mail-it1-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389582AbfEXJpg (ORCPT ); Fri, 24 May 2019 05:45:36 -0400 Received: by mail-it1-f170.google.com with SMTP id h20so14722937itk.4 for ; Fri, 24 May 2019 02:45:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=mm7u6ZMplwJx3ZNg0k2j2OUTMi4snU1dJyY1vDxWWsA=; b=InVIjS4gIzLlaEssKpThQZA9ClkW6K7hAzv+B52Bgr1MJo5CD/2ThaGgdDcdjWWjVt IXG0vAxXB0n6PJ4gTaDnUH9L+t+hhccKI8WILBpIVTu3ioWeoCVmuqgVLd81cs2CXPjd loT1mu+HIGoqrC3tETY1xCu3IyRE4NaVca0CmKt1/E7DT1cyc2TbzF2Fh/BpmXW6jgg4 BX41NivGsrK/6eskMAO+5JxhDWLjj9LQ7zKXxmALFRxXUJNbJsOlCqDEW0KrYyOScVHL Ck2P3VEZxaXyapekOWFoJeeR4lhFkgXwWT48JJwSVvNLgGEYm0TcncF4HyKmbD3wAvNd oXFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=mm7u6ZMplwJx3ZNg0k2j2OUTMi4snU1dJyY1vDxWWsA=; b=jMDcxkyw/5eaG2y6F9/HBmqCALxOjRm6kQErA631YfELMpYfzCs+R42p2yTDJA1LyD jIp7HDT5IygrfoPI6oo+btHav6hfgqm9nNb/svGkJlbNUj7ddhC7bKc1VcGbn7DBz0o5 qXSARxcWet5Nd3hwSCOPR1OvhAoTyDk78U5RVcGOso+jDcCWbOWJ/JEKzXex13hMvlp0 3dHcWf8TLR4oD9jPEuslYgmL30LIC4Uvnb+thKGnAB2r8PRy/87Uv0FGB6IDsAJxLHOr fefxXfl+9G6EbTSK48EJi5f86465k4ZK4uGctUBNG3QPd7mLiKTufnDXudYTHpbJ8H1a LlpQ== X-Gm-Message-State: APjAAAUnQUMOj8NdazOevdsiJBucge3XC3jXMrGFqppwopE65AUb+sdU eFiI4vRBaBLLZcpGr+pklQMVPj1wOIpRJYBKDCJuj5SIWrpnCg== X-Received: by 2002:a24:910b:: with SMTP id i11mr18345668ite.76.1558691135997; Fri, 24 May 2019 02:45:35 -0700 (PDT) MIME-Version: 1.0 References: <20190523185833.GA243994@google.com> <20190523200557.GA248378@gmail.com> <20190523234853.GC248378@gmail.com> <907eb6a5-dc76-d5ee-eccf-e7bd426a0868@c-s.fr> In-Reply-To: From: Ard Biesheuvel Date: Fri, 24 May 2019 11:45:21 +0200 Message-ID: Subject: Re: another testmgr question To: Pascal Van Leeuwen Cc: Christophe Leroy , "linux-crypto@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Fri, 24 May 2019 at 11:34, Pascal Van Leeuwen wrote: > > > All userland clients of the in-kernel crypto use it specifically to > > access h/w accelerators, given that software crypto doesn't require > > the higher privilege level (no point in issuing those AES CPU > > instructions from the kernel if you can issue them in your program > > directly) > > > > Basically, what is used is a socket interface that can block on > > read()/write(). So the userspace program doesn't need to be aware of > > the asynchronous nature, it is just frozen while the calls are being > > handled by the hardware. > > > With all due respect, but if the userland application is indeed > *frozen* while the calls are being handled, then that seems like its > pretty useless - for symmetric crypto, anyway - as performance would be > dominated by latency, not throughput. > Hardware acceleration would almost always lose that compared to a local > software implementation. > I certainly wouldn't want such an operation to end up at my driver! > Again, you are making assumptions here that don't always hold. Note that - a frozen process frees up the CPU to do other things while the crypto is in progress; - h/w crypto is typically more power efficient than CPU crypto; - several userland programs and in-kernel users may be active at the same time, so the fact that a single user sleeps doesn't mean the hardware is used inefficiently > Which brings up a question: is there some way for a driver to indicate > something like "don't use me unless you can seriously pipeline your > requests"? > > Regards, > Pascal van Leeuwen > Silicon IP Architect, Multi-Protocol Engines @ Inside Secure > www.insidesecure.com >