Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp117364pxv; Wed, 14 Jul 2021 20:22:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzntUIsuFMUHDV8PCspC/EgMv2x4A7XkrCalkQlmFn0exMmWfKfUIxOsl3dUFsbwZJzUWJ X-Received: by 2002:a17:906:32d8:: with SMTP id k24mr2242239ejk.422.1626319339878; Wed, 14 Jul 2021 20:22:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626319339; cv=none; d=google.com; s=arc-20160816; b=mbIjmFgYZUi/aNJ+fPfWFq8kMiE36KCZ9/sRvLNgdVyU/mA7sGsZlaagFbT3on/nYp 4QP+GV7HmeQAbAEfL3rqZxKgSSVVjH0JXYuHEJgfiI0D8MqhP+8pw5BHct8wgwwUUPiR lc8YkZ1TvqO5f9e99mcSsVF3fTo/7W/MhttSm1WlEYppiPx0yiiztq+/XURZWxmVNdV9 4DQo9UjjITIL+SOe+Q+NXfShWGRZ2E0i2mHmwDP1aiKKA6zZcqfq1nyJd1HzvtxEXIjb 9pDfnAm3KlpydVyzeh6yI8plY9SQMCmSNC6d0lePu2uaxvOuyK3doioXg4Ftb+TI+W5x yB/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=YKoCUjx/ig0hzgRMdkopE3cl7/951xyD5icRPWOD5+E=; b=kJzeRbMRF+7VeaUdtEkZkZzjvJZUpQk3fabaNdDUVD5AORZX5AAXUdFHlJIbfoAI/Q lRB3lianJwjq2n99T5JapQhg9jyuM8CtCrlQuvqKSUCzPVNw8qhOyuJL2TkdKaRH5sGC kdecmDNJQl3GRHIT+tVOYRi6/Jew2wzLauEUYVp8iRlFteajyas0llA5c0Vhs6SvkXA0 Z9NjVs02zn62FYTF0fLmlRMT5FZ5PcATCUWqqipzm+OQ16xTzS6ICekdPkRZPgpod8p5 Tg8QnLbyo+Pc7gYkdAAO3n+fs+nJfT9k3GiY83XQ9AJ9+P90eUhprduBmNrtO+rs71xv frCQ== ARC-Authentication-Results: i=1; mx.google.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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id kg2si5300996ejc.306.2021.07.14.20.21.57; Wed, 14 Jul 2021 20:22:19 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232327AbhGODXl (ORCPT + 99 others); Wed, 14 Jul 2021 23:23:41 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:6931 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230495AbhGODXk (ORCPT ); Wed, 14 Jul 2021 23:23:40 -0400 Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4GQKKz5SXlz7tWX; Thu, 15 Jul 2021 11:17:11 +0800 (CST) Received: from dggpemm500022.china.huawei.com (7.185.36.162) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Thu, 15 Jul 2021 11:20:44 +0800 Received: from [10.174.185.67] (10.174.185.67) by dggpemm500022.china.huawei.com (7.185.36.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Thu, 15 Jul 2021 11:20:43 +0800 Subject: Re: [RFC v2] /dev/iommu uAPI proposal To: "Tian, Kevin" CC: 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 , Joerg Roedel , Eric Auger , 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" , LKML , "Lu Baolu" , "wanghaibin.wang@huawei.com" References: From: Shenming Lu Message-ID: <7ea349f8-8c53-e240-fe80-382954ba7f28@huawei.com> Date: Thu, 15 Jul 2021 11:20:34 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.2.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.185.67] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm500022.china.huawei.com (7.185.36.162) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/7/9 15:48, Tian, Kevin wrote: > 4.6. I/O page fault > +++++++++++++++++++ > > uAPI is TBD. Here is just about the high-level flow from host IOMMU driver > to guest IOMMU driver and backwards. This flow assumes that I/O page faults > are reported via IOMMU interrupts. Some devices report faults via device > specific way instead of going through the IOMMU. That usage is not covered > here: > > - Host IOMMU driver receives a I/O page fault with raw fault_data {rid, > pasid, addr}; > > - Host IOMMU driver identifies the faulting I/O page table according to > {rid, pasid} and calls the corresponding fault handler with an opaque > object (registered by the handler) and raw fault_data (rid, pasid, addr); > > - IOASID fault handler identifies the corresponding ioasid and device > cookie according to the opaque object, generates an user fault_data > (ioasid, cookie, addr) in the fault region, and triggers eventfd to > userspace; > Hi, I have some doubts here: For mdev, it seems that the rid in the raw fault_data is the parent device's, then in the vSVA scenario, how can we get to know the mdev(cookie) from the rid and pasid? And from this point of view,would it be better to register the mdev (iommu_register_device()) with the parent device info? Thanks, Shenming