Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1054986pxj; Fri, 4 Jun 2021 05:07:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9LAqueZpgu5Q3H3xuIFO1SvvXuVDH2FDr+68tga7w1eK23pG/FgsuPwMdXq5OkfVUArA4 X-Received: by 2002:a17:906:2456:: with SMTP id a22mr3769468ejb.496.1622808461568; Fri, 04 Jun 2021 05:07:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1622808461; cv=pass; d=google.com; s=arc-20160816; b=DZDbY8OtaUlAGv1Mxa9M33gT8S7hMCVNFLpR7zK9d0Tm9iNYkEVW3dOYHvyIjVmXgv /J92VfMSrr7Q/4HyP7KBMOju3Yr48HFisD/e38NQajl1cnPca1TBkO5Qcbx7wO3uAYfT 4K52XAop9ZB73yQjxUTpQcvV9K3yL+V69zXFYHtPB6CzeNcMYeK+LOpYThbkV6BdI6wD F7QpU7Q/9wO3RLDx28qmBJySPv57ymoHt6tVI8exAyX6GpBtWisgH7t6fcwz/PHIxMUP 8/Zk+qCHAsi3AuQzEAp72u8RHAvx46gl1zFrpgswHdowr/y6Qd0/riiZ+hJMx/E18oja 824A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature; bh=FF2MCocW9dtVtSUUrVz5IlvJHHVJVvVFCOL6oZXSvy4=; b=KV10x21ie6v9Xp6ySlKknp2r1xBKKad6OFNhbbnMrh2fZki1Docw+MleIhcK7nZVbe MT+nnay9Qvs+d0JJQ+dPv/pYXSRGDtL/I/8CSpzt63Wf37KQVigfmGDeBFeFfFPnPgoC HDZDRV0rULjcbocQQmaK1wP0NHpktpLjC+NQ6FylfVKNdTySMSQwlpiN6tKeQwJubPYm g7UousS8BIysJsdTIbmSm8GPapy0ZvZzBPonZxTUH45yCPZrOlfeKF1t3Z6zbPx2Ye+7 7OsLwzKhx9qPd/vro9hI8u+6HncxFx+lGw6PGctZYW3Xn4y8NWhHcr4jrIPBE0bZVY8z 0nrQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=nx1r4RqF; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.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=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w2si3348769edi.531.2021.06.04.05.07.14; Fri, 04 Jun 2021 05:07:41 -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=@Nvidia.com header.s=selector2 header.b=nx1r4RqF; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.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=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230161AbhFDMHp (ORCPT + 99 others); Fri, 4 Jun 2021 08:07:45 -0400 Received: from mail-bn8nam12on2043.outbound.protection.outlook.com ([40.107.237.43]:32284 "EHLO NAM12-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229740AbhFDMHo (ORCPT ); Fri, 4 Jun 2021 08:07:44 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W81WHP4w/b09sEJC1JWvBBVEDMMo3y88IADU4lQ3UVakOzmlbHW+mz0Or/eH5lQ6x4X8h+eW4KZiE98y8dpd7xvOiDCzrUbDuHhqTKKPT7KWrYAElmvbZUksy/F9pA3G6D90ynebNxpoIEUCd3SX+yYM0DMCVzjaMqcNBz+6Z/MKfleTXPGTsLIUgl0VRC/Fl2Uhfg0CAnI1/jSMO/Sh+W0ErV3DUDJE6D52GBS3jjw5TF0YxZXm4uL3LG0cEu8EvXNuX2FG/CE/Q2yoDR1UgxXlh0EiUHeKW756ZXk8cIYILTFZjZUoUgWoAS9EuI5C2++nWIvUur+xf7JTHne74w== 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=FF2MCocW9dtVtSUUrVz5IlvJHHVJVvVFCOL6oZXSvy4=; b=mkEtPTmbwBICsq5GJFQFMnrriRl9OGh1huyEvdDEfjPx2GYFTD8SdjnZv3WhbfOyCpkexG/gUrZJF5dA0w+Gal+Jlelhs+uOEDfbdooW+36+JrnvNc/InShnOAVmyo+PdPsJYJRaN+6rLft52ILxEJykPg1k02WGpU92bA0IdyARXACyMSGlwxSKvStcpeuN0ompl8MZ45HsEoErWZ940PZYAm1xzIEhgfvo1e2tlWfnkqV6Xng0ZtOwhU0+IuSsFDkG8VwanJxgUGpwStpcE3iRav1f3iVSJ/vDnkYlZZpnJml/80Nw8jWlLKLnb40A9QiSSGDPKdoOc3qeWB26fQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FF2MCocW9dtVtSUUrVz5IlvJHHVJVvVFCOL6oZXSvy4=; b=nx1r4RqFWGwoFHULzClCSRlnEWPZrxyIlQXWY6qdHGZp6OPC1RCXkYW1FhlHikkEpMHS3IGFqVEU6y2rXoMITBbZlb5CMFL3sAm8MvBt8gYYMkw7a7BjP8VL+wxPajmOtZZQyJJcLLt/lwbH7layzjoNhIGTqb+QMwNP9qkYPg6cCYa5Jti8UQ1Syfu7/WX3mm21z7K/dwitmLHasA7Q8oQ41NBodownlpO7VDx+4WH8GbeRq1+yJvjpYulYSsNQRmr0jSDFYpRvmZe9ImJMhlF0+RScRlFHqTr0CdTlcG/TODrvJlsF0a/PFJCaB24ioLER3bdISj6dDQ7gNuer7g== Authentication-Results: linaro.org; dkim=none (message not signed) header.d=none;linaro.org; dmarc=none action=none header.from=nvidia.com; Received: from BL0PR12MB5506.namprd12.prod.outlook.com (2603:10b6:208:1cb::22) by BL1PR12MB5336.namprd12.prod.outlook.com (2603:10b6:208:314::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.23; Fri, 4 Jun 2021 12:05:56 +0000 Received: from BL0PR12MB5506.namprd12.prod.outlook.com ([fe80::3d51:a3b9:8611:684e]) by BL0PR12MB5506.namprd12.prod.outlook.com ([fe80::3d51:a3b9:8611:684e%6]) with mapi id 15.20.4195.024; Fri, 4 Jun 2021 12:05:56 +0000 Date: Fri, 4 Jun 2021 09:05:55 -0300 From: Jason Gunthorpe To: Jean-Philippe Brucker Cc: David Gibson , "Tian, Kevin" , LKML , Joerg Roedel , Lu Baolu , David Woodhouse , "iommu@lists.linux-foundation.org" , "kvm@vger.kernel.org" , "Alex Williamson (alex.williamson@redhat.com)" , Jason Wang , Eric Auger , Jonathan Corbet , "Raj, Ashok" , "Liu, Yi L" , "Wu, Hao" , "Jiang, Dave" , Jacob Pan , Kirti Wankhede , Robin Murphy Subject: Re: [RFC] /dev/ioasid uAPI proposal Message-ID: <20210604120555.GH1002214@nvidia.com> References: <20210528195839.GO1002214@nvidia.com> <20210602165838.GA1002214@nvidia.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Originating-IP: [47.55.113.94] X-ClientProxiedBy: MN2PR10CA0033.namprd10.prod.outlook.com (2603:10b6:208:120::46) To BL0PR12MB5506.namprd12.prod.outlook.com (2603:10b6:208:1cb::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from mlx.ziepe.ca (47.55.113.94) by MN2PR10CA0033.namprd10.prod.outlook.com (2603:10b6:208:120::46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.21 via Frontend Transport; Fri, 4 Jun 2021 12:05:56 +0000 Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1lp8aJ-001dAn-DW; Fri, 04 Jun 2021 09:05:55 -0300 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d158c0f3-b6d4-4589-91f4-08d927511c16 X-MS-TrafficTypeDiagnostic: BL1PR12MB5336: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7ygUHGgs+VYkAe9AbpUc+Kie7ThWmnhTas9UuigDsv2TKIzucjE1CLjyQsQwBIsWNCTUr9/LAjaNNKJrlTbHjwamrSJyVGzL24Y/X66CGHj9QJEtvADLee1oQpn4VFvopIZtRlcBtWmr3aKAGVVxLSn3qE59WAE3xn6VwRbUCA3OX4XSibXN1hV6SIYYarifnM27AtOpaw8bWYlQWUtejP/4BPJG3CmRBT38CwcMgswj9xqyKCk0OLMGqTZZfm4MfB7N9pq7Lim0T4LMPRbAhzfAlxD8B/sii/shHCYWIU8gZ1+uLm1H64R/9VDkwL+4fDVbH9rXYhH5q9MpPhxhG6w3SOp6d4CU7pjRibD3vxDfPkUOzwWc9W8BZHzEoe2TQrjh0LIt+lNKm9bRTjj/fdSvizL/w4902/3jdjg+tUl1/rJzUfU+MnxiGTugMLJxrjOaB7JlhT7Tlr4ai4X9vRSUyJDWbeyWl96gvHa5ujoYVCkGMSmdlEbw8LHGiQp0GMmgA43fR80d4OvLBqxtl9OOyxSIknOCnMwsQbtMpioDGOLzlRZUYdXyBVSxI2FgoM6rmZ1AfoKA7ThubQ5xgkemdPSWWQ0fOPywdoZC6FI= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL0PR12MB5506.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(1076003)(86362001)(38100700002)(7416002)(4744005)(54906003)(2906002)(2616005)(66556008)(5660300002)(8676002)(66946007)(426003)(9746002)(66476007)(9786002)(8936002)(498600001)(36756003)(4326008)(186003)(26005)(33656002)(6916009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?i575fRyeAsTstEf4fagGV1HoAsxoC+NnxgImGgvqpvKkSaIC9TuEJvMiRrTJ?= =?us-ascii?Q?veaiLG2Z17kFu1Ax+5miMMju+V3v7jiolA+kn6qbJsnp0xilYtyz+QXwEQz5?= =?us-ascii?Q?a/nKvWFSK8W+mEXdbypwRR6NMZX3KI5NO4dQxG4S1lLtVpHLkJHkSGF8cjUT?= =?us-ascii?Q?Xez6mlgAFxJH/Ly51aw/zdfI8ngAVZ/U3JGMOUKE+Utt3+e62Zp1XhMxDiQf?= =?us-ascii?Q?vzoouynN8ZCX+mxlgZmlWLmiTgMHT5LhuRQIc8g3ydGRTpdf6h15NTrcpPin?= =?us-ascii?Q?00Fn+6/71LPtEwECsnM47wTW1UqCKBrYtDVJNEp3ORm6JvGP2NHifY0q5+jP?= =?us-ascii?Q?Xf0kd1Q4gJSt6796PSvGsmW7pYYkFVbHy6asDQhtIGrKCvAGFAF09uwTdgaw?= =?us-ascii?Q?dpDsUPWLKNkOsAHfedQe5Uh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=?us-ascii?Q?G0t6WGgAx8y2pTnH1dRMLH8t?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: d158c0f3-b6d4-4589-91f4-08d927511c16 X-MS-Exchange-CrossTenant-AuthSource: BL0PR12MB5506.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2021 12:05:56.8433 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: kQE06zu4PSirAe6/y9nkCNEgMvVh1aIff6Q4AZZPYb5fQQFaJiwSj2mcGBSuwtpf X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5336 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 04, 2021 at 12:24:08PM +0200, Jean-Philippe Brucker wrote: > I think once it binds a device to an IOASID fd, QEMU will want to probe > what hardware features are available before going further with the vIOMMU > setup (is there PASID, PRI, which page table formats are supported, I think David's point was that qemu should be told what vIOMMU it is emulating exactly (right down to what features it has) and then the goal is simply to match what the vIOMMU needs with direct HW support via /dev/ioasid and fall back to SW emulation when not possible. If qemu wants to have some auto-configuration: 'pass host IOMMU capabilities' similar to the CPU flags then qemu should probe the /dev/ioasid - and maybe we should just return some highly rolled up "this is IOMMU HW ID ARM SMMU vXYZ" out of some query to guide qemu in doing this. Jason