Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp3013834pxb; Tue, 21 Sep 2021 12:31:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzlOMg47o1NhxE0qqlUb3Irbp71K3UPhnffzoREX+doRJVxNUKXF2yy7lrZGtLjA6jIvJH3 X-Received: by 2002:a02:9545:: with SMTP id y63mr1499411jah.116.1632252668732; Tue, 21 Sep 2021 12:31:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1632252668; cv=pass; d=google.com; s=arc-20160816; b=p0G9EqJZOgrQC1g6LgTSpqM2LtInPDW4PyHhAk5tZbDHhk2VhgtOcjTALmdAgGcZ6U Qs44cKBCp92bTre897rz4StB5QNyEBbl66QP88P17u7gV6RdiQ88L8mgnAfUdFY1uJ5m NUyELXo4GQEKo+TGGjfTvdzAxmhSaNAsipUdkHOy3PfABK4ygnzqsQYuSRAdUo/hepIc oX1yuznLwruv7YVpyRVGn/OS0Wpna/lrX+//KXw1D0ftJHL7ZtGCQiiS24f6xZnNecgt BgrbuY/qh3CyTH2Aov2B0KvbeF2dvJRUln4Wcvo05pOH/D0mj34De46WFrsgEkmkxHWQ E9Yw== 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=lTkQWGEIZdKeW8GIaLbIdfR91KQa46wv/mQV1MHCWn0=; b=VAJelDyUa+iKW6xAn0S0J4BwZne1d5n//bnXhwSOo7mENAqWVRUsg5aAb93rZSQBah x8pYilr+DMPWtmpBFVdxWEH5XeYccaRoxGTFDultPLkLrbwDawsriNIoWQ2eCmFcGcVv jvxNGaC8DXaPLFPPN3BQcBpm0V3AIst0j6dVAv89Tcb9T2Mdo78Bdku2U92nBxPRt7bU peMIEozRz6dCK+KuPm0M/pfJy5mb8TY0XlhUTNVjp+UiSSznimyFQTiWFHMvBjsDToG7 J5G3PmZ3YWg9RJaKqZw1xiRBDnkcj3jiw5c6bNX0E/o7aJKQw0lbQMhagkHoMXQg0eVi Yigw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=fnlgybI1; 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=QUARANTINE 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 j24si17417889jaa.10.2021.09.21.12.30.57; Tue, 21 Sep 2021 12:31:08 -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=fnlgybI1; 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=QUARANTINE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232306AbhIUSFy (ORCPT + 99 others); Tue, 21 Sep 2021 14:05:54 -0400 Received: from mail-dm6nam12on2081.outbound.protection.outlook.com ([40.107.243.81]:55750 "EHLO NAM12-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231944AbhIUSFt (ORCPT ); Tue, 21 Sep 2021 14:05:49 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CGfrP2PU8IFpXSQtXPnBKwu6c2o060bZBAYQGQZ2GPoxby9Lj7oKOrfW9HoTScaDI/XhsCPyoWE36u+EUDuGWi1GlGSbMqUT9nSYW7maXC/AG2mXcADBTPM3DJBRijHRN4bswOI17kTaAVij+tRVz8C7cH1pAMjMFfRcETEyQwkDG+k0yDnVpTvPu1XONsMIoIfSTRFWZM0d2zuv4TJp6CKWCXsIK01WsZSnnvNwfCAnrfzB5Mpkx1hQ6gIXJ7HndIdF8t3drLzcAMo6TkT33r7IsVJCZuYfp45vrTBCLAeIcp4uARmApjJUIP+V85A4m/3Vj9O1HjarIzMKGULubA== 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; bh=lTkQWGEIZdKeW8GIaLbIdfR91KQa46wv/mQV1MHCWn0=; b=YDR8cA9nEGhVY09DMTtgECCGPlARddbcTyOSpFUAbIqY0Du12Q0LRNWFFmwTjI1gHoTS4v2dKCIvDMqS83fhubRxpR/WwajVYKN1ax7lHnedQILzJ5Q18+QCuMB+Z94zBlwEAIv+yymrUHr43YAb7cePupbqg5SYKU0OCYumvbfvqcX0/mC/72MBGAo/7QbiMwQ8OzUzwEQmzcrwBY4Wfww53kaZj240XhVALsHHN16duQSjMuXrzadzDgFFS6IJnt3+Hpzg5+U/vmCxeJhLk74hmaTm+/ndSvGNCxuHColP1R1InzAXFkXFRGFA0Hm6nV1/4WPzjPNkEEtIL4loxg== 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=lTkQWGEIZdKeW8GIaLbIdfR91KQa46wv/mQV1MHCWn0=; b=fnlgybI1S+l2LdgE7GudGnxCGxNtTi6wl6ToyhZDwIFsjVLeDEPLZ8GxnovKtLDp0L1cNUQYGvS3zwvTcCPYBoXrQKv6wHfGbyZH/YBhtPPikzHa6DxcuYA5EI1OTzWvoiDzB0CmNt6PNzun7gwxDzrSs4rDpFC8z71xyFiuTCkEocA6+46l4H1t942OHLq5/lLy3aAxPZXTwYzo/RNqJKpucviEQEg3n7UO5BVWxNeNdpoqyWkLJ4rhgPMQ/2g4lj/vSlSYP9xnWGCaUidD2BC5wL+M5xyhyzeSUsAuFHZdoTr+6WYYBlH7nMRIkyNMPN+HxTESRPZNcbY+vjNGag== Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=nvidia.com; Received: from BL0PR12MB5506.namprd12.prod.outlook.com (2603:10b6:208:1cb::22) by BL1PR12MB5239.namprd12.prod.outlook.com (2603:10b6:208:315::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13; Tue, 21 Sep 2021 18:04:18 +0000 Received: from BL0PR12MB5506.namprd12.prod.outlook.com ([fe80::e8af:232:915e:2f95]) by BL0PR12MB5506.namprd12.prod.outlook.com ([fe80::e8af:232:915e:2f95%8]) with mapi id 15.20.4544.013; Tue, 21 Sep 2021 18:04:18 +0000 Date: Tue, 21 Sep 2021 15:04:17 -0300 From: Jason Gunthorpe To: Liu Yi L Cc: alex.williamson@redhat.com, hch@lst.de, jasowang@redhat.com, joro@8bytes.org, jean-philippe@linaro.org, kevin.tian@intel.com, parav@mellanox.com, lkml@metux.net, pbonzini@redhat.com, lushenming@huawei.com, eric.auger@redhat.com, corbet@lwn.net, ashok.raj@intel.com, yi.l.liu@linux.intel.com, jun.j.tian@intel.com, hao.wu@intel.com, dave.jiang@intel.com, jacob.jun.pan@linux.intel.com, kwankhede@nvidia.com, robin.murphy@arm.com, kvm@vger.kernel.org, iommu@lists.linux-foundation.org, dwmw2@infradead.org, linux-kernel@vger.kernel.org, baolu.lu@linux.intel.com, david@gibson.dropbear.id.au, nicolinc@nvidia.com Subject: Re: [RFC 15/20] vfio/pci: Add VFIO_DEVICE_[DE]ATTACH_IOASID Message-ID: <20210921180417.GZ327412@nvidia.com> References: <20210919063848.1476776-1-yi.l.liu@intel.com> <20210919063848.1476776-16-yi.l.liu@intel.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210919063848.1476776-16-yi.l.liu@intel.com> X-ClientProxiedBy: BL0PR02CA0123.namprd02.prod.outlook.com (2603:10b6:208:35::28) To BL0PR12MB5506.namprd12.prod.outlook.com (2603:10b6:208:1cb::22) MIME-Version: 1.0 Received: from mlx.ziepe.ca (142.162.113.129) by BL0PR02CA0123.namprd02.prod.outlook.com (2603:10b6:208:35::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Tue, 21 Sep 2021 18:04:18 +0000 Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1mSk7t-003XKS-8E; Tue, 21 Sep 2021 15:04:17 -0300 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 86b754d0-f2b7-493d-3013-08d97d2a3b02 X-MS-TrafficTypeDiagnostic: BL1PR12MB5239: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NVbTHnD3b0qxoNbnNfx0WTIQvTmR3j6NNLV15x0KFlItcxTiNWh3nJZJqmm3qWLpd2B8Gf0KY/1Hi8jacH6QxrIUPac3/jvOVN/uVd2Izhpff//WZxkawHXp3TQg/jNlCQJ7YX/qAvusCwlamBuaB0Gj63pSnxPBzBq5eaNWoECa9JosD2jbiRD8Bl8VKe2Ntels3PEH7zYfjb7LBwYgpE3/SE/1LEum5j0v702XIcXFVEvFrNQD3Nr4scMcSwmwphdPJOl3dL/sU41OKmAzFMvwdDNLstuxLbSUlAy1Rtw+5Yl5M8IlOYhF33ecHjkmpHSg8pdPx/vfObDj1XPhPerIgoLoqdAwgCDNHsJZW/5pJkE+oq98WyfzVqTr4T4iceustTQ4EeyQYUjnsmqMHMaReDVRUhDtDJl7h56G2pkGV6WVXWpjc1II1Tq4wn2dvxTkXiqHrOs+weXtQruescn5EzokRAq6US66T2fApBNvVhMiVPJ6B4V8w5X8Gi/p0uEq0xsFto7iNqO/Qw80mEQJboL4jpym+W/VhdHVvwpapr3ZCiZbmyb1CkNh6n4bsk628BYPQrXsTD3wdnXWNom+4RjNw53aPufik9solMn3LYjHJd7kRCQv+PhxkLzwHT6cly1GFIZqeGioOsZJCzgY1HfL7bjifR5Ty+XQfTwHoZ1whM9zCez4GxJPlNIj 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)(4744005)(7416002)(26005)(107886003)(426003)(4326008)(508600001)(2616005)(86362001)(66556008)(9746002)(9786002)(36756003)(33656002)(186003)(66476007)(6916009)(1076003)(5660300002)(8676002)(66946007)(316002)(38100700002)(8936002)(2906002)(27376004);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?oLzMr4fJnwf5cjPhJ98PSzbm4ftyraQAJ+NabmQOvbLNkr14YPtIyeigThG7?= =?us-ascii?Q?j8IB2aLLfyq4X0zBGh26Zcg4kSDz9fUR5VFHa62pwrMNSO7fn2km+pfCr3Ie?= =?us-ascii?Q?tNWPU0oXZW9ctt8+a76pi/MCqRtJRyxC8fkhzCW+Vy2WUkFiUI0KF9GKXqv2?= =?us-ascii?Q?uaLkALn6BryoUDQaxn1zx1XeQ/nbkY0VIYborXuTZEW/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r9T6h6geu648xyRZbog2lSQgon+2NsOHhdMY/qHUDyrKOI6Js+PdY?= =?us-ascii?Q?GMmD4O+FHPEnuoTu+Fh6WCBbwvCtnFBtQdFZQnlo+ljuytCaChWsngk5R3fs?= =?us-ascii?Q?9lFeEKAmM24YqK49xwHecwfBg9WmTVzY4d9B4q0t7IZGbpNRaX3oT0GcPO94?= =?us-ascii?Q?oBE4b+pM9Lak3QM61vO+yYn6B1yd5tx2OSMfDqs8ypSyjPrWgQZS/a83C4qa?= =?us-ascii?Q?CxHPxWA5sN/P99qRJwcv+og6?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 86b754d0-f2b7-493d-3013-08d97d2a3b02 X-MS-Exchange-CrossTenant-AuthSource: BL0PR12MB5506.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Sep 2021 18:04:18.4670 (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: 4A9jl4po/dS2QZf+jd07Pr4KM0xZcgXzZ9GkjpOkEFtz81J7WpPmQvJ8d+1XmaNl X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5239 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Sep 19, 2021 at 02:38:43PM +0800, Liu Yi L wrote: > This patch adds interface for userspace to attach device to specified > IOASID. > > Note: > One device can only be attached to one IOASID in this version. This is > on par with what vfio provides today. In the future this restriction can > be relaxed when multiple I/O address spaces are supported per device ?? In VFIO the container is the IOS and the container can be shared with multiple devices. This needs to start at about the same functionality. > + } else if (cmd == VFIO_DEVICE_ATTACH_IOASID) { This should be in the core code, right? There is nothing PCI specific here. Jason