Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4155286pxj; Tue, 15 Jun 2021 17:01:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzQ4C9DH9yrNjfIuRrfAsd0n8YxVCkykGY3ehaHmiSt5iDZwstEB0fwx0mO6kuS7WsiJ/H X-Received: by 2002:a05:6402:220d:: with SMTP id cq13mr815271edb.52.1623801676618; Tue, 15 Jun 2021 17:01:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1623801676; cv=pass; d=google.com; s=arc-20160816; b=keSQ6CmkdUf4lbAYg4r0+uC1SZt1NkW05Drrp/XuEihrVzmaw6Do62OKmREHOdFtSk hIHyAn9GEVG3BSJ2go3zrwOpB/VuV9zDCmU6zVZikyoRoMVYPoXrlQCl//tTD/jyRlTG G5pcljT9W/mloHw4gZw98vHYq49K9dczH8srfmbUcDngLK88f+aKX/wIVTi2FHck9Ji8 /devx9dNmjF1oyfxqHp2Bvovc6o2GF2P1JzRPlgU/S6boBnj35br0JbGjdsoa8xO5gqE WQOX8FplCMyn36aHFD49rKuD0DCqIki19878Zx8NX7vj44nl5fmaKAFQ8qiY6ohlAzM8 hBFQ== 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=K4M0XGo8cW1cQgA/8txH6+IUsbDdqFjIslipzPx22gE=; b=TXSR55UIBWqK6f00fHEJKFgcwcMsNimiIZjqVPK08c677wzmUDRTpDGmJnwCmRoXPE REfhglAxMVrYNItpb55iWlbV2YucNVvTkRND2QISmbJoL8RTIiJMlZrbgXNdXF21Cfvc vcQNcQkTJJ/pjPEjk/czOrgQLSTLh/AxP6wjbfJ6IuJoKc2j5RhnydCHCvBQk+hkx88r A4pLGLyWKdKdSnmvyuU3rEhC86mPdEg4/MSG6o4wTgdO6jhf+WPdooT+xuolMAX5o4yJ yjJgdYAjuh08/qtDmmAx3JlaCOsFUM00bgKQKD4kah/BJyLQCeJ83JQT0XkV/4BvIrpo TcRQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=dzEoTd9v; 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 8si491722ejx.753.2021.06.15.17.00.50; Tue, 15 Jun 2021 17:01:16 -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=dzEoTd9v; 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 S231354AbhFPABg (ORCPT + 99 others); Tue, 15 Jun 2021 20:01:36 -0400 Received: from mail-dm6nam10on2061.outbound.protection.outlook.com ([40.107.93.61]:28033 "EHLO NAM10-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229811AbhFPABg (ORCPT ); Tue, 15 Jun 2021 20:01:36 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Efbl2iVcFEH1Xl7PSTzV9kJG/NmHDnhRXB2m0tv3GkldYP0/QXnGuqSRyK8DO4S4LFraRokCZmJzheQRJDMe+AdOI4uve9geM86KQARDI0c3Bg4q3U8Fkwmjh7NPp2XJFeM42NXCUmGEvaQjJwacjgqUncr7EW02tPIpkmDLoEMmi2wG+TkNSRBBt37JElwAIdGvhQQkUtqx5P7T0xDINQtam1G/OguZiwGSswno6R1rhF8YLyMF4ikMdywRpk+KtZ553TyzAcY453deKbzXV/e98Fztsk7VUPy/JXWkZ4DhLS9PTDcdcEWAUIqcVBLtyxovVGP32XpLesmZVE0Ujw== 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=K4M0XGo8cW1cQgA/8txH6+IUsbDdqFjIslipzPx22gE=; b=RRno2uuTBv24rnV2HVTdlqSZNnlDC/FnbybTTB93lPDidPXhubKb0Wxq02aR4A/tWyL4IOKjbAXBIAcDaU90kCIUBAYDNsSMrcgPEzUN9MQFr6qYvFbRAOFCgXDiXfQgBvDWGJvhNcsbipMoWwdpPnZarrCdPH9xLZx8JzSkozB9s/S7og8oEkDm08/1crjTBIGianEUZlYLQJ7K+OgeHs5AS9NIPRr5aNCzMjV5Xz3hBCEwTXZ/xyIyuc5cxajZzTbzvBMTG+73xCvoh9oIA2qkcBhJpBoYqClqeb5atVmqH5iFbR9LHUbdwZrMDmnYfuZleOdU4o6lQNENdVZzEw== 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=K4M0XGo8cW1cQgA/8txH6+IUsbDdqFjIslipzPx22gE=; b=dzEoTd9vQXgJB1zIKDCO0/SOslsQR/fo/KWehqxEEWHatxU5S7Tfg3hYOuMlN0prdPyYI/0nn7t7ONxjrxG6SQkCd6tnaId9HL13PVnBPc3DRUTL9OKyO9d6UAVXsHk+S02aS9KobATnhYOccsKNzMnVCf7S/0qk6JPcjJWznf7913oDMMAC52lm+26s6/Ah/24ZRD5qxtaSrG3sqLqR8Q9h0eN16hkIFszujjdl3ebCXO5bmPkLAjsVH5ykoVLNI1yh7vJalB2DqlpR6Ei4pNCjfBM+TE+fFwrwFSIaqiXqEeVTYIY2+tb6n9leqCuqDxt8UY8nj0ABZ9BiOkLVew== 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 BL1PR12MB5096.namprd12.prod.outlook.com (2603:10b6:208:316::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.15; Tue, 15 Jun 2021 23:59:29 +0000 Received: from BL0PR12MB5506.namprd12.prod.outlook.com ([fe80::3d51:a3b9:8611:684e]) by BL0PR12MB5506.namprd12.prod.outlook.com ([fe80::3d51:a3b9:8611:684e%8]) with mapi id 15.20.4242.016; Tue, 15 Jun 2021 23:59:29 +0000 Date: Tue, 15 Jun 2021 20:59:28 -0300 From: Jason Gunthorpe To: "Tian, Kevin" 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" , David Gibson , "Jiang, Dave" , David Woodhouse , Jason Wang Subject: Re: [RFC] /dev/ioasid uAPI proposal Message-ID: <20210615235928.GD1002214@nvidia.com> References: <20210528233649.GB3816344@nvidia.com> <20210603130519.GY1002214@nvidia.com> <20210615150630.GS1002214@nvidia.com> <20210615230215.GA1002214@nvidia.com> <20210615234057.GC1002214@nvidia.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Originating-IP: [206.223.160.26] X-ClientProxiedBy: CH2PR10CA0018.namprd10.prod.outlook.com (2603:10b6:610:4c::28) 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 (206.223.160.26) by CH2PR10CA0018.namprd10.prod.outlook.com (2603:10b6:610:4c::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.21 via Frontend Transport; Tue, 15 Jun 2021 23:59:29 +0000 Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1ltIxs-007Gw7-Aw; Tue, 15 Jun 2021 20:59:28 -0300 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8be640fa-ad34-48c5-63e9-08d930599d25 X-MS-TrafficTypeDiagnostic: BL1PR12MB5096: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5236; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ubXWUq2q5Cd18lPmfbA1Fa1RVtxkXZdocAyY4K+eyb0KLjawNDVhmoUNpRZHxcHGFIv0bT5DvUQkXdAj8HUkE/nydYVUHS7Onf4VYucV0Ckv5P1xWA7hgdYkbWX+eqb9/5xHldVRlNRhQU2VYYb2VhUmaEslD65zmBAFXVRE+FJk71eraRAw/08ijlstqqUgPlGPuoXI77yJIf11X+XhIgpJMEO93Bm2y3TXR+d2VXi2i8BCnrasFIl9+7zpLSv5Z+rPZ1l4ktgkisB+KD8FZCm2CkU0+k5JVAngQz+OHaM59nspydww+wlsUmcmnOFJw8t37KO3fGFWUmV1hnvg0BE8rmY2xamBN5lBd7SvwHEfhBaALIBty07GqKWu4OEl8+JoBvdAuDMBVPatBqmCIbfwsvkWjULxUcf3kevVwpws3VCglRZmaFRVADhc4YeFaCwPcxY+pwkIYuCi6go3al9CNV88aU9dntNAP9uPyI6VMbNIY7YcH1+PiNS3WCa/dpjGYGTZu+/kOK0w2kia3cV7UNO/EyhTWLAh2qM+UBXVshBnV2cJyhbX7QIbTJl7ckjlp0wiRqAKWqRksYqUKx2KAEW8CyOIY05YPmf9UaA= 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)(136003)(396003)(366004)(346002)(39860400002)(376002)(426003)(33656002)(66556008)(86362001)(66476007)(8936002)(2906002)(6916009)(8676002)(186003)(38100700002)(478600001)(7416002)(4326008)(54906003)(5660300002)(9746002)(316002)(26005)(1076003)(2616005)(36756003)(66946007)(9786002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?27cXOMVLo1pk0TDBjY2ndvUJaYR3/DjgULs9AmRfjsKn4SRXyhLAsUeHqhYu?= =?us-ascii?Q?90YFmWVNk6LMSGyN+GKGj8BOMJgL7/OcOlLUrvS1L3la8EK4LdOQN9S3MPUw?= =?us-ascii?Q?teUE56reMAC1oeHqGEKZGvqd8nqufw9a/kqJ7C8qVAzFtQklmnhnJuhLIyIE?= =?us-ascii?Q?y2coQEf0ozPIv5utDwoBHmIaPnmYBeZSt36mKKzTr2vH8niN68HjyMvcJnlI?= =?us-ascii?Q?sGhbHg0VWknNXK2PgtRJNq5sQYPfcESB7w4YNJZJdLOoAi4E/t1HCsTGkyKU?= =?us-ascii?Q?IC3Z5S3JzIX3jrospLP1cdF4d3/rw2E8ojmyv/jrQYKcZ54eJpQoudMv+Cxi?= =?us-ascii?Q?qmzGccDWsj+5lPkPxl1/QGygi64wiw8pDgrl3pAzsWjhbQ8lCjq4bBvtudU6?= =?us-ascii?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W20xlJG?= =?us-ascii?Q?hsf/HS1xKtGxC/8GSNzHFWCQ?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8be640fa-ad34-48c5-63e9-08d930599d25 X-MS-Exchange-CrossTenant-AuthSource: BL0PR12MB5506.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jun 2021 23:59:29.7904 (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: IFeCKsSh4fvOljtY4PNeBEy5cuzWbOojhfZN9Of+5zwywtcZuU63imLn5+yTfFGb X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5096 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 15, 2021 at 11:56:28PM +0000, Tian, Kevin wrote: > > From: Jason Gunthorpe > > Sent: Wednesday, June 16, 2021 7:41 AM > > > > On Tue, Jun 15, 2021 at 11:09:37PM +0000, Tian, Kevin wrote: > > > > > which information can you elaborate? This is the area which I'm not > > > familiar with thus would appreciate if you can help explain how this > > > bus specific information is utilized within the attach function or > > > sometime later. > > > > This is the idea that the device driver needs to specify which bus > > specific protocol it uses to issue DMA's when it attaches itself to an > > IOASID. For PCI: > > What about defining some general attributes instead of asking iommu > fd to understand those bus specific detail? I prefer the API be very clear and intent driven, otherwise things just get confused. The whole WBINVD/no-snoop discussion I think is proof of that :\ > from iommu p.o.v there is no difference from last one. In v2 the device > driver just needs to communicate the PASID virtualization policy at > device binding time, I want it documented in the kernel source WTF is happening, because otherwise we are going to be completely lost in a few years. And your RFC did have device driver specific differences here > > The device knows what it is going to do, we need to convey that to the > > IOMMU layer so it is prepared properly. > > Yes, but it's not necessarily to have iommu fd understand bus specific > attributes. In the end when /dev/iommu uAPI calls iommu layer interface, > it's all bus agnostic. Why not? Just put some inline wrappers to translate the bus specific language to your generic language if that is what makes the most sense. Jason