fix: check BANNED in reset_stats before aborting when debugger is enabled

Related-to: GSD-10788

Signed-off-by: Brandon Yates <brandon.yates@intel.com>
This commit is contained in:
Brandon Yates 2025-04-10 20:04:10 +00:00 committed by Compute-Runtime-Automation
parent 62739986bf
commit ee75c59da5
2 changed files with 6 additions and 3 deletions

View File

@ -265,8 +265,11 @@ bool Drm::checkResetStatus(OsContext &osContext) {
const auto retVal{ioctlHelper->getResetStats(resetStats, &status, &fault)};
UNRECOVERABLE_IF(retVal != 0);
auto debuggingEnabled = rootDeviceEnvironment.executionEnvironment.isDebuggingEnabled();
if (!debuggingEnabled && checkToDisableScratchPage() && ioctlHelper->validPageFault(fault.flags)) {
if (checkToDisableScratchPage() && ioctlHelper->validPageFault(fault.flags)) {
bool banned = ((status & ioctlHelper->getStatusForResetStats(true)) != 0);
if (!banned && debuggingEnabled) {
return false;
}
IoFunctions::fprintf(stderr, "Segmentation fault from GPU at 0x%llx, ctx_id: %u (%s) type: %d (%s), level: %d (%s), access: %d (%s), banned: %d, aborting.\n",
fault.addr,
resetStats.contextId,

View File

@ -1449,7 +1449,7 @@ class MockIoctlHelperResetStats : public MockIoctlHelper {
ResetStatsFault resetStatsFaultReturnValue{};
};
TEST(DrmTest, GivenResetStatsWithValidFaultAndDebuggingEnabledWhenIsGpuHangIsCalledThenProcessNotTerminated) {
TEST(DrmTest, GivenResetStatsWithValidFaultAndContextNotBannedAndDebuggingEnabledWhenIsGpuHangIsCalledThenProcessNotTerminated) {
DebugManagerStateRestore restore;
debugManager.flags.DisableScratchPages.set(true);
@ -1475,7 +1475,7 @@ TEST(DrmTest, GivenResetStatsWithValidFaultAndDebuggingEnabledWhenIsGpuHangIsCal
resetStatsFaultExpected.type = 2;
resetStatsFaultExpected.level = 3;
ioctlHelper->statusReturnValue = 2u;
ioctlHelper->statusReturnValue = 0u;
ioctlHelper->resetStatsFaultReturnValue = resetStatsFaultExpected;
drm.ioctlHelper = std::move(ioctlHelper);