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 X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=BAYES_00,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3C882C433EF for ; Tue, 21 Sep 2021 15:49:33 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D83EC61183 for ; Tue, 21 Sep 2021 15:49:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D83EC61183 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id A559160757; Tue, 21 Sep 2021 15:49:32 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sgwKJivDmKIx; Tue, 21 Sep 2021 15:49:31 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp3.osuosl.org (Postfix) with ESMTPS id AC4B56058C; Tue, 21 Sep 2021 15:49:30 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 93C50C000F; Tue, 21 Sep 2021 15:49:30 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 2A60FC000D for ; Tue, 21 Sep 2021 15:49:30 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 1A06580E19 for ; Tue, 21 Sep 2021 15:49:30 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id c1EFm9TP4pIu for ; Tue, 21 Sep 2021 15:49:29 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp1.osuosl.org (Postfix) with ESMTPS id 8F5EA82EFC for ; Tue, 21 Sep 2021 15:49:29 +0000 (UTC) Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1398A6115A; Tue, 21 Sep 2021 15:49:29 +0000 (UTC) Received: from sofa.misterjones.org ([185.219.108.64] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mSi1P-00C4jN-1P; Tue, 21 Sep 2021 16:49:27 +0100 Date: Tue, 21 Sep 2021 16:49:26 +0100 Message-ID: <87fstyudx5.wl-maz@kernel.org> From: Marc Zyngier To: Sven Peter Subject: Re: [PATCH] iommu/dart: Remove iommu_flush_ops In-Reply-To: <20210921153934.35647-1-sven@svenpeter.dev> References: <20210921153934.35647-1-sven@svenpeter.dev> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: sven@svenpeter.dev, joro@8bytes.org, will@kernel.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Cc: Will Deacon , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" On Tue, 21 Sep 2021 16:39:34 +0100, Sven Peter wrote: > > apple_dart_tlb_flush_{all,walk} expect to get a struct apple_dart_domain > but instead get a struct iommu_domain right now. This breaks those two > functions and can lead to kernel panics like the one below. > DART can only invalidate the entire TLB and apple_dart_iotlb_sync will > already flush everything. There's no need to do that again inside those > two functions. Let's just drop them. > > pci 0000:03:00.0: Removing from iommu group 1 > Unable to handle kernel paging request at virtual address 0000000100000023 > [...] > Call trace: > _raw_spin_lock_irqsave+0x54/0xbc > apple_dart_hw_stream_command.constprop.0+0x2c/0x130 > apple_dart_tlb_flush_all+0x48/0x90 > free_io_pgtable_ops+0x40/0x70 > apple_dart_domain_free+0x2c/0x44 > iommu_group_release+0x68/0xac > kobject_cleanup+0x4c/0x1fc > kobject_cleanup+0x14c/0x1fc > kobject_put+0x64/0x84 > iommu_group_remove_device+0x110/0x180 > iommu_release_device+0x50/0xa0 > [...] > > Fixes: 46d1fb072e76b161 ("iommu/dart: Add DART iommu driver") > Reported-by: Marc Zyngier > Signed-off-by: Sven Peter Thanks for addressing this so quickly. Acked-by: Marc Zyngier Tested-by: Marc Zyngier M. -- Without deviation from the norm, progress is not possible. _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu