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 <Yong.Zhao@amd.com>
This commit is contained in:
@@ -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>(),
|
||||
(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<HSAuint64>());
|
||||
|
||||
/* 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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user