Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp457311lqp; Wed, 12 Jun 2024 06:52:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXay8/+fyoIhDDr/wamwiQWoiuk1Sib2ZvEvmLQltD7dm/ldZ6YCK1SnNq6JtDElBkjcLfBGKhzsXDfPw7ZtBuxhdM1J0nghJcg6SrDOw== X-Google-Smtp-Source: AGHT+IHAvVl0h3F3GbnkL1lwYnJ3MQEr+fbMnDrjvyf49RxHD9tDr3C8Mxg/XfMN48vloZKyNEMb X-Received: by 2002:a05:6a00:1487:b0:704:3438:f86b with SMTP id d2e1a72fcca58-705bce64576mr1975003b3a.18.1718200378371; Wed, 12 Jun 2024 06:52:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718200378; cv=pass; d=google.com; s=arc-20160816; b=wBSOMjYW3K7Eyp2C+ehkUTeTWG/sH+zz2jnq5KOME02u4gSziDrXXHryqoNma+g3te px1dAbItfixqc+7KEmUTLNPS0Tb8kbxacEWCodbChrQIIl7ULCHlRmfNXb5VmGgdySSW mDRM+vc02UF4yNlQpsuJ0ls0p+NseI3v6hV8j2/TJkl90yFqynF1SpfWvbLx0gOibUbh tOk23N8ctV+e7qe1pw9VOym8q0qdEonJ/RmytUQqOnIYACOdwJAKHkBnJ4Eesz02Ks7O XtADE32vq1b1i8KIuDgzkB4NGqvoQ9rakbRb9vNUEJ3VDMZa1z7qSLU33ns9wF6xDQJi l64A== 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=n4yFXPH48K7YremfXbvI5F9w5geLcApF+zrC9idLOg0=; fh=9PoZJKbyUadWmhn6aNiQWqWFUUSokmSNrQr7FB8YpZM=; b=M0ShY5flLiN7clbJjAOfkS1WVWqTaYa+kp2Wae+cA2zhFs/31jI1zNyZ1oPzxjtwjn CdoBJojU7gJOe1bmBflcEuz1gO53AHZ2eEXrYvKicyX3XMBzUwaDEQabX3yDZP9FKfiB ttCg3sPaZxr+bLOxL3hYJBcQT+oSsyxXTWRURgpTr5jEETANjeJswBLI6FBDBjq6RHHJ WdgEzaH6kGRQ79FOXB90MKsuMNI8Wt7y4rfO/Oy8ip1RWbVm9o6QIQDoLq7gSzgroftP qVaxXKQcnHH+u3JSrnHZNN2jtUM6etI9xdFBmQrh8983a6Yf/m22+EKDw/pH1ajRWvAd 742w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=IwKO4hxI; arc=pass (i=1 spf=pass spfdomain=ziepe.ca dkim=pass dkdomain=ziepe.ca); spf=pass (google.com: domain of linux-kernel+bounces-211598-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211598-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6de262c0169si8420965a12.300.2024.06.12.06.52.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 06:52:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-211598-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=IwKO4hxI; arc=pass (i=1 spf=pass spfdomain=ziepe.ca dkim=pass dkdomain=ziepe.ca); spf=pass (google.com: domain of linux-kernel+bounces-211598-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211598-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id DDA1E2838BD for ; Wed, 12 Jun 2024 13:52:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E9ABF17DE18; Wed, 12 Jun 2024 13:52:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="IwKO4hxI" Received: from mail-yb1-f179.google.com (mail-yb1-f179.google.com [209.85.219.179]) (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 B133617C7D5 for ; Wed, 12 Jun 2024 13:52:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718200344; cv=none; b=rTMo9Vs8OTIRynTeOTGnIQExKxGV31WN7ZsfJvdH9biHT2CFsHhd6zacmZg4DTPMzxp7ZaOVWvN8SCpkV8UUducfjS8fWUkd+TOgGVZIzW3fXpcotU9nJt8EVypuPer/WfHH0PxrZJDOXcfUXk9JVJHncTvO1uCvHxoU4n7Xp9c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718200344; c=relaxed/simple; bh=Oo7eKQ/vuiKK57nzWHRwBZAQcLEcZwfz+apajKIxjpc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=LfiIiNIG5YjRC7HtowU2to7NthsIVV6Yd4cbmWZoiMEmNWYzSfF28mgHcT1BoYRaQRFWJyEm/8/m9/UbUlfFAED9CDXpvhshFDqUL3x2n85pZuSHiDGSXgCN3X7+/zX8xAnnWuaypr2VkRUlAZfx9Zf+8eHr3u727URurs+oqyc= 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=IwKO4hxI; arc=none smtp.client-ip=209.85.219.179 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-yb1-f179.google.com with SMTP id 3f1490d57ef6-dfef5980a69so447227276.3 for ; Wed, 12 Jun 2024 06:52:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1718200342; x=1718805142; 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=n4yFXPH48K7YremfXbvI5F9w5geLcApF+zrC9idLOg0=; b=IwKO4hxIzxgsEBkBNhUlUTztoGSaqBvsEw0ONBjyssFC2uDz/Y2052AUVgiSWt4Zwt qwcJzFYSiS4AjdDvZOEVaIyDw5TJvb8qpwo7nuL59l4ZOG7jDeIiiqLtgcoSRou7+Hrr y0UsNss+aqsogQYGEE4fFmrSEufiw+CU7zwSaqEuwfw5bJXVDCmCM0w2fKAdMs69REzM doEXs2Ev57lioYfQKXVlfRic94nxvxlX/9DeU+nGBY86iYS2n9c/wh1NR3E0wsR5XBD4 j+cRt5Y8qcXEcXsCXUcWCLPK6DFmSdAs63ifn7Szm5m9W85pgzqnXzqlZfvMMTeozNWL txyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718200342; x=1718805142; 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=n4yFXPH48K7YremfXbvI5F9w5geLcApF+zrC9idLOg0=; b=C15muNoYd3CALL8zx7DDeSyjFjb4U6Z52QA8IySF9PwgQnlnudkEo57752oZRz5t5W ykfwAzwQFCKdPomDo7charV49LrOrzmzLY5rkTuCGaWWeoprdeVIo9QFHhQ/is8JsJf+ +uVR3GLjvJQpT+zk7hP9TRUzC5RjDMuNnoXCxqniXbxp0h4Ij1BXRoiMffNwJSxYzOwL OhuZB4dJXLpk1vrrA8mNyU7QMn46tsQpoK2xyjcDoaHvDNjVtt/0m4J3VAwSu9KQxrVe UyFvqUOrex8XOwsn350ana/x5HleLuo00eyX1FNVaT9E1H2Sl2tQrikpC/rJe2YrdSVG YWAg== X-Forwarded-Encrypted: i=1; AJvYcCUpkGtnNFr1RbzUDe+KMPFubE0enOVvT0kazq761o/nVMWH/TzcYlpiliYMsyhFurRRjG2iTmCEDPE7kmVRrCwxnr3H69Q4elyc0P2M X-Gm-Message-State: AOJu0Ywcs0TUYgjAU7om+EhgEkWGixdY/qsDh3IVGFzq6pvqlk1i8ZHl aFuu5qlMGE1s9XJHmFdjQqwFwkUlJV8YG3QNMwvn1ZMK9JT8+LyazrwNoH9Rb0tPKLqRaHAuQUX 0apI= X-Received: by 2002:a25:ac14:0:b0:dfe:388e:2987 with SMTP id 3f1490d57ef6-dfe694f0e9amr1659594276.64.1718200341645; Wed, 12 Jun 2024 06:52:21 -0700 (PDT) Received: from ziepe.ca ([128.77.69.89]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6b08dafd095sm16499226d6.130.2024.06.12.06.52.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 06:52:20 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.95) (envelope-from ) id 1sHOOh-0091GZ-F3; Wed, 12 Jun 2024 10:52:19 -0300 Date: Wed, 12 Jun 2024 10:52:19 -0300 From: Jason Gunthorpe To: Lu Baolu Cc: Kevin Tian , Joerg Roedel , Will Deacon , Robin Murphy , Jean-Philippe Brucker , Nicolin Chen , Yi Liu , Jacob Pan , Joel Granados , iommu@lists.linux.dev, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v6 05/10] iommufd: Add fault and response message definitions Message-ID: <20240612135219.GZ791043@ziepe.ca> References: <20240527040517.38561-1-baolu.lu@linux.intel.com> <20240527040517.38561-6-baolu.lu@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: <20240527040517.38561-6-baolu.lu@linux.intel.com> On Mon, May 27, 2024 at 12:05:12PM +0800, Lu Baolu wrote: > +/** > + * struct iommu_hwpt_pgfault - iommu page fault data > + * @size: sizeof(struct iommu_hwpt_pgfault) > + * @flags: Combination of enum iommu_hwpt_pgfault_flags > + * @dev_id: id of the originated device > + * @pasid: Process Address Space ID > + * @grpid: Page Request Group Index > + * @perm: Combination of enum iommu_hwpt_pgfault_perm > + * @addr: Fault address > + * @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. > + * @cookie: kernel-managed cookie identifying a group of fault messages. The > + * cookie number encoded in the last page fault of the group should > + * be echoed back in the response message. > + */ > +struct iommu_hwpt_pgfault { > + __u32 size; Given we fail the system call if size is not exactly the right value we should probably drop it here. The ioctl to get the FD can someday specify the format of the fault messages if we need to upgrade. If we want to change it down the road then the old FD will be exactly as it is now, and the user will request a new format FD that only works in whatever the new way is. Jason