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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 54689C04A6A for ; Sat, 12 Aug 2023 05:02:35 +0000 (UTC) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=Q2qUpeee; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4RN7nk03j7z3cP5 for ; Sat, 12 Aug 2023 15:02:34 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=Q2qUpeee; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=linux.intel.com (client-ip=134.134.136.65; helo=mgamail.intel.com; envelope-from=baolu.lu@linux.intel.com; receiver=lists.ozlabs.org) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4RN7ml0DF9z2yTN for ; Sat, 12 Aug 2023 15:01:42 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691816503; x=1723352503; h=message-id:date:mime-version:cc:subject:to:references: from:in-reply-to:content-transfer-encoding; bh=8ESbiLHr+YCgav0uKLzgJWB6fuptDUr8xuFAEutcc9g=; b=Q2qUpeeeVcg0rbru/Sfd3TJ44v2iNUzy/oq9SaJA3dsUpEhwZ7UA6KX8 6HVIuCU8GrTz6FiHKLLQmAVwIcaTBZhURDFRUmh2n4Frcq9v6828F8vob CkCm8+gp/8d8I3lYf2tnBu0lXQly+lBwYXc716WAUwxENfisfyUm+yj8J WVM73seRhwHGnPM76dwPVcTXSVZ35Id78PNG+JsgdRgUwsuehaCeHP40V EITbmTQQYH1ntpANiTZWxeBNHYAzWy0LxO7jVpL91MH/5WISq5xMjjBR+ tFo/z0mnU9c2YJWySbX89QHrSTwURFxNU91+pswXtgr5XU7bw+VL+FAQ8 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10799"; a="375513679" X-IronPort-AV: E=Sophos;i="6.01,167,1684825200"; d="scan'208";a="375513679" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Aug 2023 22:01:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10799"; a="767872740" X-IronPort-AV: E=Sophos;i="6.01,167,1684825200"; d="scan'208";a="767872740" Received: from blu2-mobl.ccr.corp.intel.com (HELO [10.254.214.60]) ([10.254.214.60]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Aug 2023 22:01:26 -0700 Message-ID: Date: Sat, 12 Aug 2023 13:01:24 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Subject: Re: [PATCH v6 15/25] iommufd/selftest: Make the mock iommu driver into a real driver Content-Language: en-US To: Jason Gunthorpe , Andy Gross , Alim Akhtar , Bjorn Andersson , AngeloGioacchino Del Regno , Baolin Wang , Christophe Leroy , Gerald Schaefer , Heiko Stuebner , iommu@lists.linux.dev, Jernej Skrabec , Jonathan Hunter , Joerg Roedel , Kevin Tian , Konrad Dybcio , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-s390@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, Russell King , linuxppc-dev@lists.ozlabs.org, Matthias Brugger , Matthew Rosato , Michael Ellerman , Nicholas Piggin , Orson Zhai , Rob Clark , Robin Murphy , Samuel Holland , Thierry Reding , Krishna Reddy , Chen-Yu Tsai , Will Deacon , Yong Wu , Chunyan Zhang References: <15-v6-e8114faedade+425-iommu_all_defdom_jgg@nvidia.com> From: Baolu Lu In-Reply-To: <15-v6-e8114faedade+425-iommu_all_defdom_jgg@nvidia.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thierry Reding , Niklas Schnelle , Steven Price , Nicolin Chen , Dmitry Osipenko , baolu.lu@linux.intel.com, Marek Szyprowski Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On 2023/8/3 8:08, Jason Gunthorpe wrote: > +/* > + * Register an iommu driver against a single bus. This is only used by iommufd > + * selftest to create a mock iommu driver. The caller must provide > + * some memory to hold a notifier_block. > + */ > +int iommu_device_register_bus(struct iommu_device *iommu, > + const struct iommu_ops *ops, struct bus_type *bus, > + struct notifier_block *nb) > +{ > + int err; > + > + iommu->ops = ops; > + nb->notifier_call = iommu_bus_notifier; > + err = bus_register_notifier(bus, nb); > + if (err) > + return err; > + > + spin_lock(&iommu_device_lock); > + list_add_tail(&iommu->list, &iommu_device_list); > + spin_unlock(&iommu_device_lock); > + > + bus->iommu_ops = ops; > + err = bus_iommu_probe(bus); By the way, bus_iommu_probe() has been changed in iommu-next, so it needs to be rebased here. Best regards, baolu