Граф коммитов

74 Коммитов

Автор SHA1 Сообщение Дата
Philip Yang 6a15d17257 libhsakmt: update to KFD ioctl version 1.6
sync with KFD ioctl version 1.6:

1.6 - Query clear flags in SVM get_attr API

Change import export handle args pad field to flags, to pass memory
alloc flags from alloc process to import process.

Change-Id: I69360b244651947e885c4a8da9f64a1163101d20
Signed-off-by: Philip Yang <Philip.Yang@amd.com>


[ROCm/ROCR-Runtime commit: dee9c023a2]
2021-07-21 21:48:18 -04:00
Kent Russell 77588e8159 Fix drm.h include path
kernel-headers provides the drm/drm.h path, while libdrm-dev[el]
provides the libdrm/drm.h path, which is what we want to use. Fix the
path so we use the newer drm.h header, as well as fixing SLES, which
doesn't provide drm.h in their kernel-headers.

Change-Id: Icb2b6643698d356169e3baeef17527a1b4e05483


[ROCm/ROCR-Runtime commit: 4f3440a8ac]
2021-07-20 12:49:15 -04:00
Jonathan Kim 1001f27cb5 libhsakmt: update thunk api for exception handling
The debugger and debug agent no longer use the Thunk API.
Remove all deprecated functions and keep commented
references for future KFD tests.

Update and the keep the version checks for future use
and hsaKmtRuntimeEnable/Disable.

Signed-off-by: Jonathan Kim <jonathan.kim@amd.com>
Signed-off-by: Laurent Morichetti <laurent.morichetti@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Change-Id: Ia2f10d82f5ac36d0bd1bda233810f26e8a154d55


[ROCm/ROCR-Runtime commit: 31ac82617c]
2021-07-16 18:36:18 -04:00
Felix Kuehling ace48bdb53 libhsakmt: add kfd_ioctl.h svm and xnack support
Add svm (shared virtual memory) range and xnack mode
APIs.

Change-Id: Ibd8d7fe566dc200730da0c892caa71aad7589ebd
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Signed-off-by: Alex Sierra <alex.sierra@amd.com>


[ROCm/ROCR-Runtime commit: ce26348f3a]
2021-04-16 00:09:17 -04:00
Felix Kuehling 3be7292742 Revert "libhsakmt: add kfd_ioctl.h svm and xnack support"
This reverts commit 07b0758bee.
SVM is not ready yet. This was merged by accident.

Change-Id: I8901594a72e785ba5d25a6448718a570e76fe117
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>


[ROCm/ROCR-Runtime commit: 41cd7aea2f]
2021-03-10 22:33:49 -05:00
Kent Russell 3a90583c47 Merge gfx90a into amd-staging
Conflicts:
	CMakeLists.txt
	include/hsakmt.h
	src/libhsakmt.h
	src/libhsakmt.ver
	src/queues.c
	src/topology.c
	tests/kfdtest/src/KFDMemoryTest.cpp
	tests/kfdtest/src/KFDTestUtil.hpp

Signed-off-by: Kent Russell <kent.russell@amd.com>
Change-Id: Ic2732e7c0b5e42c1a3a91223f65a65064b602181


[ROCm/ROCR-Runtime commit: 83d80074f7]
2021-03-02 07:48:22 -05:00
Philip Yang 07b0758bee libhsakmt: add kfd_ioctl.h svm and xnack support
Add svm (shared virtual memory) range and xnack mode
APIs.

Change-Id: Ibd8d7fe566dc200730da0c892caa71aad7589ebd
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Signed-off-by: Alex Sierra <alex.sierra@amd.com>


[ROCm/ROCR-Runtime commit: 5ae49f2321]
2021-02-23 12:20:29 -05:00
Jonathan Kim 480618489e libhsakmt: add host trap send
Adding host trap send command.

Signed-off-by: Jonathan Kim <Jonathan.Kim@amd.com>
Change-Id: I291c13f5905e00bc6685a980284a6abd0c98da78


[ROCm/ROCR-Runtime commit: f398d6d204]
2021-02-23 12:20:29 -05:00
Eric Huang 9f7ae5b9e2 libhsakmt: add new flag for memory mapped as uncached
It is to provide an option to map specific memory as
uncached on A+A HW platform.

Signed-off-by: Eric Huang <JinhuiEric.Huang@amd.com>
Change-Id: Ib665cb306a0e78aba3ea5ee2f0e46cb62ae139f8


[ROCm/ROCR-Runtime commit: 2464bfc714]
2021-02-23 12:20:29 -05:00
Gang Ba 0ddd455ead libhsakmt: add Streaming Performance Monitors APIs
Signed-off-by: Gang Ba <gaba@amd.com>
Change-Id: Iab9a98fa2079b7cae7158c524479dfc3fa672407


[ROCm/ROCR-Runtime commit: e8c0426c54]
2020-11-16 16:36:21 -05:00
Gang Ba 04e57413f4 Revert "libhsakmt: add Streaming Performance Monitors APIs"
This reverts commit c0a0ada18b.

Reason for revert: Change was submitted by accident

Change-Id: If05c705e22296fd3ca789f269737d379a933361d
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>


[ROCm/ROCR-Runtime commit: fec3780c1a]
2020-06-29 10:54:54 -04:00
Gang Ba c0a0ada18b libhsakmt: add Streaming Performance Monitors APIs
Signed-off-by: Gang Ba <gaba@amd.com>
Change-Id: I5c23a8dacf9bc50c740908aabe391432f2c7112e
Signed-off-by: Gang Ba <gaba@amd.com>


[ROCm/ROCR-Runtime commit: d675d1cce1]
2020-05-29 09:34:31 -04:00
Philip.Cox@amd.com fc181bcdb1 Initial kfd debugger address watch support
Code for new kfd debugger address watch code.
           -- Adding support for:
              -- add address watch
              -- clear address watch

Change-Id: I9b014e7cee03897157b997b9e5b39b6ed403b8e1
Signed-off-by: Philip.Cox@amd.com <Philip.Cox@amd.com>


[ROCm/ROCR-Runtime commit: 0a55f31463]
2020-05-21 13:41:55 -04:00
Amber Lin 2aa89d8bf4 libhsakmt: Sync up the ioctl number
Update the non-upstream ioctl numbers to align with the change in the
kernel.

Signed-off-by: Amber Lin <Amber.Lin@amd.com>
Change-Id: Ie0ddccb343a023b55eb18477c59341acaa666e99


[ROCm/ROCR-Runtime commit: a37a88ddcb]
2020-05-12 15:06:07 -04:00
Jonathan Kim efef21f4ff add queue snapshot test
adds api and test to get newly create queue snapshot per ptraced process.

Change-Id: Ife97123a5b930e837ccaa386801145ef23c2cc2c
Signed-off-by: Jonathan Kim <Jonathan.Kim@amd.com>


[ROCm/ROCR-Runtime commit: 8b01a1c4c5]
2019-12-02 11:56:04 -05:00
Philip Cox 74fe695127 Remove debugger data reg accesses
The debug trap accesses the data0/data1 registers, so we do not
want the userspace to write values to it.  We remove the calls to
set the data0/data1 register values.

Change-Id: Iaba842a4c445f339f16a39fe1994526ff78a2f3c
Signed-off-by: Philip Cox <Philip.Cox@amd.com>


[ROCm/ROCR-Runtime commit: 6933540c81]
2019-10-10 14:32:54 -04:00
Philip Cox 7c81389f01 Add kfd debugger version support
To check the KFD debugger API support, we need to be able to check
the major/minor version of the kfd debugger version, so we need to
expose this function from the kernel.

Change-Id: I8a3dc617607e2efa9e65306d08b8583b8b1a2172
Signed-off-by: Philip Cox <Philip.Cox@amd.com>


[ROCm/ROCR-Runtime commit: 35d56297d3]
2019-10-10 14:32:54 -04:00
Jonathan Kim c9cc529a4f add new queue bit test on clear event
enable thunk query api to report if queue is newly created
test new queue bit test on clear events.
also fixup cleanup to disable debug trap.

Change-Id: I3ebe2d85da66f28b8c82f0e68461ee7d32ec0b0d
Signed-off-by: Jonathan Kim <Jonathan.Kim@amd.com>
Reviewed-by: Philip Cox <Philip.Cox@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>


[ROCm/ROCR-Runtime commit: 1ff5cb33b2]
2019-08-23 11:25:32 -04:00
Jonathan Kim 8fc23418ea libhsakmt: update dbg enable trap and add query debug events
Add data out for enable trap to return poll fd to user space.
Add query debug events interface.

Change-Id: Ia4afde1cf167e6aa61d502380a8b329ee89d5f44
Signed-off-by: Jonathan Kim <Jonathan.Kim@amd.com>


[ROCm/ROCR-Runtime commit: 836dfd0752]
2019-08-07 10:04:33 -04:00
Oak Zeng dc22f0c67e Remove NodeId parameter from hsaKmtAllocQueueGWS
The NodeId parameter is redundant and can be retrieved
from QueueId parameter.

Change-Id: I12853849b868b304bd27633fa7653ba644d69026
Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>


[ROCm/ROCR-Runtime commit: f40f166e20]
2019-08-06 20:20:30 -04:00
Felix Kuehling f013b274aa libhsakmt: Update kfd_ioctl.h
Change-Id: Ibf165023b98787fdf295f50324e19aa062f2421d
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>


[ROCm/ROCR-Runtime commit: f5a094bc96]
2019-06-03 19:15:49 -04:00
Philip Cox 596a2491c7 libhsakmt: Update wave suspend/resume API
This is updating to the new suspend and resume API for the
KFD and the thunk.  We now support passing in a list of queues
to suspend, and not just all of the queues for the process.

The kfdtest testcase was also updated so it still compiles.

Change-Id: I71d1b178476bd9df0c311bdedaa6a891528cebcf
Signed-off-by: Philip Cox <Philip.Cox@amd.com>


[ROCm/ROCR-Runtime commit: c2c1385e29]
2019-05-03 10:32:47 -04:00
Oak Zeng 8b70424b2f Map remapped mmio page to process space
HDP conherence registers are remapped at driver level
to an empty page in mmio space (the remapped mmio page).
This change allocate and map the remapped mmio page to
process space.



Change-Id: I89c405c41870a79c5b58eea0d8e564aa35f55182
Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>


[ROCm/ROCR-Runtime commit: ae111689f0]
2019-04-30 09:00:16 -05:00
Eric Huang 6e93266f63 libhsakmt: update kfd_ioctl.h regarding RAS interface
It is aligned with RAS changes in KFD.

Change-Id: I52816da01a4001158a40a1207d1fbe6ec3271343
Signed-off-by: Eric Huang <JinhuiEric.Huang@amd.com>


[ROCm/ROCR-Runtime commit: d6cde5bf08]
2019-03-28 21:38:44 -04:00
Oak Zeng a75addec83 Use latest kfd_ioctl.h
A new SDMA queue type for XGMI was added

Change-Id: Iad065c1a7c053a58e0d86becfb374215e316a611
Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>


[ROCm/ROCR-Runtime commit: e4109de26d]
2019-03-07 13:25:33 -05:00
Oak Zeng dfb65fe0fe Delete a few SDMA queue types
The design changed. Those are not needed any more

Change-Id: Ibb1230d1c34d6ac5153275f9334af45c73805f37
Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>


[ROCm/ROCR-Runtime commit: faba8950d4]
2019-01-22 14:49:05 -06:00
Philip Cox fa45791c1a Initial gfx9 debugger node suspend/resume
Change-Id: I2a5dac3d02265c11f5b6985ab457e2d1caa0a033
Signed-off-by: Philip Cox <Philip.Cox@amd.com>


[ROCm/ROCR-Runtime commit: 37858f2311]
2019-01-11 09:00:54 -05:00
Eric Huang 616392b642 libhsakmt: add RAS support v2
RAS feature enabling bit and errors return are implemented in
existed topology and event mechanism.

v2: change library interface.

Change-Id: I75807c080b5b26e8115240b05b3d7016cb05a31a
Signed-off-by: Eric Huang <JinhuiEric.Huang@amd.com>


[ROCm/ROCR-Runtime commit: 8ee93b3187]
2018-12-13 10:17:12 -05:00
Eric Huang 58c2f26d25 Revert "libhsakmt: add RAS support"
This reverts commit 56b9bb17a7.

Change-Id: I739b17e057f2a8a0f4375741955209d2477c704a
Signed-off-by: Eric Huang <JinhuiEric.Huang@amd.com>


[ROCm/ROCR-Runtime commit: 29d11d02e8]
2018-12-08 19:42:33 -05:00
Eric Huang 56b9bb17a7 libhsakmt: add RAS support
RAS feature enabling bit and errors return are implemented in
existed topology and event mechanism.

Change-Id: I9b018bba80cf4a6998e42a7bff64318c689b1d2a
Signed-off-by: Eric Huang <JinhuiEric.Huang@amd.com>


[ROCm/ROCR-Runtime commit: 1fbe010354]
2018-11-23 11:42:34 -05:00
Oak Zeng 49dbd130f5 Use latest kfd_ioctl.h file
Change-Id: Icd7da4a305581c6857e17d59fbd0c3bd5101df3b
Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>


[ROCm/ROCR-Runtime commit: 055f7c9c2c]
2018-11-13 14:51:46 -05:00
Philip Cox f85a629639 Add GFX debug trap control code
Add initial support for the kfd debugger trap support
for GFX9 chips.

   - Adding support for Enable/Disable trap support
   - Setting debug trap support data
   - Setting wave launch trap override
   - Setting wave launch mode

Change-Id: If39f2395c4b6cf56249cf76f1c44cfcbdcef891c
Signed-off-by: Philip Cox <Philip.Cox@amd.com>


[ROCm/ROCR-Runtime commit: db92d5af23]
2018-08-22 14:40:15 -04:00
Felix Kuehling c3c36d0afd Cosmetic changes to kfd_ioctl.h
Make it more similar with upstream.

Change-Id: I982ccfd4045d96e3c30bc84d38d0e03db8de9b08
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>


[ROCm/ROCR-Runtime commit: 7495e74257]
2018-05-31 13:17:27 -04:00
Felix Kuehling 212b7f50dd Update KFD-Thunk ioctl ABI to match upstream
- Clean up and renumber scratch memory ioctl
- Renumber get_tile_config ioctl
- Renumber set_trap_handler ioctl
- Update KFD_IOC_ALLOC_MEM_FLAGS
- Renumber GPUVM memory management ioctls
- Remove unused SEP_PROCESS_DGPU_APERTURE ioctl
- Update memory management ioctls
    Replace device_ids_array_size (in bytes) with n_devices. Fix error
    handling and use n_success to update device_id arrays in objects.

This commit breaks the ABI and requires a corresponding KFD change.

Change-Id: Ibf0af5a5188e817c886eab388d1533130fc18293
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>


[ROCm/ROCR-Runtime commit: 571e2cf7e4]
2018-05-31 13:17:27 -04:00
Felix Kuehling ea79b3d1da Update kfd_ioctl.h from kernel
This adds new acquire_vm ioctl.

Change-Id: Ia6794bfd291706cecdb2d06f4902b324b48577df
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>


[ROCm/ROCR-Runtime commit: 19dacdecd3]
2018-03-09 16:36:52 -05:00
Yong Zhao 1d23f94a9b Update kfd_ioctl.h
Kernel file has been changed recently, so we update the file in thunk.

Change-Id: I359a389fa9d91641114c7fb75f420ee6b16f467a
Signed-off-by: Yong Zhao <yong.zhao@amd.com>


[ROCm/ROCR-Runtime commit: 8126ddc77e]
2017-10-06 14:49:11 -04:00
Felix Kuehling fce3048015 Remove deprecated implementation of hsaKmtMapGraphicHandle
The KFD implementation has been removed and will not be upstreamed.
This API has been superseded by hsaKmtRegisterGraphicsHandleToNodes.

Change-Id: I5f2d8da3260974618cdb6ea3fdcd77d37b82c9cb
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Amber Lin <Amber.Lin@amd.com>


[ROCm/ROCR-Runtime commit: 374bd89d8c]
2017-06-02 13:52:19 -04:00
Amber Lin dd782c86c0 Implement hsaKmtGetQueueInfo interface
For items in HsaQueueInfo, control stack information comes from KFD, CU
mask information is maintained in Thunk, and others (queue detail error
and queue type extended) are ignored (value = 0) at this point.

Change-Id: Ib21370b0f52b2bb4ebe6a9b4b6ec6139cccb25ca
Signed-off-by: Amber Lin <Amber.Lin@amd.com>


[ROCm/ROCR-Runtime commit: 683fc96325]
2017-06-01 14:15:54 -04:00
Felix Kuehling e5b910be20 Fix KFD ioctl ABI
This change breaks the ABI, and aligns it with the upstream ABI.
It also fixes some ioctl structures that are not 64-bit safe and
consolidates ioctl numbers.

Change-Id: Ib79944721534bd55a5299c5baf7bb5b3246cccd2
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>


[ROCm/ROCR-Runtime commit: 15764e2897]
2017-05-09 14:59:13 -04:00
Felix Kuehling 2cc06c88ff Switch to cleaned up memory management ioctls
Change-Id: Ib8971ef91138f2a051272b9b57f0ebd480e8e738
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>


[ROCm/ROCR-Runtime commit: 5eb31b2ebe]
2017-05-04 16:29:37 -04:00
Felix Kuehling 3d88b3571b Update kfd_ioctl.h
Copied from kernel repository.

Change-Id: I9ed021cfb5b297d9a91dce93ed6355c95fb1127b
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Shaoyun Liu <Shaoyun.Liu@amd.com>


[ROCm/ROCR-Runtime commit: e5dd2f88c6]
2017-02-27 10:39:05 -05:00
Harish Kasiviswanathan b7f6ed08ee Add API entrypoints for Cross Memory Attach
Implement two new API for cross memory read and write operation.
 - hsaKmtProcessVMRead
 - hsaKmtProcessVMWrite

Add new ioclts necessary for the above APIs.

Change-Id: I0c153e3b4e1f32b7a8b102ad5c774d9ae9bfc2fa
Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>


[ROCm/ROCR-Runtime commit: e79521b556]
2017-02-17 16:59:51 -05:00
Harish Kasiviswanathan 5d2336f1ca Add API entrypoints for IPC functionality
Implement three new APIs for IPC buffer sharing:
	-hsaKmtShareMemory()
	-hsaKmtRegisterSharedHandle()
	-hsaKmtRegisterSharedHandleToNodes()

Add new ioclts necessary for the above APIs.

Change-Id: Ia2b4d0dc91ec64bff959395d11c0536467404792
Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>


[ROCm/ROCR-Runtime commit: 559e31d6ff]
2016-11-28 16:19:22 -05:00
Harish Kasiviswanathan bd81b76c5a kfd ioctl. Remove unused definitions
Sync the file with Kernel header file

Change-Id: I52d52a38fb38bd4b37d8210ce79775b88c8a985d


[ROCm/ROCR-Runtime commit: 4838f6e740]
2016-11-22 09:44:22 -05:00
Felix Kuehling fee7a91fb9 Allocate and map doorbells in SVM for discrete GPUs
Allocate doorbells for dGPUs in the SVM aperture and map them for
GPU access. This is necessary to allow GPU-initiated submissions to
user mode queues.

Depends on new doorbell BO allocation flag in KFD.

Change-Id: I0737bef4a4764bb4a66c43846707ead2108f6601


[ROCm/ROCR-Runtime commit: 2e0a6eb371]
2016-09-16 16:04:27 -04:00
Yong Zhao cba37c251c Implement hsaKmtGetTileConfig in thunk
Change-Id: Iba8d8efa46e3c268a03442d3db568e1b19230e94


[ROCm/ROCR-Runtime commit: 8351b3d2e8]
2016-09-06 16:24:29 -04:00
shaoyunl 0c6a45ca49 Add Imprecise flag for memory access fault
KFD may not be  able to provide the precise VM fault address and status.
This flag will indicate whether the event data has the fault details

Change-Id: I15ffd5c25f555003c6450cc0700efb769418f76b


[ROCm/ROCR-Runtime commit: 79077811f5]
2016-03-14 15:17:17 -04:00
Felix Kuehling e2d2d6bd32 Update kfd_ioctl.h from kernel
Change-Id: I9852ef2e33e1f3b24343747e3c1c09b0050ffdc1


[ROCm/ROCR-Runtime commit: cb0315d31d]
2016-03-09 10:55:12 -05:00
Felix Kuehling 99325bf7c4 Add support for register/deregister memory for dGPU
Allocate SVM address space for the registered memory and use new
userptr support in KFD to create a system memory BO associated with
the given user pointer. Map this BO at the SVM address for CPU
access.

MapMemoryToGPU can be used with the registered user pointer and
will return the SVM address as alternate GPUVA.

Change-Id: I4886e193c51fb6870a567878870c36bf8b5c3748


[ROCm/ROCR-Runtime commit: 85f9efb1a0]
2016-02-16 18:12:05 -05:00
shaoyunl 4c5a3ca774 libhsakmt: Use GPU ID instead of Node ID in set_process_dgpu_aperture
Change-Id: I0e66ca4a018c15c009a3516d250f0044a4407878


[ROCm/ROCR-Runtime commit: 7e40877e81]
2016-02-04 10:32:23 -05:00