From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S268087AbUHFE7g (ORCPT ); Fri, 6 Aug 2004 00:59:36 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S268088AbUHFE7g (ORCPT ); Fri, 6 Aug 2004 00:59:36 -0400 Received: from fw.osdl.org ([65.172.181.6]:11912 "EHLO mail.osdl.org") by vger.kernel.org with ESMTP id S268087AbUHFE7f (ORCPT ); Fri, 6 Aug 2004 00:59:35 -0400 Date: Thu, 5 Aug 2004 21:58:58 -0700 (PDT) From: Linus Torvalds To: Michael Halcrow cc: James Morris , Jean-Luc Cooke , "David S. Miller" , cryptoapi@lists.logix.cz, Michal Ludvig , linux-kernel@vger.kernel.org Subject: Re: [PATCH] In-Reply-To: <20040806020313.GA21309@halcrow.us> Message-ID: References: <20040805194914.GC23994@certainkey.com> <20040806020313.GA21309@halcrow.us> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 5 Aug 2004, Michael Halcrow wrote: > > I often have a virtual address to work with in the first place, and > the data that I hash usually occupies less than one page (passphrases, > keys, etc.). Ehh. A lot of encryption algorithms are not re-entrant, which means that you can't take page faults in the middle without serious trouble. And if the data is smaller than a page, then it's cheaper to just copy it into kernel memory than it is to try to follow the page tables by hand. One is usually nice cached accesses, the other one is nasty code with locking and often totally uncached. So I'd strongly suggest against doing any "raw crypto access". Zero-copy is often just a complicated way of doing things slowly, all in the name of some benchmark performance. Linus