Skip to content

Commit f7e63ba

Browse files
bmyatesCompute-Runtime-Automation
authored andcommitted
feature: Add support for optional PF enable flag for exec queue create
Related-to: NEO-8306 Signed-off-by: Brandon Yates <[email protected]>
1 parent 9419e70 commit f7e63ba

19 files changed

+98
-10
lines changed

shared/source/os_interface/linux/xe/eudebug/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (C) 2024 Intel Corporation
2+
# Copyright (C) 2024-2025 Intel Corporation
33
#
44
# SPDX-License-Identifier: MIT
55
#
@@ -21,6 +21,7 @@ if(NEO_ENABLE_XE_EU_DEBUG_SUPPORT)
2121
list(APPEND NEO_CORE_OS_INTERFACE_LINUX_XE_EUDEBUG
2222
${CMAKE_CURRENT_SOURCE_DIR}/eudebug_interface_prelim.h
2323
${CMAKE_CURRENT_SOURCE_DIR}/eudebug_interface_prelim.cpp
24+
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}eudebug_interface_prelim_extra.cpp
2425
)
2526
endif()
2627
endif()

shared/source/os_interface/linux/xe/eudebug/eudebug_interface.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2024 Intel Corporation
2+
* Copyright (C) 2024-2025 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -16,6 +16,7 @@ class EuDebugInterface {
1616
public:
1717
static std::unique_ptr<EuDebugInterface> create(const std::string &sysFsPciPath);
1818
virtual uint32_t getParamValue(EuDebugParam param) const = 0;
19+
virtual bool isExecQueuePageFaultEnableSupported() { return false; };
1920
virtual ~EuDebugInterface() = default;
2021
};
2122

shared/source/os_interface/linux/xe/eudebug/eudebug_interface_prelim.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ uint32_t EuDebugInterfacePrelim::getParamValue(EuDebugParam param) const {
5656
return PRELIM_DRM_XE_EUDEBUG_EVENT_VM_BIND_FLAG_UFENCE;
5757
case EuDebugParam::execQueueSetPropertyEuDebug:
5858
return PRELIM_DRM_XE_EXEC_QUEUE_SET_PROPERTY_EUDEBUG;
59+
case EuDebugParam::execQueueSetPropertyValueEnable:
60+
return PRELIM_DRM_XE_EXEC_QUEUE_EUDEBUG_FLAG_ENABLE;
5961
case EuDebugParam::ioctlAckEvent:
6062
return PRELIM_DRM_XE_EUDEBUG_IOCTL_ACK_EVENT;
6163
case EuDebugParam::ioctlEuControl:
@@ -82,6 +84,8 @@ uint32_t EuDebugInterfacePrelim::getParamValue(EuDebugParam param) const {
8284
return PRELIM_WORK_IN_PROGRESS_DRM_XE_DEBUG_METADATA_SIP_AREA;
8385
case EuDebugParam::vmBindOpExtensionsAttachDebug:
8486
return PRELIM_XE_VM_BIND_OP_EXTENSIONS_ATTACH_DEBUG;
87+
default:
88+
return getAdditionalParamValue(param);
8589
}
8690
return 0;
8791
}

shared/source/os_interface/linux/xe/eudebug/eudebug_interface_prelim.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2024 Intel Corporation
2+
* Copyright (C) 2024-2025 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -12,5 +12,7 @@ class EuDebugInterfacePrelim : public EuDebugInterface {
1212
public:
1313
static constexpr const char *sysFsXeEuDebugFile = "/device/prelim_enable_eudebug";
1414
uint32_t getParamValue(EuDebugParam param) const override;
15+
bool isExecQueuePageFaultEnableSupported() override;
16+
uint32_t getAdditionalParamValue(EuDebugParam param) const;
1517
};
1618
} // namespace NEO
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* Copyright (C) 2025 Intel Corporation
3+
*
4+
* SPDX-License-Identifier: MIT
5+
*
6+
*/
7+
8+
#include "shared/source/os_interface/linux/xe/eudebug/eudebug_interface_prelim.h"
9+
10+
namespace NEO {
11+
bool EuDebugInterfacePrelim::isExecQueuePageFaultEnableSupported() {
12+
return false;
13+
}
14+
15+
uint32_t EuDebugInterfacePrelim::getAdditionalParamValue(EuDebugParam param) const {
16+
return 0;
17+
}
18+
19+
} // namespace NEO

shared/source/os_interface/linux/xe/eudebug/eudebug_interface_upstream.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ uint32_t EuDebugInterfaceUpstream::getParamValue(EuDebugParam param) const {
5555
return DRM_XE_EUDEBUG_EVENT_VM_BIND_FLAG_UFENCE;
5656
case EuDebugParam::execQueueSetPropertyEuDebug:
5757
return DRM_XE_EXEC_QUEUE_SET_PROPERTY_EUDEBUG;
58+
case EuDebugParam::execQueueSetPropertyValueEnable:
59+
return DRM_XE_EXEC_QUEUE_EUDEBUG_FLAG_ENABLE;
60+
case EuDebugParam::execQueueSetPropertyValuePageFaultEnable:
61+
return 0;
5862
case EuDebugParam::ioctlAckEvent:
5963
return DRM_XE_EUDEBUG_IOCTL_ACK_EVENT;
6064
case EuDebugParam::ioctlEuControl:

shared/source/os_interface/linux/xe/eudebug/eudebug_wrappers.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,8 @@ enum class EuDebugParam {
204204
eventTypeVmBindUfence,
205205
eventVmBindFlagUfence,
206206
execQueueSetPropertyEuDebug,
207+
execQueueSetPropertyValueEnable,
208+
execQueueSetPropertyValuePageFaultEnable,
207209
ioctlAckEvent,
208210
ioctlEuControl,
209211
ioctlReadEvent,

shared/source/os_interface/linux/xe/ioctl_helper_xe.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1647,7 +1647,7 @@ void IoctlHelperXe::setOptionalContextProperties(Drm &drm, void *extProperties,
16471647
ext[extIndexInOut].base.next_extension = 0;
16481648
ext[extIndexInOut].base.name = DRM_XE_EXEC_QUEUE_EXTENSION_SET_PROPERTY;
16491649
ext[extIndexInOut].property = getEudebugExtProperty();
1650-
ext[extIndexInOut].value = 1;
1650+
ext[extIndexInOut].value = getEudebugExtPropertyValue();
16511651
extIndexInOut++;
16521652
}
16531653
}

shared/source/os_interface/linux/xe/ioctl_helper_xe.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ class IoctlHelperXe : public IoctlHelper {
153153
int debuggerMetadataCreateIoctl(DrmIoctl request, void *arg);
154154
int debuggerMetadataDestroyIoctl(DrmIoctl request, void *arg);
155155
int getEudebugExtProperty();
156+
uint64_t getEudebugExtPropertyValue();
156157
virtual bool isExtraEngineClassAllowed(uint16_t engineClass) const { return false; }
157158
virtual std::optional<uint32_t> getCxlType() { return {}; }
158159
virtual uint32_t getNumEngines(uint64_t *enginesData) const;

shared/source/os_interface/linux/xe/ioctl_helper_xe_debugger.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ int IoctlHelperXe::getEudebugExtProperty() {
5353
return euDebugInterface->getParamValue(EuDebugParam::execQueueSetPropertyEuDebug);
5454
}
5555

56+
uint64_t IoctlHelperXe::getEudebugExtPropertyValue() {
57+
uint64_t val = euDebugInterface->getParamValue(EuDebugParam::execQueueSetPropertyValueEnable);
58+
if (euDebugInterface->isExecQueuePageFaultEnableSupported()) {
59+
val |= euDebugInterface->getParamValue(EuDebugParam::execQueueSetPropertyValuePageFaultEnable);
60+
}
61+
return val;
62+
}
63+
5664
int IoctlHelperXe::getEuDebugSysFsEnable() {
5765
return euDebugInterface != nullptr ? 1 : 0;
5866
}

0 commit comments

Comments
 (0)