fix(zebin): Do not use NT_INTELGT_PRODUCT_CONFIG for target device validation
Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
This commit is contained in:
parent
5b9d45f3bc
commit
1fba2a162e
|
@ -124,9 +124,6 @@ bool validateTargetDevice(const Elf::Elf<numBits> &elf, const TargetDevice &targ
|
|||
break;
|
||||
}
|
||||
case Elf::IntelGTSectionType::ProductConfig: {
|
||||
DEBUG_BREAK_IF(sizeof(uint32_t) != intelGTNote.data.size());
|
||||
auto productConfigData = reinterpret_cast<const uint32_t *>(intelGTNote.data.begin());
|
||||
productConfig = static_cast<AOT::PRODUCT_CONFIG>(*productConfigData);
|
||||
break;
|
||||
}
|
||||
case Elf::IntelGTSectionType::vISAAbiVersion: {
|
||||
|
|
|
@ -5580,38 +5580,6 @@ TEST_F(IntelGTNotesFixture, WhenValidatingTargetDeviceGivenValidTargetDeviceAndV
|
|||
EXPECT_TRUE(validateTargetDevice(elf, targetDevice, outErrReason, outWarning, generator));
|
||||
}
|
||||
|
||||
TEST_F(IntelGTNotesFixture, givenAotConfigInIntelGTNotesSectionWhenValidatingTargetDeviceThenUseOnlyItForValidation) {
|
||||
NEO::HardwareIpVersion aotConfig = {0};
|
||||
aotConfig.value = 0x00001234;
|
||||
|
||||
TargetDevice targetDevice;
|
||||
targetDevice.maxPointerSizeInBytes = 8u;
|
||||
ASSERT_EQ(IGFX_UNKNOWN, targetDevice.productFamily);
|
||||
ASSERT_EQ(IGFX_UNKNOWN_CORE, targetDevice.coreFamily);
|
||||
targetDevice.aotConfig.value = aotConfig.value;
|
||||
|
||||
NEO::Elf::ElfNoteSection elfNoteSection;
|
||||
elfNoteSection.descSize = 4u;
|
||||
elfNoteSection.nameSize = 8u;
|
||||
elfNoteSection.type = Zebin::Elf::IntelGTSectionType::ProductConfig;
|
||||
|
||||
uint8_t productConfigData[4];
|
||||
memcpy_s(productConfigData, 4, &aotConfig.value, 4);
|
||||
|
||||
auto sectionDataSize = sizeof(NEO::Elf::ElfNoteSection) + elfNoteSection.nameSize + elfNoteSection.descSize;
|
||||
auto noteIntelGTSectionData = std::make_unique<uint8_t[]>(sectionDataSize);
|
||||
appendSingleIntelGTSectionData(elfNoteSection, noteIntelGTSectionData.get(), productConfigData, NEO::Zebin::Elf::IntelGTNoteOwnerName.data(), sectionDataSize);
|
||||
zebin.appendSection(NEO::Elf::SHT_NOTE, Zebin::Elf::SectionNames::noteIntelGT, ArrayRef<uint8_t>::fromAny(noteIntelGTSectionData.get(), sectionDataSize));
|
||||
|
||||
std::string outErrReason, outWarning;
|
||||
auto elf = NEO::Elf::decodeElf<NEO::Elf::EI_CLASS_64>(zebin.storage, outErrReason, outWarning);
|
||||
EXPECT_TRUE(outWarning.empty());
|
||||
EXPECT_TRUE(outErrReason.empty());
|
||||
GeneratorType generator{};
|
||||
|
||||
EXPECT_TRUE(validateTargetDevice(elf, targetDevice, outErrReason, outWarning, generator));
|
||||
}
|
||||
|
||||
TEST(ValidateTargetDevice32BitZebin, Given32BitZebinAndValidIntelGTNotesWhenValidatingTargetDeviceThenReturnTrue) {
|
||||
TargetDevice targetDevice;
|
||||
targetDevice.productFamily = productFamily;
|
||||
|
|
Loading…
Reference in New Issue