From c6c2eef063b099e737fa8b9348e33a1f80d76711 Mon Sep 17 00:00:00 2001 From: Young Jin Yoon Date: Mon, 28 Oct 2024 18:31:26 +0000 Subject: [PATCH] feature: enable recoverable pagefault Enabled recoverable pagefault Related-To: NEO-13116 Signed-off-by: Young Jin Yoon --- shared/source/os_interface/linux/xe/ioctl_helper_xe.cpp | 8 +++++--- shared/source/xe2_hpg_core/linux/product_helper_bmg.cpp | 5 +++++ shared/source/xe2_hpg_core/linux/product_helper_lnl.cpp | 5 +++++ .../xe2_hpg_core/bmg/excludes_xe2_hpg_core_bmg.cpp | 1 + .../bmg/linux/product_helper_tests_bmg_linux.cpp | 4 ++-- .../xe2_hpg_core/lnl/excludes_xe2_hpg_core_lnl.cpp | 1 + .../lnl/linux/product_helper_tests_lnl_linux.cpp | 4 ++-- 7 files changed, 21 insertions(+), 7 deletions(-) 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 d1a29958d7..f8de5f6728 100644 --- a/shared/source/os_interface/linux/xe/ioctl_helper_xe.cpp +++ b/shared/source/os_interface/linux/xe/ioctl_helper_xe.cpp @@ -924,10 +924,10 @@ int IoctlHelperXe::queryDistances(std::vector &queryItems, std::vecto } bool IoctlHelperXe::isPageFaultSupported() { - xeLog(" -> IoctlHelperXe::%s %d\n", __FUNCTION__, false); + xeLog(" -> IoctlHelperXe::%s %d\n", __FUNCTION__, supportedFeatures.flags.pageFault == true); - return false; -}; + return supportedFeatures.flags.pageFault; +} uint32_t IoctlHelperXe::getEuStallFdParameter() { xeLog(" -> IoctlHelperXe::%s\n", __FUNCTION__); @@ -1721,6 +1721,7 @@ void IoctlHelperXe::querySupportedFeatures() { vmCreate.flags = flags; auto ret = IoctlHelper::ioctl(DrmIoctl::gemVmCreate, &vmCreate); + xeLog("gemVmCreate ret=%d flags=%u\n", ret, flags); if (ret == 0) { struct drm_xe_vm_destroy vmDestroy = {}; vmDestroy.vm_id = vmCreate.vm_id; @@ -1731,6 +1732,7 @@ void IoctlHelperXe::querySupportedFeatures() { return false; }; supportedFeatures.flags.pageFault = checkVmCreateFlagsSupport(DRM_XE_VM_CREATE_FLAG_LR_MODE | DRM_XE_VM_CREATE_FLAG_FAULT_MODE); + xeLog("supportedFeatures.flags.pageFault=%d\n", static_cast(supportedFeatures.flags.pageFault)); }; bool IoctlHelperXe::isEuPerDssTopologyType(uint16_t topologyType) const { return topologyType == DRM_XE_TOPO_EU_PER_DSS; diff --git a/shared/source/xe2_hpg_core/linux/product_helper_bmg.cpp b/shared/source/xe2_hpg_core/linux/product_helper_bmg.cpp index a28586f30c..eac94076ee 100644 --- a/shared/source/xe2_hpg_core/linux/product_helper_bmg.cpp +++ b/shared/source/xe2_hpg_core/linux/product_helper_bmg.cpp @@ -33,5 +33,10 @@ int ProductHelperHw::configureHardwareCustom(HardwareInfo *hwInfo, O return 0; } +template <> +bool ProductHelperHw::isPageFaultSupported() const { + return true; +} + template class ProductHelperHw; } // namespace NEO diff --git a/shared/source/xe2_hpg_core/linux/product_helper_lnl.cpp b/shared/source/xe2_hpg_core/linux/product_helper_lnl.cpp index 97d86a83a5..4988dfbce9 100644 --- a/shared/source/xe2_hpg_core/linux/product_helper_lnl.cpp +++ b/shared/source/xe2_hpg_core/linux/product_helper_lnl.cpp @@ -35,5 +35,10 @@ int ProductHelperHw::configureHardwareCustom(HardwareInfo *hwInfo, O return 0; } +template <> +bool ProductHelperHw::isPageFaultSupported() const { + return true; +} + template class ProductHelperHw; } // namespace NEO diff --git a/shared/test/unit_test/xe2_hpg_core/bmg/excludes_xe2_hpg_core_bmg.cpp b/shared/test/unit_test/xe2_hpg_core/bmg/excludes_xe2_hpg_core_bmg.cpp index d7948edf7d..c75dbffc5b 100644 --- a/shared/test/unit_test/xe2_hpg_core/bmg/excludes_xe2_hpg_core_bmg.cpp +++ b/shared/test/unit_test/xe2_hpg_core/bmg/excludes_xe2_hpg_core_bmg.cpp @@ -6,3 +6,4 @@ */ #include "shared/test/common/test_macros/hw_test_base.h" +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenAskedIfPageFaultIsSupportedThenReturnFalse, IGFX_BMG); diff --git a/shared/test/unit_test/xe2_hpg_core/bmg/linux/product_helper_tests_bmg_linux.cpp b/shared/test/unit_test/xe2_hpg_core/bmg/linux/product_helper_tests_bmg_linux.cpp index 8046567eb1..b7f4c6918f 100644 --- a/shared/test/unit_test/xe2_hpg_core/bmg/linux/product_helper_tests_bmg_linux.cpp +++ b/shared/test/unit_test/xe2_hpg_core/bmg/linux/product_helper_tests_bmg_linux.cpp @@ -57,8 +57,8 @@ BMGTEST_F(BmgProductHelperLinux, givenProductHelperWhenCheckDirectSubmissionSupp EXPECT_FALSE(productHelper->isDirectSubmissionSupported(releaseHelper)); } -BMGTEST_F(BmgProductHelperLinux, givenProductHelperWhenAskedIsPageFaultSupportedThenReturnFalse) { - EXPECT_FALSE(productHelper->isPageFaultSupported()); +BMGTEST_F(BmgProductHelperLinux, givenProductHelperWhenAskedIsPageFaultSupportedThenReturnTrue) { + EXPECT_TRUE(productHelper->isPageFaultSupported()); } BMGTEST_F(BmgProductHelperLinux, givenProductHelperWhenAskedIsKmdMigrationSupportedThenReturnFalse) { diff --git a/shared/test/unit_test/xe2_hpg_core/lnl/excludes_xe2_hpg_core_lnl.cpp b/shared/test/unit_test/xe2_hpg_core/lnl/excludes_xe2_hpg_core_lnl.cpp index 007217b930..b560ee432d 100644 --- a/shared/test/unit_test/xe2_hpg_core/lnl/excludes_xe2_hpg_core_lnl.cpp +++ b/shared/test/unit_test/xe2_hpg_core/lnl/excludes_xe2_hpg_core_lnl.cpp @@ -9,3 +9,4 @@ HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, whenGettingPreferredAllocationMethodThenNoPreferenceIsReturned, IGFX_LUNARLAKE); HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenCheckBlitEnqueuePreferredThenReturnTrue, IGFX_LUNARLAKE); +HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenProductHelperWhenAskedIfPageFaultIsSupportedThenReturnFalse, IGFX_LUNARLAKE); diff --git a/shared/test/unit_test/xe2_hpg_core/lnl/linux/product_helper_tests_lnl_linux.cpp b/shared/test/unit_test/xe2_hpg_core/lnl/linux/product_helper_tests_lnl_linux.cpp index 4e5276f21a..97d67ebff5 100644 --- a/shared/test/unit_test/xe2_hpg_core/lnl/linux/product_helper_tests_lnl_linux.cpp +++ b/shared/test/unit_test/xe2_hpg_core/lnl/linux/product_helper_tests_lnl_linux.cpp @@ -52,8 +52,8 @@ LNLTEST_F(LnlProductHelperLinux, givenProductHelperWhenAskedIfPatIndexProgrammin EXPECT_TRUE(productHelper->isVmBindPatIndexProgrammingSupported()); } -LNLTEST_F(LnlProductHelperLinux, givenProductHelperWhenAskedIsPageFaultSupportedThenReturnFalse) { - EXPECT_FALSE(productHelper->isPageFaultSupported()); +LNLTEST_F(LnlProductHelperLinux, givenProductHelperWhenAskedIsPageFaultSupportedThenReturnTrue) { + EXPECT_TRUE(productHelper->isPageFaultSupported()); } LNLTEST_F(LnlProductHelperLinux, givenProductHelperWhenAskedIsKmdMigrationSupportedThenReturnFalse) {