mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-31 20:13:04 +08:00
fix: Read fifo_head from state save area header correctly
Currently we are reading fifo_head from local copy of saved stateSaveAreaHeader. However, during fifo read dbgUMD is reading FIFO entries and accordingly SIP would also update fifo_head. Hence while accessing fifo_head, ensure that we always read fifo_head from latest in memory state save area header. Related-To: NEO-12787 Signed-off-by: Jitendra Sharma <jitendra.sharma@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
468e309e11
commit
2ed2cb43db
@@ -1739,7 +1739,11 @@ ze_result_t DebugSessionImp::readFifo(uint64_t vmHandle, std::vector<EuThread::T
|
||||
fifoTailIndex = 0;
|
||||
}
|
||||
}
|
||||
lastHead = stateSaveAreaHeader->regHeaderV3.fifo_head;
|
||||
retVal = readGpuMemory(vmHandle, reinterpret_cast<char *>(&lastHead), sizeof(uint32_t), gpuVa + offsetHead);
|
||||
if (retVal != ZE_RESULT_SUCCESS) {
|
||||
PRINT_DEBUGGER_ERROR_LOG("Reading fifo_head failed, error = %d\n", retVal);
|
||||
return retVal;
|
||||
}
|
||||
NEO::sleep(std::chrono::milliseconds(failsafeTimeoutWait));
|
||||
}
|
||||
return ZE_RESULT_SUCCESS;
|
||||
|
||||
@@ -1942,6 +1942,14 @@ TEST_F(DebugSessionTestSwFifoFixture, GivenSwFifoWhenReadGpuMemoryFailsDuringFif
|
||||
EXPECT_EQ(ZE_RESULT_ERROR_UNKNOWN, session->readFifo(0, threadsWithAttention));
|
||||
}
|
||||
|
||||
TEST_F(DebugSessionTestSwFifoFixture, GivenSwFifoWhenReadGpuMemoryFailsDuringUpdateOfLastHeadThenErrorReturned) {
|
||||
|
||||
EXPECT_FALSE(session->stateSaveAreaHeader.empty());
|
||||
session->forcereadGpuMemoryFailOnCount = 4;
|
||||
std::vector<EuThread::ThreadId> threadsWithAttention;
|
||||
EXPECT_EQ(ZE_RESULT_ERROR_UNKNOWN, session->readFifo(0, threadsWithAttention));
|
||||
}
|
||||
|
||||
TEST(DebugSessionTest, GivenSwFifoWhenStateSaveAreaVersionIsLessThanThreeDuringFifoReadThenFifoIsNotReadAndSuccessIsReturned) {
|
||||
auto stateSaveAreaHeader = MockSipData::createStateSaveAreaHeader(2);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user