From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) (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 D1ECD3A1691 for ; Tue, 24 Mar 2026 17:42:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774374173; cv=none; b=r9rpqOLY8BHGse87HhiI3Y3dweEOJzqAs4p32XrclJw7jADMZO6ifS5ZHkQu3Gud6KEXVXqAq4a2zRZeo000Jq2v6lUig8fL3h3oW3cyEjjP6OP0CBZVAS9lED/0EwjX7NFIa0oUlkDTcH7TDKGYS0Y3qNJX1GZgQcczSv7wLxk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774374173; c=relaxed/simple; bh=QWIkD2dNPOWDG2iaQmcQwa3qfpALdnFK4jzk/uKN3dw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=taP0dej7dLqZC8qEC1NytBvE7PqT60yCZ/+W5tp1YjfUC+BQ/4Qd0g8WKHealjykPUDdvMRpOThqUl1QGGPvhVd5Atmq8Dz7TsynvquKkoTwhLeUZLydxDH83RfFQgI4OXyVYw2+6/mM+FvG3fmDN1CisxtzjlP2FiqLDpZvEuc= 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=doVpiYm7; arc=none smtp.client-ip=209.85.214.178 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="doVpiYm7" Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-2b052ec7176so7235ad.1 for ; Tue, 24 Mar 2026 10:42:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1774374172; x=1774978972; 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=ELBKqo9znGMFulJJKIvGt1/Dgj2lLtKy7Txs2TxgETo=; b=doVpiYm78C66FK6Nzgxspx5ZCwIJVnT2hOR69+IJ6uG68PwYFaW8AXLY8pMbImz6yS zHjtGVKvZaspOQEORYBFyr7oqzEyad2Uz4TSeQjpDD9xiCI76nPTgq5xco40IsTMLMml yfsxs96CCzLYKOm++eg8sjBqFbIsDyfibrqKiEGXGwAqT9ete5Id+DMMzQc2WondGcbI XKqiVNIfSC0/smioznTN7pA9U080CTmrcha46HZiqNbzGDs0P51ZcVfUw4tHShVgjSTh AwDLgK0KGw2eEClpOc5geCVWB5LcR/qKz4OLm/iRFKo2TLD+N4IjxyKW3BFlbA3jK4sJ bAjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774374172; x=1774978972; 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=ELBKqo9znGMFulJJKIvGt1/Dgj2lLtKy7Txs2TxgETo=; b=ekpx/n5Dn7TfroAYzbUX/6Yd2CHHts5AElxOwrUYUrg6Vre74RxeH0bOxsn46gkBBW z0vOM5EPnGgk1C8+G4m8rjogmkNimSfS9nVYJiFZSuvPW2osnKfUSdPvcsHK1947oTXn Pg3JgYVfg1+rE0PiDtuLUt59223h76kbjfs+bGed2pBGM7j9fUaTDiaNXMwA4HKF8rK4 q+SSSUChs/uMQvlUq21TgUlBVzrQzKDn8oWnWQyKjllBbF63N57/khBXw0BtZiPf+i5R kfNMa7sNcKz0zpI2oMpJS8F7ueWbremQlOGD6KjKwhL4KKz43hRKpoFPPL0D/2wd3yCh REqg== X-Forwarded-Encrypted: i=1; AJvYcCWXcoqex2HpseqIUm9pzJcOumyiDX/ALZBAZyp72M4Kd3IUBKg5uRAqX7Nrgkz+np6SNqkifXAVA25TJIE=@vger.kernel.org X-Gm-Message-State: AOJu0Yzx2Pm6WGbneKlKCJTtfpwg7o4RsJozG7Ys0igMUXBq+vBGns4H ha1dDNOsSbJeS365VoGxPdf/Cl8aK1pH90M8mdKash3M/ma67vMnCI6F/eAZ3vY6Uw== X-Gm-Gg: ATEYQzzsQ68QWbDxsQkWQA3ObVcHt1DCnT+kW6el7h7WBAmtiIFGvAGuOSOKonBdz8p YsHD9SExV/dDDSqvBOealoVwP44BJf/RBrISvuDI1oO06wEcMtgawUW8P4LPue19/iXdIOVkUjS rfyEytgprzKMEa3ojPy93znPNYRpKw8YLhXmHFgZRSbY8I99yQgDW0Y0rgFY4FmC0fxL991ZbBW Gwn3cL/0TLc1BgLndLN3it+WeFRV2WVbJla1S/HaFnILwwOgcGKZUxTvRTGhx8nR4g0jKfFlOn5 9CWzonWghdgEXE4oX6sl/KSChUKXXQVUvmKJy55L42k6+PZdd5slxf5dcItQIP9OqtJT27fJIkA Lz99DQlABHVhwHw8qnwei9JFZg+J3uXcKN21ilINnfrCib16sUlPhbcsmnIbjUjBStZZSYt/pTi RknD0Vreej6LFycHKuHJrnXkI92d1ozAsB5KS9hVi35C7SEDfbF13wFkwjTs8CsA== X-Received: by 2002:a17:902:e543:b0:2ae:ca87:b1c2 with SMTP id d9443c01a7336-2b0b1568883mr235975ad.8.1774374171614; Tue, 24 Mar 2026 10:42:51 -0700 (PDT) Received: from google.com (168.136.83.34.bc.googleusercontent.com. [34.83.136.168]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2b0af2e9dabsm8104685ad.69.2026.03.24.10.42.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Mar 2026 10:42:50 -0700 (PDT) Date: Tue, 24 Mar 2026 17:42:46 +0000 From: Samiullah Khawaja To: Jason Gunthorpe Cc: Jacob Pan , linux-kernel@vger.kernel.org, "iommu@lists.linux.dev" , Alex Williamson , Joerg Roedel , David Matlack , Robin Murphy , Nicolin Chen , "Tian, Kevin" , Yi Liu , pasha.tatashin@soleen.com, Will Deacon , Baolu Lu Subject: Re: [PATCH V2 01/11] iommufd: Support a HWPT without an iommu driver for noiommu Message-ID: References: <20260312155637.376854-1-jacob.pan@linux.microsoft.com> <20260312155637.376854-2-jacob.pan@linux.microsoft.com> <20260323131714.GG7340@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; format=flowed Content-Disposition: inline In-Reply-To: <20260323131714.GG7340@nvidia.com> On Mon, Mar 23, 2026 at 10:17:14AM -0300, Jason Gunthorpe wrote: >On Wed, Mar 18, 2026 at 06:38:14PM +0000, Samiullah Khawaja wrote: > >> > +static const struct iommu_domain_ops noiommu_amdv1_ops = { >> > + IOMMU_PT_DOMAIN_OPS(amdv1), >> >> I understand that this fits in really well into the iommufd/hwpt >> construction, but do we need page tables for this as all the >> iova-to-phys information should be available in the IOPT in IOAS? > >Yes we do! That is the whole point. > >In iommufd once you pin the memory the phys is stored in only two >possible ways: > >1) Inside an xarray if an access is used >2) Inside at least one iommu_domain > >That's it. So to fit noiommu into this scheme, and have it rely on the >existing pinning, we either have to make it use an access or make it >use an iommu_domain -> a real one that can store phys. Thanks for the explanation. I missed the part where once pinning is done, the pfns are only available in those two places. > >Maybe a comment is helpful, but using the domain like this to store >the pinned phys has been the vfio design from day 1.. > >> get_pa() function introduced in the later patch is only used for noiommu >> use-cases, it can use the IOPT to get the physical addresses? > >No. > >Jason