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
Showing the changes to include/uapi (1 of 2 files). Show all
Unified · Split
| @@ -31,9 +31,10 @@ · 30 unmodified lines | |||
| 31 | * - 1.3 - Add SMI events support | 31 | * - 1.3 - Add SMI events support |
| 32 | * - 1.4 - Indicate new SRAM EDC bit in device properties | 32 | * - 1.4 - Indicate new SRAM EDC bit in device properties |
| 33 | * - 1.5 - Add SVM API | 33 | * - 1.5 - Add SVM API |
| 34 | * - 1.6 - Query clear flags in SVM get_attr API | ||
| 34 | */ | 35 | */ |
| 35 | #define KFD_IOCTL_MAJOR_VERSION 1 | 36 | #define KFD_IOCTL_MAJOR_VERSION 1 |
| 36 | #define KFD_IOCTL_MINOR_VERSION 5 | 37 | #define KFD_IOCTL_MINOR_VERSION 6 |
| 37 | 38 | ||
| 38 | struct kfd_ioctl_get_version_args { | 39 | struct kfd_ioctl_get_version_args { |
| 39 | __u32 major_version; /* from KFD */ | 40 | __u32 major_version; /* from KFD */ |
| @@ -575,18 +576,19 @@ struct kfd_ioctl_svm_attribute { · 535 unmodified lines | |||
| 575 | * @KFD_IOCTL_SVM_ATTR_PREFERRED_LOC or | 576 | * @KFD_IOCTL_SVM_ATTR_PREFERRED_LOC or |
| 576 | * @KFD_IOCTL_SVM_ATTR_PREFETCH_LOC resepctively. For | 577 | * @KFD_IOCTL_SVM_ATTR_PREFETCH_LOC resepctively. For |
| 577 | * @KFD_IOCTL_SVM_ATTR_SET_FLAGS, flags of all pages will be | 578 | * @KFD_IOCTL_SVM_ATTR_SET_FLAGS, flags of all pages will be |
| 578 | * aggregated by bitwise AND. The minimum migration granularity | 579 | * aggregated by bitwise AND. That means, a flag will be set in the |
| 579 | * throughout the range will be returned for | 580 | * output, if that flag is set for all pages in the range. For |
| 580 | * @KFD_IOCTL_SVM_ATTR_GRANULARITY. | 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. | ||
| 581 | * | 586 | * |
| 582 | * Querying of accessibility attributes works by initializing the | 587 | * Querying of accessibility attributes works by initializing the |
| 583 | * attribute type to @KFD_IOCTL_SVM_ATTR_ACCESS and the value to the | 588 | * attribute type to @KFD_IOCTL_SVM_ATTR_ACCESS and the value to the |
| 584 | * GPUID being queried. Multiple attributes can be given to allow | 589 | * GPUID being queried. Multiple attributes can be given to allow |
| 585 | * querying multiple GPUIDs. The ioctl function overwrites the | 590 | * querying multiple GPUIDs. The ioctl function overwrites the |
| 586 | * attribute type to indicate the access for the specified GPU. | 591 | * 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. | ||
| 590 | */ | 592 | */ |
| 591 | struct kfd_ioctl_svm_args { | 593 | struct kfd_ioctl_svm_args { |
| 592 | __u64 start_addr; | 594 | __u64 start_addr; |