From: Honglei Huang <honglei1.huang@amd.com>
To: <Felix.Kuehling@amd.com>, <alexander.deucher@amd.com>,
<christian.koenig@amd.com>, <Ray.Huang@amd.com>
Cc: <dmitry.osipenko@collabora.com>, <Xinhui.Pan@amd.com>,
<airlied@gmail.com>, <daniel@ffwll.ch>,
<amd-gfx@lists.freedesktop.org>,
<dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>,
<linux-mm@kvack.org>, <akpm@linux-foundation.org>,
<honghuang@amd.com>, Honglei Huang <Honglei1.Huang@amd.com>
Subject: [PATCH 3/5] drm/amdkfd: Add AMDKFD_IOC_SVM_RANGES ioctl command
Date: Wed, 12 Nov 2025 15:29:08 +0800 [thread overview]
Message-ID: <20251112072910.3716944-4-honglei1.huang@amd.com> (raw)
In-Reply-To: <20251112072910.3716944-1-honglei1.huang@amd.com>
From: Honglei Huang <Honglei1.Huang@amd.com>
Define a new ioctl command AMDKFD_IOC_SVM_RANGES (0x27) to support
batch registration of multiple SVM ranges. Update AMDKFD_COMMAND_END
from 0x27 to 0x28 accordingly.
This ioctl provides a more efficient interface for userspace to
register multiple non-contiguous memory ranges with the same set
of SVM attributes in a single system call, reducing context switching
overhead compared to multiple AMDKFD_IOC_SVM calls.
Signed-off-by: Honglei Huang <Honglei1.Huang@amd.com>
---
include/uapi/linux/kfd_ioctl.h | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/include/uapi/linux/kfd_ioctl.h b/include/uapi/linux/kfd_ioctl.h
index d782bda1d2ca..c5f9595ef30d 100644
--- a/include/uapi/linux/kfd_ioctl.h
+++ b/include/uapi/linux/kfd_ioctl.h
@@ -663,7 +663,6 @@ enum kfd_mmio_remap {
#define KFD_IOCTL_SVM_FLAG_GPU_ALWAYS_MAPPED 0x00000040
/* Fine grained coherency between all devices using device-scope atomics */
#define KFD_IOCTL_SVM_FLAG_EXT_COHERENT 0x00000080
-
/**
* kfd_ioctl_svm_op - SVM ioctl operations
*
@@ -1622,7 +1621,10 @@ struct kfd_ioctl_dbg_trap_args {
#define AMDKFD_IOC_DBG_TRAP \
AMDKFD_IOWR(0x26, struct kfd_ioctl_dbg_trap_args)
+#define AMDKFD_IOC_SVM_RANGES \
+ AMDKFD_IOWR(0x27, struct kfd_ioctl_svm_ranges_args)
+
#define AMDKFD_COMMAND_START 0x01
-#define AMDKFD_COMMAND_END 0x27
+#define AMDKFD_COMMAND_END 0x28
#endif
--
2.34.1
next prev parent reply other threads:[~2025-11-12 7:30 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-12 7:29 [RFC PATCH 0/5] drm/amdkfd: Add batch SVM range registration support Honglei Huang
2025-11-12 7:29 ` [PATCH 1/5] drm/amdkfd: Add KFD_IOCTL_SVM_ATTR_MAPPED attribute Honglei Huang
2025-11-12 7:29 ` [PATCH 2/5] drm/amdkfd: Add SVM ranges data structures Honglei Huang
2025-11-12 7:29 ` Honglei Huang [this message]
2025-11-12 7:29 ` [PATCH 4/5] drm/amdkfd: Add support for pinned user pages in SVM ranges Honglei Huang
2025-11-12 7:29 ` [PATCH 5/5] drm/amdkfd: Wire up SVM ranges ioctl handler Honglei Huang
2025-11-12 8:34 ` [RFC PATCH 0/5] drm/amdkfd: Add batch SVM range registration support Christian König
2025-11-12 12:10 ` Honglei1.Huang@amd.com
2025-11-12 12:50 ` Christian König
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251112072910.3716944-4-honglei1.huang@amd.com \
--to=honglei1.huang@amd.com \
--cc=Felix.Kuehling@amd.com \
--cc=Ray.Huang@amd.com \
--cc=Xinhui.Pan@amd.com \
--cc=airlied@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=dmitry.osipenko@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=honghuang@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox