From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AA1BA13C8E8 for ; Mon, 16 Sep 2024 08:51:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.118.77.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726476699; cv=none; b=U98EYzMg9r2hGvBl6HcfZntv/Qrz+La4CvMPxLvaqgT9Ztw4b/hZmJftipDIgtJXQXaF4ZFqLiV7c45NXQfBHF3JPBYoCmEpjlsvVCqXf3IqtuP5Axd3rck8+bf7POA5yPTYtJ0w6nGBidyYGgs5/WoQ7XpUwrwBOZQnLi4rl0s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726476699; c=relaxed/simple; bh=sIi6lGnRDmnpWsFor1oMST/ypdc8o4B5UfnJGrhMCEA=; h=Date:From:To:CC:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To:References; b=TKBeVqOS1X0pt/Ci/h8Z4cjgp8hc9+HJxAP+ynAOXbkU1mDEfXz4U5SRvBjO2m7wK4nhopuCSOgUf0SjLCUi+e2JkYCOrIiEdMx/qMgARXaR9I7O1qp6T+USGL9Y1xSCU37vFigl5y1geXEW9+5/yvlUG/TERdfr/7waxgbO/io= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=Y5XCUWus; arc=none smtp.client-ip=210.118.77.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="Y5XCUWus" Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20240916085129euoutp020be484d8c84a4ff14a1020681e2c5224~1rWbciQWS2846628466euoutp02Q for ; Mon, 16 Sep 2024 08:51:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20240916085129euoutp020be484d8c84a4ff14a1020681e2c5224~1rWbciQWS2846628466euoutp02Q DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1726476689; bh=00zyv8CQAfu2svO5KB8AB1uhDRFJkT8EwN1UnOCwONY=; h=Date:From:To:CC:Subject:In-Reply-To:References:From; b=Y5XCUWusG+eMa/zKSvNH1oQ904PEahK3o99SgsVLK4KXV8hexryzMmI7EcaJFKAm5 Q1YMh3uOqZvbNkZgnHhb96WKv5nGSGml+Rt/oTluJsgzRwyUwnDs3XIw2rV5amFOOq sPG0MBLEYpYqAQhWUajopUvSVuBexQn0n2HFxxPk= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20240916085129eucas1p1bbfe0f5e1670d7e87510212b07bb5c6e~1rWbInLq72956929569eucas1p1Z; Mon, 16 Sep 2024 08:51:29 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 2D.0A.09624.191F7E66; Mon, 16 Sep 2024 09:51:29 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20240916085128eucas1p1ac5a0605409839e99064198547ab1eb3~1rWanEuGe0804508045eucas1p1f; Mon, 16 Sep 2024 08:51:28 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20240916085128eusmtrp12725bf46fa341d77854fdc1e0b7b65f3~1rWamOqL51596415964eusmtrp1j; Mon, 16 Sep 2024 08:51:28 +0000 (GMT) X-AuditID: cbfec7f2-c11ff70000002598-d3-66e7f191dfaa Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 59.51.19096.091F7E66; Mon, 16 Sep 2024 09:51:28 +0100 (BST) Received: from CAMSVWEXC02.scsc.local (unknown [106.1.227.72]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20240916085128eusmtip11f7e18116a28e61705840777542ff39e~1rWaW3Tr93124331243eusmtip1d; Mon, 16 Sep 2024 08:51:28 +0000 (GMT) Received: from localhost (106.110.32.44) by CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 16 Sep 2024 09:51:26 +0100 Date: Mon, 16 Sep 2024 10:50:54 +0200 From: Joel Granados To: "Tian, Kevin" CC: David Woodhouse , Lu Baolu , Joerg Roedel , Will Deacon , Robin Murphy , Jason Gunthorpe , Klaus Jensen , "linux-kernel@vger.kernel.org" , "iommu@lists.linux.dev" , Klaus Jensen Subject: Re: [PATCH v2 0/5] iommu: Enable user space IOPFs in non-PASID and non-svm cases Message-ID: <20240916085054.gpan37ds7ea45pgh@joelS2.panther.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: X-ClientProxiedBy: CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) To CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrGKsWRmVeSWpSXmKPExsWy7djP87oTPz5PM7i8hNli88StbBYTV05m tvj1xcJi/8FvrBYzZ5xgtOicvYHdYunbrewWl3fNYb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EA30/pHmYDAAA= X-CMS-MailID: 20240916085128eucas1p1ac5a0605409839e99064198547ab1eb3 X-Msg-Generator: CA X-RootMTR: 20240914004847eucas1p23af12d7ea9f70f0de6a9a900072bdad8 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20240914004847eucas1p23af12d7ea9f70f0de6a9a900072bdad8 References: <20240913-jag-iopfv8-v2-0-dea01c2343bc@samsung.com> On Sat, Sep 14, 2024 at 12:48:31AM +0000, Tian, Kevin wrote: > > From: Joel Granados via B4 Relay > > > > > > This series makes use of iommufd_hwpt_replace_device to execute > > non-pasid/non-svm user space IOPFs. Our main motivation is to enable > > user-space driver driven device verification without SVM/PASID. > > can you elaborate why IOPFs are necessary to help verify such usage? In retrospect "enable" might not be the best word to use here. We are not "enabling" user-space driver driven device verification as it is already enabled; you could already poke a device from user space. But the whole poke space was not available, you could not test IOPF without having an SVM/PASID capable IOMMU. Therefore a better wording would be "Our main motivation is to expand or facilitate user-space driver driven device verification by enabling IOPF without SMV/PASID". Does this address your concern? > > > > > What? > > * Enable IO page fault handling in user space for a non-pasid, non-svm > > and non-virtualised use case. > > * Move IOMMU_IOPF configuration from INTEL_IOMMU_SVM into > > INTEL_IOMMU. > > * Move all page request queue related logic to a new (prq.c) file. > > * Remove PASID checks from PRQ event handling as well as PRQ > > initialization. > > * Allow execution of IOMMU_HWPT_ALLOC with a valid fault id > > (IOMMU_HWPT_FAULT_ID_VALID) > > * Insert a zero handle into the PASID array in dev->iommu_group when > > replacing the old HWPT with an IOPF enabled HWPT. > > the last bullet is stale now. oops. Missed that one; will correct in next version > > btw a selftest is expected too. I'll figure this out for the next version. Thx for the review Best -- Joel Granados