fix(debugger): pass correct sipAllocation to makeResident

- sipAllocation for context must be resident in Offline mode

Related-To: NEO-7630

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe
2023-07-28 13:22:38 +00:00
committed by Compute-Runtime-Automation
parent 8516f7f6ef
commit 997b599168
25 changed files with 141 additions and 70 deletions

View File

@@ -4160,7 +4160,7 @@ HWTEST2_F(CommandStreamReceiverHwTest,
commandStreamReceiver.flushImmediateTask(commandStream, commandStream.getUsed(), immediateFlushTaskFlags, *pDevice);
auto sipAllocation = NEO::SipKernel::getSipKernel(*pDevice).getSipAllocation();
auto sipAllocation = NEO::SipKernel::getSipKernel(*pDevice, nullptr).getSipAllocation();
EXPECT_TRUE(commandStreamReceiver.isMadeResident(sipAllocation));
@@ -4187,6 +4187,46 @@ HWTEST2_F(CommandStreamReceiverHwTest,
EXPECT_TRUE(commandStreamReceiver.isMadeResident(sipAllocation));
}
HWTEST2_F(CommandStreamReceiverHwTest,
givenOfflineDebuggingModeWhenFlushTaskImmediateCalledThenCorrectContextSipIsResident,
IsAtLeastXeHpCore) {
using STATE_SIP = typename FamilyType::STATE_SIP;
pDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]->initDebuggerL0(pDevice);
pDevice->getExecutionEnvironment()->setDebuggingMode(DebuggingMode::Offline);
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
commandStreamReceiver.storeMakeResidentAllocations = true;
EXPECT_FALSE(commandStreamReceiver.getSipSentFlag());
commandStreamReceiver.setSipSentFlag(true);
EXPECT_TRUE(commandStreamReceiver.getSipSentFlag());
commandStreamReceiver.setSipSentFlag(false);
EXPECT_FALSE(commandStreamReceiver.getSipSentFlag());
commandStreamReceiver.flushImmediateTask(commandStream, commandStream.getUsed(), immediateFlushTaskFlags, *pDevice);
auto sipAllocation = NEO::SipKernel::getSipKernel(*pDevice, &commandStreamReceiver.getOsContext()).getSipAllocation();
EXPECT_TRUE(commandStreamReceiver.isMadeResident(sipAllocation));
HardwareParse hwParserCsr;
hwParserCsr.parseCommands<FamilyType>(commandStreamReceiver.commandStream, 0);
auto stateSipCmd = hwParserCsr.getCommand<STATE_SIP>();
ASSERT_NE(nullptr, stateSipCmd);
EXPECT_EQ(sipAllocation->getGpuAddressToPatch(), stateSipCmd->getSystemInstructionPointer());
EXPECT_TRUE(commandStreamReceiver.getSipSentFlag());
commandStreamReceiver.flushImmediateTask(commandStream,
commandStream.getUsed(),
immediateFlushTaskFlags,
*pDevice);
EXPECT_TRUE(commandStreamReceiver.getSipSentFlag());
EXPECT_TRUE(commandStreamReceiver.isMadeResident(sipAllocation));
}
HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverHwTest, givenScratchSpaceSurfaceStateEnabledWhenRequiredScratchSpaceIsSetThenPerThreadScratchSizeIsAlignedNextPow2) {
auto commandStreamReceiver = std::make_unique<MockCsrHw<FamilyType>>(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield());
auto scratchController = static_cast<MockScratchSpaceControllerXeHPAndLater *>(commandStreamReceiver->getScratchSpaceController());