Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp5858948iog; Thu, 23 Jun 2022 06:48:24 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v1RhVn4kD5ybo5NDPYxJcrbovbnt9dWnSUsgrgQDWinct/QiommKoOKPiNIkc3dzeW+9wo X-Received: by 2002:a17:906:4fc6:b0:722:e739:53cb with SMTP id i6-20020a1709064fc600b00722e73953cbmr8419948ejw.128.1655992104635; Thu, 23 Jun 2022 06:48:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655992104; cv=none; d=google.com; s=arc-20160816; b=t4bz+7MK8kX4YwIAgM0EwNUMTCTQoI+Za9I7/bXKDr72dhE3Jm9xF9GvPi64zIEjBE g6AGnkSrPKOk1PUFzhWWP/8h2qElSn2GN4qPqbU08I510o+ndzGsPIsTW541IC5RAfh+ 8nCyEcQfomoEA1pnvjCM1hLuTKptVZ1RK2E60mG07sQNDPliVixxDENfUozkMUvTj79O dZmaH8H7X9doRGDUj4sL2A6ZdUCGAM6G+vAc8hEY1EMa9C7K/ui95ElMk63ObwcpP6BR ovP9vIb+UqEmDy3ljoUXX+HgsFUzzdkzztjQjLcSGIAL1jxFuWkG04YCSByhhbZq7EL4 YCKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=5t2ZxfOWJflPUwbwmmwOCJqpVPf2KbpUPVzEuVvJJGc=; b=r7gY+US48WzsSKjhLgV0lRfUj+3ILbxjWlIzoobwQ4OIS0WNCeS+tyHhfNi7704CyE YEGElTIef6Ojtq9PAa9kHUcdl8v0lh+DdF6FXQdTW/73CrV3FF2lyLmYqiBoDHTt3B2q 4ac8AMDjYLQcvc/Gm/VICWCL/pvbJnIQWOTCb15aTwNqRbCIVtOrQhLc4tMYnWm2ytii 2BAmAoealBYROwGBvTgUpsMIFjlWorzIFvtWgPR3ga7bvWoo1AbYzZE4qGIp4oBzeL1w dzAtp9893+P2ahBTTp3BYWKDAXTJ3TXuRoLRIWKQn7iGNF4UdtHf/7EixDVsvCh8poWg Vajw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dz13-20020a0564021d4d00b00435d76df983si251777edb.410.2022.06.23.06.47.58; Thu, 23 Jun 2022 06:48:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231516AbiFWN2Y (ORCPT + 99 others); Thu, 23 Jun 2022 09:28:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231219AbiFWN2Q (ORCPT ); Thu, 23 Jun 2022 09:28:16 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13CC8BF60; Thu, 23 Jun 2022 06:28:04 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 87A4D67373; Thu, 23 Jun 2022 15:28:00 +0200 (CEST) Date: Thu, 23 Jun 2022 15:28:00 +0200 From: Christoph Hellwig To: Dexuan Cui Cc: Christoph Hellwig , "m.szyprowski@samsung.com" , "robin.murphy@arm.com" , "iommu@lists.linux-foundation.org" , "linux-kernel@vger.kernel.org" , "linux-hyperv@vger.kernel.org" , "Michael Kelley (LINUX)" , Andrea Parri , Tianyu Lan Subject: Re: [PATCH] dma-direct: use the correct size for dma_set_encrypted() Message-ID: <20220623132800.GA9262@lst.de> References: <20220622191424.15777-1-decui@microsoft.com> <20220623054352.GA12543@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 23, 2022 at 07:00:58AM +0000, Dexuan Cui wrote: > It looks like commit 4a37f3dd9a831 fixed a different issue? > > Here my patch is for the latest mainline: > > In dma_direct_alloc()'s error handling path, we pass 'size' to dma_set_encrypted(): > out_encrypt_pages: > if (dma_set_encrypted(dev, page_address(page), size)) > > However, in dma_direct_free(), we pass ' 1 << page_order ' to dma_set_encrypted(). > I think the ' 1 << page_order' is incorrect and it should be 'size' as well? Indeed. I've applied the patch now.