Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3990478pxb; Tue, 25 Jan 2022 00:51:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJyFoJpDRcxkNPZbbA0FSmiDpa2gtFB1RwfzOvbrLYueLP0MXlUolmCvBqQKar+BYAZqwawI X-Received: by 2002:aa7:cfd8:: with SMTP id r24mr14593917edy.366.1643100663954; Tue, 25 Jan 2022 00:51:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643100663; cv=none; d=google.com; s=arc-20160816; b=XgM8tfiWSbCzOQSrnT9wnx1jPw+ViEjykOIRKq7L9PFR4CAtIkLBgAziFQBpu0CdFw ngztp6O0YSVVFXqIkvSwpsrJV35wmk2NSRWe7EUJeokfLTtCLDonunIdAolP23TCaFI5 Ktwnr1aQ31JVt96FeXwN3A/d9nUqdyWnO/AndVQhVPgpazoVHViIg85zgo/O3G6L3KpG btwPp/6XlxAOPs73scj/hyX6vnzJ8XS6qDeH/cY6YG2C6e8c8v4y5VAXr4wm37U7ZrWO NdO2VciA52StlgSzP3ee1qLySx1VYCJxTOl7fAFwlB/RfEldooPqiNi+6fZEoWayVZ87 5ebw== 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=KUs4U72Q+/3QWQJVGRAQUl91pAMf7TpE2SNj1yo8p1U=; b=N1C9wsDLtuWFWxHhRDDT+EbDK5Qs32He+WVztqLmYsuyMNMRqvOpcvMyxvvANZjilq w1JB+ePBtGCYBLXo+xca2H6SyGROZFm9HvZpdYAMl4D9yEed1SID2rh/dQBIHTQ//+Oz wD05QiyxMNUgpmA0BV1fb5yisuAlShx0mCGYWXZAMeXtIaBveTl873sjr7O1EsXpM4Zg 9eXBB8heKoEfa7rmuZ//9p4+VUEYhBjQNxPmLy513NBlnspYGC98S1MJZx4k7anVf+wZ A2629JyZQX4fPnlLalo/DVbr2PlIVdmtEXrjEjn0JNIgdCP7EecnzsfJsFu6iIBaCO++ OjRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=V1sZsfiy; 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 o11si1788403ejy.636.2022.01.25.00.50.39; Tue, 25 Jan 2022 00:51:03 -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=V1sZsfiy; 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 S1320871AbiAYDPA (ORCPT + 99 others); Mon, 24 Jan 2022 22:15:00 -0500 Received: from mga01.intel.com ([192.55.52.88]:63761 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1318491AbiAYDGC (ORCPT ); Mon, 24 Jan 2022 22:06:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643079962; x=1674615962; h=cc:subject:to:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=by9ZO+ZTDaK468UmSn4Yi/q3n6O9rPWIIHQ/Z6V2Pus=; b=V1sZsfiyN8T4D944xM4WGXhYmpEpZDUx1MqHjV+E8/dhd55TXlVZnezd IaWQA+xtkppwDTeO2pcMY+va2psU4czhhIk5WwyLELn4KoVy/u9s7c92h I6IHjDsNboQq8SfJ5jiWUV0JLRgNopb8jZ+0urexY1eRu+3b36iVKmsgc Ku5idTD8/91QNevRrQvGrnrf2Hs3/QG74B0tce8sZmNUOsei+e7ANeZRY LyyEIPj6/wpy/w3eyYf8gFEJduryPxBDTkhdyKExBwtiiLJKDwpo7Mf4F Qjm6fhxHOv74kjHDHEE9iWKV9BswPxVO7T85ezbJWOW33E6GFgvtxITzN w==; X-IronPort-AV: E=McAfee;i="6200,9189,10237"; a="270647151" X-IronPort-AV: E=Sophos;i="5.88,313,1635231600"; d="scan'208";a="270647151" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jan 2022 19:02:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,313,1635231600"; d="scan'208";a="534531392" 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:02:03 -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 6/7] iommu: Use right way to retrieve iommu_ops To: Christoph Hellwig References: <20220124071103.2097118-1-baolu.lu@linux.intel.com> <20220124071103.2097118-7-baolu.lu@linux.intel.com> From: Lu Baolu Message-ID: Date: Tue, 25 Jan 2022 11:01:03 +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:32 PM, Christoph Hellwig wrote: > On Mon, Jan 24, 2022 at 03:11:01PM +0800, Lu Baolu wrote: >> The common iommu_ops is hooked to both device and domain. When a helper >> has both device and domain pointer, the way to get the iommu_ops looks >> messy in iommu core. This sorts out the way to get iommu_ops. The device >> related helpers go through device pointer, while the domain related ones >> go through domain pointer. > > Ugg. This really sounds like we should have a different structures for > each set of ops? > Yes. Do this in the following patch. Best regards, baolu