Update zebin note target metadata
This commit removes ZebinTargetMetadata struct, and uses ZebinTargetFlags for both target validations: via machine type, and via intel gt notes. Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
This commit is contained in:
parent
b8028d79c7
commit
1b4319fdab
|
@ -109,51 +109,6 @@ struct ZebinTargetFlags {
|
|||
};
|
||||
static_assert(sizeof(ZebinTargetFlags) == sizeof(uint32_t), "");
|
||||
|
||||
struct ZebinTargetMetadata {
|
||||
// bit[7:0]: dedicated for specific generator (meaning based on generatorId)
|
||||
enum GeneratorSpecificFlags : uint8_t {
|
||||
NONE = 0
|
||||
};
|
||||
// bit[22:20]: generator of this device binary
|
||||
enum GeneratorId : uint8_t {
|
||||
UNREGISTERED = 0,
|
||||
IGC = 1
|
||||
};
|
||||
|
||||
union {
|
||||
struct {
|
||||
// bit[7:0]: dedicated for specific generator (meaning based on generatorId)
|
||||
uint8_t generatorSpecificFlags : 8;
|
||||
|
||||
// bit[12:8]: values [0-31], min compatbile device revision Id (stepping)
|
||||
uint8_t minHwRevisionId : 5;
|
||||
|
||||
// bit[13:13]:
|
||||
// 0 - full validation during decoding (safer decoding)
|
||||
// 1 - no validation (faster decoding - recommended for known generators)
|
||||
bool validateRevisionId : 1;
|
||||
|
||||
// bit[14:14]:
|
||||
// 0 - ignore minHwRevisionId and maxHwRevisionId
|
||||
// 1 - underlying device must match specified revisionId info
|
||||
bool disableExtendedValidation : 1;
|
||||
|
||||
// bit[19:15]: max compatbile device revision Id (stepping)
|
||||
uint8_t maxHwRevisionId : 5;
|
||||
|
||||
// bit[22:20]: generator of this device binary
|
||||
// 0 - Unregistered
|
||||
// 1 - IGC
|
||||
uint8_t generatorId : 3;
|
||||
|
||||
// bit[31:23]: MBZ, reserved for future use
|
||||
uint8_t reserved : 8;
|
||||
};
|
||||
uint32_t packed = 0U;
|
||||
};
|
||||
};
|
||||
static_assert(sizeof(ZebinTargetMetadata) == sizeof(uint32_t), "");
|
||||
|
||||
namespace ZebinKernelMetadata {
|
||||
namespace Tags {
|
||||
static constexpr ConstStringRef kernels("kernels");
|
||||
|
|
|
@ -25,7 +25,7 @@ namespace NEO {
|
|||
bool validateTargetDevice(const Elf::Elf<Elf::EI_CLASS_64> &elf, const TargetDevice &targetDevice) {
|
||||
GFXCORE_FAMILY gfxCore = IGFX_UNKNOWN_CORE;
|
||||
PRODUCT_FAMILY productFamily = IGFX_UNKNOWN;
|
||||
Elf::ZebinTargetMetadata targetMetadata = {};
|
||||
Elf::ZebinTargetFlags targetMetadata = {};
|
||||
auto intelGTNotes = getIntelGTNotes(elf);
|
||||
for (const auto &intelGTNote : intelGTNotes) {
|
||||
switch (intelGTNote->type) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2020-2021 Intel Corporation
|
||||
* Copyright (C) 2020-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
|
@ -332,7 +332,7 @@ TEST(UnpackSingleDeviceBinaryZebin, WhenMachineIsIntelGTAndIntelGTNoteSectionIsV
|
|||
notes[1].type = NEO::Elf::IntelGTSectionType::GfxCore;
|
||||
notes[1].desc = targetDevice.coreFamily;
|
||||
|
||||
NEO::Elf::ZebinTargetMetadata targetMetadata;
|
||||
NEO::Elf::ZebinTargetFlags targetMetadata;
|
||||
targetMetadata.validateRevisionId = true;
|
||||
targetMetadata.minHwRevisionId = targetDevice.stepping - 1;
|
||||
targetMetadata.maxHwRevisionId = targetDevice.stepping + 1;
|
||||
|
|
|
@ -5107,7 +5107,7 @@ TEST_F(IntelGTNotesFixture, WhenGettingIntelGTNotesGivenValidIntelGTNotesSection
|
|||
notes[1].type = Elf::IntelGTSectionType::GfxCore;
|
||||
notes[1].desc = IGFX_GEN9_CORE;
|
||||
|
||||
Elf::ZebinTargetMetadata targetMetadata;
|
||||
Elf::ZebinTargetFlags targetMetadata;
|
||||
targetMetadata.validateRevisionId = true;
|
||||
targetMetadata.minHwRevisionId = 5;
|
||||
targetMetadata.maxHwRevisionId = 7;
|
||||
|
@ -5170,7 +5170,7 @@ TEST_F(IntelGTNotesFixture, WhenValidatingTargetDeviceGivenValidTargetDeviceAndV
|
|||
notes[1].type = Elf::IntelGTSectionType::GfxCore;
|
||||
notes[1].desc = targetDevice.coreFamily;
|
||||
|
||||
Elf::ZebinTargetMetadata targetMetadata;
|
||||
Elf::ZebinTargetFlags targetMetadata;
|
||||
targetMetadata.validateRevisionId = true;
|
||||
targetMetadata.minHwRevisionId = targetDevice.stepping - 1;
|
||||
targetMetadata.maxHwRevisionId = targetDevice.stepping + 1;
|
||||
|
@ -5214,7 +5214,7 @@ TEST_F(IntelGTNotesFixture, WhenValidatingTargetDeviceGivenInvalidTargetDeviceAn
|
|||
notes[1].type = Elf::IntelGTSectionType::GfxCore;
|
||||
notes[1].desc = targetDevice.coreFamily + 2;
|
||||
|
||||
Elf::ZebinTargetMetadata targetMetadata;
|
||||
Elf::ZebinTargetFlags targetMetadata;
|
||||
targetMetadata.validateRevisionId = true;
|
||||
targetMetadata.minHwRevisionId = targetDevice.stepping + 1;
|
||||
targetMetadata.maxHwRevisionId = targetDevice.stepping + 3;
|
||||
|
|
Loading…
Reference in New Issue