From f7e63ba0d023484329c01f52b684a68b2249f159 Mon Sep 17 00:00:00 2001 From: Brandon Yates Date: Tue, 4 Feb 2025 20:24:41 +0000 Subject: [PATCH] feature: Add support for optional PF enable flag for exec queue create Related-to: NEO-8306 Signed-off-by: Brandon Yates --- .../linux/xe/eudebug/CMakeLists.txt | 3 ++- .../linux/xe/eudebug/eudebug_interface.h | 3 ++- .../xe/eudebug/eudebug_interface_prelim.cpp | 4 ++++ .../xe/eudebug/eudebug_interface_prelim.h | 4 +++- .../eudebug_interface_prelim_extra.cpp | 19 +++++++++++++++++++ .../xe/eudebug/eudebug_interface_upstream.cpp | 4 ++++ .../linux/xe/eudebug/eudebug_wrappers.h | 2 ++ .../os_interface/linux/xe/ioctl_helper_xe.cpp | 2 +- .../os_interface/linux/xe/ioctl_helper_xe.h | 1 + .../linux/xe/ioctl_helper_xe_debugger.cpp | 8 ++++++++ .../xe/ioctl_helper_xe_debugger_stubs.cpp | 5 +++++ .../common/mocks/linux/debug_mock_drm_xe.h | 1 + .../xe/eudebug/mock_eudebug_interface.cpp | 4 +++- .../linux/xe/eudebug/mock_eudebug_interface.h | 5 ++++- .../linux/xe/eudebug/CMakeLists.txt | 3 ++- .../eudebug_interface_prelim_tests.cpp | 3 ++- .../eudebug_interface_prelim_tests_extra.cpp | 17 +++++++++++++++++ .../eudebug_interface_upstream_tests.cpp | 3 ++- .../xe/ioctl_helper_xe_debugger_tests.cpp | 17 ++++++++++++++++- 19 files changed, 98 insertions(+), 10 deletions(-) create mode 100644 shared/source/os_interface/linux/xe/eudebug/eudebug_interface_prelim_extra.cpp create mode 100644 shared/test/unit_test/os_interface/linux/xe/eudebug/eudebug_interface_prelim_tests_extra.cpp diff --git a/shared/source/os_interface/linux/xe/eudebug/CMakeLists.txt b/shared/source/os_interface/linux/xe/eudebug/CMakeLists.txt index 4ba93996ac..d9e4ff55ed 100644 --- a/shared/source/os_interface/linux/xe/eudebug/CMakeLists.txt +++ b/shared/source/os_interface/linux/xe/eudebug/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright (C) 2024 Intel Corporation +# Copyright (C) 2024-2025 Intel Corporation # # SPDX-License-Identifier: MIT # @@ -21,6 +21,7 @@ if(NEO_ENABLE_XE_EU_DEBUG_SUPPORT) list(APPEND NEO_CORE_OS_INTERFACE_LINUX_XE_EUDEBUG ${CMAKE_CURRENT_SOURCE_DIR}/eudebug_interface_prelim.h ${CMAKE_CURRENT_SOURCE_DIR}/eudebug_interface_prelim.cpp + ${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}eudebug_interface_prelim_extra.cpp ) endif() endif() diff --git a/shared/source/os_interface/linux/xe/eudebug/eudebug_interface.h b/shared/source/os_interface/linux/xe/eudebug/eudebug_interface.h index afb54d5287..06d9e7b9a2 100644 --- a/shared/source/os_interface/linux/xe/eudebug/eudebug_interface.h +++ b/shared/source/os_interface/linux/xe/eudebug/eudebug_interface.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2024 Intel Corporation + * Copyright (C) 2024-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -16,6 +16,7 @@ class EuDebugInterface { public: static std::unique_ptr create(const std::string &sysFsPciPath); virtual uint32_t getParamValue(EuDebugParam param) const = 0; + virtual bool isExecQueuePageFaultEnableSupported() { return false; }; virtual ~EuDebugInterface() = default; }; diff --git a/shared/source/os_interface/linux/xe/eudebug/eudebug_interface_prelim.cpp b/shared/source/os_interface/linux/xe/eudebug/eudebug_interface_prelim.cpp index c28eea2c66..fedf9d0082 100644 --- a/shared/source/os_interface/linux/xe/eudebug/eudebug_interface_prelim.cpp +++ b/shared/source/os_interface/linux/xe/eudebug/eudebug_interface_prelim.cpp @@ -56,6 +56,8 @@ uint32_t EuDebugInterfacePrelim::getParamValue(EuDebugParam param) const { return PRELIM_DRM_XE_EUDEBUG_EVENT_VM_BIND_FLAG_UFENCE; case EuDebugParam::execQueueSetPropertyEuDebug: return PRELIM_DRM_XE_EXEC_QUEUE_SET_PROPERTY_EUDEBUG; + case EuDebugParam::execQueueSetPropertyValueEnable: + return PRELIM_DRM_XE_EXEC_QUEUE_EUDEBUG_FLAG_ENABLE; case EuDebugParam::ioctlAckEvent: return PRELIM_DRM_XE_EUDEBUG_IOCTL_ACK_EVENT; case EuDebugParam::ioctlEuControl: @@ -82,6 +84,8 @@ uint32_t EuDebugInterfacePrelim::getParamValue(EuDebugParam param) const { return PRELIM_WORK_IN_PROGRESS_DRM_XE_DEBUG_METADATA_SIP_AREA; case EuDebugParam::vmBindOpExtensionsAttachDebug: return PRELIM_XE_VM_BIND_OP_EXTENSIONS_ATTACH_DEBUG; + default: + return getAdditionalParamValue(param); } return 0; } diff --git a/shared/source/os_interface/linux/xe/eudebug/eudebug_interface_prelim.h b/shared/source/os_interface/linux/xe/eudebug/eudebug_interface_prelim.h index c624cf7607..567e354755 100644 --- a/shared/source/os_interface/linux/xe/eudebug/eudebug_interface_prelim.h +++ b/shared/source/os_interface/linux/xe/eudebug/eudebug_interface_prelim.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2024 Intel Corporation + * Copyright (C) 2024-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -12,5 +12,7 @@ class EuDebugInterfacePrelim : public EuDebugInterface { public: static constexpr const char *sysFsXeEuDebugFile = "/device/prelim_enable_eudebug"; uint32_t getParamValue(EuDebugParam param) const override; + bool isExecQueuePageFaultEnableSupported() override; + uint32_t getAdditionalParamValue(EuDebugParam param) const; }; } // namespace NEO diff --git a/shared/source/os_interface/linux/xe/eudebug/eudebug_interface_prelim_extra.cpp b/shared/source/os_interface/linux/xe/eudebug/eudebug_interface_prelim_extra.cpp new file mode 100644 index 0000000000..b1c10cb9ca --- /dev/null +++ b/shared/source/os_interface/linux/xe/eudebug/eudebug_interface_prelim_extra.cpp @@ -0,0 +1,19 @@ +/* + * Copyright (C) 2025 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "shared/source/os_interface/linux/xe/eudebug/eudebug_interface_prelim.h" + +namespace NEO { +bool EuDebugInterfacePrelim::isExecQueuePageFaultEnableSupported() { + return false; +} + +uint32_t EuDebugInterfacePrelim::getAdditionalParamValue(EuDebugParam param) const { + return 0; +} + +} // namespace NEO \ No newline at end of file diff --git a/shared/source/os_interface/linux/xe/eudebug/eudebug_interface_upstream.cpp b/shared/source/os_interface/linux/xe/eudebug/eudebug_interface_upstream.cpp index c46ebb3730..a7ecac2832 100644 --- a/shared/source/os_interface/linux/xe/eudebug/eudebug_interface_upstream.cpp +++ b/shared/source/os_interface/linux/xe/eudebug/eudebug_interface_upstream.cpp @@ -55,6 +55,10 @@ uint32_t EuDebugInterfaceUpstream::getParamValue(EuDebugParam param) const { return DRM_XE_EUDEBUG_EVENT_VM_BIND_FLAG_UFENCE; case EuDebugParam::execQueueSetPropertyEuDebug: return DRM_XE_EXEC_QUEUE_SET_PROPERTY_EUDEBUG; + case EuDebugParam::execQueueSetPropertyValueEnable: + return DRM_XE_EXEC_QUEUE_EUDEBUG_FLAG_ENABLE; + case EuDebugParam::execQueueSetPropertyValuePageFaultEnable: + return 0; case EuDebugParam::ioctlAckEvent: return DRM_XE_EUDEBUG_IOCTL_ACK_EVENT; case EuDebugParam::ioctlEuControl: diff --git a/shared/source/os_interface/linux/xe/eudebug/eudebug_wrappers.h b/shared/source/os_interface/linux/xe/eudebug/eudebug_wrappers.h index d67ed771b8..33635b90a1 100644 --- a/shared/source/os_interface/linux/xe/eudebug/eudebug_wrappers.h +++ b/shared/source/os_interface/linux/xe/eudebug/eudebug_wrappers.h @@ -204,6 +204,8 @@ enum class EuDebugParam { eventTypeVmBindUfence, eventVmBindFlagUfence, execQueueSetPropertyEuDebug, + execQueueSetPropertyValueEnable, + execQueueSetPropertyValuePageFaultEnable, ioctlAckEvent, ioctlEuControl, ioctlReadEvent, diff --git a/shared/source/os_interface/linux/xe/ioctl_helper_xe.cpp b/shared/source/os_interface/linux/xe/ioctl_helper_xe.cpp index f801f67fb3..dc3510bd4d 100644 --- a/shared/source/os_interface/linux/xe/ioctl_helper_xe.cpp +++ b/shared/source/os_interface/linux/xe/ioctl_helper_xe.cpp @@ -1647,7 +1647,7 @@ void IoctlHelperXe::setOptionalContextProperties(Drm &drm, void *extProperties, ext[extIndexInOut].base.next_extension = 0; ext[extIndexInOut].base.name = DRM_XE_EXEC_QUEUE_EXTENSION_SET_PROPERTY; ext[extIndexInOut].property = getEudebugExtProperty(); - ext[extIndexInOut].value = 1; + ext[extIndexInOut].value = getEudebugExtPropertyValue(); extIndexInOut++; } } diff --git a/shared/source/os_interface/linux/xe/ioctl_helper_xe.h b/shared/source/os_interface/linux/xe/ioctl_helper_xe.h index 4e86f27bf0..836331a29b 100644 --- a/shared/source/os_interface/linux/xe/ioctl_helper_xe.h +++ b/shared/source/os_interface/linux/xe/ioctl_helper_xe.h @@ -153,6 +153,7 @@ class IoctlHelperXe : public IoctlHelper { int debuggerMetadataCreateIoctl(DrmIoctl request, void *arg); int debuggerMetadataDestroyIoctl(DrmIoctl request, void *arg); int getEudebugExtProperty(); + uint64_t getEudebugExtPropertyValue(); virtual bool isExtraEngineClassAllowed(uint16_t engineClass) const { return false; } virtual std::optional getCxlType() { return {}; } virtual uint32_t getNumEngines(uint64_t *enginesData) const; diff --git a/shared/source/os_interface/linux/xe/ioctl_helper_xe_debugger.cpp b/shared/source/os_interface/linux/xe/ioctl_helper_xe_debugger.cpp index 993a438be7..b170a76cbd 100644 --- a/shared/source/os_interface/linux/xe/ioctl_helper_xe_debugger.cpp +++ b/shared/source/os_interface/linux/xe/ioctl_helper_xe_debugger.cpp @@ -53,6 +53,14 @@ int IoctlHelperXe::getEudebugExtProperty() { return euDebugInterface->getParamValue(EuDebugParam::execQueueSetPropertyEuDebug); } +uint64_t IoctlHelperXe::getEudebugExtPropertyValue() { + uint64_t val = euDebugInterface->getParamValue(EuDebugParam::execQueueSetPropertyValueEnable); + if (euDebugInterface->isExecQueuePageFaultEnableSupported()) { + val |= euDebugInterface->getParamValue(EuDebugParam::execQueueSetPropertyValuePageFaultEnable); + } + return val; +} + int IoctlHelperXe::getEuDebugSysFsEnable() { return euDebugInterface != nullptr ? 1 : 0; } diff --git a/shared/source/os_interface/linux/xe/ioctl_helper_xe_debugger_stubs.cpp b/shared/source/os_interface/linux/xe/ioctl_helper_xe_debugger_stubs.cpp index 5fb10be84c..2822d0a57b 100644 --- a/shared/source/os_interface/linux/xe/ioctl_helper_xe_debugger_stubs.cpp +++ b/shared/source/os_interface/linux/xe/ioctl_helper_xe_debugger_stubs.cpp @@ -34,6 +34,11 @@ int IoctlHelperXe::getEudebugExtProperty() { return 0; } +uint64_t IoctlHelperXe::getEudebugExtPropertyValue() { + UNRECOVERABLE_IF(true); + return 0; +} + int IoctlHelperXe::getEuDebugSysFsEnable() { return 0; } diff --git a/shared/test/common/mocks/linux/debug_mock_drm_xe.h b/shared/test/common/mocks/linux/debug_mock_drm_xe.h index 321ceb1bf7..d84d054bae 100644 --- a/shared/test/common/mocks/linux/debug_mock_drm_xe.h +++ b/shared/test/common/mocks/linux/debug_mock_drm_xe.h @@ -33,6 +33,7 @@ struct MockIoctlHelperXeDebug : IoctlHelperXe { using IoctlHelperXe::bindInfo; using IoctlHelperXe::euDebugInterface; using IoctlHelperXe::getEudebugExtProperty; + using IoctlHelperXe::getEudebugExtPropertyValue; using IoctlHelperXe::IoctlHelperXe; using IoctlHelperXe::tileIdToGtId; }; diff --git a/shared/test/common/os_interface/linux/xe/eudebug/mock_eudebug_interface.cpp b/shared/test/common/os_interface/linux/xe/eudebug/mock_eudebug_interface.cpp index 751067c378..97d6a977a6 100644 --- a/shared/test/common/os_interface/linux/xe/eudebug/mock_eudebug_interface.cpp +++ b/shared/test/common/os_interface/linux/xe/eudebug/mock_eudebug_interface.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2024 Intel Corporation + * Copyright (C) 2024-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -26,6 +26,8 @@ uint32_t MockEuDebugInterface::getParamValue(EuDebugParam param) const { RETURN_AS_IS(EuDebugParam::euControlCmdResume); RETURN_AS_IS(EuDebugParam::euControlCmdStopped); RETURN_AS_IS(EuDebugParam::execQueueSetPropertyEuDebug); + RETURN_AS_IS(EuDebugParam::execQueueSetPropertyValueEnable); + RETURN_AS_IS(EuDebugParam::execQueueSetPropertyValuePageFaultEnable); RETURN_AS_IS(EuDebugParam::eventTypeEuAttention); RETURN_AS_IS(EuDebugParam::eventTypeExecQueue); RETURN_AS_IS(EuDebugParam::eventTypeExecQueuePlacements); diff --git a/shared/test/common/os_interface/linux/xe/eudebug/mock_eudebug_interface.h b/shared/test/common/os_interface/linux/xe/eudebug/mock_eudebug_interface.h index d8a5b2dda6..1e14a197a5 100644 --- a/shared/test/common/os_interface/linux/xe/eudebug/mock_eudebug_interface.h +++ b/shared/test/common/os_interface/linux/xe/eudebug/mock_eudebug_interface.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2024 Intel Corporation + * Copyright (C) 2024-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -15,7 +15,10 @@ class MockEuDebugInterface : public EuDebugInterface { static constexpr const char *sysFsXeEuDebugFile = "/mock_eudebug"; static constexpr uintptr_t sysFsFd = 0xE0DEB0; static constexpr EuDebugInterfaceType euDebugInterfaceType = EuDebugInterfaceType::upstream; + bool isExecQueuePageFaultEnableSupported() override { return pageFaultEnableSupported; }; uint32_t getParamValue(EuDebugParam param) const override; + + bool pageFaultEnableSupported = false; }; } // namespace NEO diff --git a/shared/test/unit_test/os_interface/linux/xe/eudebug/CMakeLists.txt b/shared/test/unit_test/os_interface/linux/xe/eudebug/CMakeLists.txt index d2b4370044..29c9cbddb5 100644 --- a/shared/test/unit_test/os_interface/linux/xe/eudebug/CMakeLists.txt +++ b/shared/test/unit_test/os_interface/linux/xe/eudebug/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright (C) 2024 Intel Corporation +# Copyright (C) 2024-2025 Intel Corporation # # SPDX-License-Identifier: MIT # @@ -16,6 +16,7 @@ if(NEO_ENABLE_XE_EU_DEBUG_SUPPORT) if(NEO_ENABLE_XE_PRELIM_DETECTION) list(APPEND NEO_CORE_OS_INTERFACE_TESTS_LINUX_XE_EUDEBUG ${CMAKE_CURRENT_SOURCE_DIR}/eudebug_interface_prelim_tests.cpp + ${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}eudebug_interface_prelim_tests_extra.cpp ) endif() endif() diff --git a/shared/test/unit_test/os_interface/linux/xe/eudebug/eudebug_interface_prelim_tests.cpp b/shared/test/unit_test/os_interface/linux/xe/eudebug/eudebug_interface_prelim_tests.cpp index dbca563c44..dcba8325c5 100644 --- a/shared/test/unit_test/os_interface/linux/xe/eudebug/eudebug_interface_prelim_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/xe/eudebug/eudebug_interface_prelim_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2024 Intel Corporation + * Copyright (C) 2024-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -35,6 +35,7 @@ TEST(EuDebugInterfacePrelimTest, whenGettingParamValueThenCorrectValueIsReturned EXPECT_EQ(static_cast(PRELIM_DRM_XE_EUDEBUG_EVENT_VM_BIND_UFENCE), euDebugInterface.getParamValue(EuDebugParam::eventTypeVmBindUfence)); EXPECT_EQ(static_cast(PRELIM_DRM_XE_EUDEBUG_EVENT_VM_BIND_FLAG_UFENCE), euDebugInterface.getParamValue(EuDebugParam::eventVmBindFlagUfence)); EXPECT_EQ(static_cast(PRELIM_DRM_XE_EXEC_QUEUE_SET_PROPERTY_EUDEBUG), euDebugInterface.getParamValue(EuDebugParam::execQueueSetPropertyEuDebug)); + EXPECT_EQ(static_cast(PRELIM_DRM_XE_EXEC_QUEUE_EUDEBUG_FLAG_ENABLE), euDebugInterface.getParamValue(EuDebugParam::execQueueSetPropertyValueEnable)); EXPECT_EQ(static_cast(PRELIM_DRM_XE_EUDEBUG_IOCTL_ACK_EVENT), euDebugInterface.getParamValue(EuDebugParam::ioctlAckEvent)); EXPECT_EQ(static_cast(PRELIM_DRM_XE_EUDEBUG_IOCTL_EU_CONTROL), euDebugInterface.getParamValue(EuDebugParam::ioctlEuControl)); EXPECT_EQ(static_cast(PRELIM_DRM_XE_EUDEBUG_IOCTL_READ_EVENT), euDebugInterface.getParamValue(EuDebugParam::ioctlReadEvent)); diff --git a/shared/test/unit_test/os_interface/linux/xe/eudebug/eudebug_interface_prelim_tests_extra.cpp b/shared/test/unit_test/os_interface/linux/xe/eudebug/eudebug_interface_prelim_tests_extra.cpp new file mode 100644 index 0000000000..77b83b9df7 --- /dev/null +++ b/shared/test/unit_test/os_interface/linux/xe/eudebug/eudebug_interface_prelim_tests_extra.cpp @@ -0,0 +1,17 @@ +/* + * Copyright (C) 2025 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "shared/source/os_interface/linux/xe/eudebug/eudebug_interface_prelim.h" +#include "shared/source/os_interface/linux/xe/xedrm_prelim.h" +#include "shared/test/common/test_macros/test.h" + +using namespace NEO; + +TEST(EuDebugInterfacePrelimTest, whenCheckingIfisExecQueuePageFaultEnableSupportedThenCorrectValueIsReturned) { + EuDebugInterfacePrelim euDebugInterface{}; + EXPECT_FALSE(euDebugInterface.isExecQueuePageFaultEnableSupported()); +} diff --git a/shared/test/unit_test/os_interface/linux/xe/eudebug/eudebug_interface_upstream_tests.cpp b/shared/test/unit_test/os_interface/linux/xe/eudebug/eudebug_interface_upstream_tests.cpp index 21a1e8fbb0..f2a4a93a41 100644 --- a/shared/test/unit_test/os_interface/linux/xe/eudebug/eudebug_interface_upstream_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/xe/eudebug/eudebug_interface_upstream_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2024 Intel Corporation + * Copyright (C) 2024-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -36,6 +36,7 @@ TEST(EuDebugInterfaceUpstreamTest, whenGettingParamValueThenCorrectValueIsReturn EXPECT_EQ(static_cast(DRM_XE_EUDEBUG_EVENT_VM_BIND_UFENCE), euDebugInterface.getParamValue(EuDebugParam::eventTypeVmBindUfence)); EXPECT_EQ(static_cast(DRM_XE_EUDEBUG_EVENT_VM_BIND_FLAG_UFENCE), euDebugInterface.getParamValue(EuDebugParam::eventVmBindFlagUfence)); EXPECT_EQ(static_cast(DRM_XE_EXEC_QUEUE_SET_PROPERTY_EUDEBUG), euDebugInterface.getParamValue(EuDebugParam::execQueueSetPropertyEuDebug)); + EXPECT_EQ(static_cast(DRM_XE_EXEC_QUEUE_EUDEBUG_FLAG_ENABLE), euDebugInterface.getParamValue(EuDebugParam::execQueueSetPropertyValueEnable)); EXPECT_EQ(static_cast(DRM_XE_EUDEBUG_IOCTL_ACK_EVENT), euDebugInterface.getParamValue(EuDebugParam::ioctlAckEvent)); EXPECT_EQ(static_cast(DRM_XE_EUDEBUG_IOCTL_EU_CONTROL), euDebugInterface.getParamValue(EuDebugParam::ioctlEuControl)); EXPECT_EQ(static_cast(DRM_XE_EUDEBUG_IOCTL_READ_EVENT), euDebugInterface.getParamValue(EuDebugParam::ioctlReadEvent)); diff --git a/shared/test/unit_test/os_interface/linux/xe/ioctl_helper_xe_debugger_tests.cpp b/shared/test/unit_test/os_interface/linux/xe/ioctl_helper_xe_debugger_tests.cpp index cb878acf56..b5162d3545 100644 --- a/shared/test/unit_test/os_interface/linux/xe/ioctl_helper_xe_debugger_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/xe/ioctl_helper_xe_debugger_tests.cpp @@ -66,6 +66,21 @@ TEST_F(IoctlHelperXeTest, givenIoctlHelperXeWhenCallingGetEudebugExtPropertyThen EXPECT_EQ(xeIoctlHelper->getEudebugExtProperty(), static_cast(EuDebugParam::execQueueSetPropertyEuDebug)); } +TEST_F(IoctlHelperXeTest, givenIoctlHelperXeWhenCallingGetEudebugExtPropertyValueThenCorrectValueReturned) { + auto executionEnvironment = std::make_unique(); + executionEnvironment->setDebuggingMode(DebuggingMode::offline); + auto drm = DrmMockXeDebug::create(*executionEnvironment->rootDeviceEnvironments[0]); + auto xeIoctlHelper = static_cast(drm->ioctlHelper.get()); + uint64_t expectedValue = 0; + auto mockEuDebugInterface = static_cast(xeIoctlHelper->euDebugInterface.get()); + mockEuDebugInterface->pageFaultEnableSupported = true; + expectedValue = static_cast(EuDebugParam::execQueueSetPropertyValueEnable) | static_cast(EuDebugParam::execQueueSetPropertyValuePageFaultEnable); + EXPECT_EQ(xeIoctlHelper->getEudebugExtPropertyValue(), expectedValue); + mockEuDebugInterface->pageFaultEnableSupported = false; + expectedValue = static_cast(EuDebugParam::execQueueSetPropertyValueEnable); + EXPECT_EQ(xeIoctlHelper->getEudebugExtPropertyValue(), expectedValue); +} + using IoctlHelperXeTestFixture = ::testing::Test; HWTEST_F(IoctlHelperXeTestFixture, GivenDebuggingDisabledWhenCreateDrmContextThenEuDebuggableContextIsNotRequested) { DebugManagerStateRestore restorer; @@ -139,7 +154,7 @@ HWTEST_F(IoctlHelperXeTestFixture, GivenDebuggingEnabledWhenCreateDrmContextThen EXPECT_EQ(ext.base.name, static_cast(DRM_XE_EXEC_QUEUE_EXTENSION_SET_PROPERTY)); EXPECT_EQ(ext.base.next_extension, 0ULL); EXPECT_EQ(ext.property, static_cast(EuDebugParam::execQueueSetPropertyEuDebug)); - EXPECT_EQ(ext.value, 1ULL); + EXPECT_EQ(ext.value, static_cast(EuDebugParam::execQueueSetPropertyValueEnable)); } HWTEST_F(IoctlHelperXeTestFixture, GivenContextCreatedForCopyEngineWhenCreateDrmContextThenEuDebuggableContextIsNotRequested) {