Skip to contentSkip to conversation

drm/amdkfd: fix profiler ioctl command number

PATCH In review Perry Yuan 3 participants 6 messages Apr 16 AMD KFD

lore
Share & tools
lore

Perry Yuan

author
#0 lore raw

PATCH 1/2 drm/amdkfd: fix profiler ioctl command number

Move AMDKFD_IOC_PROFILER from the secondary ioctl range to the primary upstream range at 0x28 and bump AMDKFD_COMMAND_END to 0x29.

Fixes 4abe9fd1e763 ("Add kfd_ioctl_profiler to contain profiler kernel driver changes")
---
 include/uapi/linux/kfd_ioctl.h | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
include/uapi/linux/kfd_ioctl.h +3 -6
index da93daa3283c..1a94d512df35 100644
@@ -1711,13 +1711,10 @@ struct kfd_ioctl_profiler_args {
 #define AMDKFD_IOC_CREATE_PROCESS		\
 		AMDKFD_IO(0x27)
 
-#define AMDKFD_COMMAND_START		0x01
-#define AMDKFD_COMMAND_END		0x28
-
 #define AMDKFD_IOC_PROFILER			\
-		AMDKFD_IOWR(0x86, struct kfd_ioctl_profiler_args)
+		AMDKFD_IOWR(0x28, struct kfd_ioctl_profiler_args)
 
-#define AMDKFD_COMMAND_START_2		0x80
-#define AMDKFD_COMMAND_END_2		0x87
+#define AMDKFD_COMMAND_START		0x01
+#define AMDKFD_COMMAND_END		0x29
 
 #endif
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH 2/2 drm/amdkfd: bump KFD ioctl minor version to 1.23

Bump KFD_IOCTL_MINOR_VERSION from 22 to 23 and document version 1.23 in kfd_ioctl.h so userspace can detect profiler ioctl support.

---
 include/uapi/linux/kfd_ioctl.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
include/uapi/linux/kfd_ioctl.h +2 -1
index 1a94d512df35..9584b5aab727 100644
@@ -48,9 +48,10 @@
  * - 1.20 - Trap handler support for expert scheduling mode available
  * - 1.21 - Debugger support to subscribe to LDS out-of-address exceptions
  * - 1.22 - Add queue creation with metadata ring base address
+ * - 1.23 - Add profiler control ioctl to enable/disable profiler on a process
  */
 #define KFD_IOCTL_MAJOR_VERSION 1
-#define KFD_IOCTL_MINOR_VERSION 22
+#define KFD_IOCTL_MINOR_VERSION 23
 
 struct kfd_ioctl_get_version_args {
 	__u32 major_version;	/* from KFD */
Signature · 1 line
2.34.1
Reviewed-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] drm/amdkfd: bump KFD ioctl minor version to 1.23

Series is:

Quoted 29 lines · Perry Yuan

Bump KFD_IOCTL_MINOR_VERSION from 22 to 23 and document version 1.23 in kfd_ioctl.h so userspace can detect profiler ioctl support.

---
 include/uapi/linux/kfd_ioctl.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
include/uapi/linux/kfd_ioctl.h +2 -2
index 1a94d512df35..9584b5aab727 100644
@@ -48,9 +48,10 @@
  * - 1.20 - Trap handler support for expert scheduling mode available
  * - 1.21 - Debugger support to subscribe to LDS out-of-address exceptions
  * - 1.22 - Add queue creation with metadata ring base address
+ * - 1.23 - Add profiler control ioctl to enable/disable profiler on a process
  */
 #define KFD_IOCTL_MAJOR_VERSION 1
-#define KFD_IOCTL_MINOR_VERSION 22
+#define KFD_IOCTL_MINOR_VERSION 23
 
 struct kfd_ioctl_get_version_args {
        __u32 major_version;    /* from KFD */
--

2.34.1

#3 lore raw
In reply to Perry Yuan

[AMD Official Use Only - AMD Internal Distribution Only]

Not sure if something git got messed up here, but it looks like you're removing

include/uapi/linux/kfd_ioctl.h struct kfd_ioctl_profiler_args { · line 1721

Quoted 2 lines
include/uapi/linux/kfd_ioctl.h +0 -2
-#define AMDKFD_COMMAND_START_2               0x80
-#define AMDKFD_COMMAND_END_2         0x87

Kent

Quoted 42 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Perry Yuan
Sent: Thursday, April 16, 2026 12:50 AM
To: Deucher, Alexander <[email protected]>; amd- [email protected]
Subject: [PATCH 1/2] drm/amdkfd: fix profiler ioctl command number

Move AMDKFD_IOC_PROFILER from the secondary ioctl range to the primary upstream range at 0x28 and bump AMDKFD_COMMAND_END to 0x29.

Fixes 4abe9fd1e763 ("Add kfd_ioctl_profiler to contain profiler kernel driver

changes")

---
 include/uapi/linux/kfd_ioctl.h | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
include/uapi/linux/kfd_ioctl.h +3 -7
index da93daa3283c..1a94d512df35 100644
@@ -1711,13 +1711,10 @@ struct kfd_ioctl_profiler_args {
 #define AMDKFD_IOC_CREATE_PROCESS            \
              AMDKFD_IO(0x27)
 
-#define AMDKFD_COMMAND_START         0x01
-#define AMDKFD_COMMAND_END           0x28
-
 #define AMDKFD_IOC_PROFILER                  \
-             AMDKFD_IOWR(0x86, struct kfd_ioctl_profiler_args)
+             AMDKFD_IOWR(0x28, struct kfd_ioctl_profiler_args)
 
-#define AMDKFD_COMMAND_START_2               0x80
-#define AMDKFD_COMMAND_END_2         0x87
+#define AMDKFD_COMMAND_START         0x01
+#define AMDKFD_COMMAND_END           0x29
 
 #endif
--

2.34.1

#4 lore raw
Quoted 6 lines · Kent

[AMD Official Use Only - AMD Internal Distribution Only]

Not sure if something git got messed up here, but it looks like you're removing

include/uapi/linux/kfd_ioctl.h struct kfd_ioctl_profiler_args { · line 1721

Quoted 2 lines
include/uapi/linux/kfd_ioctl.h +0 -2
-#define AMDKFD_COMMAND_START_2               0x80
-#define AMDKFD_COMMAND_END_2         0x87

That's on purpose. Those were not supposed to be here to begin with.

Alex

Quoted 46 lines

Kent

Quoted 42 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Perry Yuan
Sent: Thursday, April 16, 2026 12:50 AM
To: Deucher, Alexander <[email protected]>; amd- [email protected]
Subject: [PATCH 1/2] drm/amdkfd: fix profiler ioctl command number

Move AMDKFD_IOC_PROFILER from the secondary ioctl range to the primary upstream range at 0x28 and bump AMDKFD_COMMAND_END to 0x29.

Fixes 4abe9fd1e763 ("Add kfd_ioctl_profiler to contain profiler kernel driver

changes")

---
 include/uapi/linux/kfd_ioctl.h | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
include/uapi/linux/kfd_ioctl.h +3 -7
index da93daa3283c..1a94d512df35 100644
@@ -1711,13 +1711,10 @@ struct kfd_ioctl_profiler_args {
 #define AMDKFD_IOC_CREATE_PROCESS            \
              AMDKFD_IO(0x27)
 
-#define AMDKFD_COMMAND_START         0x01
-#define AMDKFD_COMMAND_END           0x28
-
 #define AMDKFD_IOC_PROFILER                  \
-             AMDKFD_IOWR(0x86, struct kfd_ioctl_profiler_args)
+             AMDKFD_IOWR(0x28, struct kfd_ioctl_profiler_args)
 
-#define AMDKFD_COMMAND_START_2               0x80
-#define AMDKFD_COMMAND_END_2         0x87
+#define AMDKFD_COMMAND_START         0x01
+#define AMDKFD_COMMAND_END           0x29
 
 #endif
--

2.34.1

#5 lore raw

[Public]

Ah perfect, thanks for clarifying. Then yeah we're all good.

Kent

Quoted 67 lines

-----Original Message-----
From: Alex Deucher <[email protected]>
Sent: Thursday, April 16, 2026 9:35 AM
To: Russell, Kent <[email protected]>
Cc: Yuan, Perry <[email protected]>; Deucher, Alexander <[email protected]>; [email protected]
Subject: Re: [PATCH 1/2] drm/amdkfd: fix profiler ioctl command number

Quoted 6 lines · Kent

[AMD Official Use Only - AMD Internal Distribution Only]

Not sure if something git got messed up here, but it looks like you're removing

include/uapi/linux/kfd_ioctl.h struct kfd_ioctl_profiler_args { · line 1721

Quoted 2 lines
include/uapi/linux/kfd_ioctl.h +0 -2
-#define AMDKFD_COMMAND_START_2               0x80
-#define AMDKFD_COMMAND_END_2         0x87

That's on purpose. Those were not supposed to be here to begin with.

Alex

Quoted 5 lines

Kent

Quoted 2 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Perry

Yuan

Quoted 41 lines
Quoted 40 lines

Sent: Thursday, April 16, 2026 12:50 AM
To: Deucher, Alexander <[email protected]>; amd- [email protected]
Subject: [PATCH 1/2] drm/amdkfd: fix profiler ioctl command number

Move AMDKFD_IOC_PROFILER from the secondary ioctl range to the primary upstream range at 0x28 and bump AMDKFD_COMMAND_END to 0x29.

Fixes 4abe9fd1e763 ("Add kfd_ioctl_profiler to contain profiler kernel driver

changes")

---
 include/uapi/linux/kfd_ioctl.h | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
include/uapi/linux/kfd_ioctl.h +3 -7
index da93daa3283c..1a94d512df35 100644
@@ -1711,13 +1711,10 @@ struct kfd_ioctl_profiler_args {
 #define AMDKFD_IOC_CREATE_PROCESS            \
              AMDKFD_IO(0x27)
 
-#define AMDKFD_COMMAND_START         0x01
-#define AMDKFD_COMMAND_END           0x28
-
 #define AMDKFD_IOC_PROFILER                  \
-             AMDKFD_IOWR(0x86, struct kfd_ioctl_profiler_args)
+             AMDKFD_IOWR(0x28, struct kfd_ioctl_profiler_args)
 
-#define AMDKFD_COMMAND_START_2               0x80
-#define AMDKFD_COMMAND_END_2         0x87
+#define AMDKFD_COMMAND_START         0x01
+#define AMDKFD_COMMAND_END           0x29
 
 #endif
--

2.34.1