Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4324842pxb; Mon, 1 Feb 2021 19:49:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJzax1aipvhWDPvgWPhdZIHKgx2BnZp6OO0/+MyaPdr+ZVWRlGa9TPqoaRbc4aHu0JZQeaWw X-Received: by 2002:aa7:c94a:: with SMTP id h10mr22711104edt.41.1612237797826; Mon, 01 Feb 2021 19:49:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612237797; cv=none; d=google.com; s=arc-20160816; b=iSIDUbNGzhC6+XgJ9mZdSmS9UmOlt5a65K/4poju0unyTKQzjLb64Ee5OLm8Bi5qyQ JNl6lyxsfazJfswJLsFU+UC9+6bRwynTqM3xcnY5nypSqz4qM8YF3lUSC38gJLLUxno0 bAgFXIc01H+9jTfId6+IE4gBhNVvR3GvXD2lNL+P3mXtL185XC6D+ujNTRdX+hb4AxaH VZajSyqyxIDbifnMdKVGmBwYOVOzRrHD+YTR4MmCctBKtTUbd3Hxt+CIkjh9waaiG8cU g8NwfnG8SN/VuCfaIDJGuopCgJ55FTf7rYvTeAmL+k3iT0zYJiPVTIU2RnAarnpBzQ71 UhYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=J3ovN7l59shGa9uLHNrxuf6RqxDvr30lx1CIYIdEPw8=; b=z7ve1MtWOq1+k067gNR6kp/dTsRppd2xGCCJSS1eNWnU702X5mxF0Hp7Im5ug7J9Lv XOes7QsWXUVwKPznG1y0rcqjyhPOYiNiybbQ95xkvy1DcRmRs2lIQY+mhA9ofcu1ffGy sqvFiJL9pW1mVIbz1W7ur5UIxGQC2egBOXRlgDcP6degfj0CyZtKXu3JR46aMAlrXe+J lSi6byOw8mwLnC6rVzyWNBi7zqCAtuAl/p3B+8g2fVimM7XNQozsy3w3aYmxuiBUcGbX ez9FgfAd/C+6cu/GbAU+EYkplrmrPPBTS9d5GRt0tOu3qUF0B2vl14pkujo0qccjjgI5 oNYg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v24si11588993edx.601.2021.02.01.19.49.32; Mon, 01 Feb 2021 19:49:57 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230157AbhBBDsW convert rfc822-to-8bit (ORCPT + 99 others); Mon, 1 Feb 2021 22:48:22 -0500 Received: from szxga02-in.huawei.com ([45.249.212.188]:3002 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229872AbhBBDsT (ORCPT ); Mon, 1 Feb 2021 22:48:19 -0500 Received: from DGGEMM405-HUB.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4DV9hv28l2zR5KD; Tue, 2 Feb 2021 11:46:23 +0800 (CST) Received: from dggpemm500012.china.huawei.com (7.185.36.89) by DGGEMM405-HUB.china.huawei.com (10.3.20.213) with Microsoft SMTP Server (TLS) id 14.3.498.0; Tue, 2 Feb 2021 11:47:33 +0800 Received: from dggemi761-chm.china.huawei.com (10.1.198.147) by dggpemm500012.china.huawei.com (7.185.36.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2106.2; Tue, 2 Feb 2021 11:47:33 +0800 Received: from dggemi761-chm.china.huawei.com ([10.9.49.202]) by dggemi761-chm.china.huawei.com ([10.9.49.202]) with mapi id 15.01.2106.006; Tue, 2 Feb 2021 11:47:33 +0800 From: "Song Bao Hua (Barry Song)" To: "Tian, Kevin" , Jason Gunthorpe CC: "chensihang (A)" , Arnd Bergmann , Greg Kroah-Hartman , "linux-kernel@vger.kernel.org" , "iommu@lists.linux-foundation.org" , "linux-mm@kvack.org" , Zhangfei Gao , "Liguozhu (Kenneth)" , "linux-accelerators@lists.ozlabs.org" Subject: RE: [RFC PATCH v2] uacce: Add uacce_ctrl misc device Thread-Topic: [RFC PATCH v2] uacce: Add uacce_ctrl misc device Thread-Index: AQHW8vWniUnMS+RFOU2UJJCa8sDlvKo39q+AgADtcaD//5AFgIAAh9tQ//+YwwCAAIUv4IAEx5CAgAWazQCAADRGAIAAkKkA Date: Tue, 2 Feb 2021 03:47:33 +0000 Message-ID: <06924f5853c24f99a4b1f5683bdc74e4@hisilicon.com> References: <1611563696-235269-1-git-send-email-wangzhou1@hisilicon.com> <20210125154717.GW4605@ziepe.ca> <96b655ade2534a65974a378bb68383ee@hisilicon.com> <20210125231619.GY4605@ziepe.ca> <5f64a68042c64f37b5cba74028bd2189@hisilicon.com> <20210126011304.GZ4605@ziepe.ca> <20210201234424.GI4718@ziepe.ca> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.126.202.106] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: Tian, Kevin [mailto:kevin.tian@intel.com] > Sent: Tuesday, February 2, 2021 3:52 PM > To: Jason Gunthorpe > Cc: Song Bao Hua (Barry Song) ; chensihang (A) > ; Arnd Bergmann ; Greg > Kroah-Hartman ; linux-kernel@vger.kernel.org; > iommu@lists.linux-foundation.org; linux-mm@kvack.org; Zhangfei Gao > ; Liguozhu (Kenneth) ; > linux-accelerators@lists.ozlabs.org > Subject: RE: [RFC PATCH v2] uacce: Add uacce_ctrl misc device > > > From: Jason Gunthorpe > > Sent: Tuesday, February 2, 2021 7:44 AM > > > > On Fri, Jan 29, 2021 at 10:09:03AM +0000, Tian, Kevin wrote: > > > > SVA is not doom to work with IO page fault only. If we have SVA+pin, > > > > we would get both sharing address and stable I/O latency. > > > > > > Isn't it like a traditional MAP_DMA API (imply pinning) plus specifying > > > cpu_va of the memory pool as the iova? > > > > I think their issue is the HW can't do the cpu_va trick without also > > involving the system IOMMU in a SVA mode > > > > This is the part that I didn't understand. Using cpu_va in a MAP_DMA > interface doesn't require device support. It's just an user-specified > address to be mapped into the IOMMU page table. On the other hand, The background is that uacce is based on SVA and we are building applications on uacce: https://www.kernel.org/doc/html/v5.10/misc-devices/uacce.html so IOMMU simply uses the page table of MMU, and don't do any special mapping to an user-specified address. We don't break the basic assumption that uacce is using SVA, otherwise, we need to re-build uacce and the whole base. > sharing CPU page table through a SVA interface for an usage where I/O > page faults must be completely avoided seems a misleading attempt. That is not for completely avoiding IO page fault, that is just an extension for high-performance I/O case, providing a way to avoid IO latency jitter. Using it or not is totally up to users. > Even if people do want this model (e.g. mix pinning+fault), it should be > a mm syscall as Greg pointed out, not specific to sva. > We are glad to make it a syscall if people are happy with it. The simplest way would be a syscall similar with userfaultfd if we don't want to mess up mm_struct. > Thanks > Kevin Thanks Barry