From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from aserp2120.oracle.com (aserp2120.oracle.com [141.146.126.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.server123.net (Postfix) with ESMTPS for ; Thu, 24 Sep 2020 17:59:00 +0200 (CEST) MIME-Version: 1.0 Message-ID: <17ff78d3-2ef3-414b-8168-2a2f603fcec0@default> Date: Thu, 24 Sep 2020 08:58:47 -0700 (PDT) From: Sudhakar Panneerselvam Sender: Sudhakar Panneerselvam References: <1600281606-1446-1-git-send-email-sudhakar.panneerselvam@oracle.com> <3be1ea32-b6a8-41ef-a9ba-ed691434d068@default> <20200924012732.GA10766@redhat.com> In-Reply-To: <20200924012732.GA10766@redhat.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: Re: [dm-crypt] [RFC PATCH 0/2] dm crypt: Allow unaligned buffer lengths for skcipher devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mike Snitzer Cc: agk@redhat.com, dm-devel@redhat.com, dm-crypt@saout.de, mpatocka@redhat.com, Damien.LeMoal@wdc.com, Shirley Ma , ssudhakarp@gmail.com, Martin Petersen , Milan Broz Hello Mike, > -----Original Message----- > From: Mike Snitzer [mailto:snitzer@redhat.com] > Sent: Wednesday, September 23, 2020 7:28 PM > To: Sudhakar Panneerselvam > Cc: agk@redhat.com; dm-devel@redhat.com; dm-crypt@saout.de; > mpatocka@redhat.com; Damien.LeMoal@wdc.com; Shirley Ma > ; ssudhakarp@gmail.com; Martin Petersen > ; Milan Broz > Subject: Re: [RFC PATCH 0/2] dm crypt: Allow unaligned buffer lengths for > skcipher devices >=20 > You've clearly done a nice job with these changes. Looks clean. Thanks. >=20 > BUT, I'm struggling to just accept that dm-crypt needs to go to these > extra lengths purely because of one bad apple usecase. During my initial stages of investigation, I had the same impression as you= rs, but digging further, I felt fixing dm-crypt would be more appropriate. In the following two test cases, windows installation/formatting/booting, a= ll were successful. Windows Guest <--> Vhost-Scsi <--> LIO(scsi/target/blockio) <--> iSCSI bloc= k device Windows Guest <--> Vhost-Scsi <--> LIO(scsi/target/blockio) <--> Local Mega= Raid Block Device When I inserted dm-crypt in the IO path, that is where I noticed windows bo= ot/install/format failures. The IO path is like this: Windows Guest <--> Vhost-Scsi <--> LIO(scsi/target/blockio) <--> dm-crypt = <--> iSCSI block device After these tests, I realized that, when every other component in the IO st= ack can handle unaligned bio lengths, why can't make dm-crypt handle the sa= me. Hence, the patch. =20 >=20 > These alignment constraints aren't new. Are there other portions of > Linux's crypto subsystem that needed comparable fixes in order to work > with Microsfot OS initiated IO through a guest? I ran basic test with "--cipher aes-xts-plain64" and verified the fix. Also= , noticed that the crypto subsystem uses APIs in crypto/skcipher.c which ar= e already specifically written to handle unaligned buffers. >=20 > You forecast that these same kinds of changes are needed for AEAD and > dm-integrity... that's alarming. I understand the concern. I have tried to ensure the patch doesn't result i= n degrade in performance for the Linux use case. If at all, there is any pe= rformance impact due to this change, it will be only for windows(I didn't s= ee any performance drop in my test, though). Thanks Sudhakar >=20 > Are we _certain_ there is no other way forward? > (Sorry I don't have suggestions.. I'm in "fact finding mode" ;) >=20 > Thanks, > Mike >=20 > On Wed, Sep 23 2020 at 1:01pm -0400, > Sudhakar Panneerselvam wrote: >=20 > > Could someone review this patch set, please? > > > > Thanks > > Sudhakar > > > > > -----Original Message----- > > > From: Sudhakar Panneerselvam > > > Sent: Wednesday, September 16, 2020 12:40 PM > > > To: agk@redhat.com; snitzer@redhat.com; dm-devel@redhat.com > > > Cc: Shirley Ma ; ssudhakarp@gmail.com; Martin > > > Petersen > > > Subject: [dm-devel] [RFC PATCH 0/2] dm crypt: Allow unaligned buffer > lengths > > > for skcipher devices > > > > > > Hi, > > > > > > This changeset allows processing of unaligned bio requests in dm cryp= t > > > for the I/Os generated from a windows guest OS in a QEMU environment. > If > > > this changeset is accepted, then I will be submitting another changes= et that > > > addresses the similar issue in AEAD disks and dm-integrity module. > > > > > > Thanks > > > Sudhakar > > > > > > Sudhakar Panneerselvam (2): > > > dm crypt: Allow unaligned bio buffer lengths for skcipher devices > > > dm crypt: Handle unaligned bio buffer lengths for lmk and tcw > > > > > > drivers/md/dm-crypt.c | 154 > +++++++++++++++++++++++++++++++++++---- > > > ----------- > > > 1 file changed, 108 insertions(+), 46 deletions(-) > > > > > > -- > > > 1.8.3.1 > > > > > > -- > > > dm-devel mailing list > > > dm-devel@redhat.com > > > https://www.redhat.com/mailman/listinfo/dm-devel > > > > > >=20