fix: abort only when disabling scratch page

Modifed getResetStatus to abort only when scratch page is disabled
Removed an incorrect UNRECOVERABLE_IF statement based on the status:
validPageFault can be true when banned flag is not set, if CAT error
does not occur as a result of page fault.

Related-To: GSD-5673
Signed-off-by: Young Jin Yoon <young.jin.yoon@intel.com>
This commit is contained in:
Young Jin Yoon
2024-03-21 18:02:47 +00:00
committed by Compute-Runtime-Automation
parent bf7436c2a2
commit ec009cf9e3
2 changed files with 7 additions and 5 deletions

View File

@@ -273,10 +273,10 @@ bool Drm::checkResetStatus(OsContext &osContext) {
uint32_t status = 0;
const auto retVal{ioctlHelper->getResetStats(resetStats, &status, &fault)};
UNRECOVERABLE_IF(retVal != 0);
if (ioctlHelper->validPageFault(fault.flags)) {
UNRECOVERABLE_IF((status & ioctlHelper->getStatusForResetStats(true)) == 0);
PRINT_DEBUG_STRING(debugManager.flags.PrintDebugMessages.get(), stderr, "ERROR: Unexpected page fault from GPU at 0x%llx, type: %d, level: %d, access: %d, aborting.\n",
fault.addr, fault.type, fault.level, fault.access);
if (disableScratch && ioctlHelper->validPageFault(fault.flags)) {
bool banned = ((status & ioctlHelper->getStatusForResetStats(true)) == 0);
PRINT_DEBUG_STRING(debugManager.flags.PrintDebugMessages.get(), stderr, "ERROR: Unexpected page fault from GPU at 0x%llx, type: %d, level: %d, access: %d, banned: %d, aborting.\n",
fault.addr, fault.type, fault.level, fault.access, banned);
UNRECOVERABLE_IF(true);
}
if (resetStats.batchActive > 0 || resetStats.batchPending > 0) {

View File

@@ -1408,8 +1408,10 @@ class MockIoctlHelperResetStats : public MockIoctlHelper {
};
TEST(DrmDeathTest, GivenResetStatsWithValidFaultWhenIsGpuHangIsCalledThenProcessTerminated) {
MockExecutionEnvironment executionEnvironment{};
DebugManagerStateRestore restore;
debugManager.flags.DisableScratchPages.set(true);
MockExecutionEnvironment executionEnvironment{};
DrmMock drm{*executionEnvironment.rootDeviceEnvironments[0]};
uint32_t contextId{0};
EngineDescriptor engineDescriptor{EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_BCS, EngineUsage::regular})};