Graphe des révisions

2959 Révisions

Auteur SHA1 Message Date
Sean Keely 9ff0268f4c Further cmake changes.
Add namespacing to elf find module.

Stop using CMAKE_CXX_FLAGS and start using target properties for this.

Ideally we should remove the actual option strings and replace with cmake
compiler properties or compile features.

Change-Id: I57756387b3bd3c565c99a35fed4b37fe1a2d0556
2020-06-19 22:33:36 -04:00
Sean Keely 55a4f01b16 Update to modern cmake.
Adds support for find_package(), locates dependencies with
find_package(), swaps the roles of /hsa/include/hsa and /include/hsa
as well as /lib & /hsa/lib.

Kernel code objects no longer build at every make call but only
as needed.  Dependencies are tracked through to clang.

Device lib is still located with directory searches.  build_devicelibs.sh
does not yet install the cmake config files on the build systems.

Corrects DAZ mode mismatch in code object compilation.

Still needs updating to compiler properties rather than direct
manipulation of CMAKE_CXX_FLAGS.

Change-Id: I02d946c8a77d5cf753681f8e3d3153fca4aae86a
2020-06-19 22:33:36 -04:00
Sean Keely a5e492253e Remove legacy build files.
Change-Id: I540846b46714b6b07039e8b84929588f156652e0
2020-06-19 22:33:36 -04:00
Ramesh Errabolu 42b38daa22 Update License header and Cleanup IP references
Change-Id: I0a6636e1d8457045d034d05383cfb5d4e7680fee
2020-06-19 22:33:36 -04:00
Ramesh Errabolu 0ca0691ca7 Build ROCr core and image libraries as one shared object
Change-Id: I3a16c1227e7db2e386ab33886965596fa0fb0c87
2020-06-19 22:33:36 -04:00
Sean Keely f101875de8 Add warning about incorrect package names when using CMake 3.5
Signed-off-by: Sean Keely <Sean.Keely@amd.com>
Change-Id: Ie35b287224ec6b963bc317baf60853fbe223fc17
2020-06-19 20:12:16 -05:00
Laurent Morichetti db6a781f0c Preserve the exec mask for the queue error case
Save and restore exec_lo/exec_hi around the mGetDoorbellId macro in
the signal_error case just like we do in the signal_debugger case.

Also reset the wave_id (ttmp4/ttmp5) to 0 since it isn't preserved.
0 will be detected as a new wave by the debugger api library.

Change-Id: I5123caa9431154ec1584bae85e42648c97c64c37
2020-06-18 02:25:11 -04:00
Eric Huang 0003b6d147 kfdtest: change shader command to avoid compile error for gfx90a
Signed-off-by: Eric Huang <jinhuieric.huang@amd.com>
Change-Id: I531ebac162403cc957802bbcdb34cdc022be3a50
2020-06-17 10:15:12 -04:00
Sean Keely d163fac13d Fix install issue.
Create symlink directory before attmpting to create the symlink.

Change-Id: Ic4d07052e5bfc32280c7d71e58784cbba3536e2a
2020-06-17 03:15:25 -05:00
Yong Zhao 6a762ec717 libhsakmt: Improve the comment regarding queue doorbells
The comment failed to convey the fact.

Change-Id: Ia9b1d1c2583e288a6308d2bc81d42055064a5f4f
Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
2020-06-16 15:16:03 -04:00
Tony 047b80ab41 Do not add offset/size to code object URI if loading from complete file
Change-Id: I7cb1e803e0bcdbc24935273af431fbcc88404bfd
2020-06-12 05:10:35 -04:00
Sean Keely f0b0555996 Add optional support for the cmake per user package registry.
Default is OFF to conform to latest cmake standard (3.15) and
because this feature can cause some confusion for unaware developers.

Change-Id: I6fdbd5ab76c90b73ac6451a383334a83cabef438
Signed-off-by: Sean Keely <Sean.Keely@amd.com>
2020-06-11 14:25:57 -05:00
Sean Keely 06add334b9 Update to conform with modern cmake best practices.
Immediate benefit is that this enables cmake native find_package
support including transitive passthrough of link dependencies,
options, and include paths.

It does require a bump to cmake 3.6 to enable proper package file
names.

Change-Id: I3f4e2f2db745c04a7f686111b080098a0d92fbf5
Signed-off-by: Sean Keely <Sean.Keely@amd.com>
2020-06-11 14:25:41 -05:00
Evgeny b033453537 concurrent sqtt support
Change-Id: I0e1515d4b0aab30b0a9b673120eee28d96f64d9e
2020-06-10 22:45:30 -04:00
Tony a74660c69a Initialize HSA Queue object before creating KFD queue
Initialize all the fields in the HSA queue object to known values
before calling the thunk to create the KFD queue. This ensures that
when the debugger detects that a KFD queue is created it can access
the values it requires. The values it requires include the apperture
addresses, queue scratch memory base, and the HSA queue kind.

Change-Id: Ic985755b0402c6794d5987e60aff50d223f09eb9
2020-06-04 04:56:24 -04:00
Konstantin Zhuravlyov 5f614c31f5 Correct loader URI reporting
- Check address is in the range of the mapped file.
  - Correct calculation of offset within the file.

Change-Id: I848a3ead4422698c2ef1c140bc8ae5e000a717f7
2020-06-03 13:03:07 -04:00
Laurent Morichetti da6d892058 Handle address watch exceptions
Set ttmp11[8] and send a signal for the debugger when the handler
is entered because of an address watch exception.

Change-Id: Icc83a79027bb7ca1e50e19e2f00464cb9ca862f3
2020-06-02 15:25:15 -04:00
Konstantin Zhuravlyov 9eb735ec24 Add support for code object URI to ROCr
Adds the following:
	- New factory method to create a code object reader from
          file with offset and size.
	- A pair of queries on a loaded code object to get the URI name/length.
	- A bump to the AMD vendor loader extension API and its associated table.

Change-Id: I17c83e9c2447d29a43c438459395365f786a3611
2020-06-01 11:07:50 -04:00
Gang Ba d675d1cce1 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>
2020-05-29 09:34:31 -04:00
Sean Keely 4e0bf29704 Separate memory map info printing from vmfault handler.
Allows the print utility to be called from GDB.

Change-Id: Ia27ff9ba23ad6c0117ba1278693d4c8b0473bdc1
2020-05-28 23:34:49 -04:00
Sean Keely 32bb10086d Select a non-empty pool for image kernarg.
Zero size pools have no numa bindings.  Selecting a pool with numa
bindings should prevent thrashing due to numa balancing daemon.

Change-Id: Ib0082cb9af66e24e07a2adbb83c1045145d51403
2020-05-28 23:34:42 -04:00
Sean Keely 40d1931209 Relocate initial system clock setup.
This has nothing to do with registering agents.
Moved to Runtime::Load.

Change-Id: I0f84c9d8f5a68d458717111113f02af56c92f4f6
2020-05-28 23:34:30 -04:00
Sean Keely 29b660c91e Correct IPC fragment reuse.
Memory from the suballocator may be exported via IPC.  If this
happens then the allocating process should not reuse that memory
since it would still be connected to the remote process.  IPC exported
memory must be released back to the driver.

Change-Id: I2ab0c814f63191f753fc3640cc4140ee144bf07f
2020-05-28 21:46:02 -04:00
Sean Keely 09ebc21d13 Remove PointerInfo fragment branch.
All types which could be generated from a fragment need to take this branch.
Taking the branch is correct for all types, it was a performance optimization
only and was missing IPC.  Branch removal simplifies updates for any future
fragment use and will allow CQE to report any performance issues that might
require bringing the branch back.

Change-Id: I8041788c422e880b764e144eb1877f5126ba76f3
2020-05-28 21:46:02 -04:00
Sean Keely 397608e2c0 Fix pointer info block base address fetch.
Thunk may report nullptr for host base if the host does not have
access.  Use agent base in this case.

Change-Id: I44883d35a3fff0941b1e3037d16b059591a6c511
2020-05-28 21:46:02 -04:00
Joseph Greathouse 3fe95c696a Add ability to get ASIC revision from hsa_agent_get_info()
Change-Id: Ie30c64f9e02f9e704c9a4c4145deb9580429fdf6
2020-05-28 14:25:13 -05:00
Joseph Greathouse 5ddd8fb68b Pull out ASIC revision from HSA capability
KFD now passes the ASIC revision to user level through some bits
in the HSA topology's capability field. Some user-level software
wants this because different ASIC revisions may require user-level
software to do different things (e.g. patch code for things that
are changed in later hardware revisions).

Change-Id: I16f2a15ae0875edd01ebdb1f1685ec7865f7049e
2020-05-22 10:39:13 -05:00
Philip.Cox@amd.com 0a55f31463 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>
2020-05-21 13:41:55 -04:00
Laurent Morichetti 584ef1e1ca Clear mode.debug_en if !status.halt
The 1st level trap handler jumps to the 2nd level trap handler on
context save requests or regular traps if (mode.debug_en
&& !status.halt) is true.

If we return from the 2nd level trap handler without status.halt=1, then
we need to make sure mode.debug_en is cleared, or we will re-enter the
2nd level trap handler again and again when trapsts.savectx is set.

Change-Id: I4db6369de8c91a32842f488a4df5c9d94fa65aa9
2020-05-19 18:31:29 -07:00
Sean Keely ddebda6433 Add USER GCR packet
Allows cache flush from SDMA.

Change-Id: Iecae0b49519b2d4da7b1c053b03f721544439e71
2020-05-16 00:59:03 -04:00
Sean Keely 2ffc9ecbb3 Remove gfx1030 references.
Options seem to be gfx1030 and gfx1030.

Change-Id: I3e33e3a950d1b950e10163612b892d9c382628fa
2020-05-15 16:53:11 -05:00
Felix Kuehling df16950a0c libhsakmt: use _Static_assert instead of static_assert
Using static_assert breaks in "Many Linux" build environment. It is not
supported by that libc version. _Static_assert is a compiler built-in
and does not depend on the libc version.

Change-Id: I37cf0ad10de94d8f6fc8cefc4fdda55c9520d599
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
2020-05-15 01:34:10 -04:00
Sean Keely 012ffed459 Correct HSA_AMD_AGENT_INFO_MAX_ADDRESS_WATCH_POINTS text.
Missing attribute type.  Also remove dangling word in
HSA_AMD_AGENT_INFO_MEMORY_WIDTH.

No code change, documentation only.

Change-Id: I1d0efdb721eaa0e2fb0bdb21f8d5e034beaf8857
2020-05-13 22:40:25 -05:00
Ranieri Althoff aa185380f9 Avoid calculating strlen multiple times
Change-Id: Iec66c7d35e5d6cd2deb02c94ee070d0fa1335147
Signed-off-by: Ranieri Althoff <ranisalt@gmail.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
2020-05-13 00:38:26 -04:00
Amber Lin a37a88ddcb 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
2020-05-12 15:06:07 -04:00
Laurent Morichetti 838c6bd6ad Set ttmp11[8] for all memory violation errors
In the case where SQ_WAVE_TRAPSTS_XNACK_ERROR_MASK is set, we also need
to set the TTMP11_EXCP_RAISED_BIT in ttmp11. If we don't, the debugger
may think that the wave is halted at launch (halted without events).

Change-Id: I8c19605bbfc145275728de4ad1979d3ba8bb478a
2020-05-12 00:44:06 -04:00
Sean Keely c60364e1e0 Allow linear swizzle mode with tiled image requests.
Mesa address lib faults if the only acceptable swizzle modes are
forbidden.  The old address lib simply ignored the forbidden list
in this case.  Mesa addrlib will not select linear unless there
is no other option so allowing linear mode for tiled images will
still use tiled modes when possible.

Change-Id: I1aa44d072db902c968484dbff67b482af03b45d9
2020-05-11 23:34:44 -04:00
Ori Messinger 46f5e83066 Create KFDTest for SDMA Fault
The purpose of this KFDTest is to investigate the behaviour of an
SDMA queue when an invalid memory address is used.

v2: Don't wait for SDMA queue to finish - it won't finish because of
the gpuvm fault.

v3: Create kfd event before SDMA queue submission. This fix the issue
that gpuvm fault happens earlier than kfd event is created then KFD
exception handler can't find the kfd event (to wake up kfd test)

v4: Instead of using 0x12345678 as the invalid VA, map one page of
FB to gpu and unmap it. Use the mapped GPUVA as the
invalid address

Change-Id: I58af1511f75d869adddede302b238c2725f3fe5a
Signed-off-by: Ori Messinger <Ori.Messinger@amd.com>
Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
2020-05-11 18:52:35 -04:00
Sean Keely 9c9064c2b7 Correct async_mem_copy sample.
Peer accessibility query was not previously directed at the peer agent.

Change-Id: I259f0afac827a6e4778a56419a3acd296d00391b
2020-05-11 18:39:39 -04:00
Kent Russell dc784ba482 Fix HostAccess flags for XGMI configs in P2PTest
We need HostAccess for large-bar XGMI configs for this test,
but we can't use it on small-bar XGMI configs, so deal with it
appropriately

Change-Id: Ic16b810de03adfc63de21a00c55e5f3ea1ce66d1
2020-05-11 11:12:33 -04:00
Sean Keely 2fbacccaed Correct handling of failed lazy_ptr constructors.
Contructor function must not be attempted twice even if the construction
attempt returns nullptr.

Change-Id: I75353e5e511769a96e4332f7f60887f6559c1cd5
2020-05-08 22:23:46 -04:00
Jonathan Kim 93c333711a libhsakmt: queue suspend/resume can return non-zero positive values
New queue suspend/resume update can now return the number of successful
queue requests so return success if IOCTL return is non-negative.

This should be backwards compatible since old queue suspend/resume returns
0 on success.

Signed-off-by: Jonathan Kim <Jonathan.Kim@amd.com>
Change-Id: I06b70d95d203b2bfc19a0cc1b88c5719c695159a
2020-05-08 22:10:41 -04:00
Tony bccb25fc33 Make HSA_QUEUE_TYPE_COOPERATIVE a queue type value
- Correct defintion of HSA_QUEUE_TYPE_COOPERATIVE to be a queue type
  and not a bit mask.
- Correct implementation of hsa_queue_type_t to treat is as an
  enumeration type and not a bit mask. In particular
  HSA_QUEUE_TYPE_COOPERATIVE is a distinct queue type that uses the
  multi producer protocol, and is not a bit set value.

Change-Id: I9415be8853671e5511e16e306caf16020e8c84af
2020-05-07 19:24:19 -04:00
Matt Arsenault 96d4140609 Do not use llvm-dis to pick the triple
There are a couple problems with this. First, llvm-dis is an unstable
llvm development tool and 3rd party users should generally not rely on
it. The text format is unstable, and the regex here isn't even
explicitly looking for the target triple field, so it could
accidentally find something else. Second, picking the target to
compile based on the library you are linking is a fundamentally
backwards decision. The target you're compiling for changes the
library you would want to link. The device libraries are only ever
compiled with amdgcn-amd-amdhsa. If we had a second triple, this
should be explicitly building for any it cares about.

Change-Id: I3bae8398f60f78df61ab2177aa9e83f47ec6dea4
2020-05-06 13:28:39 -04:00
Laurent Morichetti df03a377f5 Check all s_endpgm instructions
The ROCR trap handler should check for all end program instructions
and not halt on them. Mask off the imm16 before comparing the
instruction to the s_endpgm opcode.

Change-Id: I669ffc7f5b699d7daf0c8ec5761ed7bb193f07a7
2020-05-04 19:52:53 -04:00
Felix Kuehling e5062c4383 libhsakmt: Add PROT_NONE CPU mapping for scratch mappings
This is needed to allow gdb to access the memory.

Change-Id: I96c084b714e952d7b7000f0dd41e1c530fdd092f
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
2020-05-02 15:52:30 -04:00
Sean Keely 3da81968cb Update addrlib with latest Mesa source.
Change-Id: Idd8cdaac9ad370397d62f6a32687ca7bc7d7462b
2020-05-01 20:33:09 -04:00
Sean Keely 1440da3e15 Remove dead code from image_manager_xx.cpp
Image swizzle mode will be set by the preferred surface info
function.

Change-Id: I41e639be53cafbb4db6cf15c159aa2bd457ec5be
2020-05-01 20:32:45 -04:00
Sean Keely 7e3db20826 Move Images code to hsa-runtime folder
Change-Id: I53c1845d985ac3e9708d952865009c0021f3bb4f
2020-04-30 19:35:57 -05:00
Ramesh Errabolu 1a3ee2fd03 Update Image code base to use addrlib from mesa
Change-Id: I31355d7fc3db423c16772cf105e9b6b59a3a6307
2020-04-30 19:35:56 -05:00