From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6F710606A31D for ; Fri, 23 Oct 2026 13:49:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=lljDlKeM; dkim=pass (2048-bit key, unprotected) header.d=ziepe.ca header.i=@ziepe.ca header.a=rsa-sha256 header.s=google header.b=iDwrUNBe DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=WZKXP8VTOXU0OFEfLxvR9auLXjQRH/E3aKS3dlf0WJ8=; b=lljDlKeMhVxO2OlYWWQ0KN5Ci0 PuhcM6Sr1prDzgjXUtf7q4J8tmH+djUYBI5fBMhUhCqVX/4M5JtimA02tnRgDA+EZlM4fcVg5o5IT q+VjMkDH2z3QaPCsFpCBInHg1NZ4v1hh/RWydIDNq3hgQ+VE0DSVKbnflwKMGVMCwNM0lgow0zeYT FgIEHoiZlVTfhvkAvPFDf2iuaAlj8lViXLFTjCc5ZdJsktwfZUV4i+Ei04HjHhWntdrUuG1JE4VCZ XH7Qv1d+vBi45Q5LZ2wTIrao1Z5D1ZL7qq7jUSql8Xs3/RRIFrMO0+Dqof0JY+PgyNpmsEV90qFUC G7z3YGgA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xKFdp-0000000GRBy-3RBs; Fri, 23 Oct 2026 13:49:05 +0000 Received: from mail-qk1-x72d.google.com ([2607:f8b0:4864:20::72d]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xKFdm-0000000GRBJ-3NR9 for linux-arm-kernel@lists.infradead.org; Fri, 23 Oct 2026 13:49:03 +0000 Received: by mail-qk1-x72d.google.com with SMTP id af79cd13be357-93e63ee7b4cso109190285a.2 for ; Fri, 23 Oct 2026 06:49:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1792763341; x=1793368141; darn=lists.infradead.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=WZKXP8VTOXU0OFEfLxvR9auLXjQRH/E3aKS3dlf0WJ8=; b=iDwrUNBe7g1iILgn9iCeImkgds79FhrJH8yzzidaV2A8ONyHOqkfN/qFeM2JT69sNy E00++EjYPlBw3xsD5NUSzOROu0zOjckHZoek3qo1rPWc5QRCny+ucp5mMsQWEEMXpz9q xT56AhDd/NTteagyNKFqQuIk9lNyID9ZXhzxBvlQxyB363NfO27PpsyRqxLhWIld2W8A HuTuCIVBjPNHY8fxFtsI74oqk/XnPWHwj3QxB4URLZZ7jcrDg4HytUVPWhd+kK13itUH BnlNApWf3FVHLla+gYBJN0uFkt+otnTiXOKw5hsJJg4ypkOSMgaxr9+J/9mOWdXQBAEv p0aQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1792763341; x=1793368141; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=WZKXP8VTOXU0OFEfL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oBS5 K1SLuCqAzUAoCZagJouMyRNqp5a08d7HzLOo3zVMhvcxYKVTftg1wrtq/DLfsXg/IoISiMMkZW6 lYBX7hQFsXsaWaKTr2YZfwioeOz8mfVzSx3rEumIcHhjm46m3E147fhbh6/Q/fqJNizvZJN0O4a 4h5Ex+T5J3+9YjzKX+BITxY= X-Received: by 2002:a05:620a:439e:b0:93f:1cd7:734b with SMTP id af79cd13be357-93f6f796974mr406212285a.34.1792763341610; Fri, 23 Oct 2026 06:49:01 -0700 (PDT) Received: from ziepe.ca (hlfxns010zw-159-2-239-150.pppoe-dynamic.high-speed.ns.bellaliant.net. [159.2.239.150]) by smtp.gmail.com with ESMTPSA id af79cd13be357-94047b1c97esm21136585a.30.2026.10.23.06.49.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Oct 2026 06:49:01 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1xKFdk-0000000GhLJ-2S35; Fri, 23 Oct 2026 10:49:00 -0300 Date: Fri, 23 Oct 2026 10:49:00 -0300 From: Jason Gunthorpe To: Robin Murphy Cc: Samiullah Khawaja , Joerg Roedel , Will Deacon , Kevin Tian , Alex Williamson , iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Pasha Tatashin , David Matlack , Lu Baolu , Pranjal Shrivastava Subject: Re: [RFC PATCH 3/3] iommu/arm-smmu-v3: Add support for hitless replace of S1 domains Message-ID: <20261023134900.GB3977851@ziepe.ca> References: <20260925011308.3381953-1-skhawaja@google.com> <20260925011308.3381953-4-skhawaja@google.com> <3d1eb92f-3447-49f0-a210-fd4fa015304b@arm.com> X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3d1eb92f-3447-49f0-a210-fd4fa015304b@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261023_064902_860084_21AF22DA X-CRM114-Status: GOOD ( 11.80 ) X-Spam-Score: -2.1 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Fri, Oct 23, 2026 at 02:43:28PM +0100, Robin Murphy wrote: > > @@ -3664,8 +3726,8 @@ static int arm_smmu_attach_dev(struct iommu_domain *domain, struct device *dev, > > struct arm_smmu_cd target_cd; > > arm_smmu_make_s1_cd(&target_cd, master, smmu_domain); > > - arm_smmu_write_cd_entry(master, IOMMU_NO_PASID, cdptr, > > - &target_cd); > > + arm_smmu_replace_cd_entry(master, IOMMU_NO_PASID, cdptr, > > + &target_cd); > > No, we cannot blindly do this for arbitrary ->attach_dev calls - the > majority of S1->S1 transitions are going to be moving back and forth between > the default domain and user domains, where there is zero expectation, let > alone guarantee, that the translations would be equivalent and thus not > liable to lead to TLB conflict aborts or amalgamation hell. Heh, yeah this probably only works properly with BBML2 or something so the temporary ASID doesn't explode. Jason