Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2547930rdb; Mon, 5 Feb 2024 09:45:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IFPxrn+3IUq0o7mbB2iQcbR5bKwGJJTbOzHw1Z8A4Ps5iaON1QJdU/VeMak3ZDd2tkiyhRx X-Received: by 2002:a17:906:e8d:b0:a36:f480:40e5 with SMTP id p13-20020a1709060e8d00b00a36f48040e5mr92296ejf.46.1707155139616; Mon, 05 Feb 2024 09:45:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707155139; cv=pass; d=google.com; s=arc-20160816; b=f8e4DdpHLzgzTp2DeItM5S1njal7qrmHbCnJ3sBsd0oOze5B7fYyUIGk/nbeYiOTvv EDaqkWVaS+AI/OQ7NXksltzXYimR3nIzJn8PDvSPInQMJgXVAWCM4UAWc/sbtfSg6aHE /fBRJbmDg5YN24hItSYfry0H0wpVTwZsi3WuIJx2U9pqukonPOdk7DuKw7xqSSz/BqGi 1ga8ipWg5qJduQbpAG3Fp0ZzqJta5aKM/LwLXhfkw5AkfdLawXVcX9rnqSrrvvIoExhy PDcFdxJbOaDsf+acq6MLjonB/1ZpcN4xRVrSCEWaLweYayCm7PtTYktFA4/SyGWKypBe hspA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=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=Kr2vrWVlUyntHvMw7Si5zE2PHtWM0mT+einhFyctsMw=; fh=0D5iPGBUFAuzLfMVHG7SlHM2vdVBp4qcUq0wq4fnk1A=; b=hQVV9PI+CRaHIHNCxITEuk8HZqiN0W1u4TFHX0+BX3Gy/H86OE1DK+YRTwFwzUZYdt cGkRqH5SB6hrSQwLhooC9ai6gbD2dE7qniLOrnZywxxOLLa0XWsiThO4fKN2H8AkXrkL dI2SI5IRg0WxIcSHsF4pxOdtp91jdIb/EQbNlS93qYXIqTvapAowjTqj1t9ky2FouozH OvYXw7MOf29RyOff9Aq82CosA+YogrcG8W60Za5Rg/3WzCJsVOUq52xYs2ugfE+PC4RJ Y+qYiwdjXv1v0zs7R/+T0QAqII69yKW/h+ziKdncZSTVk4o8uRtGZV9NAwvxoaLDPCAa L5cA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=jsMRoJ2z; arc=pass (i=1 spf=pass spfdomain=ziepe.ca dkim=pass dkdomain=ziepe.ca); spf=pass (google.com: domain of linux-kernel+bounces-53140-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-53140-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCXNs6BEmTpg2Hirvef2wS1JqL/PzOuLyhok7KRVY6OtMLbZa1FqBqc2fmgO4j8bf4mQLV5/1tf0MgDBmR2UwyRYGW88PQ6a133YcTdmig== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id u14-20020a1709063b8e00b00a37d8e3c5b0si70368ejf.4.2024.02.05.09.45.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 09:45:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-53140-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=jsMRoJ2z; arc=pass (i=1 spf=pass spfdomain=ziepe.ca dkim=pass dkdomain=ziepe.ca); spf=pass (google.com: domain of linux-kernel+bounces-53140-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-53140-linux.lists.archive=gmail.com@vger.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 5E2AA1F23C6F for ; Mon, 5 Feb 2024 17:45:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6295147F65; Mon, 5 Feb 2024 17:45:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="jsMRoJ2z" Received: from mail-qv1-f44.google.com (mail-qv1-f44.google.com [209.85.219.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1AF9B47F55 for ; Mon, 5 Feb 2024 17:45:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707155110; cv=none; b=tBJDY9nGfpZCdaCKGJY5qpcqTmiB3i35dUYLvmq6HFQnMSLNPrNQ74OzTbsrYFLfUXv8Ggm7A0/bU57cFIJL28mbY4t+qXSAXCvt7XS9DV8bMTdhZjEk8sI1kiC7aqAiVyPwPT1RSmfhuC+IVtw7acDk8BMX70fIupdW43SbnqY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707155110; c=relaxed/simple; bh=Kr2vrWVlUyntHvMw7Si5zE2PHtWM0mT+einhFyctsMw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=shC0KE4KeCKzYxdgrloo36NZSPllljBSxnBuROtmlURmKnU07iviwBY0/g1aq5MQMYqG0bYzOm9Oy4HxLk4PVB/QShY8ps4NlaB0IYyKpECnKljqAatnPkcNzLn5cM+UJWOuJzn6ud1wbc4LVx6wEYmcXhcrK/bbbhVFp9hr+/g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca; spf=pass smtp.mailfrom=ziepe.ca; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b=jsMRoJ2z; arc=none smtp.client-ip=209.85.219.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ziepe.ca Received: by mail-qv1-f44.google.com with SMTP id 6a1803df08f44-6818aa07d81so28932536d6.0 for ; Mon, 05 Feb 2024 09:45:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1707155108; x=1707759908; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Kr2vrWVlUyntHvMw7Si5zE2PHtWM0mT+einhFyctsMw=; b=jsMRoJ2zE4vu6qmvUlqL8POfKb3VpE+2XVEC27n8vACxFPeGElYxUmvZildNnYoOu/ J0VXY7zabjx+mmzFpc5OzHviOd3oelQl0StOaqYOyTAx4Y2sjpR4O8NTbnPIRgU7cMFi m86nLowDbBv45N/VYMWjMosC/bx63oYAKOjY1MJSRQrfEgNb9eAaxmw0AIQEqs0XOvfV DEzIWfy8nlcLvSwffjoCHCXPxdpDQp8+bqrPkSw906iWVvfASo9KV8SlYE93YtDa0zw5 tjZ/WKWsXa4ksUpLky7m7YNQl0BbjxoJEMuOv0SHDn8GDRT7R/TkZEnwO+295HTLauhT EbCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707155108; x=1707759908; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Kr2vrWVlUyntHvMw7Si5zE2PHtWM0mT+einhFyctsMw=; b=gf6sTd3z7ANczlwIWH9GnfNzeM7//Oek3Dx4+1IS81IMKxYeOqiHu8lyzHx4MhgDRn 5Lkzpi2uCTTxoNaEpvnQpNhVlv6aYJuO0PafyfwfuS4BzyPWkiKK+rp4nRkxfycKvaR9 6uy5+WmYN5QyC2AkjT/maRdSQlz4l7JTh6zpJAwEXxgse4X3cZJLfdf1Ma8ursCcqcNO xrHMS3TuNofb1byBMtKjiqqOKBSmGnp8Obtzh/Jr7J/qeaoUN0zQPMJlcZMjm93oqoUE unf8oL3jBVHCdQK7+qRG9qn+paplLWLfGWlhoGQFnk4HITktTOJF5vX/FWif5n+f62AF 4nKQ== X-Gm-Message-State: AOJu0Yz9sjTjEG1oNWj/BAngqbvJdD8cXvnQEvJnnDzsL9+U+nhGlQam QIEIIJAaCXCPjJn4Kf4E6W0CdzUveeYDuMIt/1gSjnwe4CeTt7NxJP0a+Y0X7UI= X-Received: by 2002:a0c:e14b:0:b0:68c:850d:7e12 with SMTP id c11-20020a0ce14b000000b0068c850d7e12mr85628qvl.50.1707155107926; Mon, 05 Feb 2024 09:45:07 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCWYPsWNFHv61exg+gMCQoag7gBZCOBqvyfZr1G9u+oPjqyrOwq3LYPfZ8DHnZ3lXGCW2H019rMJwKaxvLdC5XJN8bQPMtNx4sk0ynWnOH6QQ0slFrl5Ptdld6MfH+LsWOHXY6wGQ6IS12X4C5mk7za1Dt+B8lfZb10uQeB7pc/qZi7KKSgE4gi5/CGlXF+4KBrVRqMRlkZd5pnzVvhMFtp+/ID8YmfxZrrlM0m4QZoS0fYfjZl2v7d6XT0Gx8rUoXS0m9BTSzGFi8JG1cntWWEOJqGd7n7hHxxx4nUep3NwoA6HXavGEL5rXEZrdH+4UAd5sTZupOuxdbJV7A27rTBK67ACC96kircN6b9iBI1gGhtBpK9vNzQrHhudWql3BnS1EE1AS6aSX0WJ9rQHdrdmf3f9tnqcPEtENeciOx5OKeqVX5FAJReENYnTCNdQvPLNQer06oyzN3teSNcXQ48e1ehHBdIWISjJ7sB2lCzU73LG6HbNiR6oXT2JmXEqVaaiqtvL9iLUZ27KHPnSmSugFdYit9jQu51JSiHQgMtqIEKWj8uDuoLdyqhILWFR2ijsYJiEOHPgbH/hy+qkOlatgS3FAMrr+S/UgXx1wrJIAxxRZPk41WEdoxjJjHo8C0dZRbsUwVnhWcFMQZxRkFnSxxmnzmE6FnjNBZzNic9S6vFkSUtAKElK/+YSZSgxAevXVtsRW/5Env/IJqiTts//EICbFYy2RiY+TC0rAd9SM2NM Received: from ziepe.ca (hlfxns017vw-142-68-80-239.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.68.80.239]) by smtp.gmail.com with ESMTPSA id lx13-20020a0562145f0d00b006819bb31533sm176462qvb.99.2024.02.05.09.45.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 09:45:07 -0800 (PST) Received: from jgg by wakko with local (Exim 4.95) (envelope-from ) id 1rX31n-000fbS-19; Mon, 05 Feb 2024 13:45:07 -0400 Date: Mon, 5 Feb 2024 13:45:07 -0400 From: Jason Gunthorpe To: James Gowans Cc: linux-kernel@vger.kernel.org, Eric Biederman , kexec@lists.infradead.org, Joerg Roedel , Will Deacon , iommu@lists.linux.dev, Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, Paolo Bonzini , Sean Christopherson , kvm@vger.kernel.org, Andrew Morton , linux-mm@kvack.org, Alexander Graf , David Woodhouse , "Jan H . Schoenherr" , Usama Arif , Anthony Yznaga , Stanislav Kinsburskii , madvenka@linux.microsoft.com, steven.sistare@oracle.com, yuleixzhang@tencent.com Subject: Re: [RFC 11/18] dma-iommu: Always enable deferred attaches for liveupdate Message-ID: <20240205174507.GD31743@ziepe.ca> References: <20240205120203.60312-1-jgowans@amazon.com> <20240205120203.60312-12-jgowans@amazon.com> 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: <20240205120203.60312-12-jgowans@amazon.com> On Mon, Feb 05, 2024 at 12:01:56PM +0000, James Gowans wrote: > Seeing as translations are pre-enabled, all devices will be set for > deferred attach. The deferred attached actually has to be done when > doing DMA mapping for devices to work. This shouldn't be part of your solution.. A DMA API using driver should never be attached to a device that is being persisted across a kexec. If it does then the device should be fully reset and re-attached to the normal DMA API iommu domain. You should be striving to have an iommu_domain to represent the special post-kexec translation regime. Jason