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
31 * - 1.3 - Add SMI events support31 * - 1.3 - Add SMI events support
32 * - 1.4 - Indicate new SRAM EDC bit in device properties32 * - 1.4 - Indicate new SRAM EDC bit in device properties
33 * - 1.5 - Add SVM API33 * - 1.5 - Add SVM API
34 * - 1.6 - Query clear flags in SVM get_attr API
34 */35 */
35#define KFD_IOCTL_MAJOR_VERSION 136#define KFD_IOCTL_MAJOR_VERSION 1
36#define KFD_IOCTL_MINOR_VERSION 537#define KFD_IOCTL_MINOR_VERSION 6
37 38
38struct kfd_ioctl_get_version_args {39struct 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 or576 * @KFD_IOCTL_SVM_ATTR_PREFERRED_LOC or
576 * @KFD_IOCTL_SVM_ATTR_PREFETCH_LOC resepctively. For577 * @KFD_IOCTL_SVM_ATTR_PREFETCH_LOC resepctively. For
577 * @KFD_IOCTL_SVM_ATTR_SET_FLAGS, flags of all pages will be578 * @KFD_IOCTL_SVM_ATTR_SET_FLAGS, flags of all pages will be
578 * aggregated by bitwise AND. The minimum migration granularity579 * aggregated by bitwise AND. That means, a flag will be set in the
579 * throughout the range will be returned for580 * 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 the587 * Querying of accessibility attributes works by initializing the
583 * attribute type to @KFD_IOCTL_SVM_ATTR_ACCESS and the value to the588 * attribute type to @KFD_IOCTL_SVM_ATTR_ACCESS and the value to the
584 * GPUID being queried. Multiple attributes can be given to allow589 * GPUID being queried. Multiple attributes can be given to allow
585 * querying multiple GPUIDs. The ioctl function overwrites the590 * 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 */
591struct kfd_ioctl_svm_args {593struct kfd_ioctl_svm_args {
592 __u64 start_addr;594 __u64 start_addr;