Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp696164pxj; Wed, 2 Jun 2021 09:08:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyzKcFWq7fX6slU5WdqTeujNIxmqCaS5UGVs9e+0XTucUxG4CSYrqtq3ta+Gwa9Lje4MVih X-Received: by 2002:a17:906:3057:: with SMTP id d23mr26818493ejd.131.1622650126505; Wed, 02 Jun 2021 09:08:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1622650126; cv=pass; d=google.com; s=arc-20160816; b=TxF4g04ph9VWHX8QR8NZ+fXxQ//mGRQjXQ1REZ7as6X1cdfKWNoX3/jRss+XRQe3+m P/X+CrJEIMnQMdmmUDxJbSsmVo+my7/lVBkFhVrTYY347saND2ErVq3wWXAgrw43AJ1/ Y5+Zk61BLwCq8sRdFdwY6C5GYwmgJrZ4uJ7CYQ28KhaPTGg+HOd5GbjEpxCjaDhMztG2 qQoZ3qLNTti/1BM1u830mwMMFzorht3zL7GM8JUGJO/ilhYz3ZKAy1dK9vYtmXR8q+ZI BKv0W+VMxMuBkqmWcrgV6It4wzrGhzPgSEtkgo3NN09ShxTnh96s+hU6jgaZuqr7O/2L btww== 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-transfer-encoding:content-disposition:references:message-id :subject:cc:to:from:date:dkim-signature; bh=TXxVVVjsUITA1BeRCS65X1i6eOYr+zynRbuJtxbzyzE=; b=vfJPm4/XxGgW/Q6NJyt1eY9G1GcyrGFRolhTAOKEyYBtkHTjjCkk2XUE8Uawyq1yoN HPMH6xMVK+5IbZEo9U4byRwyijFgP0SRjj/bQV2Npfl1AoBAgDZ2nbdHgHf7S5Zu4NMN JJg5eyEIMTMtYgJpssbyIJ4gfNjsdD+cZktKBAxVSqB1w7KdvcllFMT1TB+fKF4pPZOw BLoB9RoUGCI+CgBxR/iSyHSonOxspkbXxt6hDBh6bRT+ktCoC2lrpKvEwfB+Rb/pXNNW KiQRLxsW4dDT//cjTMK2lwYiqvOMEDRcobwTonPCkBXdOKWobGulHmRzk6pZ408u2e1x B/MQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b="f4Ib+M/G"; 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 b13si288868ede.317.2021.06.02.09.08.23; Wed, 02 Jun 2021 09:08:46 -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="f4Ib+M/G"; 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 S232625AbhFBQIz (ORCPT + 99 others); Wed, 2 Jun 2021 12:08:55 -0400 Received: from mail-bn1nam07on2045.outbound.protection.outlook.com ([40.107.212.45]:38532 "EHLO NAM02-BN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229668AbhFBQIy (ORCPT ); Wed, 2 Jun 2021 12:08:54 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=moE/tftfOuQl/n3wpVOmUomv3GNGo64894oNQgLmTpojX2QPKWUQz2TVYpGB0QqYZWCbYJqdjfoa0GQOtMAQIdK1KxJ/1zQjUIrAeZFTylCslEHeMdCC7u92gRX9fdkn5SPLOKg60+D1V1xsoCqv1dFHDjtsim4CnWl2Wen6aUBq6Lmrf41UL5QTh5CD6x9aRib61r1+PQPT1gIR4GqpcF5eiQon2g5XRLBBkCEgMogoy3RYNSVASE6WiFBjF5GUM7etthmEJzhOk6aaHcLll9aYzo8yN8Znnj4oiimv/rp4HrRf6GxhN+iUrcCcatBX6IxYqCK2x2gMOEIKK17MpA== 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=TXxVVVjsUITA1BeRCS65X1i6eOYr+zynRbuJtxbzyzE=; b=K2zoTH9T5NmVVzHzb+TrSSRHkrGRuaFypr0oj3j72GH7q5TcN7EnF+EbcFXeZggD4WipdVUuQ0rM6V9HhXBlLbEzgugskuk3GSjzLNBA3zgSuM5L3n7htNCLNrXacNgQEbTrZrUxm2Zyf2qUyEHKAj/x4CJM2/3pJMBkoUoj8xOk0E+dCCgo+qfOJ1yk4AC+0KIsjhzDC0qW3BF+CB7MZ2nDYW/MSTcWKWyEsQIduv1opEX4/h0mFRGdfeg1/+ladA+tJWpGp+hN5QAC3n2TYD7y6jSGKqRfht5j/BICKo4JfBbrvuVMnVoJcWvr2fSHXmG953GXvAqX+ebkK5N58g== 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=TXxVVVjsUITA1BeRCS65X1i6eOYr+zynRbuJtxbzyzE=; b=f4Ib+M/GYvejCZRkKzTuyoHG20hsE6x42HZItoWOFBK2pCLS9FT2BFiue/jSn/QWg+vPzby+izDaekFmtyHmFm7OABLn7UZhkr4FwWO+rF3j3NpX9mwMGMF3DAZZeSZN8W8lpwovfVoHJ6wInriq8IRYTm3Dw2yiI7eakeKRl6zjEi1Jl4udGRMCcOtF/6gt4L+sz1ngwuDj4OK0LReC3jpI3TU8iaJLuJE9ONj9uAYhcLAzUWTQfULcM/l4ufAvlMC6SwRsQjVKvwPjng7lNGb7GYkRiJMzxKDI1MHmFhfMx2xE8tOIWt4jX9tLN+DRFhTK5Q9Gk/jft40/Q0+JmA== Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=nvidia.com; Received: from BL0PR12MB5506.namprd12.prod.outlook.com (2603:10b6:208:1cb::22) by BL1PR12MB5361.namprd12.prod.outlook.com (2603:10b6:208:31f::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.21; Wed, 2 Jun 2021 16:07:10 +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.020; Wed, 2 Jun 2021 16:07:10 +0000 Date: Wed, 2 Jun 2021 13:07:08 -0300 From: Jason Gunthorpe To: Jason Wang Cc: "Tian, Kevin" , LKML , Joerg Roedel , Lu Baolu , David Woodhouse , "iommu@lists.linux-foundation.org" , "kvm@vger.kernel.org" , "Alex Williamson (alex.williamson@redhat.com)" , Eric Auger , Jonathan Corbet , "Raj, Ashok" , "Liu, Yi L" , "Wu, Hao" , "Jiang, Dave" , Jacob Pan , Jean-Philippe Brucker , David Gibson , Kirti Wankhede , Robin Murphy Subject: Re: [RFC] /dev/ioasid uAPI proposal Message-ID: <20210602160708.GW1002214@nvidia.com> References: <20210528200311.GP1002214@nvidia.com> <20210601202834.GR1002214@nvidia.com> <1a3b4cf2-f511-640b-6c8c-a85f94a9536d@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1a3b4cf2-f511-640b-6c8c-a85f94a9536d@redhat.com> X-Originating-IP: [47.55.113.94] X-ClientProxiedBy: MN2PR22CA0005.namprd22.prod.outlook.com (2603:10b6:208:238::10) 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 MN2PR22CA0005.namprd22.prod.outlook.com (2603:10b6:208:238::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.15 via Frontend Transport; Wed, 2 Jun 2021 16:07:09 +0000 Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1loTOe-000HKt-Kn; Wed, 02 Jun 2021 13:07:08 -0300 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bffe30a4-594d-4e64-9a60-08d925e079e9 X-MS-TrafficTypeDiagnostic: BL1PR12MB5361: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wksudrp7SltA9HDruyozKcvqhpfUN9n4eoPtGVqDQzdhNyOwcUK5voQkJ4k3U0UbkcUVMYCSksjkLHCqeP4ar9E8mgcsJCf2Xp3VaPK/vuGbuymFx3uUukXeNCw3R7vaXLKJBQUl+2ClQoy+2j5uxx4TK31udstFbEuS8m0GmlA050QYzQn5hdDEAZyjd+QeUF7N6GT5cgnHkTjzayvPuySFeVp2HRziDJy8g7EDHAJ/oWpc3LIny9gyZK3LLi8VsNsWlvETLUXvZN2ldZBK/Y5+S1eAwgk5FNANxZRWdjMTQnF4WjnU3icpOm3gag3nyn+zz6PE5vz8X98ZoNZUxZEzayVBCFlyVqvlQJf6PzHY3gNOpLUtrxIb38FQnMigkYGVLnP+hu6MiheryQoLqrW1ANYdzmiVQh6nO4CG1oXUEX5BehQy6ANidM9CxQ0GeBNqJn6MFnpTPmC7v8ZHlbKDa/CQeLUIs6mdCKZqZ0g//TPA/Tg75Pt1SCdcMr0uqCMVgJe4WryNDFU8TICpgeB5PFFRrnYeZDDoBVRF5kR6+OWZTJrq0SkjGfykcatJgir9cbTEY2WvS0zU09pMOf1E4FnVyEmsgcjZQ/D/HZM= 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)(39860400002)(136003)(396003)(346002)(376002)(5660300002)(4326008)(426003)(7416002)(36756003)(38100700002)(66476007)(54906003)(8676002)(8936002)(33656002)(478600001)(2616005)(6916009)(66946007)(9786002)(2906002)(9746002)(186003)(86362001)(66556008)(26005)(316002)(1076003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?B?eHloUzhFVjFrbGZaWFV2Q0NNOTFVcHBOaXczZkdwSGNOdnc5cU12N3NiZmhY?= =?utf-8?B?ZzRlWktoUEV1TUhRRTI5SnpYTDd6VHFEMWZiZDNJK3FtUmRuZW84VFErbVhH?= =?utf-8?B?bTNiT2tvOE0xZWNpL3A2UmQ3VFBrTy9ZZW5oenJlMDhPNWtydk1PbWVhb3JQ?= =?utf-8?B?Uyt6RmNtMXJBbGxiKzlidy9QcWlxMkwxM2tudUVmQTN0R2FQalJQNDU4ajMw?= =?utf-8?B?OGtpOEZlclhmYTdsZ3cweVp6UENyUkQrcC9DK25aYld6WThzeUVpMUtLNWZQ?= =?utf-8?B?VmJ2WVFhMlRtcXZwTmpCQ1o5ZUZ6KzJwdC9wdn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tnb3NvZVhLUGZXMmIvMnd6QmZoNlI5L3JH?= =?utf-8?B?elNPM3ZMRlZvZlBXMVdGUTl1dHh3di9OTnAwWVdxWERKVXV4NStqbW9Uelcx?= =?utf-8?B?Y25ROE5uRVFuWkZJbjY3c2xKbFVYRStxUHhqMmJHaTR0RHAydGtBNUVVVUk5?= =?utf-8?B?eS9lcXRvR1pMMnZ3SVRZbkYzOXpzMGVYVWJtZG9zZGdzRnN2QTc3TUMzeGxW?= =?utf-8?B?NVVLWkJKcDExVGZyQ28xN1I3N2lTR2FOSkpzNDc3UE01a3pkd05TUWhlbTgw?= =?utf-8?B?UklSSEh4Q2R4a1VybFo4ejdkODZvcS81TWxtNG5KTjN5TGZwWTU4VFJrR3Y4?= =?utf-8?B?NUw3Z2lLeU56QWdrenhPSnZjc2xwc1B6dEZzaVpKZURjLzJsb2JUNGFRbkNX?= =?utf-8?B?U3d1TGhrN1dDdVVIWEtBOVpKYTJTY281YjlSNElRWDJndGV0VlZyeEpRTytO?= =?utf-8?B?VXJpN1JoZExVRkY1YVJzNHQ1R3h4cGJxeWU5cVI3di9LcGxaOUI2Q3N5OUhw?= =?utf-8?Q?JWiqRyDNgNPDxGgmC7tFDuMoBDccZI9UMc7POpE?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: bffe30a4-594d-4e64-9a60-08d925e079e9 X-MS-Exchange-CrossTenant-AuthSource: BL0PR12MB5506.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jun 2021 16:07:09.9353 (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: JCGhwrbb4QxvyKypzrvDS0ggAqW3UjQ0udJpNtipnD9uKSDzCjLKNPzUljxIQRI1 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5361 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 02, 2021 at 04:52:02PM +0800, Jason Wang wrote: > > 在 2021/6/2 上午4:28, Jason Gunthorpe 写道: > > > I summarized five opens here, about: > > > > > > 1) Finalizing the name to replace /dev/ioasid; > > > 2) Whether one device is allowed to bind to multiple IOASID fd's; > > > 3) Carry device information in invalidation/fault reporting uAPI; > > > 4) What should/could be specified when allocating an IOASID; > > > 5) The protocol between vfio group and kvm; > > > > > > For 1), two alternative names are mentioned: /dev/iommu and > > > /dev/ioas. I don't have a strong preference and would like to hear > > > votes from all stakeholders. /dev/iommu is slightly better imho for > > > two reasons. First, per AMD's presentation in last KVM forum they > > > implement vIOMMU in hardware thus need to support user-managed > > > domains. An iommu uAPI notation might make more sense moving > > > forward. Second, it makes later uAPI naming easier as 'IOASID' can > > > be always put as an object, e.g. IOMMU_ALLOC_IOASID instead of > > > IOASID_ALLOC_IOASID.:) > > I think two years ago I suggested /dev/iommu and it didn't go very far > > at the time. > > > It looks to me using "/dev/iommu" excludes the possibility of implementing > IOASID in a device specific way (e.g through the co-operation with device > MMU + platform IOMMU)? This is intended to be the 'drivers/iommu' subsystem though. I don't want to see pluggabilit here beyoned what drivers/iommu is providing. If someone wants to do a something complicated through this interface then they need to make a drivers/iommu implementation. Or they need to use the mdev-esque "SW TABLE" mode when their driver attaches to the interface. If this is good enough or not for a specific device is an entirely other question though > What's more, ATS spec doesn't forbid the device #PF to be reported via a > device specific way. And if this is done then a kernel function indicating page fault should be triggered on the ioasid handle that the device has. It is still drivers/iommu functionality Jason