From 1c2c5a7b9ab504edb30630764ad14bff842bbdad Mon Sep 17 00:00:00 2001 From: Yong Zhao Date: Thu, 12 Dec 2019 21:21:59 -0500 Subject: [PATCH] kfdtest: Delete two useless exception tests The InvalidPPR* tests are only useful for gfx801 right now, on which they won't trigger exceptions. So they are not relevent in the KFDExceptionTest category. In addition, given AccessPPRMem already tests the PPR memory functionality, we can just delete those two tests. Change-Id: Id5c6e23c4c0ce47a4f04e9e1f0fa9083e0a9d0e0 Signed-off-by: Yong Zhao --- tests/kfdtest/scripts/kfdtest.exclude | 1 - tests/kfdtest/src/KFDExceptionTest.cpp | 106 ------------------------- 2 files changed, 107 deletions(-) diff --git a/tests/kfdtest/scripts/kfdtest.exclude b/tests/kfdtest/scripts/kfdtest.exclude index 42e0df356c..ca2cbb5c5b 100644 --- a/tests/kfdtest/scripts/kfdtest.exclude +++ b/tests/kfdtest/scripts/kfdtest.exclude @@ -92,7 +92,6 @@ SDMA_BLACKLIST=\ KV_QUEUE_BLACKLIST=\ "KFDExceptionTest.InvalidBadAddress:"\ "KFDExceptionTest.InvalidWriteAddress:"\ -"KFDExceptionTest.InvalidPPR*:"\ "KFDLocalMemoryTest.*:"\ "KFDEventTest.Signal*Event*:"\ "KFDQMTest.CreateQueueStressSingleThreaded:"\ diff --git a/tests/kfdtest/src/KFDExceptionTest.cpp b/tests/kfdtest/src/KFDExceptionTest.cpp index 428e4a64d7..1a25e4cad4 100644 --- a/tests/kfdtest/src/KFDExceptionTest.cpp +++ b/tests/kfdtest/src/KFDExceptionTest.cpp @@ -155,112 +155,6 @@ TEST_F(KFDExceptionTest, InvalidBadAddress) { TEST_END } -/* TODO: Check why this test doesn't behave as expected. - * Expected behaviour: Since pDst is not mapped in GPU VM, an attempt - * to write to pDst should trigger a Memory Fault. - * However, If pDst > 40bits (MC Size) GPU does not create Memory Fault. - * An EOP interrupt is generated however as expected no data is copied - * into pDst. - */ -TEST_F(KFDExceptionTest, InvalidPPRWriteProtection) { - TEST_REQUIRE_ENV_CAPABILITIES(ENVCAPS_64BITLINUX); - TEST_START(TESTPROFILE_RUNALL); - - int defaultGPUNode = m_NodeInfo.HsaDefaultGPUNode(); - ASSERT_GE(defaultGPUNode, 0) << "failed to get default GPU Node"; - - if (is_dgpu()) { - LOG() << "Skipping test: Test requires APU." << std::endl; - return; - } - - if (m_FamilyId == FAMILY_RV) { - LOG() << "Skipping test: IOMMU issues on Raven." << std::endl; - return; - } - - m_ChildPid = fork(); - if (m_ChildPid == 0) { - m_ChildStatus = hsaKmtOpenKFD(); - if (m_ChildStatus != HSAKMT_STATUS_SUCCESS) { - WARN() << "KFD open failed in child process" << std::endl; - return; - } - - HsaMemoryBuffer srcBuffer(PAGE_SIZE, defaultGPUNode, false); - void* pDst = VirtualAllocMemory(NULL, PAGE_SIZE, MEM_READ); - - LOG() << "PPR dst address is " << pDst << std::endl; - - srcBuffer.Fill(0xAA55AA55); - TestMemoryException(defaultGPUNode, srcBuffer.As(), - (HSAuint64)pDst); - - /* Wait for enough time here to ensure this process got killed by kernel - * due to PPR exception. - */ - sleep(5); - } else { - int childStatus; - - waitpid(m_ChildPid, &childStatus, 0); - EXPECT_EQ(WIFSIGNALED(childStatus), true); - EXPECT_EQ(WTERMSIG(childStatus), SIGSEGV); - } - - TEST_END -} - -/* TODO: Same as previous test InvalidPPRWriteProtection */ -TEST_F(KFDExceptionTest, InvalidPPRReadProtection) { - TEST_REQUIRE_ENV_CAPABILITIES(ENVCAPS_64BITLINUX); - TEST_START(TESTPROFILE_RUNALL); - - int defaultGPUNode = m_NodeInfo.HsaDefaultGPUNode(); - ASSERT_GE(defaultGPUNode, 0) << "failed to get default GPU Node"; - - if (is_dgpu()) { - LOG() << "Skipping test: Test requires APU." << std::endl; - return; - } - - if (m_FamilyId == FAMILY_RV) { - LOG() << "Skipping test: IOMMU issues on Raven." << std::endl; - return; - } - - m_ChildPid = fork(); - if (m_ChildPid == 0) { - m_ChildStatus = hsaKmtOpenKFD(); - if (m_ChildStatus != HSAKMT_STATUS_SUCCESS) { - WARN() << "KFD open failed in child process" << std::endl; - return; - } - - HsaMemoryBuffer dstBuffer(PAGE_SIZE, defaultGPUNode, false); - void* pSrc = VirtualAllocMemory(NULL, PAGE_SIZE, MEM_NONE); - - LOG() << "PPR src address is " << pSrc << std::endl; - - dstBuffer.Fill(0xAA55AA55); - TestMemoryException(defaultGPUNode, (HSAuint64)pSrc, - dstBuffer.As()); - - /* Wait for enough time here to ensure this process got killed by kernel - * due to PPR exception. - */ - sleep(5); - } else { - int childStatus; - - waitpid(m_ChildPid, &childStatus, 0); - EXPECT_EQ(WIFSIGNALED(childStatus), true); - EXPECT_EQ(WTERMSIG(childStatus), SIGSEGV); - } - - TEST_END -} - /* Allocate Read Only buffer. Test Memory Exception failure by * attempting to write to that buffer in the child process. */