Received: by 2002:a05:7208:70d5:b0:7f:5597:fa5c with SMTP id q21csp1268786rba; Fri, 22 Mar 2024 08:55:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXD+Nws4sswxU6zBvQP7ia8bn3LoAfA5tLIU5qKmndokTgGAmC/lqaCwVZedt0cFy0Z7piQcmtwYZZxrjm6etlQ0i4Mupkm0lDj/2xDjQ== X-Google-Smtp-Source: AGHT+IFUJmoN8ZgTkepFgTo1EgBfthzymBwIxI5SryuTDCmMJ6lH9Cypnn/PwlYTvVTY/Yr3Iz65 X-Received: by 2002:ad4:5942:0:b0:691:837c:a140 with SMTP id eo2-20020ad45942000000b00691837ca140mr2833586qvb.64.1711122941041; Fri, 22 Mar 2024 08:55:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711122941; cv=pass; d=google.com; s=arc-20160816; b=GT58ewOk6gh0EDSFlzq0ScK49JDXCdFCAoZe2ekfRLCGhAmEFtMEnqHFSeOPol70gE dGFz4BMSJTi3IcXV6EqtnrpGa76U0ioIpscDoiGZjqzdSXiG5uo2dsepq/D2pKtmGM4u eQYH4tBcempY9QlcwtE7/HMSU5fd0rIaNgUhA7blPJxjrjDfCSrWC0RGQwUXwe11OuZG GijLrr4sdEa9NDQWpQy0ReBd9lDFUqSBtEQyVw0ORGiNa3crlWCEoCh1X9YBo5JYpWE0 Azy0TjUl5kZ1cpp147bUp+eDA1YZR7/2TVsEwxm0atKh/BUeNs8lXMtF4qb/ht/7lFK6 1uuQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=PGWFWYsqYPVGLIzHKko/RGWwUmBfI+5FDMmKLhYTaxw=; fh=faC7k3L+MYchKD0LgFdVMWQxQtrw7s5zlD5vYhCcieU=; b=EektpJ2LxhQvFJVL0oRMOLKE73+no2xwcFR0u87DF6SWuuWjEvCX/ErAzNYvsnqd1q GU6N0gN7Yhxx6H6cJin/l2XQgoGg0t6P6IFroswfrThK2Qe61nlErugZ2pgoEMzocNeu RQQzD7gC2/mIFPTdHlIF3RIMBu+r/qJK8yFjzTBrf3oOy16n4dFTgVRE7XZ3kj6oCmtA VP7j9BlVB1qRWGdl0WBSFoqb6aMMEe9dNBgj97pEtwNbYWmHh1lWEV1d05sT3RWnRPlU dRZ8ivPZFluRvpoQvvS8Aut+IsmmCMgEYrSlh8LTyeOAXwvQjIZF+DVO7XDJp+YjHjAy OI/A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sjwCIOQa; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-111732-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111732-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id gh7-20020a05621429c700b006916876f0a1si2301838qvb.121.2024.03.22.08.55.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 08:55:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-111732-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sjwCIOQa; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-111732-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111732-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id A42A51C22989 for ; Fri, 22 Mar 2024 15:55:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E0EDA56754; Fri, 22 Mar 2024 15:55:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="sjwCIOQa" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 08CCC54919; Fri, 22 Mar 2024 15:55:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711122935; cv=none; b=S4kNedhZxs8MGJ4ZhMNUpfV+WuhTw5TJ+IkPi6pdG+F7SwAHEBnLOKsMdHR85DhuUuvQS1fwjV3mKgnQnPhuXcpMecrKWtqWnXHkpaeXIAvhBRBZmJ26OaNlNLveC1iDxFlXCapeoXYbYvf1USQrxMDIE9EdUDuyXiNktIFmBo4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711122935; c=relaxed/simple; bh=KBxbC04wRzWWwKvLE9KMw4YX1znbdo8yfBBNgMOfrII=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=QjbyfH83umUz8Xpq0fnYf6+J/mygtBJ0ayWSWYBH4gQdyd2BCrXp3sfbTDkxwD6v2gCSI+FVssr0KAHXtLm3LCWsbEugI9I3Aig+S5iB0vxKBOSfIVb63B+ZtZfz9vSZciwBMmKgn/BAdBMdyy0rCkYDty9ATDz7SQmH5Mee+jE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=sjwCIOQa; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id BDB1DC43390; Fri, 22 Mar 2024 15:55:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711122934; bh=KBxbC04wRzWWwKvLE9KMw4YX1znbdo8yfBBNgMOfrII=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sjwCIOQa4pcZ9lcWhOvJXf7sUt7tYQ0s7MDOdyVy7+NPkDN7E0HpkRFLsAeINXqP1 Qk020GAQ6KK+5cI572KTCPOfrW5YZcaHcSmNLBCK8f51BA5FCSsKSQpHnpP9iiyzJO 9ulMVTEY3wdUE8bqK90PrE4DFVp/J7LMBq5yJtipiWLHklZ5tWcxm/aXUGqb9ZWlRq Jz3jIjiKH0nHLUJdLpFJEyc+Ji2LuRp5QGQrGK45C0bI66WQoupjR7jTejbxF24thL oaHtxiYe0VExQdZhGS1LYIvfQe/Bc6Ct4fDRv/QvqUVJSwiq5xM34li0mnAhf8SmeM 8nA+ZSE9F/7Vg== Date: Fri, 22 Mar 2024 15:55:29 +0000 From: Will Deacon To: Jason Gunthorpe Cc: Robin Murphy , Tyler Hicks , Jerry Snitselaar , linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, Dexuan Cui , Easwar Hariharan Subject: Re: Why is the ARM SMMU v1/v2 put into bypass mode on kexec? Message-ID: <20240322155529.GE5634@willie-the-truck> References: <120d0dec-450f-41f8-9e05-fd763e84f6dd@arm.com> <20240319154756.GB2901@willie-the-truck> <20240319175007.GC66976@ziepe.ca> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240319175007.GC66976@ziepe.ca> User-Agent: Mutt/1.10.1 (2018-07-13) Hey Jason, On Tue, Mar 19, 2024 at 02:50:07PM -0300, Jason Gunthorpe wrote: > On Tue, Mar 19, 2024 at 03:47:56PM +0000, Will Deacon wrote: > > > Right, it's hard to win if DMA-active devices weren't quiesced properly > > by the outgoing kernel. Either the SMMU was left in abort (leading to the > > problems you list above) or the SMMU is left in bypass (leading to possible > > data corruption). Which is better? > > For whatever reason (and I really don't like this design) alot of work > was done on x86 so that device continues to work as-was right up until > the crash kernel does the first DMA operation. Including having the > crash kernel non disruptively inherit and retain the IOMMU > configuration. (eg see translation_pre_enabled() stuff in intel > driver) Right, I'm also not thrilled about trying to implement that :) What we have at the moment seems to be good enough to avoid folks complaining about it. For the case Tyler is reporting, though, I _think_ it's just a standard kexec() rather than a crashkernel. Will