Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5440490pxj; Wed, 23 Jun 2021 01:02:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwH/AG0/ENWRXESJdp8ZHlho/0eRpyPrdBFipWaH4EZG4kESUWt7JpxhXfjuxpkf5tBvOk X-Received: by 2002:a17:907:2bd1:: with SMTP id gv17mr8516122ejc.15.1624435353072; Wed, 23 Jun 2021 01:02:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1624435353; cv=pass; d=google.com; s=arc-20160816; b=GjqJsv1oVe8jtPN8TKnYbdi+8kP8HtyI8I1wmo6Rti1nnePk/b/JxwOvbLDPqdeCL5 DQPbIV3uQBF3z/0LjWCW3TwkN+PdLpjW79LFhZrUME9Th4L86ODBmYMwajQiqZZVU9x6 13+OpUeRMEA8CZJsKECIjOiJ0ngodvKWNKkXb8S03LA/oA+IrO2IRcmkCSPTLGDkEBly 7A6j9PlYhmbLLj7HKVSzfe3ew5TQTeETlVgPMdt4MBaR6JZ9abt+k6KA93R5ikKBWR9q JbXLl2zOiHCDq8miGjti5Bx4x2BDNfVo7JEyc22mt7S7mk/2n3nRmfRC5Rbr2v0wTvLa e8GQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :dlp-reaction:dlp-product:dlp-version:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature:ironport-sdr :ironport-sdr; bh=39ofjA0oANVXTPxcBxfYjxhfF4ik8C2GsRarUCFSUVo=; b=MkZfAMOLirI88WHrPpG7XMcXFfQy4jREQ2J9j4AeOIe63QPoBpC2eoxbefYcfXH5uY D30lvUdidLWLwz2wPoZUA+qi9sHkesIDsAbWt4D/Bhngm9TX1pz/Djij1z/eef9qbAt9 ShWO2rEmogsKUUF4lXDLeorn9X1JpqV7o55tqYscIwlJAAvKb5ph2iR7SAVpqsB1qOAg 72yCnrpxHfhkqP175wSeeI4o83fQfIqOOHgBIaJeqpc8dCXC9RPhk5ew8dsii9YZ9FU1 AINUph9Ex1o/YMyWKIlAxxOvf+U2DJ8YIuqtVPfWWgyKtIbvUiBkNhiiIE0S2ebqucT3 E2vA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=acj6TCBP; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id aq16si9428506ejc.217.2021.06.23.01.02.10; Wed, 23 Jun 2021 01:02:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=acj6TCBP; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230061AbhFWID2 (ORCPT + 99 others); Wed, 23 Jun 2021 04:03:28 -0400 Received: from mga05.intel.com ([192.55.52.43]:24271 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229902AbhFWIDZ (ORCPT ); Wed, 23 Jun 2021 04:03:25 -0400 IronPort-SDR: 6oxvM4+FlbPgMDpuvcb2OCD5VHajd82hNKVb6bGI4IYNu/RzmD6p5+VDoNJEEzmWip4HSqkUrZ JZyNcfTKzL0g== X-IronPort-AV: E=McAfee;i="6200,9189,10023"; a="292843249" X-IronPort-AV: E=Sophos;i="5.83,293,1616482800"; d="scan'208";a="292843249" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jun 2021 01:00:56 -0700 IronPort-SDR: vX5NoCCcFe6G/piKXxfb0VjKG7o/NQbinEUDQlvfZeGQoKOww73c4fmF10koY6zCwMZTFR3FRp 5SRQ+rkqTNUg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,293,1616482800"; d="scan'208";a="454563172" Received: from orsmsx604.amr.corp.intel.com ([10.22.229.17]) by fmsmga008.fm.intel.com with ESMTP; 23 Jun 2021 01:00:56 -0700 Received: from orsmsx602.amr.corp.intel.com (10.22.229.15) by ORSMSX604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Wed, 23 Jun 2021 01:00:56 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4 via Frontend Transport; Wed, 23 Jun 2021 01:00:56 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.103) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.4; Wed, 23 Jun 2021 01:00:55 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DJWNsKf4BU78mkFD9efhBGClPXYm/MzVN1bO6JFsVp58r8+rP2yAs2xzsohPNAbrWu6u+PjfSxP8V+JQQ9fHTNKiEPfiYnVlL0hfRlf1VVsk3JFtRIIGVsWdXWxOlIyFRGp57Soh8/ulxSw9/2AJAmTokKVyGTllh7tGe2x/6MGzuk/V/vl6A/xleQRR3ssDS0/TVi0YNWIK440sTR/bgjFOk3qY/tVnAoYX07l/G+PRRFy1KeObRu8O21wmBFPLAc+ml1TQ454XmOxfVQHHugwyKTE/cgTTJmDW6oXgRky/prqjHrFnVovCTZJ8fmGSHDEeU5FZ1SzeAmoxyasjag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=39ofjA0oANVXTPxcBxfYjxhfF4ik8C2GsRarUCFSUVo=; b=P56FchOroKSDWNj2s+QCuH8b+JTi9BVXPKg2psjJZ50Olqs+gXaSS4Lvd+VmMvTu3gPJyubbdWoD4hcfVBUOgEXFTDes5Sb8+W2ES8wo4TF3u3cjmz1y1Ou71JnlJZDXVUv+e2SPj0CnlKH3C2YBt3WgO1BmTCmBsYlLj+xuyTmLqXveWieZBdCJxjBWrOPshlxPu4suvrHoIBDcu0KE33FIA66WTHlb73KoPHPFuPGLEP4EqrYO8nANihAjP/9a0B0IQifQoXhN/KhGJ7PizVwXRvdVHhm8PuEx/eP1/lOXjmPSwO3/iRg932x9D15HnWvu1odoSvSNSlCAh0FHDg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=39ofjA0oANVXTPxcBxfYjxhfF4ik8C2GsRarUCFSUVo=; b=acj6TCBPcHV8wA/m4YUKtCdg+MGJ0JQU6vIW8A858LAM8BUNKRyDuo1FrAb5W0akSneOAsmeyQwAOxu7nC25WtT9rmsB14vNF7q/6YtqlVqGTZVUPORoL9w6s2rGltDm2rVmDw3tDI2DufaeCvRDtOE/Q/kbjolvuV5asJXu0cY= Received: from MWHPR11MB1886.namprd11.prod.outlook.com (10.175.54.9) by MWHPR11MB1933.namprd11.prod.outlook.com (10.175.54.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.21; Wed, 23 Jun 2021 08:00:49 +0000 Received: from MWHPR11MB1886.namprd11.prod.outlook.com ([fe80::6597:eb05:c507:c6c1]) by MWHPR11MB1886.namprd11.prod.outlook.com ([fe80::6597:eb05:c507:c6c1%12]) with mapi id 15.20.4242.024; Wed, 23 Jun 2021 08:00:49 +0000 From: "Tian, Kevin" To: David Gibson CC: Jean-Philippe Brucker , "Alex Williamson (alex.williamson@redhat.com)" , "Raj, Ashok" , "kvm@vger.kernel.org" , "Jonathan Corbet" , Robin Murphy , LKML , Kirti Wankhede , "iommu@lists.linux-foundation.org" , "Jason Gunthorpe" , "Jiang, Dave" , "David Woodhouse" , Jason Wang Subject: RE: [RFC] /dev/ioasid uAPI proposal Thread-Topic: [RFC] /dev/ioasid uAPI proposal Thread-Index: AddSzQ97BhCb3gd8AUyldaDZ6yOMNAEqZK+AADR4pXACuXPOAAE11w8g Date: Wed, 23 Jun 2021 08:00:49 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.5.1.3 dlp-product: dlpe-windows dlp-reaction: no-action authentication-results: gibson.dropbear.id.au; dkim=none (message not signed) header.d=none;gibson.dropbear.id.au; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.198.143.21] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 78aa1a14-4516-4f41-fcb1-08d9361d0392 x-ms-traffictypediagnostic: MWHPR11MB1933: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4303; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 9Cvxe4AYBGUKz98Xo4PcYZs7SSKoMc80YZVNQz65KfdgDSRlBTYTBmgD60joFqApoPTTJx/akyzyYVJqOy5YOiSzB1UAM9hGFOtrjDDsBEjY+5DrUQ7/irffoo2kJNudlK5ypMFHKTPIPnz/N65Nty8qtbsVqWZDFk2P5oef/uQpj7E8xMpUlzPKu1WMVe8KcKLK3hO1qXJnyR2hy6G+186bgw3z5GbQfklnP4u/nXUxWW4mnTvWRu8MFbQjILJ79Jl6OuL+WA34gB4wGxB2RkLoWkyyWGAamC6wDkutimnsAxBE5TdEYtGmFOAciPveg1YIK3EjMfJtw/mD3USW5jhBwKCM3JtYMOgg3oU8f/yEKJ/cUlX9+WOxvFf4J0X85dldehzzpd3Y/QqBff8Fd6tS0jRLpmTpdudnHT8eIwmDas88PSZZ9qni/1TfuQWQnIlgQALWFCpVddSI47Q7CqO+mo0X2A20aOMTm/QyN6SGxglh1y8H8mkufJ3ml5oxU8INZBqkOIj1unsJTcIksalS2R/WQmmjYAhRKWpFVerfCyfSyGn7kw36CI2zn+jjggqpmeFm0Hj7+iWSyIxjgg+8dlQdM2tWyMBOI0xZAIg= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR11MB1886.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(376002)(346002)(396003)(366004)(39860400002)(136003)(71200400001)(4326008)(86362001)(7416002)(66556008)(2906002)(66446008)(478600001)(6916009)(83380400001)(186003)(122000001)(26005)(52536014)(8676002)(8936002)(76116006)(7696005)(54906003)(55016002)(6506007)(9686003)(316002)(5660300002)(66946007)(38100700002)(66476007)(33656002)(64756008);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?8H2llP44LElefVBZX64duZXMHhiNZe07g6HBeooER+YgVScenuUwq2zSmNE6?= =?us-ascii?Q?jkj/lkicguce81Zx3H8gq/1mSFgtLXizH4NyyK30RxUUspF9d1NBrhGp4g2f?= =?us-ascii?Q?cNl0lSHfk0gDETUucKpQMc8kTVnTQi/WA2e4mnoDQHCJ5/hf8o9m5jfmpTCo?= =?us-ascii?Q?baV1Jz1iyaS51JWAJgPLzHhWLzdN0kMWgc/y28CsnY5ueXC/aFJTwbD8re2K?= =?us-ascii?Q?EeL0Nl37NxnhradUkORqlm5mO/iLjZdCZKwZS1hwuVqfG4DPcM5rL3nNbx/C?= =?us-ascii?Q?sWmeCCQPFdan6RjL/BKu4K38/fccKlBvgAeAzSnUukWiNMk/SoDdos2yTY/e?= =?us-ascii?Q?V5MwTJeUaWcLCnblo960QA20gP1Ecfjw5Qam1HNSmAlZjLNpoA0xuboRY+jK?= =?us-ascii?Q?vj0iN3eK1sco8LTIZGUlVdzR2ufzf68C1ZjgZxjO3dGfR48Bzj5kAqNg0Nzr?= =?us-ascii?Q?aMhigmxw8mlztmAN6bFNA2vgAdjqVTR3Pu7IOhT0ONY3s1eIO91FHjQfuTS4?= =?us-ascii?Q?HfC6rrpxWq1tquXaqiUunXgsMWgfXYKyFsCnlmBltJesxshyD/qTWMNH97tq?= =?us-ascii?Q?XVysbs0g4m8TuRerALeA0rgdMvK0fN+lBtqRyG47Hu6ruQwjb1pzXjMD9AVn?= =?us-ascii?Q?BCS7E2V5EJpKp6izDttkUlGzI6h5+GTOsYOg2jGHbygzuxRgmhEKUkSyprLB?= =?us-ascii?Q?O9Re1yUzsFmOnPjLg2LNFnUIRQ8I67mxmC5G8Eu7UBcQ8S7FH7wtV2pThAXs?= =?us-ascii?Q?YpMOUfphrkQPnJwPdh9Kyxn7iGhX/10o1YvMuRMOwGLVg87m37icT8fLWKBq?= =?us-ascii?Q?MHg2CJp9FLs3ydtp98WVia2rvgQrm6TfNVT6FALonNNeMutjM0Ofpr4CjQPx?= =?us-ascii?Q?ZkiH08B2XsFML2DTmp3PHX+GqBDfFiWtb886gCYJcXGJBS6m/VmzO3DPvrUV?= =?us-ascii?Q?GMUW2UlEGsJfa1Az1YkqgVPoCoLHlWpeQHLlc9PjR5vKzUNcBi4yUrbBpVV7?= =?us-ascii?Q?FxX4L4Z5vxNec2pYZZHkKdZfXI8Dpt/srlZkLBjGAYkUXQ0QpzmWIYtFB45D?= =?us-ascii?Q?x5e+F8lCkyVakdBDg55i/E2G83uXFaZVTdxwyW2wF8mszsbWpH38iwr5SH7l?= =?us-ascii?Q?2AQFBNPzOiFHoGPoEKggmzkjgxzFXevy4QWoLe66ezU1A8c/uZ5D7AWXOx7c?= =?us-ascii?Q?ySVORtEWSjgqvUappdAK5gk6BBaMlyfTAr0RIy56GzesUsVqtsmZW3tD7eJw?= =?us-ascii?Q?to6mh/NDqrW0itgTFYOyrvzGv7c6Z2QUoOmUeLkGfO+jAz9L/gopCo8uxYZ2?= =?us-ascii?Q?0RgUXHyXeZlkeZG1eVIBLKij?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB1886.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 78aa1a14-4516-4f41-fcb1-08d9361d0392 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Jun 2021 08:00:49.0352 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: KkAXK3VlLxAVMp4JSNV1X39BurHGiJjJbRiCwTfW5vU+AD3lhb4Fs1k0MB1Qjter8herewH5G0pMesWpiWi+0g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1933 X-OriginatorOrg: intel.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > From: David Gibson > Sent: Thursday, June 17, 2021 12:08 PM >=20 > On Thu, Jun 03, 2021 at 08:12:27AM +0000, Tian, Kevin wrote: > > > From: David Gibson > > > Sent: Wednesday, June 2, 2021 2:15 PM > > > > > [...] > > > > > > > > > > /* > > > > * Get information about an I/O address space > > > > * > > > > * Supported capabilities: > > > > * - VFIO type1 map/unmap; > > > > * - pgtable/pasid_table binding > > > > * - hardware nesting vs. software nesting; > > > > * - ... > > > > * > > > > * Related attributes: > > > > * - supported page sizes, reserved IOVA ranges (DMA > mapping); > > > > > > Can I request we represent this in terms of permitted IOVA ranges, > > > rather than reserved IOVA ranges. This works better with the "window= " > > > model I have in mind for unifying the restrictions of the POWER IOMMU > > > with Type1 like mapping. > > > > Can you elaborate how permitted range work better here? >=20 > Pretty much just that MAP operations would fail if they don't entirely > lie within a permitted range. So, for example if your IOMMU only > implements say, 45 bits of IOVA, then you'd have 0..0x1fffffffffff as > your only permitted range. If, like the POWER paravirtual IOMMU (in > defaut configuration) you have a small (1G) 32-bit range and a large > (45-bit) 64-bit range at a high address, you'd have say: > 0x00000000..0x3fffffff (32-bit range) > and > 0x800000000000000 .. 0x8001fffffffffff (64-bit range) > as your permitted ranges. >=20 > If your IOMMU supports truly full 64-bit addressing, but has a > reserved range (for MSIs or whatever) at 0xaaaa000..0xbbbb0000 then > you'd have permitted ranges of 0..0xaaa9ffff and > 0xbbbb0000..0xffffffffffffffff. I see. Has incorporated this comment in v2. >=20 > [snip] > > > For debugging and certain hypervisor edge cases it might be useful to > > > have a call to allow userspace to lookup and specific IOVA in a guest > > > managed pgtable. > > > > Since all the mapping metadata is from userspace, why would one > > rely on the kernel to provide such service? Or are you simply asking > > for some debugfs node to dump the I/O page table for a given > > IOASID? >=20 > I'm thinking of this as a debugging aid so you can make sure that how > the kernel is interpreting that metadata in the same way that your > userspace expects it to interpret that metadata. >=20 I'll not include it in this RFC. There are already too many stuff. The debugging aid can be added anyway when it's actually required.=20 Thanks, Kevin