Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp371984pxj; Wed, 2 Jun 2021 00:59:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyR7rzr6KwF2Ip3/+nCo6NdqFyN2e0u5DwU1/F4XUh3ceeMfdoDDbEMLZHPZeXZco9M5Ndm X-Received: by 2002:a05:6e02:1311:: with SMTP id g17mr4158142ilr.191.1622620797715; Wed, 02 Jun 2021 00:59:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622620797; cv=none; d=google.com; s=arc-20160816; b=AEc4DiNx1GhhlJOIcP9cE+gMnz+oH50s3NFxrlu+jZNL6aeSTtpOQdnMKYv10kGFBF SkVrMrCIp90JsobifV05j4HuSrpt1TUo8WoT0a0UJOQMWxHB3012ghVp8hqbtCa2HctX SVwj5jjZ5phhkKHtGeK3rEV2uxxbp0t7Jw+omBwCtmWQ7eq2NuLgYBwAKePQnSGMEUd/ RU4vuwarnp4t7ZP+XwxRGFItkGkanAuxf3K2a+XNnUz1i6prj3gUeOZv1VO+mHygy75i EufcXTazEbPAFxu+9dnL8rKJh/GFwAtnpR2ghJ3H/Kwou3FkrFgw1M47O+2Rqy+zsduc 9LTQ== 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=VBTuiG6BY1hPEhbnJUIPBRfrotQcBt8ynGJGXZZ+K7A=; b=LqUfh8I3YkcItJJosnMiMKmYnoF3KIobfWaugBC/9cLskkZ/zjkx2G6yXx+87vSlb6 L/42zyBiDEiH2d842KMweV62sOjPQHn7tdP+d8hVnlf0F8rsPtVj3z1URXOnO2T7PzIS UA6GBx9gwdQzgCsn3FL9+DmmFX8FMGjFoATt5jy+t/o9mct26atUTbuwPwieUQ3FtSzN 643TPOY3doNIDRjFXRlChDEo9GVMWJmHqySoyRJiafQIjVUUm1hl3tIIFdCF335q4qRs 2fdCs05COLkqu+i0nmZ/qF4fW3ndUPL8cMOuQZ/Y/72bPcsv8EjGwX6ZUenZXt55DIJW wVzg== 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 v5si8007580ioh.27.2021.06.02.00.59.34; Wed, 02 Jun 2021 00:59:57 -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 S229650AbhFBEwN (ORCPT + 99 others); Wed, 2 Jun 2021 00:52:13 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:3500 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229571AbhFBEwM (ORCPT ); Wed, 2 Jun 2021 00:52:12 -0400 Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4FvxNH3C1RzYq8c; Wed, 2 Jun 2021 12:47:43 +0800 (CST) Received: from dggpemm500022.china.huawei.com (7.185.36.162) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 2 Jun 2021 12:50:27 +0800 Received: from [10.174.185.220] (10.174.185.220) 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; Wed, 2 Jun 2021 12:50:26 +0800 Subject: Re: [RFC] /dev/ioasid uAPI proposal To: Jason Gunthorpe , Lu Baolu CC: "Tian, Kevin" , LKML , Joerg Roedel , David Woodhouse , "iommu@lists.linux-foundation.org" , "kvm@vger.kernel.org" , "Alex Williamson (alex.williamson@redhat.com)" , Jason Wang , Eric Auger , Jonathan Corbet , "Raj, Ashok" , "Liu, Yi L" , "Wu, Hao" , "Jiang, Dave" , Jacob Pan , Jean-Philippe Brucker , David Gibson , Kirti Wankhede , "Robin Murphy" , Zenghui Yu , "wanghaibin.wang@huawei.com" References: <01fe5034-42c8-6923-32f1-e287cc36bccc@linux.intel.com> <20210601173323.GN1002214@nvidia.com> From: Shenming Lu Message-ID: <23a482f9-b88a-da98-3800-f3fd9ea85fbd@huawei.com> Date: Wed, 2 Jun 2021 12:50:26 +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: <20210601173323.GN1002214@nvidia.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.185.220] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) 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/6/2 1:33, Jason Gunthorpe wrote: > On Tue, Jun 01, 2021 at 08:30:35PM +0800, Lu Baolu wrote: > >> The drivers register per page table fault handlers to /dev/ioasid which >> will then register itself to iommu core to listen and route the per- >> device I/O page faults. > > I'm still confused why drivers need fault handlers at all? Essentially it is the userspace that needs the fault handlers, one case is to deliver the faults to the vIOMMU, and another case is to enable IOPF on the GPA address space for on-demand paging, it seems that both could be specified in/through the IOASID_ALLOC ioctl? Thanks, Shenming