eb-local.isa_audit¶
- module eb-local.isa_audit src/isa_audit.zig[source][autodoc]¶
eb-local audit-isa: the instructions in an installed prefix that need a CPU feature the target does not have. Every ELF file under the path is disassembled by objdump; each instruction’s mnemonic, encoding and vector width select the features it needs from tables generated by tools/isa_tables/gen.py, and a feature missing from the target’s set is a violation. Code that selects its instruction set at run time is listed in an allow file and reported as dispatch, which does not fail the audit.
Types¶
- pub const Arch = enum[source][autodoc]¶
The architectures the audit reads: the machine of the ELF file selects one.
- pub const Target = struct[source][autodoc]¶
An EESSI software subdirectory, its architecture and the features its CPU has.
- pub const Db = struct[source][autodoc]¶
The tables of the generator, parsed.
- pub fn load(a: Allocator) LoadError!*Db[source][autodoc]¶
Parse the embedded tables into a database allocated from
a.
- pub const Verdict = struct[source][autodoc]¶
What one instruction needs: the features the target must have, the features the tables do not classify, and whether the mnemonic is unknown for a vector encoding.
- pub const AllowEntry = struct[source][autodoc]¶
A package whose files hold code chosen at run time, and the features that code may use.
- pub const Finding = struct[source][autodoc]¶
One feature a file needs and the target lacks: how many instructions, the first one, and whether the allow list covers it.
- pub const Unclassified = struct[source][autodoc]¶
A feature or mnemonic the tables cannot judge, and how often it occurs.
- pub const Problem = struct[source][autodoc]¶
A file or directory the audit could not read or disassemble, and why.
Error sets¶
Functions¶
- pub fn parseLine(line: []const u8) ?Line[source][autodoc]¶
Parse
ADDRESS:<tab or spaces>BYTES<tab>MNEMONIC OPERANDSas GNU objdump and llvm-objdump print it; null for any other line. Instruction prefixes before the mnemonic are skipped, and a symbol or comment after the operands is cut.
- pub fn x86Encoding(bytes: []const u8) u8[source][autodoc]¶
The encoding of an x86-64 instruction from its bytes: V for VEX, E for EVEX, X for XOP, L for the rest.
- pub fn vectorWidth(operands: []const u8) u16[source][autodoc]¶
The widest vector register or memory operand the operands name, 0 for none.
- pub fn aliasOf(mn: []const u8, buf: *[32]u8) ?[]const u8[source][autodoc]¶
The mnemonic of the instruction an assembler alias stands for (vcmpltps, vpcmpnleub, vpcomltb, pclmullqlqdq), written into
buf.
- pub fn classifyX86(db: *const Db, ln: Line) Verdict[source][autodoc]¶
What an x86-64 instruction needs.
- pub fn classifyA64(db: *const Db, ln: Line) Verdict[source][autodoc]¶
What an aarch64 instruction needs: the feature of the first rule its mnemonic and operands match.
- pub fn parseAllow(a: Allocator, db: *const Db, text: []const u8) Allocator.Error![]const AllowEntry[source][autodoc]¶
Parse “PACKAGE feature[,feature…] # reason” lines. A feature the tables do not name is ignored.
- pub fn allowed(entries: []const AllowEntry, path: []const u8, feature: u8) bool[source][autodoc]¶
True when a file under /software/PACKAGE/ may use the feature.