On Wed, Aug 21, 2019 at 03:21:18PM +0800, zhangfei.gao@xxxxxxxxxxx wrote:Thanks Greg,
Hi, GregThere should be a standard way to get such a handle from userspace
On 2019/8/21 äå12:59, Greg Kroah-Hartman wrote:
On Tue, Aug 20, 2019 at 09:08:55PM +0800, zhangfei wrote:I am sorry, not understand here.
On 2019/8/15 äå10:13, Greg Kroah-Hartman wrote:That's odd, why not use the other default apis to do that?
On Wed, Aug 14, 2019 at 05:34:25PM +0800, Zhangfei Gao wrote:UACCE_DEV_NOIOMMU maybe confusing here.
+int uacce_register(struct uacce *uacce)THat is odd, why even offer this feature then if it is a major issue?
+{
+ int ret;
+
+ if (!uacce->pdev) {
+ pr_debug("uacce parent device not set\n");
+ return -ENODEV;
+ }
+
+ if (uacce->flags & UACCE_DEV_NOIOMMU) {
+ add_taint(TAINT_CRAP, LOCKDEP_STILL_OK);
+ dev_warn(uacce->pdev,
+ "Register to noiommu mode, which export kernel data to user space and may vulnerable to attack");
+ }
In this mode, app use ioctl to get dma_handle from dma_alloc_coherent.
It does not matter iommu is enabled or not.You should use the other documentated apis for this, don't create your
In case iommu is disabled, it maybe dangerous to kernel, so we added warning here, is it required?
own.
Do you mean there is a standard ioctl or standard api in user space, it can
get dma_handle from dma_alloc_coherent from kernel?
today. Isn't that what the ion interface does? DRM also does this, as
does UIO I think.
Do you have a spec somewhere that shows exactly what you are trying toThe purpose is doing dma in user space.
do here, along with example userspace code? It's hard to determine it
given you only have one "half" of the code here and no users of the apis
you are creating.