Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp799878rdf; Tue, 21 Nov 2023 17:56:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IFRYsYvvZtdODXgq6g8fh5jDT9y46SkS40IU+1fXgcmA+vsQ2NUmMmUUPhqN/zxaNFdjAT2 X-Received: by 2002:a17:902:b20a:b0:1cf:6ccf:7599 with SMTP id t10-20020a170902b20a00b001cf6ccf7599mr1037729plr.5.1700618175669; Tue, 21 Nov 2023 17:56:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700618175; cv=none; d=google.com; s=arc-20160816; b=e79cVzso5F2JD8dw3WPBV+x/aof5wIo+OcwBQuILPTeue8MPqdyDV2Xh3ZxiNH5sAT 6PsDV+AWZOUwJBE+YCs0YHvQZbqFL8FG9c5ba538vZgKpLSHf7gliIqExnNTkPmwRxgV 5ENMuUCDH2Ri/Diil0hXbj7xvujOor08zDtbKBANHkZIiCEz8XGQvs1J++qSRywet29D KQ8VoOZ//E8av17SCACwZi1dlnQvYweb1Zy1KJPie+PVisgahgJ84XndqDYf5/o4imEO p4xMKGrwJqe/1vxxCnKa4s1fkUPQpp88PoZyGaYQ7VEFoCrXTIqFUOO+4leJw22aUOEx jENA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:cc:user-agent:mime-version :date:message-id:dkim-signature; bh=RIGTkrYQv0F7ipbVk1k6PJoG/Ytxa0wBFEdGKl1iBFM=; fh=9v8MKegBTZX8FudMOFxS4katVcZ/UdGqC3S4kgd/L8U=; b=bAKRa4/L9mzqbAm7pHLlwxKEWfhWHgg5gvl/ZiXQMOyuzhmhBa8UapAO2L3qjd5gZz zxJpaBoAxFMQMXtXlM5Ee6ZXWMocjWHYgC6iVGmfbfdH7iMmemhFEGDU9RtqSMEVAJxG O3k6UuTLYBEgH68NVkNU/PebhzpDckHkOEoOvOC1PH+X/b+KUQVgAgLV5RwQx5R3O6wz Qv31LN2e9XiybFJIFEb6R3Ke/qaA9gaNBT5yXNZhGVy4IGDWDsKRVXYAAdNIV7sTC48M eie1NtIJAYVgDD+u0b8dYlw7Wco+4iU4qLF4lRcE2Z/QoWmZGNakYn7nUneRiu4TuQMK TWrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=TT+BlEEN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id be3-20020a170902aa0300b001bc2fd76db1si11119403plb.65.2023.11.21.17.56.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 17:56:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=TT+BlEEN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 5B20080ECAF4; Tue, 21 Nov 2023 17:56:13 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343493AbjKVBzx (ORCPT + 99 others); Tue, 21 Nov 2023 20:55:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229775AbjKVBzx (ORCPT ); Tue, 21 Nov 2023 20:55:53 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 915E5DD for ; Tue, 21 Nov 2023 17:55:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700618149; x=1732154149; h=message-id:date:mime-version:cc:subject:to:references: from:in-reply-to:content-transfer-encoding; bh=gxF+z61IXTXTtbMXeR8K2hgpRdKrIDL/R0Zmx7ml8xo=; b=TT+BlEENgD0SzVS4ktzW158MedCkUnx8wPmjlci3Fe4rPVIW7TsiawMi xpUnW7c1QwJ9iBxkiMAonM05u+IGwqXj8JAL4tiELbyGhXUPUjqzcx9N8 gwXdEUVTM0RWXafR2kXlobnaBipviW6eM7TFWPDjJ7U6UNcw/Z4AVpVoR YbO0U7v7eBk1ERhslx5ogS67JYqcV7LIFX69TLV8Wp5lx++TNtEyDWGex g7ujvavWfXztpoNkTwNyA/fJxSwSTGaFoRdhPd8+VZ+O98Wb1f9ObvzBI ZIqXqexIBCDVNlFwm16RBoAGG5xbBTWifi1QgwfKkR5OKzcacSDT3/JEo w==; X-IronPort-AV: E=McAfee;i="6600,9927,10901"; a="458459149" X-IronPort-AV: E=Sophos;i="6.04,217,1695711600"; d="scan'208";a="458459149" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Nov 2023 17:55:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10901"; a="1098231951" X-IronPort-AV: E=Sophos;i="6.04,217,1695711600"; d="scan'208";a="1098231951" Received: from allen-box.sh.intel.com (HELO [10.239.159.127]) ([10.239.159.127]) by fmsmga005.fm.intel.com with ESMTP; 21 Nov 2023 17:55:46 -0800 Message-ID: <719ab0c1-e2a8-4446-8b3f-ba751db0ce27@linux.intel.com> Date: Wed, 22 Nov 2023 09:51:27 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: baolu.lu@linux.intel.com, iommu@lists.linux.dev, jgg@nvidia.com, linux-kernel@vger.kernel.org, jsnitsel@redhat.com Subject: Re: [PATCH v6 4/7] iommu: Decouple iommu_domain_alloc() from bus ops Content-Language: en-US To: Robin Murphy , joro@8bytes.org, will@kernel.org References: <6c7313009aae0e39ae2855920990ebf85af4662f.1700589539.git.robin.murphy@arm.com> From: Baolu Lu In-Reply-To: <6c7313009aae0e39ae2855920990ebf85af4662f.1700589539.git.robin.murphy@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 21 Nov 2023 17:56:13 -0800 (PST) On 11/22/23 2:04 AM, Robin Murphy wrote: > As the final remaining piece of bus-dependent API, iommu_domain_alloc() > can now take responsibility for the "one iommu_ops per bus" rule for > itself. It turns out we can't safely make the internal allocation call > any more group-based or device-based yet - that will have to wait until > the external callers can pass the right thing - but we can at least get > as far as deriving "bus ops" based on which driver is actually managing > devices on the given bus, rather than whichever driver won the race to > register first. > > This will then leave us able to convert the last of the core internals > over to the IOMMU-instance model, allow multiple drivers to register and > actually coexist (modulo the above limitation for unmanaged domain users > in the short term), and start trying to solve the long-standing > iommu_probe_device() mess. > > Reviewed-by: Jason Gunthorpe > Reviewed-by: Jerry Snitselaar > Signed-off-by: Robin Murphy > > --- > > v5: Rewrite, de-scoping to just retrieve ops under the same assumptions > as the existing code. > --- > drivers/iommu/iommu.c | 25 ++++++++++++++++++++++--- > 1 file changed, 22 insertions(+), 3 deletions(-) Reviewed-by: Lu Baolu Best regards, baolu