History

drm/xe/uapi: Restore flags VM_BIND_FLAG_READONLY and VM_BIND_FLAG_IMMEDIATE

The commit 84a1ed5e6756 ("drm/xe/uapi: Remove unused flags") is partially reverted. At the time, flags not used by user space were removed during cleanup. Some flags now needed by the compute runtime are brought back in this commit: - DRM_XE_VM_BIND_FLAG_READONLY is used to write protect kernel ISA thus preventing accidental overwrites. - DRM_XE_VM_BIND_FLAG_IMMEDIATE is used to trigger mapping at the time of binding in order to prevent faulting at execution time. The changes in the compute runtime are ready and approved, see link below. v2: Include a link to the PR in the commit message (Matthew Brost) v3: Update kernel doc and improve commit message (Lucas De Marchi)

Francois Dugast committed 2 years ago

Commit 31ced031 parent b611dad3 files · +23 −2Browse files

Showing the changes to include/uapi (1 of 3 files). Show all

Unified · Split

include/uapi/drm/xe_drm.h+8−0
@@ -871,6 +871,12 @@ struct drm_xe_vm_destroy { · 870 unmodified lines
871871 * - %DRM_XE_VM_BIND_OP_PREFETCH
872872 *
873873 * and the @flags can be:
874+ * - %DRM_XE_VM_BIND_FLAG_READONLY - Setup the page tables as read-only
875+ * to ensure write protection
876+ * - %DRM_XE_VM_BIND_FLAG_IMMEDIATE - On a faulting VM, do the
877+ * MAP operation immediately rather than deferring the MAP to the page
878+ * fault handler. This is implied on a non-faulting VM as there is no
879+ * fault handler to defer to.
874880 * - %DRM_XE_VM_BIND_FLAG_NULL - When the NULL flag is set, the page
875881 * tables are setup with a special bit which indicates writes are
876882 * dropped and all reads return zero. In the future, the NULL flags
@@ -963,6 +969,8 @@ struct drm_xe_vm_bind_op { · 86 unmodified lines
963969 /** @op: Bind operation to perform */
964970 __u32 op;
965971
972+#define DRM_XE_VM_BIND_FLAG_READONLY (1 << 0)
973+#define DRM_XE_VM_BIND_FLAG_IMMEDIATE (1 << 1)
966974 #define DRM_XE_VM_BIND_FLAG_NULL (1 << 2)
967975 #define DRM_XE_VM_BIND_FLAG_DUMPABLE (1 << 3)
968976 /** @flags: Bind flags */