From: Logan Gunthorpe Subject: Re: [PATCH 09/22] dm-crypt: Make use of the new sg_map helper in 4 call sites Date: Fri, 14 Apr 2017 10:03:43 -0600 Message-ID: <302ae5ab-d515-5427-2e54-d58a9cdb8241@deltatee.com> References: <1492121135-4437-1-git-send-email-logang@deltatee.com> <1492121135-4437-10-git-send-email-logang@deltatee.com> <20170414083921.GC25471@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Steve Wise , linux-nvme@lists.infradead.org, Stephen Bates , target-devel@vger.kernel.org, Sumit Semwal , devel@driverdev.osuosl.org, rds-devel@oss.oracle.com, Sagi Grimberg , linux-scsi@vger.kernel.org, Matthew Wilcox , linux-rdma@vger.kernel.org, fcoe-devel@open-fcoe.org, Ross Zwisler , open-iscsi@googlegroups.com, linux-media@vger.kernel.org, Ming Lin , intel-gfx@lists.freedesktop.org, sparmaintainer@unisys.com, linux-raid@vger.kernel.org, dri-devel@lists.freedesktop.org, Dan Williams , megaraidlinux.pdl@broadcom.com, Jens Axboe , linaro-mm-sig@lists.linaro.org, "Martin K. Petersen" , Greg Kroah-Hartman Return-path: In-Reply-To: <20170414083921.GC25471@lst.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" List-Id: linux-crypto.vger.kernel.org On 14/04/17 02:39 AM, Christoph Hellwig wrote: > On Thu, Apr 13, 2017 at 04:05:22PM -0600, Logan Gunthorpe wrote: >> Very straightforward conversion to the new function in all four spots. > > I think the right fix here is to switch dm-crypt to the ahash API > that takes a scatterlist. Hmm, well I'm not sure I understand the code enough to make that conversion. But I was looking at it. One tricky bit seems to be that crypt_iv_lmk_one adds a seed, skips the first 16 bytes in the page and then hashes another 16 bytes from other data. What would you do construct a new sgl for it and pass it to the ahash api? The other thing is crypt_iv_lmk_post also seems to modify the page after the hash with a crypto_xor so you'd still need at least one kmap in there. Logan