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 06CB6C433FE for ; Tue, 25 Jan 2022 03:16:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1320545AbiAYDNR (ORCPT ); Mon, 24 Jan 2022 22:13:17 -0500 Received: from mga04.intel.com ([192.55.52.120]:38508 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381285AbiAYDAo (ORCPT ); Mon, 24 Jan 2022 22:00:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643079644; x=1674615644; h=cc:subject:to:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=hcjXanRyyzUabhBOjDATgrq+wFYZUEv0LZVR5v+RCiM=; b=WMt64R1HH3cQvA1FW2Xnmp6sdqYJxAwyImTvxQS3lNi+SabtULNESSDQ 2PT7IAF8NOP93DbdVKOvNcA+B3Epuy+Huh0UKeb3vI0P64zPIKFiFdKG0 8LCexSdDqS9Z7EFznoSF6t7xRmbHhOMDaJYuNTl2/o5O+6ud87/af+hg3 DXT8IGM5RCf3r7AZlYvOLKNiIIgoTBtKJlyESbwqPHRXPKyh2pce8nK0r I0239VzXjhODGQrX9ZevfhDGffM9c7niaOKwkWfNOrRClPByGImXDc0zg Pr2DaAEpcbvfIRMyc8tZZap2+VkdHnsVSIYrLovujBKANTquVGB3XoDps Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10237"; a="245039202" X-IronPort-AV: E=Sophos;i="5.88,313,1635231600"; d="scan'208";a="245039202" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jan 2022 19:00:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,313,1635231600"; d="scan'208";a="534530804" Received: from allen-box.sh.intel.com (HELO [10.239.159.118]) ([10.239.159.118]) by orsmga008.jf.intel.com with ESMTP; 24 Jan 2022 19:00:34 -0800 Cc: baolu.lu@linux.intel.com, Joerg Roedel , Jason Gunthorpe , Ben Skeggs , Kevin Tian , Ashok Raj , Will Deacon , Robin Murphy , Alex Williamson , Eric Auger , Liu Yi L , Jacob jun Pan , David Airlie , Daniel Vetter , Thierry Reding , Jonathan Hunter , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 5/7] drm/nouveau/device: Get right pgsize_bitmap of iommu_domain To: Christoph Hellwig References: <20220124071103.2097118-1-baolu.lu@linux.intel.com> <20220124071103.2097118-6-baolu.lu@linux.intel.com> From: Lu Baolu Message-ID: <5977c231-fbd3-ac26-ff13-94ed7a08f347@linux.intel.com> Date: Tue, 25 Jan 2022 10:59:34 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/24/22 5:29 PM, Christoph Hellwig wrote: > On Mon, Jan 24, 2022 at 03:11:00PM +0800, Lu Baolu wrote: >> The supported page sizes of an iommu_domain are saved in the pgsize_bitmap >> field. Retrieve the value from the right place. >> >> Signed-off-by: Lu Baolu >> Reviewed-by: Robin Murphy >> Link: https://lore.kernel.org/r/20211218074546.1772553-1-baolu.lu@linux.intel.com > > Looks good: > > Reviewed-by: Christoph Hellwig > > Wouldn't it mke sense to remove the pgsize_bitmap in struct iommu_ops > and initialize the domain field in the domain_alloc methods? Or am I > missing something? > It looks reasonable to me. The pgsize_bitmap is an attribute of a domain that provides the map/unmap interfaces. It could be moved out of the iommu_ops structure. Best regards, baolu