From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7708CC43334 for ; Thu, 23 Jun 2022 13:28:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231283AbiFWN2R (ORCPT ); Thu, 23 Jun 2022 09:28:17 -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) Precedence: bulk List-ID: X-Mailing-List: linux-hyperv@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.