Skip to content

Commit cf53cc5

Browse files
Enable recoverable page faults on PVC platform only
Related-To: NEO-6355 Signed-off-by: Milczarek, Slawomir <[email protected]> Source: 9b7b193
1 parent b6e6299 commit cf53cc5

File tree

8 files changed

+39
-3
lines changed

8 files changed

+39
-3
lines changed

shared/source/os_interface/hw_info_config.h

+2
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ class ProductHelper {
116116
virtual bool is3DPipelineSelectWARequired() const = 0;
117117
virtual bool isStorageInfoAdjustmentRequired() const = 0;
118118
virtual bool isBlitterForImagesSupported() const = 0;
119+
virtual bool isPageFaultSupported() const = 0;
119120
virtual bool isTile64With3DSurfaceOnBCSSupported(const HardwareInfo &hwInfo) const = 0;
120121
virtual bool isDcFlushAllowed() const = 0;
121122
virtual uint32_t computeMaxNeededSubSliceSpace(const HardwareInfo &hwInfo) const = 0;
@@ -272,6 +273,7 @@ class ProductHelperHw : public ProductHelper {
272273
bool is3DPipelineSelectWARequired() const override;
273274
bool isStorageInfoAdjustmentRequired() const override;
274275
bool isBlitterForImagesSupported() const override;
276+
bool isPageFaultSupported() const override;
275277
bool isTile64With3DSurfaceOnBCSSupported(const HardwareInfo &hwInfo) const override;
276278
bool isDcFlushAllowed() const override;
277279
uint32_t computeMaxNeededSubSliceSpace(const HardwareInfo &hwInfo) const override;

shared/source/os_interface/hw_info_config.inl

+5
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,11 @@ bool ProductHelperHw<gfxProduct>::isBlitterForImagesSupported() const {
335335
return false;
336336
}
337337

338+
template <PRODUCT_FAMILY gfxProduct>
339+
bool ProductHelperHw<gfxProduct>::isPageFaultSupported() const {
340+
return false;
341+
}
342+
338343
template <PRODUCT_FAMILY gfxProduct>
339344
bool ProductHelperHw<gfxProduct>::isDcFlushAllowed() const {
340345
return true;

shared/source/os_interface/linux/drm_neo.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -1168,6 +1168,10 @@ bool Drm::queryTopology(const HardwareInfo &hwInfo, QueryTopologyData &topologyD
11681168
}
11691169

11701170
void Drm::queryPageFaultSupport() {
1171+
const auto &productHelper = this->getRootDeviceEnvironment().getHelper<ProductHelper>();
1172+
if (!productHelper.isPageFaultSupported()) {
1173+
return;
1174+
}
11711175

11721176
if (const auto paramId = ioctlHelper->getHasPageFaultParamId(); paramId) {
11731177
int support = 0;

shared/source/xe_hpc_core/linux/hw_info_config_pvc.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2021-2022 Intel Corporation
2+
* Copyright (C) 2021-2023 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -75,6 +75,11 @@ uint64_t ProductHelperHw<gfxProduct>::getDeviceMemoryMaxBandWidthInBytesPerSecon
7575
return memoryMaxClkRateInMhz * 1000 * 1000 * numberOfHbmStacksPerTile * memoryBusWidth / 8;
7676
}
7777

78+
template <>
79+
bool ProductHelperHw<gfxProduct>::isPageFaultSupported() const {
80+
return true;
81+
}
82+
7883
} // namespace NEO
7984

8085
#include "shared/source/xe_hpc_core/linux/hw_info_config_xe_hpc_core.inl"

shared/test/unit_test/os_interface/hw_info_config_tests.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,11 @@ HWTEST_F(ProductHelperTest, givenProductHelperWhenAskedIfBlitterForImagesIsSuppo
391391
EXPECT_FALSE(productHelper->isBlitterForImagesSupported());
392392
}
393393

394+
HWTEST_F(ProductHelperTest, givenProductHelperWhenAskedIfPageFaultIsSupportedThenReturnFalse) {
395+
396+
EXPECT_FALSE(productHelper->isPageFaultSupported());
397+
}
398+
394399
HWTEST_F(ProductHelperTest, givenProductHelperWhenAskedIfTile64With3DSurfaceOnBCSIsSupportedThenTrueIsReturned) {
395400

396401
EXPECT_TRUE(productHelper->isTile64With3DSurfaceOnBCSSupported(pInHwInfo));

shared/test/unit_test/os_interface/linux/drm_query_topology_prelim_tests.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -328,12 +328,17 @@ TEST(DrmQueryTest, WhenCallingQueryPageFaultSupportThenReturnFalseByDefault) {
328328
TEST(DrmQueryTest, givenPageFaultSupportEnabledWhenCallingQueryPageFaultSupportThenReturnCorrectValue) {
329329
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
330330
DrmQueryMock drm{*executionEnvironment->rootDeviceEnvironments[0]};
331+
const auto &productHelper = executionEnvironment->rootDeviceEnvironments[0]->getHelper<ProductHelper>();
331332

332333
for (bool hasPageFaultSupport : {false, true}) {
333334
drm.context.hasPageFaultQueryValue = hasPageFaultSupport;
334335
drm.queryPageFaultSupport();
335336

336-
EXPECT_EQ(hasPageFaultSupport, drm.hasPageFaultSupport());
337+
if (productHelper.isPageFaultSupported()) {
338+
EXPECT_EQ(hasPageFaultSupport, drm.hasPageFaultSupport());
339+
} else {
340+
EXPECT_FALSE(drm.hasPageFaultSupport());
341+
}
337342
}
338343
}
339344

shared/test/unit_test/xe_hpc_core/pvc/linux/hw_info_config_tests_pvc.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ PVCTEST_F(PvcProductHelperLinux, givenProductHelperWhenAskedIfPatIndexProgrammin
7272
EXPECT_TRUE(productHelper->isVmBindPatIndexProgrammingSupported());
7373
}
7474

75+
HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenAskedIfPageFaultIsSupportedThenReturnFalse, IGFX_PVC);
76+
77+
PVCTEST_F(PvcProductHelperLinux, givenProductHelperWhenAskedIsPageFaultSupportedThenReturnTrue) {
78+
EXPECT_TRUE(productHelper->isPageFaultSupported());
79+
}
80+
7581
PVCTEST_F(PvcProductHelperLinux, givenAotConfigWhenSetHwInfoRevisionIdForPvcThenCorrectValueIsSet) {
7682
auto &compilerProductHelper = this->executionEnvironment->rootDeviceEnvironments[0]->getHelper<CompilerProductHelper>();
7783
for (const auto &config : AOT_PVC::productConfigs) {

shared/test/unit_test/xe_hpg_core/mtl/linux/hw_info_config_tests_mtl.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2021-2022 Intel Corporation
2+
* Copyright (C) 2021-2023 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -43,3 +43,7 @@ MTLTEST_F(MtlProductHelperLinux, givenMtlWhenIsBlitterForImagesSupportedIsCalled
4343
MTLTEST_F(MtlProductHelperLinux, givenMtlWhenisVmBindPatIndexProgrammingSupportedIsCalledThenTrueIsReturned) {
4444
EXPECT_TRUE(productHelper->isVmBindPatIndexProgrammingSupported());
4545
}
46+
47+
MTLTEST_F(MtlProductHelperLinux, givenProductHelperWhenAskedIsPageFaultSupportedThenReturnFalse) {
48+
EXPECT_FALSE(productHelper->isPageFaultSupported());
49+
}

0 commit comments

Comments
 (0)