From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) (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 216DF359A6D for ; Thu, 28 May 2026 20:39:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780000761; cv=none; b=HTBD7RfOx/xWd2GPhCFjDf06NlFmwpFcwWwV3PWVb4/1krwHcstMqWsfyNrThxBsW1ixfl74rY6H4zaDrQF7U5lRCvxhQQ1+mdlOKJcNOTfrxfqTF5oS+S+TiJY0pxYFdNNmb4sQXvNiXKopyqgqWPpO19mQ7+tIYFcVRQycirU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780000761; c=relaxed/simple; bh=KqExw4yVF8fFYi6V24rBae9JPYjDk4kcYZvI5BlVCOw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=iTJkcDGhnoehsCRbDGVRnPw8Qsece0tKQ1QmVG0wizzRi36nbFm+9Y3YkPoDV/EQEbhvgdE4Iar2z5uaiF8H8GhtWqI9ZuM3gk3xD32+jHNfUVF1wDX9NwmSv+jPgas3ZxTyT79U02V4nr5rI7tSXpcYtwXsnnqvtEeUK7QyN6M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=aSLLlC07; arc=none smtp.client-ip=209.85.214.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="aSLLlC07" Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-2b46da8c48eso2275ad.1 for ; Thu, 28 May 2026 13:39:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1780000759; x=1780605559; 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=meonzuuyclWLVGJV9U6aQdhritntP0vgCuzICbgArsQ=; b=aSLLlC07u77GJQTwuQxyzhP4+xahlBgRDYVON+pUV/Jcsz1wxnFI4rjObiRLovMYHX pH/ETFAfKr//tQvQCeX4TAe6D+vA+Cu9JpADVQLUycD9o1oyF39t+pJ/WUIsDAupMV1v 0JG/ZC+SkFBNAKXrb+CtLQyW0A5ZbHtnKqBf6SRYBcjrLQrrgtc4dutAfBA0V7LH9r+d 28aXtbPN66zkYMqNqUYd2N7u78oJ0kWYE8YgqR6nzXqgGKmfHoSQtVYEukWAl67nke9v kVBHceQseAn9HTvPX+9ZzWD/5xZLEXXcH6vm9lIlNSEE0uygLVOoHJFOpEl/iSnUVFml iaaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780000759; x=1780605559; h=in-reply-to:content-disposition: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; bh=meonzuuyclWLVGJV9U6aQdhritntP0vgCuzICbgArsQ=; b=fCJsza3c+2M0fF5uqKtM0wO0g1sy88/nbeQ5xXyuX4EnbMu/16kRl8aJ5XV+ZJQnqE Y8RV3hho1tlfznA/jIMzsj0PD7ergjDKWHmWzO5TLYJXXrjLJn7TmF2fMIrBizntJ8Vn PSjRKS11Z69ebzSizMWs9IH/YNHFwpoWkK0He9z3eaDZN+7rWFhtq/UrsEJscG36bNKd 9sZ/rxMomUvraoq9ue7Wpuaw5atJjSl2NPPc4AyLNqNW+vv6JrS+UFKYwVeUSwcSnilr 1YAzbLiBk1UFc29I8u3MDIwBnnrxcmjglGe87AGqLg4S1qcpif8ohkRdPrEuiZ88nviB iXZg== X-Forwarded-Encrypted: i=1; AFNElJ9TC2p9TCy46AvpwnS3ROFT/YpDoCDEXApwLmkwwuevDsdSOIX2kl9GAySIA9GGExBKBCjy6QTpzXLsw90=@vger.kernel.org X-Gm-Message-State: AOJu0YzCYTzrxePTifdoNNGw02x+azxrEzjHk8lH68XVttHXi+0eSB2+ OMSJhzEeW4A3Sw7vRmnY/CRJ6WpJRWaWLN3VGU9Pp5gyejNIG2QM19KGu3izrOyXftdc5DrnFdg DpRMOhA== X-Gm-Gg: Acq92OHSCGRItvorS7p5bevYZ5uCm0ffVo+YpK2dR5AUcANSevAVW9fBfdlk4nSd514 bH5ab48Ps3bLZImAPNkCuoaHFHDD+YJit1zqOoOIElCiNTJRj5SLhnsXjZ8vRih+7EVDtwVMJY1 CsJ09FlmPprDXWqQsvcUS5vV1rXiluJfpsv8RU0ev9114gqpkfhiI4jmzLXo3/tB7Yu0Qn3slxm unWecLdKXSm5NDY/1KyPOYWnslKI778zzNfkbzxnN84/Up5a4b+un9MuHbTYwx9t7Z9JAxcJmol o2WPTr/uUtQtsb3VlLYvAl45q3Ss1WyAUORxt0qJPFMIlgCMY6FGL+y7Dimoh+7a3CI7/eg+4Tj 6ftJjdctktm5He4txX5s3znLqSYkaaFbYVMECVxxDM/MZ4Yu9FLgQhtdbScufsWEdAJgKqDi/SS L64SGpqGgeDYTqjuwvsIWOoUF2wNiG74wr+ZELeyf6lDocwqDeHokmDYgo0JagtYyq7K7L X-Received: by 2002:a17:903:1a67:b0:2bd:6dad:3dfb with SMTP id d9443c01a7336-2bf2046519bmr79225ad.25.1780000759071; Thu, 28 May 2026 13:39:19 -0700 (PDT) Received: from google.com (44.234.124.34.bc.googleusercontent.com. [34.124.234.44]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2bf1e609a0asm1939385ad.26.2026.05.28.13.39.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 May 2026 13:39:18 -0700 (PDT) Date: Thu, 28 May 2026 20:39:11 +0000 From: Pranjal Shrivastava To: Jason Gunthorpe Cc: Nicolin Chen , will@kernel.org, robin.murphy@arm.com, joro@8bytes.org, bhelgaas@google.com, baolu.lu@linux.intel.com, kevin.tian@intel.com, miko.lenczewski@arm.com, linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, dan.j.williams@intel.com, jonathan.cameron@huawei.com, vsethi@nvidia.com, linux-cxl@vger.kernel.org, nirmoyd@nvidia.com Subject: Re: [PATCH v6 3/3] iommu/arm-smmu-v3: Allow ATS to be always on Message-ID: References: <18bb6f421b3be891caa8f1fb50f3a4d56b52d5be.1779392420.git.nicolinc@nvidia.com> <20260528152930.GA3195266@nvidia.com> <20260528180018.GB3195266@nvidia.com> <20260528200450.GC3195266@nvidia.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: <20260528200450.GC3195266@nvidia.com> On Thu, May 28, 2026 at 05:04:50PM -0300, Jason Gunthorpe wrote: > On Thu, May 28, 2026 at 11:20:35AM -0700, Nicolin Chen wrote: > > On Thu, May 28, 2026 at 06:14:57PM +0000, Pranjal Shrivastava wrote: > > > On Thu, May 28, 2026 at 03:00:18PM -0300, Jason Gunthorpe wrote: > > > > On Thu, May 28, 2026 at 04:32:23PM +0000, Pranjal Shrivastava wrote: > > > > > On Thu, May 28, 2026 at 12:29:30PM -0300, Jason Gunthorpe wrote: > > > > > > On Thu, May 28, 2026 at 03:24:40PM +0000, Pranjal Shrivastava wrote: > > > > > > > > > > > > > > + master->ats_always_on = true; > > > > > > > > + > > > > > > > > + return arm_smmu_alloc_cd_tables(master); > > > > > > > > > > > > > > Nit: I'm not sure if I'm getting this right, are we saying we *need* to > > > > > > > allocate CDs for CXL.cache cases in the probe itself because STE.EATS > > > > > > > requires Config=Translate with S1DSS in bypass? > > > > > > > > > > > > Yeah, basically. > > > > > > > > > > > > Effectively the ARM rules for enabling ATS and Bypass together require > > > > > > a valid CD table pointer. > > > > > > > > > > Ack. But do we expect transactions before attach_dev? What'd happen if > > > > > we don't allocate CDs here? > > > > > > > > It can be done at any point before a non-abort STE is formed. > > > > > > > > The core code pretty much does this immediately after probe so there > > > > isn't much point in moving it later. > > > > > > > > > > Right.. that's what I'm not understanding clearly, if the STE is Abort > > > anyway during probe, why are we breaking the alloc-at-attach convention? > > > Usually, we allocate CD tables in the first attach_dev call. Why does > > > that not work here? > > > > It would work in attach_dev(). I just felt cleaner to have it in > > probe(), paired with arm_smmu_free_cd_tables() in the release(). > > I thought it was like this because we don't have an alloc on attach > flow for the identity domain, so add it there or add it here.. Right, doing it in attach would've been cleaner, but I don't mind the existing way too (since it's merged anyway) I went down this hole since the reason for the convention change wasn't immediately clear. Thanks for the clarification! Praan