Add support for IntelGT note section

Add extraction of IntelGT note section in zebin decoder.
Add target validation based on intelGT notes in zebin decoder.
Add check in unpacking (unpackSingleDeviceBinary) for e_machine,
and validate target device accordingly.

Related-To: NEO-5658
Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
This commit is contained in:
Krystian Chmielewski
2021-07-02 14:28:08 +00:00
committed by Compute-Runtime-Automation
parent bec8cdd6f1
commit 7ee83db9d8
7 changed files with 436 additions and 9 deletions

View File

@@ -28,6 +28,7 @@ struct ZebinSections {
StackVec<SectionHeaderData *, 1> constDataSections;
StackVec<SectionHeaderData *, 1> symtabSections;
StackVec<SectionHeaderData *, 1> spirvSections;
StackVec<SectionHeaderData *, 1> noteIntelGTSections;
};
using UniqueNode = StackVec<const NEO::Yaml::Node *, 1>;
@@ -41,6 +42,9 @@ struct ZeInfoKernelSections {
UniqueNode experimentalPropertiesNd;
};
bool validateTargetDevice(const Elf::Elf<Elf::EI_CLASS_64> &elf, const TargetDevice &targetDevice);
std::vector<const Elf::IntelGTNote *> getIntelGTNotes(const Elf::Elf<Elf::EI_CLASS_64> &elf);
DecodeError extractZebinSections(NEO::Elf::Elf<Elf::EI_CLASS_64> &elf, ZebinSections &out, std::string &outErrReason, std::string &outWarning);
DecodeError validateZebinSectionsCount(const ZebinSections &sections, std::string &outErrReason, std::string &outWarning);
void extractZeInfoKernelSections(const NEO::Yaml::YamlParser &parser, const NEO::Yaml::Node &kernelNd, ZeInfoKernelSections &outZeInfoKernelSections, ConstStringRef context, std::string &outWarning);