History

drm/amdkfd: Allow querying SVM attributes that are clear

Currently the SVM get_attr call allows querying, which flags are set in the entire address range. Add the opposite query, which flags are clear in the entire address range. Both queries can be combined in a single get_attr call, which allows answering questions such as, "is this address range coherent, non-coherent, or a mix of both"? Proposed userspace for UAPI: https://github.com/RadeonOpenCompute/ROCR-Runtime/tree/memory_model_queries

Felix Kuehling committed 5 years ago

Commit a43e2a01 parent ed7c28c2 files · +22 −13Browse files

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

Unified · Split

include/uapi/linux/kfd_ioctl.h+9−7
@@ -31,9 +31,10 @@ · 30 unmodified lines
3131 * - 1.3 - Add SMI events support
3232 * - 1.4 - Indicate new SRAM EDC bit in device properties
3333 * - 1.5 - Add SVM API
34+ * - 1.6 - Query clear flags in SVM get_attr API
3435 */
3536 #define KFD_IOCTL_MAJOR_VERSION 1
36−#define KFD_IOCTL_MINOR_VERSION 5
37+#define KFD_IOCTL_MINOR_VERSION 6
3738
3839 struct kfd_ioctl_get_version_args {
3940 __u32 major_version; /* from KFD */
@@ -575,18 +576,19 @@ struct kfd_ioctl_svm_attribute { · 535 unmodified lines
575576 * @KFD_IOCTL_SVM_ATTR_PREFERRED_LOC or
576577 * @KFD_IOCTL_SVM_ATTR_PREFETCH_LOC resepctively. For
577578 * @KFD_IOCTL_SVM_ATTR_SET_FLAGS, flags of all pages will be
578− * aggregated by bitwise AND. The minimum migration granularity
579− * throughout the range will be returned for
580− * @KFD_IOCTL_SVM_ATTR_GRANULARITY.
579+ * aggregated by bitwise AND. That means, a flag will be set in the
580+ * output, if that flag is set for all pages in the range. For
581+ * @KFD_IOCTL_SVM_ATTR_CLR_FLAGS, flags of all pages will be
582+ * aggregated by bitwise NOR. That means, a flag will be set in the
583+ * output, if that flag is clear for all pages in the range.
584+ * The minimum migration granularity throughout the range will be
585+ * returned for @KFD_IOCTL_SVM_ATTR_GRANULARITY.
581586 *
582587 * Querying of accessibility attributes works by initializing the
583588 * attribute type to @KFD_IOCTL_SVM_ATTR_ACCESS and the value to the
584589 * GPUID being queried. Multiple attributes can be given to allow
585590 * querying multiple GPUIDs. The ioctl function overwrites the
586591 * attribute type to indicate the access for the specified GPU.
587− *
588− * @KFD_IOCTL_SVM_ATTR_CLR_FLAGS is invalid for
589− * @KFD_IOCTL_SVM_OP_GET_ATTR.
590592 */
591593 struct kfd_ioctl_svm_args {
592594 __u64 start_addr;