lkml.org 
[lkml]   [2022]   [Oct]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH v2] dmaengine: idxd: Do not enable user type Work Queue without Shared Virtual Addressing
Date
> From: Fenghua Yu <fenghua.yu@intel.com>
> Sent: Saturday, October 15, 2022 6:26 AM
>
> + /*
> + * User type WQ is enabled only when SVA is enabled for two
> reasons:
> + * - If no IOMMU or IOMMU Passthrough without SVA, userspace

This statement is kind of misleading. Even if IOMMU is in DMA mode
user type WQ still doesn't work w/o SVA.

> + * can directly access physical address through the WQ.
> + * - The IDXD cdev driver does not provide any ways to pin
> + * user pages and translate the address from user VA to IOVA or
> + * PA without IOMMU SVA. Therefore the application has no way
> + * to instruct the device to perform DMA function. This makes
> + * the cdev not usable for normal application usage.
> + */

It could be simply stated as "SVA is the only secure/reliable way for
the device to access user space memory"

> + if (!device_user_pasid_enabled(idxd)) {
> + idxd->cmd_status = IDXD_SCMD_WQ_USER_NO_IOMMU;

be specific i.e. IDXD_SCMD_WQ_USER_NO_SVA

> + dev_dbg(&idxd->pdev->dev,
> + "User type WQ cannot be enabled without SVA.\n");
> +
> + return -EOPNOTSUPP;
> + }
> +
>

with above change the check on pasid_enabled should be removed from
idxd_cdev_open() and idxd_cdev_release(). They should always work
with SVA enabled.

\
 
 \ /
  Last update: 2022-10-19 13:50    [W:0.049 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site