Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3988677pxb; Tue, 25 Jan 2022 00:48:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJzSsjZ0kwjq9rQZN7gr6o2zyBABkKekLsO7Lp6yR3jyzoa8KXikmYyqUuuZAZ2Iw2JGxq0O X-Received: by 2002:a17:90b:3148:: with SMTP id ip8mr2467296pjb.72.1643100512358; Tue, 25 Jan 2022 00:48:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643100512; cv=none; d=google.com; s=arc-20160816; b=wS6IDcNzutTK7ZDptqRi8TgeTvJpH9qxXFtOw9dDOblswo41AVHnxr0GSvbOqbcs3z FV1/RFjIxDHuTXy5DpvpaurwhSL/GqGSAZ1ISqwL99Mk9pzOt9h42F9uv1VOGB7gyRQS cVmWMV/j4+IBurrlgw32SLiSZV0yQ1R4sb2Cja1z6+OgYmgGR/TuYpElmLxUe1hdL9Oa MaXGgs5kKEcWTh4k+jtJaqxZwobFB7WTru70yqCSq3GK22+Ls7PokmfUmUkiY5pxc1Il kTccCrdujXNWVQcZui/Wv4mcr6UztMl6bYWrfPrRv13PNASn5eWO6oj2y+ABhe7H7JIQ b5+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject:cc:dkim-signature; bh=GqI/DqmTCxm24ws6/7kFPEzYi8tF3oMfarORTMYhUAQ=; b=FFgtd+QLqkx8RUcJA06czAoNfPYDmR/hxXw9gvRD7mrameLnRWOmAn2yJOIl7ncgBZ RMMBaFYBARzg2HS6K+tjNQZ3QGPPW2OrZhhV+1aIsb6VX+rMsEl0a0ZiINLZ4PVo6EjC rSOBZhQQWNR7prA8/YB1hXnCE9dL17tq116wqE3swo1Ku34FQgLuOsN8qT5Q4UJ3JhU7 d6m9P3RIuTa2E6hRcJw0NLq5ItD4X6/TNOizxxywWDqaEtgH3ExbdbdU0Bv977ABOM+p pPFOYgwvf96eTC+/D9Se6FFYrGZ4y6Tgsd3wMN1+e5WXmTWaCZig62Odtn1cjTIviZt8 y3JA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=WMt64R1H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g22si5470580pfv.169.2022.01.25.00.48.19; Tue, 25 Jan 2022 00:48:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=WMt64R1H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1320539AbiAYDNQ (ORCPT + 99 others); Mon, 24 Jan 2022 22:13:16 -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