mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-04 15:53:45 +08:00
L0Debug fixes for multi tile devices
- notify module allocation for (sub)device used to create module, makeResident called within (sub)device contexts - access ISA with vmHandle specific to device index Related-To: NEO-5784 Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
9f2cfc6f9d
commit
ee8af85341
@@ -1285,9 +1285,9 @@ ze_result_t DebugSessionLinux::interruptImp(uint32_t deviceIndex) {
|
||||
return result == 0 ? ZE_RESULT_SUCCESS : ZE_RESULT_ERROR_NOT_AVAILABLE;
|
||||
}
|
||||
|
||||
ze_result_t DebugSessionLinux::getISAVMHandle(const zet_debug_memory_space_desc_t *desc, size_t size, uint64_t &vmHandle) {
|
||||
ze_result_t DebugSessionLinux::getISAVMHandle(uint32_t deviceIndex, const zet_debug_memory_space_desc_t *desc, size_t size, uint64_t &vmHandle) {
|
||||
auto accessVA = desc->address;
|
||||
auto &isaMap = clientHandleToConnection[clientHandle]->isaMap[0];
|
||||
auto &isaMap = clientHandleToConnection[clientHandle]->isaMap[deviceIndex];
|
||||
ze_result_t status = ZE_RESULT_ERROR_UNINITIALIZED;
|
||||
vmHandle = invalidHandle;
|
||||
|
||||
@@ -1450,7 +1450,7 @@ bool DebugSessionLinux::tryAccessIsa(uint32_t deviceIndex, const zet_debug_memor
|
||||
{
|
||||
std::lock_guard<std::mutex> memLock(asyncThreadMutex);
|
||||
|
||||
status = getISAVMHandle(desc, size, vmHandle);
|
||||
status = getISAVMHandle(deviceIndex, desc, size, vmHandle);
|
||||
if (status == ZE_RESULT_SUCCESS) {
|
||||
isaAccess = true;
|
||||
} else if (status == ZE_RESULT_ERROR_INVALID_ARGUMENT) {
|
||||
|
||||
@@ -252,7 +252,7 @@ struct DebugSessionLinux : DebugSessionImp {
|
||||
|
||||
ze_result_t readGpuMemory(uint64_t vmHandle, char *output, size_t size, uint64_t gpuVa) override;
|
||||
ze_result_t writeGpuMemory(uint64_t vmHandle, const char *input, size_t size, uint64_t gpuVa) override;
|
||||
ze_result_t getISAVMHandle(const zet_debug_memory_space_desc_t *desc, size_t size, uint64_t &vmHandle);
|
||||
ze_result_t getISAVMHandle(uint32_t deviceIndex, const zet_debug_memory_space_desc_t *desc, size_t size, uint64_t &vmHandle);
|
||||
ze_result_t getElfOffset(const zet_debug_memory_space_desc_t *desc, size_t size, const char *&elfData, uint64_t &offset);
|
||||
ze_result_t readElfSpace(const zet_debug_memory_space_desc_t *desc, size_t size, void *buffer,
|
||||
const char *&elfData, const uint64_t offset);
|
||||
|
||||
@@ -494,7 +494,7 @@ TEST_F(TileAttachTest, GivenTileAndVmBindEventsForIsaWhenReadingEventThenModuleL
|
||||
TEST_F(TileAttachTest, GivenIsaWhenReadingOrWritingMemoryThenMemoryIsReadAndWritten) {
|
||||
zet_debug_config_t config = {};
|
||||
config.pid = 0x1234;
|
||||
zet_debug_session_handle_t debugSession0 = nullptr;
|
||||
zet_debug_session_handle_t debugSession0 = nullptr, debugSession1 = nullptr;
|
||||
|
||||
zetDebugAttach(neoDevice->getSubDevice(0)->getSpecializedDevice<L0::Device>()->toHandle(), &config, &debugSession0);
|
||||
|
||||
@@ -516,6 +516,7 @@ TEST_F(TileAttachTest, GivenIsaWhenReadingOrWritingMemoryThenMemoryIsReadAndWrit
|
||||
ze_result_t result = zetDebugReadMemory(tileSessions[0]->toHandle(), thread, &desc, bufferSize, &output);
|
||||
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
EXPECT_EQ(vm0, handler->vmOpen.handle);
|
||||
|
||||
for (int i = 0; i < bufferSize; i++) {
|
||||
EXPECT_EQ(static_cast<char>(0xaa), output[i]);
|
||||
@@ -527,6 +528,16 @@ TEST_F(TileAttachTest, GivenIsaWhenReadingOrWritingMemoryThenMemoryIsReadAndWrit
|
||||
result = zetDebugWriteMemory(tileSessions[0]->toHandle(), thread, &desc, bufferSize, &output);
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
EXPECT_EQ(1u, handler->pwriteCalled);
|
||||
EXPECT_EQ(vm0, handler->vmOpen.handle);
|
||||
|
||||
zetDebugAttach(neoDevice->getSubDevice(0)->getSpecializedDevice<L0::Device>()->toHandle(), &config, &debugSession1);
|
||||
addIsaVmBindEvent(rootSession, vm1, true, true);
|
||||
handler->preadCalled = 0;
|
||||
|
||||
result = zetDebugReadMemory(tileSessions[1]->toHandle(), thread, &desc, bufferSize, &output);
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
EXPECT_EQ(vm1, handler->vmOpen.handle);
|
||||
EXPECT_EQ(1u, handler->preadCalled);
|
||||
}
|
||||
|
||||
TEST_F(TileAttachTest, GivenElfAddressWhenReadMemoryCalledTheElfMemoryIsRead) {
|
||||
|
||||
Reference in New Issue
Block a user