Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp579279lqb; Fri, 24 May 2024 07:16:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXeJnUtuTbUOt8gmhSxqa8/nFnHxYShr0Ot7HttrtGd+H9yCz6fDNv2PnvZyjF+s3n7baPmJc4H5ahhf8Nj+Hsfn/P6N0X2XLIdlhqgkA== X-Google-Smtp-Source: AGHT+IETCiOn7DPb3zoCKH6vCjUtSzqs03DSj5XwV6h+QKOq9ad5AXDLlqiu14hEtY1Ep6R9i6ZA X-Received: by 2002:a17:90a:bd8f:b0:2bd:d42a:e199 with SMTP id 98e67ed59e1d1-2bf5e944845mr2555719a91.9.1716560163090; Fri, 24 May 2024 07:16:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716560163; cv=pass; d=google.com; s=arc-20160816; b=FrjcfobGx5YOMHFKr7dg2ZXUDEerpj4G+EvxaDx0p1G/zIj7Y2/UsdPpemLjD+Z8Yp M9HXg/vq+LQ2a2EEqKj3Q5xD0Nsm8G9ta/X5oCno1Knf7PWHX88epR2QqGdouCh7Y2el Ngz1YyrMdG7nLIHmjhHUqn9f6oqGri0GgRQC7D3HT7HMnq3N52vUGCBGggAr642zaHQt l/yHMcEkQSi29b6c6z+RkaGiWrtmMTJ1oor/U3yzRnyhfNd0B38Qncnh3FDwD6tR3luT vSJVd8j9qS5b1hdbFoo55Ea2j1Z7tvhpaWUStnisCra+cROvXgwgB9xp+zM7KV/06g8n /Yhw== 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=IB3mcx1/Tv2PzlpsLjModpuSvG006O6sdr/ydjXYZrw=; fh=+xu8dItLyZZHbvwB2sI3CbpYsbEqiVN0EuyjAOXkXKs=; b=ct/YTYzUmS9QANaamP9TMdVJnfT96x22V8bBm9arq6WhAPpJN5CxLzfl7pLdy+mRi/ tp6Dwj1L+3xRrbO9e8fyKbrqNIbIFjbqjs0iARbOua+F9L3FcX+AnS5tySUSSs1jDVoj /mas+v9Be3wyEY25ZVsWqyQfdICPa+m0bFfZwC24rDSPkiAo22FcCdIO72pR75honJwy 6j+g38/9q+H25hqOCXLF5IZ6o5H6m8rn6+YriYcvFZWMN8e58r5nag8f0yBBxLSDdvRZ lAjKo8OLxdN7niHaOfw9UdphTSXMFmfTqUYMMOLjXp08Ta/rvEDuG1el3NdJSz0lsCwu 60Cg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=Z4O9HmfJ; arc=pass (i=1 spf=pass spfdomain=ziepe.ca dkim=pass dkdomain=ziepe.ca); spf=pass (google.com: domain of linux-kernel+bounces-188780-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-188780-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2bdda14d4fbsi3517996a91.157.2024.05.24.07.16.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 May 2024 07:16:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-188780-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=Z4O9HmfJ; arc=pass (i=1 spf=pass spfdomain=ziepe.ca dkim=pass dkdomain=ziepe.ca); spf=pass (google.com: domain of linux-kernel+bounces-188780-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-188780-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id EE39BB22715 for ; Fri, 24 May 2024 14:15:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AF93312C490; Fri, 24 May 2024 14:15:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="Z4O9HmfJ" Received: from mail-qv1-f43.google.com (mail-qv1-f43.google.com [209.85.219.43]) (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 315E912BF39 for ; Fri, 24 May 2024 14:15:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716560111; cv=none; b=T0n/yvkPhbX/VWfsI/oocdx3WYmh5EqQ6dlw2CCwUzHgPNVPKDScmB7MAFO1/dnYM7zOMdy7hz576PKD6maOR6fwa88JJzks+3RcOL5mfx/NBg0RfAs7sjFfkXRsgjI0OFVJWb6cn2STLSb521OAArYMpxbqr+UzISl44uxzYsk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716560111; c=relaxed/simple; bh=Xks612s/7rT6Q6ukp30bszt+1cZ8l1ePIW1QRk5v5F0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=IIbnJSnzZJx/QCPLPw0pQbpsqHWACKE+s+dq/Off06WryZ5MkIQ9eZVzdKs+6Knn8TDoX7FKBxvZhCjz3j5bFKK3plOa+5sWKmsB1wkbluedDyXauO2vgSRyXThxOyIX3osJrC+k6jmCMp0rFlzgNGB8rzBrPtUn0pXKvusVrww= 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=Z4O9HmfJ; arc=none smtp.client-ip=209.85.219.43 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-f43.google.com with SMTP id 6a1803df08f44-6ab9d01c479so4551896d6.1 for ; Fri, 24 May 2024 07:15:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1716560108; x=1717164908; 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=IB3mcx1/Tv2PzlpsLjModpuSvG006O6sdr/ydjXYZrw=; b=Z4O9HmfJAyLs8AKSAar3Mk5yc6fTi61i4Tyh0u49fTmuPdGPGa3gjfOeHY9Z9f43dT ypMsblj33z3xR1NU1zBLwVmcz06JQTsQRNmos+CVVPXwXof4J17yi61VlYRa/BQF+kPd DCj21Sffp+XWSs0cT9TtnIH9GI6ZohnjP+2p+i50hYa77sIJoELz5IQbp1fndRXFXmlT BOz4DNGt1UaTxm0Un01AUceMRNo+FDc6vZ6zMRZZsf6+oDYQNnbQXO0Tdmcid3xspsXz GOQbgP/Jjr+dcB+q9PlGPzp26C7HVBrroA0oYuszHsPiuK91C8k/iYKOL/DzBXjxczkt 4W6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716560108; x=1717164908; 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=IB3mcx1/Tv2PzlpsLjModpuSvG006O6sdr/ydjXYZrw=; b=wUqLWSsgmsZNgnGgpDAgysh7q8QQrYDN0ETTUKdP71S/VEsueZZ7RmtH0tNu2r1S9N 1pWPKznow9H0kPomViVumBrkF3JfEblEA1UDKS4IAAgYqL+co/K/OImioE6/+Dc67bEM MjqvfGqLTvcg5mFDylrerbXLQLOJ/VrjIBjTntKp4nfSOiRscKNJ1eqtJF2mb+bkwgR9 dkz0pKbd/gYveIiWsCjz6WcTf1i3uyVQ6h7z1aG4qWoUMdaWhZBCPkU5KYDSWrxfuVw/ nveuzMj9LG+z04tLbx+NbSbrAHy8Vy5UFjP9sJcEpZuqQHnokvXOLvCsL9XyVLHh/qtI EUcA== X-Forwarded-Encrypted: i=1; AJvYcCXBX6LqfTBjJUPpu+JOxO7UyS6/zic3x6gaO+EB6avq1hmPNfafGkOvl5WsktUNdLN5KaxEREGYrktSjuktfbFp8gafVMvT53e6xVLS X-Gm-Message-State: AOJu0YyqM0IJ02Np0W+JnzupO+v0OLH69GTqdd4I58yJ3GaWsfMJJji0 +PvDDAZDSk9q5/Z3npi6bBSNB23mpDJyf85zI1jlm5s3K3AG+k21j0DwEy/RgHc= X-Received: by 2002:a05:6214:4981:b0:6aa:3dc9:4b2 with SMTP id 6a1803df08f44-6abbbca5e8amr26530426d6.5.1716560108113; Fri, 24 May 2024 07:15:08 -0700 (PDT) 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 6a1803df08f44-6ac071048a3sm7543566d6.69.2024.05.24.07.15.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 May 2024 07:15:07 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.95) (envelope-from ) id 1sAVhK-001JcU-UZ; Fri, 24 May 2024 11:15:06 -0300 Date: Fri, 24 May 2024 11:15:06 -0300 From: Jason Gunthorpe To: "Tian, Kevin" Cc: Baolu Lu , Joerg Roedel , Will Deacon , Robin Murphy , Jean-Philippe Brucker , Nicolin Chen , "Liu, Yi L" , Jacob Pan , Joel Granados , "iommu@lists.linux.dev" , "virtualization@lists.linux-foundation.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v5 4/9] iommufd: Add fault and response message definitions Message-ID: <20240524141506.GN69273@ziepe.ca> References: <20240430145710.68112-1-baolu.lu@linux.intel.com> <20240430145710.68112-5-baolu.lu@linux.intel.com> <805f3ae2-341e-4255-add8-3f6dd296a556@linux.intel.com> <04288162-e5fd-48f3-bb60-a41b4ed2c244@linux.intel.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: On Mon, May 20, 2024 at 04:59:18AM +0000, Tian, Kevin wrote: > > From: Baolu Lu > > Sent: Monday, May 20, 2024 11:33 AM > > > > On 5/20/24 11:24 AM, Tian, Kevin wrote: > > >> From: Baolu Lu > > >> Sent: Sunday, May 19, 2024 10:38 PM > > >> > > >> On 2024/5/15 15:43, Tian, Kevin wrote: > > >>>> From: Lu Baolu > > >>>> Sent: Tuesday, April 30, 2024 10:57 PM > > >>>> > > >>>> + * @length: a hint of how much data the requestor is expecting to > > fetch. > > >> For > > >>>> + * example, if the PRI initiator knows it is going to do a 10MB > > >>>> + * transfer, it could fill in 10MB and the OS could pre-fault in > > >>>> + * 10MB of IOVA. It's default to 0 if there's no such hint. > > >>> > > >>> This is not clear to me and I don't remember PCIe spec defines such > > >>> mechanism. > > >> > > >> This came up in a previous discussion. While it's not currently part of > > > > > > Can you provide a link to that discussion? > > > > https://lore.kernel.org/linux-iommu/20240322170410.GH66976@ziepe.ca/ > > > > We can always extend uAPI for new usages, e.g. having a new flag > bit to indicate the additional filed for carrying the number of pages. > But requiring the user to handle non-zero length now (though trivial) > is unnecessary burden. It is tricky to extend this stuff since it comes out in read().. We'd have to have userspace negotiate a new format most likely. > Do we want the response message to also carry a length field i.e. > allowing the user to partially fix the fault? No, the device will discover this when it gets another fault :) Jason