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 737C9C433EF for ; Tue, 21 Sep 2021 15:49:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5B82F610A1 for ; Tue, 21 Sep 2021 15:49:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234227AbhIUPu6 (ORCPT ); Tue, 21 Sep 2021 11:50:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:38942 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229804AbhIUPu5 (ORCPT ); Tue, 21 Sep 2021 11:50:57 -0400 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 Cc: Joerg Roedel , Will Deacon , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org 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") Content-Type: text/plain; charset=US-ASCII 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.