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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 EA773C4332F for ; Thu, 13 Oct 2022 01:09:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:To:Subject:Cc: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=GfUSJ5vu+EhXsXXEskIlyC4Rm9Ptgp1Yf90pDSqAlTk=; b=h9WhrlDCPdOXCz XvNR12Fyo1QSE+f8OcG4J2pqcbgDLdQrGq8wMEOuxcS0ms1hC5n1wjL3HEZpBvVi+P98NWgsWeevm P30z/HewAwmWSbLY9VhVu2dSZhlijSFTV2cYqbR+N8peesgleK9BMptAVqWQpkV/6e/liQOyGYq86 vDx0I03tZ4r7LQpW8mtqmDjIF77I3mNOxCBizRxU9tkzkaj1AQymtwROGYnr52MchB8s64DYhO3h/ xtIRC57Bdc9+WZvJRQL6dFuGv5ETuHuBPy3WXni0OR2RMTO7zmX0UvUZ+rh3wblRBO/4dKIHaBE4b 7VOQ4hxzu6TVrhSUzVhQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oimhs-00A67G-Ha; Thu, 13 Oct 2022 01:08:16 +0000 Received: from mga17.intel.com ([192.55.52.151]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oimhp-00A66T-Kf for linux-arm-kernel@lists.infradead.org; Thu, 13 Oct 2022 01:08:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1665623293; x=1697159293; h=message-id:date:mime-version:cc:subject:to:references: from:in-reply-to:content-transfer-encoding; bh=sI7uA/BF8g87pdoZDXo20zv0ZMkz5SEoNiAKN8ktSaI=; b=T8PEYYHetBZye38uNgebja/MnOXWCC0ULh6XLK+lB2rA3dnXM7i7k0x/ qYWNPX6iCV7XawimWQES3ei9Mhqq2SR6eJk1D0weQ9lssXBVum5mvebvl PZEqhAfCeJYyh+WEW6frIf5QO96Zya5YdnGqLCt2naOKPU35OYk9a2jaV 45OsVy7vADPQR84fPLDsiHcpGZw/RuHOZvIVQto07nLsQSgHYdzyXBXn4 wQ9wj633gLyrIw7Fs2Bwz34Jk9AxbzdB7hGU0p4WPFcCH/Z/lxtBFbLkd 7Wmy6dfPW466F/0oE5X0xhNS+eMyMQKBFzwgBJRYvgWDA4+cOaOh3mG4y g==; X-IronPort-AV: E=McAfee;i="6500,9779,10498"; a="285330881" X-IronPort-AV: E=Sophos;i="5.95,180,1661842800"; d="scan'208";a="285330881" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2022 18:08:11 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10498"; a="621972685" X-IronPort-AV: E=Sophos;i="5.95,180,1661842800"; d="scan'208";a="621972685" Received: from blu2-mobl3.ccr.corp.intel.com (HELO [10.254.210.100]) ([10.254.210.100]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2022 18:08:07 -0700 Message-ID: <9f3acdbc-26a5-46a1-bdbf-0a66bb7b43dd@linux.intel.com> Date: Thu, 13 Oct 2022 09:08:05 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.2 Cc: baolu.lu@linux.intel.com, joro@8bytes.org, will@kernel.org, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, kevin.tian@intel.com, suravee.suthikulpanit@amd.com, vasant.hegde@amd.com, mjrosato@linux.ibm.com, schnelle@linux.ibm.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 05/16] iommu: Move bus setup to IOMMU device registration To: Alex Williamson , Robin Murphy References: <20221012102841.478c2b3b.alex.williamson@redhat.com> Content-Language: en-US From: Baolu Lu In-Reply-To: <20221012102841.478c2b3b.alex.williamson@redhat.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221012_180813_715560_79731626 X-CRM114-Status: GOOD ( 11.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Alex, On 2022/10/13 0:28, Alex Williamson wrote: > On Mon, 15 Aug 2022 17:20:06 +0100 > Robin Murphy wrote: > >> Move the bus setup to iommu_device_register(). This should allow >> bus_iommu_probe() to be correctly replayed for multiple IOMMU instances, >> and leaves bus_set_iommu() as a glorified no-op to be cleaned up next. >> >> At this point we can also handle cleanup better than just rolling back >> the most-recently-touched bus upon failure - which may release devices >> owned by other already-registered instances, and still leave devices on >> other buses with dangling pointers to the failed instance. Now it's easy >> to clean up the exact footprint of a given instance, no more, no less. >> >> Tested-by: Marek Szyprowski >> Reviewed-By: Krishna Reddy >> Reviewed-by: Kevin Tian >> Tested-by: Matthew Rosato # s390 >> Tested-by: Niklas Schnelle # s390 >> Signed-off-by: Robin Murphy >> --- >> >> v4: Factor out the ops check in iommu_device_register() to keep the loop >> even simpler, and comment the nominal change in behaviour >> >> drivers/iommu/iommu.c | 55 +++++++++++++++++++++++-------------------- >> 1 file changed, 30 insertions(+), 25 deletions(-) > This introduces the below lockdep spat regression, bisected to commit: > > 57365a04c921 ("iommu: Move bus setup to IOMMU device registration") > > This can be reproduced with simple vfio-pci device assignment to a VM > on x86_64 with VT-d. Thanks, Thank you for reporting this. I have proposed below fix: https://lore.kernel.org/all/20220927053109.4053662-1-baolu.lu@linux.intel.com/ Does it work for you? Best regards, baolu _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel