Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5016464pxj; Wed, 9 Jun 2021 07:21:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxf/U7ExkTMHnF0LD6sa8HvDsNPVi4NBaF0UzqsjWUWEIUH3nvWUYfG3VrkMp5ImGu21bDh X-Received: by 2002:a17:906:509:: with SMTP id j9mr110496eja.149.1623248503670; Wed, 09 Jun 2021 07:21:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623248503; cv=none; d=google.com; s=arc-20160816; b=ORhHZApHMSOiuT49C+SQAR9+fwD9wSp4FyEe5Oyeh9twLdRnozchfSiMNW0m5fyIXD v4HS7dy8NqVatGQTr2gdT1Gv7EB+zzf3Q2KDlcDgrHwFaT2PzyP1psyBLrSHg7dQFwEA 0ERU+jZ2JU1oGrCz6j0GMJ8tyf5lBzivUO0XFAbqPwV3b2N7+/ujMiR5uk07ekN95d4K T7Sv/3na6X82RofbSVUD3c2KX3rMWvSh2MTl0skbfVGvXkMHRA8EX0MiHEMj7nlg16T9 XuaHIZNMnLMOgFaagxLms9hmZwGJOq85rWIb7rqhRC7uT512XPmWHT95QQGLeWdZF5Ge X+Sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:reply-to:dkim-signature; bh=UGhpFhVlOYIC5kowMMVAYHo7k0EKPg3F6ebOQuwUO2Q=; b=o9Dafoj6AFP6InHWwdIq5lMpDwAi+a7Z1N3WotOBhcRjovYaWk5klwqKjm6s5vcSf8 WjT8b5R78uOu5u5WMAS5Qlto5v9Ry9rlz4AAmkhSAetWsJHepMB0QNYkaI8mAkMZ6Gqz TNGGfVszfc806khSwmGviykuiTVHirRFGvrizEXSREJHjzYxR4f/YzvwcnS7p3mrxHDm +kf8jdk91G+6581tLYWYXcRlFp351Hlt4RUOT0nncB4/tXGuolQNRfDTEGj2NmvJvN9j CJkn/def0yKXn3WoGPZalzK9xAnuucC7/ONSEmv2sNY5CnWZArt8qJwDCsLY5xIB0qhv earA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Hr7h2vMJ; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z1si2326337edd.156.2021.06.09.07.21.18; Wed, 09 Jun 2021 07:21:43 -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=@redhat.com header.s=mimecast20190719 header.b=Hr7h2vMJ; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232972AbhFIKQt (ORCPT + 99 others); Wed, 9 Jun 2021 06:16:49 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:32346 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234217AbhFIKQs (ORCPT ); Wed, 9 Jun 2021 06:16:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623233694; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UGhpFhVlOYIC5kowMMVAYHo7k0EKPg3F6ebOQuwUO2Q=; b=Hr7h2vMJP5MFiqu8dsvSwpBzdSIUviOr/30iuUvRzBPNfToCP+OgqBE9lEbuY1NbvqtVCp lTRfDIf+CJxl0c0CbgEXmREhxnlp93ptDgVnaisTczuQGA2H3dKsZkBvgrP4axb/yhHJui xWLNo5EvRhsYKgTC8JyfCaQ3gcZkOK0= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-363-aIDHPVOWPO-QHAfEwGk4dw-1; Wed, 09 Jun 2021 06:14:52 -0400 X-MC-Unique: aIDHPVOWPO-QHAfEwGk4dw-1 Received: by mail-wm1-f70.google.com with SMTP id m33-20020a05600c3b21b02901a44b1d2d87so1756703wms.3 for ; Wed, 09 Jun 2021 03:14:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:reply-to:subject:to:cc:references:from :message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding:content-language; bh=UGhpFhVlOYIC5kowMMVAYHo7k0EKPg3F6ebOQuwUO2Q=; b=ptxGx1HR0RjrphGps8F5HiHg0y2M0lpTt7P0f/JULBNiOuoeYwlzPJax6wzGpzsH6x 2gRGEGaARIQAxzGxVTNeppoaPEaOxm91wPvDTSBYuXKjnNz3IJklVG7F1PRHw2/PDC1r 8/kUUPRpwLRDTs2Ktnt/RNHUjSwCjr/F4ywQVmALCUntCFDLWvQWo7K4Zr4AeVzaVna9 itN89HIcPlSZQ9LPguvMSi2jsPbMcYhSN6Cu6qK4tWS3n/qN83mVc5+MmfnT9GKFHmvK i6lfRiLSdEr8N5d8IsThsiv8SlREK5dxDOrx3aM0mP+eRMRKNS0k+vq+EQ65ZWZCk3jq WcCg== X-Gm-Message-State: AOAM530fBL1iLXbcyGX/+LJ18vdZgY0jvM4gkpBSCW0vVwrYcaGSvgsW tInNf4fEt4MqNBYT6fjuuv2JBV8VK9blVy42jcVIcG4FTie9Is+gao1TVADkWLTMtrotMQlU0SO E6EnLtmhGkPKwRWslU8r3HMxX X-Received: by 2002:a05:600c:1d1b:: with SMTP id l27mr15988802wms.62.1623233691355; Wed, 09 Jun 2021 03:14:51 -0700 (PDT) X-Received: by 2002:a05:600c:1d1b:: with SMTP id l27mr15988778wms.62.1623233691155; Wed, 09 Jun 2021 03:14:51 -0700 (PDT) Received: from ?IPv6:2a01:e0a:59e:9d80:527b:9dff:feef:3874? ([2a01:e0a:59e:9d80:527b:9dff:feef:3874]) by smtp.gmail.com with ESMTPSA id r3sm4058615wmq.8.2021.06.09.03.14.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 09 Jun 2021 03:14:50 -0700 (PDT) Reply-To: eric.auger@redhat.com Subject: Re: Plan for /dev/ioasid RFC v2 To: "Tian, Kevin" , Jason Gunthorpe , "Alex Williamson (alex.williamson@redhat.com)" , Jean-Philippe Brucker , David Gibson , Jason Wang , "parav@mellanox.com" , "Enrico Weigelt, metux IT consult" , Paolo Bonzini , Shenming Lu Cc: Jonathan Corbet , "Raj, Ashok" , "Liu, Yi L" , "Wu, Hao" , "Jiang, Dave" , Jacob Pan , Kirti Wankhede , Robin Murphy , "kvm@vger.kernel.org" , "iommu@lists.linux-foundation.org" , David Woodhouse , Joerg Roedel , LKML , Lu Baolu References: From: Eric Auger Message-ID: <8a3f2bc6-79b7-5dfb-492a-21c0af7b9c2c@redhat.com> Date: Wed, 9 Jun 2021 12:14:48 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Kevin, On 6/9/21 11:37 AM, Tian, Kevin wrote: >> From: Eric Auger >> Sent: Wednesday, June 9, 2021 4:15 PM >> >> Hi Kevin, >> >> On 6/7/21 4:58 AM, Tian, Kevin wrote: >>> Hi, all, >>> >>> We plan to work on v2 now, given many good comments already received >>> and substantial changes envisioned. This is a very complex topic with >>> many sub-threads being discussed. To ensure that I didn't miss valuable >>> suggestions (and also keep everyone on the same page), here I'd like to >>> provide a list of planned changes in my mind. Please let me know if >>> anything important is lost. :) >>> >>> -- >>> >>> (Remaining opens in v1) >>> >>> - Protocol between kvm/vfio/ioasid for wbinvd/no-snoop. I'll see how >>> much can be refined based on discussion progress when v2 is out; >>> >>> - Device-centric (Jason) vs. group-centric (David) uAPI. David is not fully >>> convinced yet. Based on discussion v2 will continue to have ioasid uAPI >>> being device-centric (but it's fine for vfio to be group-centric). A new >>> section will be added to elaborate this part; >>> >>> - PASID virtualization (section 4) has not been thoroughly discussed yet. >>> Jason gave some suggestion on how to categorize intended usages. >>> I will rephrase this section and hope more discussions can be held for >>> it in v2; >>> >>> (Adopted suggestions) >>> >>> - (Jason) Rename /dev/ioasid to /dev/iommu (so does uAPI e.g. IOASID >>> _XXX to IOMMU_XXX). One suggestion (Jason) was to also rename >>> RID+PASID to SID+SSID. But given the familiarity of the former, I will >>> still use RID+PASID in v2 to ease the discussoin; >>> >>> - (Jason) v1 prevents one device from binding to multiple ioasid_fd's. This >>> will be fixed in v2; >>> >>> - (Jean/Jason) No need to track guest I/O page tables on ARM/AMD. >> When >>> a pasid table is bound, it becomes a container for all guest I/O page >> tables; >> while I am totally in line with that change, I guess we need to revisit >> the invalidate ioctl >> to support PASID table invalidation. > Yes, this is planned when doing this change. OK > >>> - (Jean/Jason) Accordingly a device label is required so iotlb invalidation >>> and fault handling can both support per-device operation. Per Jean's >>> suggestion, this label will come from userspace (when VFIO_BIND_ >>> IOASID_FD); >> what is not totally clear to me is the correspondance between this label >> and the SID/SSID tuple. >> My understanding is it rather maps to the SID because you can attach >> several ioasids to the device. >> So it is not clear to me how you reconstruct the SSID info >> > Yes, device handle maps to SID. The fault data reported to userspace > will include {device_label, ioasid, vendor_fault_data}. In your case > I believe SSID will be included in vendor_fault_data thus no reconstruct > required. For Intel the user could figure out vPASID according to device_ > label and ioasid, i.e. no need to include PASID info in vendor_fault_data. OK that works. Thanks Eric > > Thanks > Kevin