diff --git a/shared/source/debug_settings/debug_variables_base.inl b/shared/source/debug_settings/debug_variables_base.inl index 77536f4395..30cc64fcc6 100644 --- a/shared/source/debug_settings/debug_variables_base.inl +++ b/shared/source/debug_settings/debug_variables_base.inl @@ -236,6 +236,7 @@ DECLARE_DEBUG_VARIABLE(int32_t, ExitOnSubmissionNumber, -1, "Call exit(0) on X s DECLARE_DEBUG_VARIABLE(int32_t, ExitOnSubmissionMode, 0, "Exit on X submission mode. 0: Any context type, 1: Compute context only, 2: Copy context only ") DECLARE_DEBUG_VARIABLE(int32_t, ForceInOrderImmediateCmdListExecution, -1, "-1: default, 0: disabled, 1: all Immediate Command Lists are switched to in-order execution") DECLARE_DEBUG_VARIABLE(int64_t, OverrideEventSynchronizeTimeout, -1, "-1: default - user provided timeout value, >0: timeout in nanoseconds") +DECLARE_DEBUG_VARIABLE(int32_t, ForceTlbFlush, -1, "-1: default, 0: Tlb flush disabled, 1: Tlb Flush enabled") /*LOGGING FLAGS*/ DECLARE_DEBUG_VARIABLE(int32_t, PrintDriverDiagnostics, -1, "prints driver diagnostics messages to standard output, value corresponds to hint level") diff --git a/shared/source/os_interface/product_helper.inl b/shared/source/os_interface/product_helper.inl index 6df287b19d..e096545973 100644 --- a/shared/source/os_interface/product_helper.inl +++ b/shared/source/os_interface/product_helper.inl @@ -54,7 +54,11 @@ void ProductHelperHw::adjustSamplerState(void *sampler, const Hardwa template bool ProductHelperHw::isTlbFlushRequired() const { - return true; + bool tlbFlushRequired = true; + if (DebugManager.flags.ForceTlbFlush.get() != -1) { + tlbFlushRequired = !!DebugManager.flags.ForceTlbFlush.get(); + } + return tlbFlushRequired; } template diff --git a/shared/source/xe_hpc_core/pvc/os_agnostic_product_helper_pvc.inl b/shared/source/xe_hpc_core/pvc/os_agnostic_product_helper_pvc.inl index 5f6cbd0329..eafd2ad539 100644 --- a/shared/source/xe_hpc_core/pvc/os_agnostic_product_helper_pvc.inl +++ b/shared/source/xe_hpc_core/pvc/os_agnostic_product_helper_pvc.inl @@ -168,7 +168,11 @@ bool ProductHelperHw::isBlitCopyRequiredForLocalMemory(const RootDev template <> bool ProductHelperHw::isTlbFlushRequired() const { - return false; + bool tlbFlushRequired = false; + if (DebugManager.flags.ForceTlbFlush.get() != -1) { + tlbFlushRequired = !!DebugManager.flags.ForceTlbFlush.get(); + } + return tlbFlushRequired; } template <> diff --git a/shared/test/common/test_files/igdrcl.config b/shared/test/common/test_files/igdrcl.config index a1f81e1e7b..047a6dcda2 100644 --- a/shared/test/common/test_files/igdrcl.config +++ b/shared/test/common/test_files/igdrcl.config @@ -519,3 +519,4 @@ DirectSubmissionControllerMaxTimeout = -1 ExitOnSubmissionNumber = -1 ExitOnSubmissionMode = 0 ForceInOrderImmediateCmdListExecution = -1 +ForceTlbFlush = -1 \ No newline at end of file diff --git a/shared/test/unit_test/os_interface/product_helper_tests.cpp b/shared/test/unit_test/os_interface/product_helper_tests.cpp index ba30414cf5..78399b2544 100644 --- a/shared/test/unit_test/os_interface/product_helper_tests.cpp +++ b/shared/test/unit_test/os_interface/product_helper_tests.cpp @@ -416,6 +416,16 @@ HWTEST2_F(ProductHelperTest, givenProductHelperWhenAskedIfIsTimestampWaitSupport EXPECT_FALSE(productHelper->isTimestampWaitSupportedForEvents()); } +HWTEST2_F(ProductHelperTest, givenProductHelperWhenAskedIfIsTlbFlushRequiredThenTrueIsReturned, IsNotPVC) { + EXPECT_TRUE(productHelper->isTlbFlushRequired()); +} + +HWTEST2_F(ProductHelperTest, givenProductHelperAndForceTlbFlushNotSetWhenAskedIfIsTlbFlushRequiredThenFalseIsReturned, IsNotPVC) { + DebugManagerStateRestore restore{}; + DebugManager.flags.ForceTlbFlush.set(0); + EXPECT_FALSE(productHelper->isTlbFlushRequired()); +} + HWTEST_F(ProductHelperTest, givenLockableAllocationWhenGettingIsBlitCopyRequiredForLocalMemoryThenCorrectValuesAreReturned) { DebugManagerStateRestore restore{}; diff --git a/shared/test/unit_test/xe_hpc_core/pvc/test_product_helper_pvc.cpp b/shared/test/unit_test/xe_hpc_core/pvc/test_product_helper_pvc.cpp index f36d5ac032..667d1cc7ac 100644 --- a/shared/test/unit_test/xe_hpc_core/pvc/test_product_helper_pvc.cpp +++ b/shared/test/unit_test/xe_hpc_core/pvc/test_product_helper_pvc.cpp @@ -32,6 +32,12 @@ PVCTEST_F(PvcProductHelper, whenCheckIsTlbFlushRequiredThenReturnProperValue) { EXPECT_FALSE(productHelper->isTlbFlushRequired()); } +PVCTEST_F(PvcProductHelper, whenForceTlbFlushSetAndCheckIsTlbFlushRequiredThenReturnProperValue) { + DebugManagerStateRestore restore; + DebugManager.flags.ForceTlbFlush.set(1); + EXPECT_TRUE(productHelper->isTlbFlushRequired()); +} + PVCTEST_F(PvcProductHelper, givenPVCRevId3AndAboveWhenGettingThreadEuRatioForScratchThen16IsReturned) { auto hwInfo = *defaultHwInfo; hwInfo.platform.usRevId = 3;