Commit Graph

210 Commits

Author SHA1 Message Date
Mateusz Jablonski 420f273a6c fix: don't wait on condition in unit tests
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2023-10-10 15:14:30 +02:00
Brandon Yates 3fbce47182 refactor(debugger): Rename DebugSessionLinux
Rename to DebugSessionLinuxi915 in preparation
for implementation of Xe debugger

Related-to: NEO-8404

Signed-off-by: Brandon Yates <brandon.yates@intel.com>
2023-10-09 10:12:47 +02:00
Mateusz Jablonski 95eb5df978 refactor: use reference in for-range loops
Related-To: NEO-9038
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2023-10-04 15:32:26 +02:00
Mateusz Jablonski 895a586083 refactor: use reference in for-range loops
Related-To: NEO-9038
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2023-10-03 18:56:53 +02:00
Mateusz Jablonski 1963ea69e5 fix: add missing member initializations
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2023-10-03 08:41:46 +02:00
Brandon Yates 253e1df43b feature(debugger): Filter page fault threads by start IP
When a thread is stopped due to potential page fault
we must check AIP against start IP to ensure it is not
a newly started thread accidentally caught by PF algorithm

Related-to: NEO-8617

Signed-off-by: Brandon Yates <brandon.yates@intel.com>
2023-09-29 12:45:32 +02:00
Brandon Yates 9c56a11c2e refactor(debugger): Move PF exception check into bitmask
Related-to: NEO-8617
Signed-off-by: Brandon Yates <brandon.yates@intel.com>
2023-09-28 08:28:00 +02:00
Brandon Yates b3464a2621 feature(debugger): Expose DBG regset
Related-To: NEO-8383

Signed-off-by: Brandon Yates <brandon.yates@intel.com>
2023-09-26 11:50:29 +02:00
Jitendra Sharma 8f7b3e6699 feature: Report 128 GRF count with zetDebugGetRegisterSetProperties
Related-to: NEO-6788

Signed-off-by: Jitendra Sharma <jitendra.sharma@intel.com>
2023-09-18 11:03:59 +02:00
Brandon Yates 7c1f5585d7 feature(debugger): online page fault event handling
Sync to
https://github.com/intel-gpu/drm-uapi-helper/releases/tag/v2.0-rc20

Related-to: LOCI-2052

Signed-off-by: Brandon Yates <brandon.yates@intel.com>
2023-09-18 00:15:45 +02:00
Brandon Yates 513045bd90 fix(debugger): auto-ack vmbind on tile for module from other tiles
Related-to: NEO-8371

Signed-off-by: Brandon Yates <brandon.yates@intel.com>
2023-09-14 15:33:58 +02:00
Compute-Runtime-Validation e489c16529 Revert "feature: Report 128 GRF count with zetDebugGetRegisterSetProperties"
This reverts commit 6596ce5097.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
2023-09-14 14:34:55 +02:00
Jitendra Sharma 6596ce5097 feature: Report 128 GRF count with zetDebugGetRegisterSetProperties
Related-to: NEO-6788

Signed-off-by: Jitendra Sharma <jitendra.sharma@intel.com>
2023-09-13 14:12:38 +02:00
Jitendra Sharma 9818ef61a5 feature: Report correct GRF register count
Based on Large GRF enabled or not, report correct GRF
register.

Related-To: NEO-6788
Signed-off-by: Jitendra Sharma <jitendra.sharma@intel.com>
2023-09-04 11:42:48 +02:00
Compute-Runtime-Validation 154530ad23 Revert "feature: Report correct GRF register count"
This reverts commit 8eb3fe222e.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
2023-09-01 15:12:57 +02:00
Jitendra Sharma 8eb3fe222e feature: Report correct GRF register count
Based on Large GRF enabled or not, report correct GRF
register.

Related-To: NEO-6788
Signed-off-by: Jitendra Sharma <jitendra.sharma@intel.com>
2023-08-31 18:48:29 +02:00
Compute-Runtime-Validation e61c5af7ec Revert "feature(debugger): online page fault event handling"
This reverts commit 0c6444aab7.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
2023-08-24 08:16:45 +02:00
Brandon Yates 0c6444aab7 feature(debugger): online page fault event handling
Related-to: LOCI-2052

Signed-off-by: Brandon Yates <brandon.yates@intel.com>
2023-08-23 18:29:58 +02:00
Brandon Yates 9db08001c4 fix(debugger): Set flags for MME regset
Related-to: NEO-8286

Signed-off-by: Brandon Yates <brandon.yates@intel.com>
2023-08-23 16:38:35 +02:00
Mateusz Hoppe 8e07dd30cb performance(debugger): optimize ATT handling - minimize mem allocs
- do not allocate state save area every time attention event
is handled
- keep allocated memory for subsequent events
- remove not needed DBEUG_BREAK

Related-To: NEO-8183

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2023-07-18 08:37:04 +02:00
Mateusz Hoppe 9a53f20e6c performance(debugger): optimize ATT event handling
- check threads with attention state before reading SR_IDENT
- memory read is costly, for threads already in stopped state
there is no need to read sr_ident and check thread state again
- single stepping one thread performance is substantially improved,
by the factor of 6x

Related-To: NEO-8183

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2023-07-17 10:42:34 +02:00
Mateusz Hoppe 6205cca038 fix(debugger): require immediate binding for Module's allocations
- all bos from Module must have requireImmediateBinding
flag set
- this change fixes hang in debugger - where MODULE LOAD event
was not sent

Resolves: NEO-8121

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2023-07-06 17:34:22 +02:00
Brandon Yates bef89a3a7c feature(debugger): Force GRF count to 128
System Routine changes for implementing large-grf debugging
will result in GRF count of 256 being reported for kernels
in all GRF modes. Applications using L0 Debug API do not
yet have a way to determine actual GRF count for kernel.

This commit is a temporary adjustment to avoid breaking debug
API users after new system routine is enabled.

This problem will be fully solved in follow up patch with switch to
zetDebugGetThreadRegisterSetProperties

Related-to: NEO-7370

Signed-off-by: Brandon Yates <brandon.yates@intel.com>
2023-06-27 14:24:52 +02:00
Mateusz Hoppe c4f36a6808 fix(debugger): ack pending events before closing session
- ack module / isa vm bind events before close(fd)

Related-To: NEO-7960

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2023-05-11 17:21:23 +02:00
Brandon Yates 713f166d17 feature(debugger): Implement zetDebugGetThreadRegisterSetProperties (1/n)
Current SIP implementation has constant reg descs for all threads.
Initial implementation of this API always returns same reg descs as the
non-thread version of API. When SIP exposes per-thread reg descs,
this API will be updated to expose them.

Related-to: NEO-7370
Signed-off-by: Brandon Yates <brandon.yates@intel.com>
2023-05-08 14:46:48 +02:00
Fabian Zwolinski e351a90f81 refactor: Rename member variables to camelCase 2/n
Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
2023-04-27 20:39:22 +02:00
Mateusz Hoppe bfd32d6284 fix: read state save area once for all threads for resume(ALL)
- when resume(all) is called - all threads' sr counter needs to be
verified. Reading state save area separately for all threads takes
longer than reading whole state save area once. State save area is
only read again if sr counter wasn't updated
- fail while reading state save area means threads might have completed
execution
- this fix optimizes time spent in resume(all), that may be called before
debugger detaches

Related-To: NEO-7897

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2023-04-17 15:41:13 +02:00
Mateusz Hoppe 079105a5c2 fix: optimize ATT handling - read state save area once for all threads
- reading state save area for every threads takes too long when all
application threads have completed and there are stale ATT events to
process
- on detach gdb seemed to be frozen waiting for ATT event to be handled
- fix is to read state save area once - and check SIP counter for every
thread in ATT bitmask

Related-To: NEO-7897

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2023-04-14 10:57:18 +02:00
Mateusz Hoppe d1393e08d3 refactor: remove debug break when EU CONTROL ioctl fails
- when no threads are executing, interrupt all may fail and debug break
fires - although error is handled and correct event is returned. To
prevent abort, debug break has to be removed

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2023-04-05 13:07:31 +02:00
Mateusz Hoppe e26ebfc51b fix: check exception reason for stopped threads
- before marking interrupt request check exception reason. If there is
exception other than forced exception or forced external halt treat
thread as stopped and generate distinct event for it.

Related-To: NEO-7869

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2023-04-05 12:01:20 +02:00
Mateusz Hoppe bfb59cc573 fix: do not resume threads that have pending THREAD_STOPPED events
- threads with pending events cannot be resumed by resume(all) as they
they were not yet discovered by debugger as stopped.
- set reportAsStopped when THREAD_STOPPED event is read
- when resuming, only resume a thread when it was reported

Related-To: NEO-7817

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2023-03-31 12:42:25 +02:00
Yates, Brandon 0f6140deb0 fix(l0debug): windows topology map should always be created
Topology map was only being created when ZET_ENABLE_PROGAM_DEBUGGING was
set.  This was not correct.  Now it is unconditionally created at init,
and debug attach will fail if it is not valid.

Related-to: LOCI-3937

Signed-off-by: Yates, Brandon <brandon.yates@intel.com>
2023-03-27 16:24:57 +02:00
Filip Hazubski bd6349724b feature(debugger): Increase buffer size used in readAndHandleEvent function
Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
2023-03-17 15:54:32 +01:00
Mateusz Jablonski a7830eb478 refactor l0 cmake: add CMakeLists.txt files to solution
Related-To: NEO-7507
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2023-03-17 12:09:03 +01:00
Mateusz Hoppe f2275caf3a performance: L0 debug - improve single-step time
- check threads with ATT only when more than one thread is resumed
- if single thread is resumed - check only that thread
- delay thread state check - allowing thread to reenter SIP

Related-To: NEO-7750

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2023-03-15 09:48:35 +01:00
Mateusz Jablonski fbe01e534b fix l0 debug: correct UNRECOVERABLE_IF condition
correct debug API tests to respect more than 8 threads per eu

Related-To: NEO-7442

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2023-03-10 12:54:31 +01:00
Yates, Brandon 11bec57d10 fix(L0 debug): Fix singleThread conversion for some hw configs
Configs with low slices disabled produced wrong EuThread vector

Signed-off-by: Yates, Brandon <brandon.yates@intel.com>
2023-03-10 10:30:49 +01:00
Mateusz Hoppe caecbb12f0 fix: Add ATT scan after interrupt in handling ATT event
- make sure to capture all threads after interrupt, also those that
could be lagging to enter SIP

Related-To: NEO-7776

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2023-03-07 11:53:25 +01:00
Mateusz Hoppe 802848a43f fix: L0Debug - allow access only for reported stopped threads
- read/write registers/memory only allowed for threads reported as
stopped by events
- threads newly stopped, accidentally, that are resumed immediately
are not allowed register/memory access

Related-To: NEO-7776

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2023-03-03 13:34:57 +01:00
Mateusz Hoppe 6947220298 perf(debugger): Optimize registers access during debugging
Register read/write implementation was unnecessarily checking magic values
which were taking significant time. By removing those checks, register
access is speed-up by a factor of 3.

Resolves: NEO-7754

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2023-02-23 12:14:03 +01:00
Mateusz Hoppe e8b4841577 perf(debugger): Optimize single-stepping of eu threads
Single-stepping threads is based on resume() and THREAD_STOPPED events
To speed up single-stepping, stopped threads must be discovered
immediately after resume() is called.
This change is adding ATT scan and event generation in resume()

Related-To: NEO-7750

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2023-02-23 11:06:13 +01:00
Warchulski, Jaroslaw b224ec947e Cleanup includes 50
Cleaned up files:
shared/source/helpers/hw_info.h

Related-To: NEO-5548
Signed-off-by: Warchulski, Jaroslaw <jaroslaw.warchulski@intel.com>
2023-02-10 20:26:13 +01:00
Warchulski, Jaroslaw 64f735481d Cleanup includes 48
Cleaned up files:
shared/source/command_container/command_encoder.inl
shared/source/os_interface/hw_info_config.h

Related-To: NEO-5548
Signed-off-by: Warchulski, Jaroslaw <jaroslaw.warchulski@intel.com>
2023-02-10 17:23:02 +01:00
Warchulski, Jaroslaw a2e6a8284b Cleanup includes 47
Cleaned up files:
level_zero/tools/source/debug/windows/debug_session.h
level_zero/tools/source/sysman/memory/windows/os_memory_imp.h
level_zero/tools/source/sysman/windows/kmd_sys_manager.h
opencl/test/unit_test/aub_tests/command_stream/copy_engine_aub_tests_xehp_and
shared/source/command_container/command_encoder.inl
shared/source/command_stream/command_stream_receiver_hw_xehp_and_later.inl
shared/source/helpers/blit_commands_helper_base.inl
shared/test/unit_test/image/image_surface_state_fixture.h
shared/test/unit_test/os_interface/windows/os_interface_win_tests.h

Related-To: NEO-5548
Signed-off-by: Warchulski, Jaroslaw <jaroslaw.warchulski@intel.com>
2023-02-10 17:07:30 +01:00
Kamil Kopryk d8d1b7f331 Initialize status variable
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
2023-02-10 11:01:47 +01:00
Kamil Kopryk 524d945e8c refactor: rename l0 hw_helpers dir to gfx_core_helpers
Related-To: NEO-6853
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
2023-02-02 11:15:56 +01:00
Kamil Kopryk 2484c7ceb2 refactor: rename hw_helper files to gfx_core_helper files
Related-To: NEO-6853
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
2023-02-01 19:37:51 +01:00
Yates, Brandon f53d9103ad Fix(L0Debug): Fix thread creation on dg2 128EU
Not enough EUThread objects were being created
resulting in a crash during breeakpoint
processing

Related-to: LOCI-3937

Signed-off-by: Yates, Brandon <brandon.yates@intel.com>
2023-01-31 19:48:50 +01:00
Matias Cabral 2f09a07445 Increase min version of SIP with SLM support
Resolves: NEO-7506

Signed-off-by: Matias Cabral <matias.a.cabral@intel.com>
2023-01-27 19:06:58 +01:00
Kamil Kopryk eb002acaa1 refactor: rename l0_gfx_core_helper files
Related-To: NEO-6853
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
2023-01-24 12:59:26 +01:00