Commit Graph

37 Commits

Author SHA1 Message Date
5c01435f8d ga10x: fill GspSystemInfo ACPI method data and bIsPrimary
GSP_SET_SYSTEM_INFO went to GSP-RM with acpiMethodData and bIsPrimary
left zero. On an Optimus laptop nouveau (r535/r570_gsp_acpi_info) and
OpenRM fill them from the GPU's ACPI node: the _DOD display list, the JT
_DSM capabilities and the NVOP Optimus capabilities. Do the same, at the
580.178.04 GspSystemInfo offsets (acpiMethodData 0xa0..0x344, bIsPrimary
0x380), and log what was found:

  ga10x: ACPI sysinfo: primary=0 dod=0(n=1) jt=0(caps=20016003) opt=0(caps=19000059)

This did not by itself fix the GA107 boot (the sysmem flush page did,
programmed since #145),
and it has not been tested in isolation; it brings the system info in
line with what the other drivers send on Optimus systems. Only x86 with
CONFIG_ACPI evaluates the methods.

bIsPrimary comes from video_is_primary_device() where <asm/video.h> has
it (6.9+, probed in Kbuild) and from the VGA arbiter's default device
before that.

Also report an I/O BAR to GSP-RM only when PCI_COMMAND_IO is enabled:
the GA107 exposes an I/O BAR that the platform leaves disabled.
2026-12-02 07:27:28 +08:00
7ed49fbf73 docs: update HANDOFF.md and PARITY_AND_UNLOCKS.md for Round 2 Waves 6-9 2026-12-01 19:47:05 +00:00
ac4c31c12d tools: ioctl capture/replay workflow with normalized 620.73.04 golden transcripts (#120)
LD_PRELOAD ioctl recorder, replay_diff.py, capture_stock.sh, replay_live.sh,
golden stock 620.73.04 transcript + known-gaps, and an offline control test.
Stock swap is opt-in via NV_RS_CAPTURE_BDF. No HANDOFF.md/AGENTS.md changes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-12-01 13:06:44 -05:00
caa7340c83 Tighten kernel module ENDBR relocation checks. (Kernel compat followup pr #10) (#15)
* Refuse data relocation targets that do not resolve to an instruction boundary

PR #10 comment 4742386524, cherry-picked from d91d2df onto this branch: a data
relocation to .text+1 where offset 1 is inside a multi-byte instruction has no
entry in instr_at, so the checker dropped it and the ENDBR rule passed having
never seen the target. A target in an allocatable data section that resolves to a
code section must resolve to a recorded instruction boundary, so the unresolvable
case is now a failure.

Resolving the refused targets exposed two facts the earlier commit had wrong: the
current object does have section-symbol relocations (3 data relocations), and
readelf prints section names truncated to 256 characters while objdump prints the
full name (measured here: a 306-character name prints as 256 in readelf, 306 in
objdump). The checker now maps the truncated name back to the full one. With
both, the 3 targets resolve to endbr64 entries at addend 0: counts 357 -> 360
data relocations to code, 0 missing pads, 0 mid-function, 0 unresolved, gate
green.

Test: tests/kernel-module-gate/*.s + tools/test_kernel_module_gate.sh, added as a
validate_all step (30/30 -> 31/31 in AGENTS.md). Cases: .rodata -> .text+6 inside
a 5-byte mov must be refused; .text+0 on an endbr64 entry passes; a name over 256
characters still resolves. The checker takes an object path for this, which also
stops it writing the committed report, and skips the module-only checks when
kernel-open/nvidia_rs.ko is absent so synthetic objects can be checked without a
build.

Adapted to this branch: the new check follows ibt_enforced (CONFIG_X86_KERNEL_IBT
in $(KERNEL_OUTPUT)/.config, NV_RS_KERNEL_IBT, or endbr entries in the object)
instead of plain x86_64, and the resolution keeps the fn_entries entry flag that
endbr64_at_data_relocation_targets uses.

(cherry picked from commit d91d2df)

* Say the checker's ENDBR rule is stricter than objtool's, and list the extra conditions

PR #10 comment 4742452532, cherry-picked from 166a3df onto this branch. The ENDBR bullet
states the checker's rule as if it were objtool's rule. Re-checked validate_ibt_data_reloc at
the v6.12 tag: objtool returns 0 (accepts) when find_insn finds nothing at sym->offset +
addend, when the destination is marked noendbr, and when the destination is an ENDBR that is
not a function entry. The checker is a superset: recorded instruction boundary, first
instruction of the function, addend 0, and endbr64 regardless of marking.

Adapted to this branch: the docs here were restructured into the ENDBR / IBT bullet list, so
the distinction goes as a bullet on the existing section instead of the old Gate law
paragraph; the counts and the x86-gating wording already live in the bullets above.

(cherry picked from commit 166a3df)

* Refuse a truncated 256-character name that is not a unique identity

PR #15 comment 4743365034: mapping the readelf-truncated name to the last section that
shares that prefix means a relocation to one section is judged against the other section's
instruction. Two sections sharing their first 256 characters print identically in readelf,
so the prefix cannot identify one section. The checker now records a prefix as ambiguous
when a second distinct full name shares it, and refuses any data relocation to an ambiguous
target rather than guessing.

Fixture tests/kernel-module-gate/duplicate-prefix.s: two code sections with the same first
256 characters, the first starting with endbr64, the second with ret, and .rodata pointing
at the endbr64 entry. Before the change the checker resolved it to the second section and
reported the target as missing a pad - the wrong answer for the right reason. Now it is
refused. Test asserts the ambiguous count as well as the unresolved count; 4/4 pass.

No ambiguity exists on the current object (1681 code sections, 11 names over 256 characters,
no shared prefix), so the only report change is the new ambiguous_truncated_names field: 360
resolved targets, 0 unresolved, 0 ambiguous, gate green.

* Require the module in default validation; skip its checks only in object-only mode

PR #15 comment 4743365052: the module-only checks were skipped whenever the .ko was absent,
so a default run against a present object and a missing nvidia_rs.ko could write passed: true
with no GOT-relocation, runtime-symbol, module-name or PCI-alias check. Now the default run
carries a module_present check that fails on a missing module, and the skips happen only in
explicit object-only mode (--object-only), which is what the gate test uses. Writing the
committed report is likewise limited to the default run, so fixture runs cannot overwrite it.

Test gained a case for it: explicit paths without --object-only and a nonexistent module must
report module_present false. 5/5 pass. Report records module_checks_run for the verified default
run (360 targets, 0 unresolved, 0 ambiguous, green).

* Assert that the positive gate fixtures actually resolve a relocation

PR #15 comment 4743365065: the entry and long-name cases only checked the resolve flag, the
unresolved count and the ambiguous count, and all three are satisfied by an object that
resolved nothing - the silent dropping the test exists to detect. Both positive cases now also
assert data_relocations_to_code == 1 and endbr64_at_data_relocation_targets, so a fixture that
fails to produce the relocation fails the test. The negative cases keep their own assertions
(0 resolved targets, refused), which is what a refused target looks like. 5/5 pass.

* Check ambiguity on the symbol path, not only the section path

PR #15 comment 4743485055: the ambiguous-name guard ran only when the relocation name was
also a code section, so a symbol name reaching the checker as a shared 256-character prefix
was resolved through the first entry recorded in symtrunc and judged against the wrong
function's instruction. The guard now runs before resolution on both paths.

Fixture tests/kernel-module-gate/duplicate-symbol-prefix.s: two symbol names sharing their
first 256 characters, one exactly 256 long and one longer, with .rodata pointing at both. Measured
on this box with binutils 2.47: readelf -r prints names truncated to 256 ('symAaaaaaaaaa_RINvXs9_[...]')
while readelf -rW, which the checker uses, prints them in full - so the longer name is a unique
identity and must resolve to its own instruction, while the 256-character name is a printed form
belonging to both symbols and must be refused. Before the change the checker resolved that
relocation to the first symbol disassembled, a ret, and reported the target as missing a pad.
Test asserts both halves: the shared printed form refused, the unique name resolved. 6/6 pass.

* Move the gate cases from the shell harness into explicit per-case asserts

tools/test_kernel_module_gate.sh compared one string built from three JSON fields, so every
case had to be read through the same helper and the positive cases could only assert that
nothing was refused. tests/kernel-module-gate/test_gate_cases.py states, per fixture, the whole
set of values the IBT rule must report - resolves, unresolved, ambiguous, resolved targets, and
the endbr64 rule - and asserts the dict, so a fixture that resolves nothing fails. The
module-required case asserts module_present false plus that the module-only checks were skipped.

The checker is invoked with sys.executable (it is not executable in the tree) and in object-only
mode, which keeps the committed report from being overwritten by fixture runs. validate_all step
replaced (still 31 steps), AGENTS.md and docs/KERNEL_COMPAT.md point at the new file, fixture
comments name the test that reads them. 2 tests / 6 cases pass.

* Qualify the relocation rule with IBT enforcement in the gate law

PR #15 comment 4743567439: the law read as if the instruction-boundary rule applied to every
code target, but the checker reports data_relocation_targets_resolve_to_instructions as True
when IBT is not enforced (verified against the current code: 'True if not ibt_enforced else not
unresolved and not ambiguous_targets'). On a non-IBT build the check is green without having
enforced anything, so the counts there are not evidence that the targets resolved. The line now
states the condition and how to read a green check without it.

Docs-only: AGENTS.md line 46 and the same paragraph in docs/KERNEL_COMPAT.md. No code change;
the behaviour is intended (the rule is x86/IBT-specific), the wording was the problem.

* Assert the shared-prefix rule instead of one readelf-dependent outcome

PR #15 comment 4743709007: the duplicate-prefix expectation only held when readelf printed the
relocation name truncated to 256 characters. Measured here with binutils 2.47: readelf -rW prints
names taken from the section string table truncated to 256 (this fixture field is 256, and the real
object has 374 fields at exactly 256) but prints symbol names in full, which is why
duplicate-symbol-prefix resolves. An implementation that prints names in full, as the review
measured on 2.41, makes the section case resolve to the first section endbr64 entry instead of
refusing it, so the fixed expectation was tool-dependent.

Two changes, both printing-independent:
- the checker refuses a name only when the printed form is a truncated prefix shared by two
  entities; a name readelf prints in full is its own identity and resolves normally, so the symbol
  path no longer refuses an attributable name
- test_gate_cases.py takes each shared-prefix case expectation from the printing readelf actually
  showed, compared against nm full names, and records which branch ran, so the assertion is the rule
  rather than an assumed outcome. Resolving to whichever entity was disassembled first fails
  whichever branch applies.

Verified on this box: duplicate-prefix observed truncated, so refused; duplicate-symbol-prefix
observed full, so both relocations resolved to their own entries. 6/6 cases pass, default gate
unchanged (360 resolved, 0 unresolved, 0 ambiguous), no shared prefix on the current object.

* Fix the shared-prefix classifier and refuse a name that cannot be attributed

PR #15 comment 4743842886, two parts, both confirmed against the code:

1. observed_printing() compared relocation names with nm --defined-only, which does not list
   section symbols (measured: it prints nothing for the duplicate-prefix fixture), so a section
   name printed in full was still classified as truncated and the test would pick the wrong
   expectation on a readelf that does not truncate. The classifier now compares the printed field
   against objdump's untruncated section names and against the name the fixture intended for each
   relocation entry, which is the only way to tell a complete 256-character name from another name
   truncated onto it.

2. With the exact-length-only guard, a name of exactly 256 characters that is also another name's
   truncated form was resolved instead of refused: from the printed text the checker cannot know
   which entry produced the string, so that resolution is a guess. The guard is unconditional again
   for ambiguous printed names, and duplicate-symbol-prefix.s now has one relocation, targeting the
   longer symbol, so the test knows which entity the entry names and asserts the identity, not just
   the aggregate counts.

Branch data measured here: GNU readelf 2.47 truncates names from the section string table (the
duplicate-prefix field is 256) and prints symbol names in full under -W (262), so the section case
runs the truncated branch and the symbol case runs the full branch. llvm-readelf 23 prints both in
full (347 for the same object), which is the second behaviour the classifier must handle. Running the
fixtures with the guard removed shows what the test is guarding: duplicate-prefix resolves instead of
being refused, and the symbol case resolves to the wrong symbol, so both branches fail.

6/6 cases pass, py_compile clean, default gate unchanged (360 resolved, 0 unresolved, 0 ambiguous).

* Identify relocation targets from the ELF tables, not from printed names

PR #15 comment 4743869738: a printed string is not an identity. A 256-character section name P is
also the printed form of a longer name P+suffix, so a relocation to the longer section was judged
against P, and an endbr64 in P could make a pointer to a ret in the longer section pass. The target's
entity now comes from the section header table, the symbol table and the relocation entries
themselves: target section, symbol value and addend, so nothing is attributed from a printed name.

objdump is still the source of instruction boundaries, so its disassembly has to be attributed to a
section. A header whose printed form belongs to two sections cannot be attributed, so the prefix is
recorded as ambiguous and every target in it is refused. Demonstrated on the fixture with a
truncating objdump: with the guard the target is refused; with the guard removed it is attributed to
whichever section was seen last, so a data pointer to a ret is not refused.

duplicate-prefix.s now has the relocation name the longer section, whose entry is a ret, so the case
asserts the target was attributed to the entity the ELF names rather than to the one sharing the
printed prefix. 6/6 cases pass, py_compile clean, default gate unchanged (360 recorded targets, 0
unresolved, 0 ambiguous, 1332 functions without endbr), committed report byte-identical, no hardware
touched.

* Record data relocations to code-symbol aliases through the symbol table

PR #15 comment 4743869751: objdump displays one symbol per address, so an alias for an address it had
already displayed had no name to match in the first-instruction map and the relocation was dropped
without being recorded - the ENDBR rule then passed over an empty set, and a pointer to a non-ENDBR
instruction could pass both IBT checks. Measured before this case existed, on the committed checker:
tests/kernel-module-gate/alias.s recorded 1 target and the alias at the entry was dropped. Resolved
through the ELF symbol table (the previous commit) both targets are recorded: the alias at the entry is
an entry pad, the alias inside the multi-byte instruction is recorded as a target that is not one.

The entry flag is now the symbol's own address (addend 0), not objdump's block header, so an alias is
an entry when the symbol it names is one. 7/7 gate cases pass, py_compile clean, default gate
unchanged (360 recorded targets, 0 unresolved, 0 ambiguous, 1332 functions without endbr), committed
report byte-identical, no hardware touched.

* Guard drm_driver.date at the 6.14 boundary

make modules failed on kernel 7.3.6: struct drm_driver has no date member there. Verified against the
source at tags - include/drm/drm_drv.h carries char *date; through v6.13 and not at v6.14 - so the
initialiser is guarded below that boundary. .major, .minor and .patchlevel are still present in the
7.3.6 header (lines 391-395), so .date is the only field that needs it.

Verified by rebuilding (build only, nothing loaded, no hardware): the DRM object and all four modules
link, and the gate is green on the rebuilt object. The recorded report is left as committed, since
rebuilding with the pinned nightly (1.102.0-nightly 6181cc4f0, 2026-11-28) changes its codegen numbers
(360 -> 205 data relocations to code, 1332 -> 1336 functions without endbr); that run's report was
reverted per the decision to keep the recorded artifact.

* Count only defined symbol-table entries as protocol exports

PR #15 comment 4744249665: export_names was built from every symbol table entry, so a name that is only
referenced (st_shndx == SHN_UNDEF) counted as an export. Measured on the new fixture, an object that
references all nine protocol names and defines none reports protocol_exports_present true - the nm
--defined-only check this set replaced rejected it, and object-only mode has no module undefined-symbol
check to catch it. The set now skips SHN_UNDEF entries; the symbols stay in elf_symbols for relocation
analysis, so a data relocation against an undefined symbol is still seen and skipped as before.

Undefined entries on the current object: 134, none of them protocol names, so the recorded gate numbers
do not move. test_gate_cases.py asserts both sides - undefined-exports.s (nine names referenced, none
defined, exports False) and defined-exports.s (the same nine defined, exports True) - and rule() reports
the export set for every case so a fixture that exports nothing asserts that. 9/9 cases pass,
py_compile clean, gate green on the current build (205 recorded targets, 0 unresolved, 0 ambiguous),
committed report left as recorded, no hardware touched.

* Refuse a section name that cannot be attributed to one section

PR #15 comment 4744249690: name_index kept only the last section index per name, so two sections
sharing a name put objdump's single disassembly header under whichever index came last. Measured on the
new fixture with the committed checker: an endbr64 in the first section was recorded under the second,
which is empty, so the .quad pointing at that empty section resolved and passed both relocation checks.
A name belonging to more than one section is not an identity, so every section sharing it is now
unattributable and its targets are refused; duplicates are counted in their own key because they are not
truncations, and the committed report gains that key with 0.

GNU as cannot produce the shape - it merges sections that share a name and warns "ignoring changed
section attributes" - so the fixture is assembled and then linked with ld -r and the linker script beside
it, which keeps two output sections under one name. Duplicate section names on the current object: 0.
10/10 gate cases pass, py_compile clean, gate green on the current build (205 recorded targets, 0
unresolved, 0 ambiguous, 0 duplicate names); the recorded report keeps its recorded numbers and gains
only the new key, whose value is 0 for the recorded object as well because as and ld merge same-named
sections, so that shape cannot occur in this object. No hardware touched.

* Set IBT explicitly in the gate test instead of depending on the host kernel config

PR #15 comment 4744572952: the refusal expectations assume IBT is enforced. Measured on this box with a
kernel config that has no CONFIG_X86_KERNEL_IBT=y: the duplicate-name case reports resolves true while the
case expects false, so the suite fails (9/10) - validate_all.sh runs the suite with nothing set, so any
host without an IBT config fails it. The shared-prefix case has the same dependency when a tool prints the
shared form, because then no entry evidence is recorded and enforcement comes only from the host config.

The test now passes NV_RS_KERNEL_IBT=1 in the checker environment for every case, and the checker honours
NV_RS_KERNEL_IBT=0 as an explicit override, which is what utils.mk documents for 0/1 but the checker did
not implement. The disabled path is asserted separately: a fixture whose code entry is a ret with a data
relocation to it reports the target as recorded and not an entry pad under enforced IBT, and reports the
ENDBR rule green over the same target with ibt_gate_enforced false when IBT is not in effect - green there
means skipped, which is the distinction the gate law requires.

Measured: 12/12 cases pass on this box and 12/12 with a no-IBT kernel config through KERNEL_OUTPUT; the
gate for the current build is unchanged (205 recorded targets, 0 unresolved, 0 ambiguous, 0 duplicate
names, 1336 functions without endbr, enforcement true from the host config). py_compile clean, no hardware
touched.

* Keep entry evidence when the disassembly cannot be attributed to a section

PR #15 comment 4744572963: first_instr was only written when cur was not None, so an endbr64 at a block
entry inside a duplicate-name section was never recorded as entry evidence. Without an IBT kernel config
or an override, that left no evidence and the ENDBR check reported green over a target that had been
recorded as unattributable - the object-based fallback the docs describe was defeated. Measured on the
fixture with NV_RS_KERNEL_IBT=0 against the committed checker: resolves true, one recorded target, the
pointer to the empty section passing both checks. Entry evidence is now recorded independently of
attribution, so enforcement comes from the object and the target is refused: ibt_gate_enforced true,
unattributable_duplicate_names 1, resolves false.

The gate numbers for the current object do not move, because every section on it is attributable: 205
recorded targets, 0 unresolved, 0 ambiguous, 0 duplicate names, 1336 functions without endbr. 13/13 cases
pass, including a case that asserts enforcement from object evidence with IBT not in effect; py_compile
clean, no hardware touched.

* Read extended section numbering from the header-0 escape fields

PR #15 summary, extended ELF section numbering: the checker took the section count and the string table
index straight from e_shnum and e_shstrndx. Per the spec (Table 3.5, gabi.xinuos.com/elf/03-sheader.html),
when e_shnum is SHN_UNDEF the real count is in sh_size of header 0, and when e_shstrndx is an escape value
the real string table index is in sh_link of header 0; a symbol whose st_shndx is SHN_XINDEX gets its
index from the associated SHT_SYMTAB_SHNDX (type 18) section. Measured on a crafted object: readelf reads
it correctly (8 headers, names resolved, symXindex resolving to index 1) while the checker saw no sections
and reported green over an empty set on an object whose two data relocations point at a ret entry.

The test builds the object itself - as and ld cannot emit extended numbering - and asserts the two targets
are recorded and refused (2 recorded, 2 not entry pads). With the SHT_SYMTAB_SHNDX section missing the
escape value names no section and objdump refuses the file, so the run exits nonzero instead of passing:
measured, "symbol number 2 references nonexistent SHT_SYMTAB_SHNDX section". Nothing is dropped silently.

15/15 gate cases pass, py_compile clean. The current object has 3859 sections, below the escape bound, so
the gate numbers do not move: 205 recorded targets, 0 unresolved, 0 ambiguous, 0 duplicate names, 1336
functions without endbr. No hardware touched.

* Load the section-name table once and decode only the name bytes

PR #15 comment (nitpick, tools/check_kernel_module.py line 16): blob(shstrndx) was called for every
section entry, re-reading the header and the table each time, and cstr copied the rest of the table
before splitting. The table is now loaded once into shnames and reused, and cstr finds the NUL in the
existing table and decodes only the name bytes. Behaviour when no terminator is present is preserved:
t.find returns -1 and the slice runs to the end of the table, the same as the split. A name offset past
the end of the table still decodes to the empty string.

No behaviour change, so no gate number moves: 15/15 cases pass, py_compile clean, gate on the current
build unchanged (205 recorded targets, 0 unresolved, 0 ambiguous, 0 duplicate names, 1336 functions
without endbr). No hardware touched.

* Correct the function-entry claim on the ENDBR rule

PR #15 comment (docs/KERNEL_COMPAT.md line 30): the line said mid-function targets fail. Measured, they
do not always. A data relocation to a label on an endbr64 inside a function passes: objdump prints every
labelled symbol as its own block header, so that label is a block entry, and the check requires endbr64 at
the resolved address with addend 0, not that the address is a function entry. Measured before the edit (tmp/gate-verify/midendbr2.s): entry endbr64, a nop, then a
labelled endbr64 at offset 5, relocated with addend 0 - resolves true, ENDBR rule true, one recorded
target. The same shape is already asserted by duplicate-symbol-prefix.s, whose relocated
symbol starts at offset 1 and is recorded as an entry pad, so the docs and the case now say the same thing.

The finding's alternative - enforce function-entry boundaries - is not open to this checker. objdump's block
boundary is the label, so a label inside a function cannot be told from an entry from its output, and a rule
keyed on symbol type would refuse the current build: all 205 recorded targets on kernel-open/nvidia/nv-rust.o_binary
come from symbols that are not STT_FUNC. Line 31 carried the same false claim ("the first instruction of a
function") and is corrected with the same measurement, so the distinction the docs draw against objtool
stands on what the checker can actually prove: a recorded instruction boundary, endbr64 at the resolved
address, addend 0.

Docs only. Gate test 16/16, py_compile clean, gate on the current build unchanged (205 recorded targets,
0 unresolved, 0 ambiguous, 0 duplicate names, 1336 functions without endbr - that counter counts block
entries, the same ambiguity). No hardware touched.

* Skip a raw reserved st_shndx as a special value, not a section reference

PR #15 comment (tools/check_kernel_module.py line 72): elf_symbols stored st_shndx after SHN_XINDEX
expansion only, so a symbol whose raw value is a reserved special value (SHN_ABS 65521) resolved through
the section header table at that number once extended numbering made the count larger than it - measured
with count 0xfff3, where 65521 is a real section as well as SHN_ABS's value. The committed checker
reported green on that object with 2 recorded code targets, one of them the absolute symbol attributed to a
section it does not name. The raw value is now recorded before expansion and the reserved range
SHN_LORESERVE..0xfffe is skipped before the section-bounds check, while SHN_XINDEX still resolves to a real
index inside that range. The symbols are not classified as unresolved or as SHN_UNDEF, and the export set
keys on the raw value, so the nine absolute protocol names in the fixture are still counted as defined
exports.

Measured after the fix on the same object: 1 recorded target (the SHN_XINDEX symbol resolving to index
65521), 0 unresolved, exports still present. The gate test builds the object itself because as and ld
cannot emit extended numbering; the symbol covering the code needs a size that spans the section, otherwise
objdump prints the section as one undecodable blob instead of the endbr64 entry, measured with symbol size
1, 5 and 14, so the fixture uses 14.

Gate test 16/16, py_compile clean, gate on the current build unchanged (205 recorded targets, 0 unresolved,
0 ambiguous, 0 duplicate names, 1336 functions without endbr - no reserved st_shndx values on it). No
hardware touched, no report key added.

* State the addend-zero condition on the ENDBR pass

PR #15 comment (docs/KERNEL_COMPAT.md line 30, second comment): the line described the resolution but not
the pass condition, so a reader could not see that the addend is part of it. Line 30 now states that a
target passes only when the instruction at the resolved address is endbr64 and the relocation addend is
zero, and that the resolved address is the symbol's value plus the addend. Measured on one instruction:
the same endbr64 at offset 5 inside a function fails through the addend-5 form (as emits the reloc against
the section symbol) and passes through the addend-0 form against the symbol.

The counter name is the reason this needs care: data_relocations_pointing_inside_a_function counts a
nonzero addend, not a target inside a function body - the addend-0 measurement reports 0 there although its
target is inside the function. On the current object no recorded target has a nonzero addend, so the counter
and its name agree there (205 recorded, 0 counted), which is why the committed report needs no change and no
key is added.

Docs only. Gate test 16/16, py_compile clean, gate on the current build unchanged (205 recorded targets, 0
unresolved, 0 ambiguous, 0 duplicate names, 1336 functions without endbr). No hardware touched.

* Rename the addend counter to what it actually counts

Decision on a docs inaccuracy found while writing the addend clause: data_relocations_pointing_inside_a_function
counted recorded targets with a nonzero addend under a name that described the target's position. Measured on
tmp/gate-verify/midendbr.o: the addend-5 reloc reports 1, the addend-0 reloc to the same endbr64 reports 0
although its target is inside the function, so the name and the value disagree on a case that exists.

The key is renamed to data_relocations_with_nonzero_addend in the checker and the printed summary
(the committed report stays untouched, since it's machine specific and we don't want to affect that).

No gate case asserts this counter (the fixtures have no nonzero addend: as emits a symbol-based reloc with
addend 0 for the aliases), so the gate test is unchanged: 16/16, py_compile clean, gate green on the current
build (205 recorded, 0 nonzero addend, 0 unresolved, 0 ambiguous, 0 duplicate names). No hardware touched.

* Say the stricter target condition does not guarantee objtool success

PR #15 comment (docs/KERNEL_COMPAT.md line 31): the line drew the comparison one way, so a reader could
take a green check as an objtool pass. Verified on the source the line already quotes (v6.12
tools/objtool/check.c): validate_ibt() iterates for_each_sec over the sections read_sections built from the
section header table, skips executable sections, sections with no reloc section, and a named exclusion list
(.discard*, .debug*, .altinstructions, .orc_unwind_ip, __ex_table, ...), and SHF_ALLOC does not appear
anywhere in check.c, so a reloc in a non-allocatable, non-executable section is checked by objtool and never
reaches the checker, which requires ALLOC (if not sections[sec][1]&ALLOC or sections[sec][1]&EXEC:continue).

Measured on one object with a ret entry relocated from both .rodata and a non-allocatable .note.mine: the
checker records 1 target and refuses that one, and says nothing about the second (0 recorded for it); objtool
would warn on both since .note.mine is not in its exclusion list. objtool itself is not installed on this box,
so the objtool side is stated from the verified source, not from a run - the checker side is the measurement.

Docs only. Gate test 16/16, py_compile clean, gate on the current build unchanged (205 recorded targets, 0
nonzero addend, 0 unresolved, 0 ambiguous, 0 duplicate names). No hardware touched.

* Scope the recorded-target numbers to the population they were measured on

PR #15 comment (docs/KERNEL_COMPAT.md line 30): the line put 205 recorded targets next to a counter whose
committed value comes from a different population. Verified: the committed report records 360 recorded targets
for object sha 5d56363b..., which no toolchain on this box reproduces; the current build is sha 4d06b634... and
measures 205. The STT_FUNC statement was measured on the current build, so line 30 now scopes it to that
population and says plainly that it is not claimed for the 360. Line 30 also now says what the rename commit
did and did not change for that metric: only the key name, value 0 either way, while the committed report as a
whole is not the current build's output - 360 recorded, the count having moved 357 -> 360 in c57b76b, plus the
ambiguous_truncated_names and unattributable_duplicate_names fields this PR added and the module checks that
only a default run produces. So a reader cannot take the committed report as a re-measurement of the current
object.

Docs only. Gate test 16/16, py_compile clean, gate on the current build unchanged (205 recorded targets, 0
nonzero addend, 0 unresolved, 0 ambiguous, 0 duplicate names), committed report untouched. No hardware touched.

* Name what this PR added to the committed report

Docs only. Gate test 16/16, py_compile clean, gate on the current build unchanged (205 recorded targets, 0
nonzero addend, 0 unresolved, 0 ambiguous, 0 duplicate names), committed report untouched. No hardware touched.

Post-rebase addendum: clarify that the report was left unchanged as per
the repo maintainer request.

* Update kernel-module-codegen-validation.json

Satisfy latest CR review

* revert changes to reports/kernel-module-codegen-validation.json

master branch as source of truth

* Fix minor nitpick

---------

Co-authored-by: arabek <arabek@noreply.codeberg.org>
2026-12-01 12:32:14 -05:00
373e801f8c rmapi/drm/uvm: multi-arch RMAPI, PCI-bound DRM atomic/syncobj/NVIDIA ioctls, and 5 R620 UVM symbols (Wave 5)
- src/nvidia/src/rmapi/gpu.rs: remove GV100-only gate (line 5250) and add chip-derived GPU names across Maxwell, Pascal, Volta (Titan V / Quadro GV100), Turing, Ampere, Ada, Hopper, and Blackwell.
- kernel-open/nvidia-drm/nvidia_rs_drm.c: bind real NVIDIA PCI GPUs when present (platform fallback), enable DRIVER_SYNCOBJ | DRIVER_SYNCOBJ_TIMELINE | DRIVER_MODESET | DRIVER_ATOMIC, and implement core DRM_IOCTL_NVIDIA_* ioctls matching stock nvidia-drm-drv.c.
- interface_dispatch.rs, uvm_interface_ffi.rs, src/nvidia/Makefile, uvm_iface_exports.c, uvm_bridge.c: implement and export all 5 new R620 nvUvmInterface* symbols (AccessBitsBufAlloc/Free/Dump, RegisterUvmEvents/DeRegisterUvmEvents -> 81 total exported symbols).
- Update HANDOFF.md and docs/PARITY_AND_UNLOCKS.md with Wave 1-5 summary.

Validated: fmt, clippy -D warnings, 1067/1067 nv-rs-core tests, IBT=1 & IBT=0 modules + check_kernel_module.py (largest_stack: 1016, 0 GOT/memcpy/SIMD), uvm-bridge, QEMU EDU non-IOMMU + IOMMU.
2026-12-01 17:05:11 +00:00
c5d51ec8f7 build: export RUSTC_BOOTSTRAP=1 when NV_RS_KERNEL_IBT=1 (fixes #31)
Stock 580.178.04 nv-kernel.o_binary unconditionally emits endbr64
(f3 0f 1e fa) prologues so CONFIG_X86_KERNEL_IBT=y kernels do not raise
#CP on indirect calls. utils.mk already enables -Z cf-protection=branch
-C jump-tables=no on IBT kernels, but stable/distro rustc (including
rust-toolchain.toml 1.100.0, Arch rust, Gentoo dev-lang/rust) rejected
-Z without RUSTC_BOOTSTRAP=1.

Exporting RUSTC_BOOTSTRAP=1 inside the NV_RS_KERNEL_IBT=1 block allows
stable rustc to emit ENDBR64 prologues directly (verified on stable
rustc 1.100.0: check_kernel_module.py passed=true, largest_stack=1000,
data_relocation_targets_without_endbr=0,
data_relocations_pointing_inside_a_function=0).
2026-12-01 05:28:22 +00:00
2be365241d kernel: detect pci_resize_resource exclude_bars from pci.h
exclude_bars arrived in 6.19 and was backported to 6.18 stable, so a
LINUX_VERSION_CODE >= 6.19 check misses those trees. Key the fourth
argument off the declaration in include/linux/pci.h, the same way
PCI_IRQ_INTX is keyed off the macro.

- kernel-open/Kbuild defines NV_RS_PCI_RESIZE_EXCLUDE_BARS when pci.h
  declares exclude_bars.
- pci_adapter.c prefers that macro, then the 6.19 and Ubuntu checks.
- docs/KERNEL_COMPAT.md records the guard.
2026-11-30 20:23:04 -05:00
caef37fa93 kernel: add RHEL 9.8+ (5.14) compat guards, firmware install, boot kit, and driver_version= param
Cherry-picked and adapted from PR #9 onto master:
- RHEL 9.8+ backport guards: #ifndef PCI_IRQ_INTX in irq_adapter.c, RHEL_RELEASE_CODE in vm_flags_set/clear (rmapi_node.c, uvm_node.c) and DMA_BUF namespace import (dmabuf_p2p.c). (nano_timer_adapter.c container_of() and rom_fw_adapter.c MAX_PAGE_ORDER were already landed on master.)
- install.sh: install extracted target/firmware/nvidia-rs/*/*.fw packs into /lib/firmware before depmod.
- contrib/rhel-5.14-boot/: boot persistence setup for RHEL 9 (modprobe/dracut/udev/systemd/nodes.sh), with empty-vs-wildcard pci_target guard in nodes.sh.
- driver_version= module parameter (default 580.178.04): overrides /proc/driver/nvidia/version, NV_ESC_CHECK_VERSION_STR, and RM 0x101/0x13e identity replies at load time so hosts running newer 580.x userspace (e.g. driver_version=580.196.07) work without breaking 580.178.04 parity.

Co-authored-by: Gaël STEPHAN <gstephan@wyplay.com>
2026-12-01 00:09:44 +00:00
4472b75ccd Follow-up to PR #10/#11: auto-gate IBT flags, fix RUSTC fallback & section-reloc gate, align stock 580.178.04 compat/FOLL_LONGTERM
- utils.mk: search ~/.cargo/bin in rustup lookup and fall back to ~/.cargo/bin/rustc; auto-gate -Z cf-protection=branch -C jump-tables=no on CONFIG_X86_KERNEL_IBT=y (overridable via NV_RS_KERNEL_IBT=0/1).
- rust-toolchain.toml: restore default stable 1.100.0 (IBT kernels build with RUSTUP_TOOLCHAIN=nightly-2026-11-29).
- tools/check_kernel_module.py: resolve section-symbol relocation targets against disassembled function-entry addresses (avoiding false mid-function failures on valid .text+<entry_off> relocs) and enforce the x86 endbr64 gate when IBT is configured or emitted.
- Stock 580.178.04 parity: omit .llseek across fops (matching nv.c/uvm.c), use container_of() in nano_timer_adapter.c (matching nv-timer.h), use #if defined(MAX_PAGE_ORDER) in rom_fw_adapter.c (matching nv-linux.h), and pass FOLL_LONGTERM in nv_rs_rmapi_os_lock_user_pages (matching os-mlock.c).
- Docs: remove scratch docs/HISTORY.md and update docs/KERNEL_COMPAT.md.
2026-11-30 17:19:30 +00:00
2f342fca9f State the MAX_ORDER/NR_PAGE_ORDERS difference instead of identical tests
PR #10 round-2 comment 4742226583: the bullet claimed order >= NR_PAGE_ORDERS was the
identical test to order >= MAX_ORDER. Verified against the tags: v6.7 mmzone.h defines
MAX_ORDER 10 (default config), so the old guard rejects order 10; v6.8 defines MAX_PAGE_ORDER
10 and NR_PAGE_ORDERS (MAX_PAGE_ORDER + 1) = 11, so the new guard admits order 10. Order 10
is the behavioral difference; the identical-test claim is removed.

Code unchanged: the new side matches the v6.8 allocator (order > MAX_PAGE_ORDER,
free_area[NR_PAGE_ORDERS]); the old side keeps the exclusive MAX_ORDER semantics from the
MAX_ORDER = 11 era - on stock v6.7 that is one order stricter than what its own allocator
accepts (page_alloc.c checks order > MAX_ORDER). Docs-only commit.
2026-11-30 17:39:55 +01:00
58655a7fcf Take elf_machine from the Machine header line and commit the verified run
readelf -h prints the Magic line before the Machine line, so splitting on the
first colon captured Magic as elf_machine. Match the Machine line instead.

Commit the report regenerated by the verification run for the four PR #10 review
fixes: py_compile clean, check_irq_mock.sh 20/20, rom-fw fixture C stage
compiles with -Wall -Wextra -Werror, gate green on the current object with the
numbers unchanged (357 data relocations to code, 0 missing pads, 0 mid-function).
elf_machine is now in the report; module_sha256 reflects the .ko currently on
disk. tmp/ added to .gitignore so scratch stays untracked per the Git rules.
2026-11-30 17:39:55 +01:00
cd5d5e7aea Pin the nightly by date to the build that produced the validation report
PR #10 review nitpick: channel = nightly is an updateable channel, not a fixed
compiler build, so the codegen the ENDBR gate measures can drift between runs.
Pin nightly-2026-11-29 - the dated archived nightly on this box (rustc
1.102.0-nightly, commit-hash 2be539647feed020b47ddbf897b8533d2d8d4c46,
commit-date 2026-11-29) that produced
reports/kernel-module-codegen-validation.json. Unstable-flag support is kept:
the pin is a nightly, just a fixed one. The box resolves the pin through rustup
in utils.mk RUSTC; the dated toolchain is fetched on first use (it is not
installed under the dated name yet - rustup will install it, no action taken
here).
2026-11-30 17:39:55 +01:00
4bec328edf Gate the endbr64 relocation rule to x86_64 objects
PR #10 review comment 4741785482: the endbr64 + zero-addend pass condition
applied to every object without reading the ELF machine type. AArch64 function
entries do not start with endbr64, so a data relocation to a function in an
ARM64 object fails the gate and make modules exits non-zero on ARM64 hosts -
the aarch64 build path in utils.mk is unchanged by this PR, so the failure is
new in the PR.

Read the e_machine field via readelf -h and enforce the endbr64 + zero-addend
rule only for x86_64 objects; every other check stays active on ARM64. The
report carries elf_machine. Proven: current x86 object unchanged, gate green;
synthetic AArch64 object with a data relocation to a non-endbr entry passes
gated and fails when x86 enforcement is forced on the same object.
2026-11-30 17:39:55 +01:00
7ea1cd4000 Resolve section-symbol relocations as code targets in the gate check
PR #10 review comment 4741785469: the checker resolved a data-relocation target
only as a function label or a .text.<fn> name, so relocations against a section
symbol (.text+0x20) were never added to data_relocs and skipped the
zero-addend + endbr64 pass condition, letting the gate pass on a code target
without a landing pad. objtool's validate_ibt_data_reloc does resolve them:
find_insn(sym->sec, sym->offset + addend).

Record every instruction address during disassembly, collect allocatable
executable sections from readelf flags, and resolve section-symbol relocations
to the instruction at the addend; the existing endbr64/zero-addend checks apply
to resolved code targets, and targets that do not resolve to code remain out of
the pass condition.

Proven on synthetic objects: .rodata pointer to .text+4 (mid-function nop) now
fails the check; the same section at addend 0 on an endbr64 entry passes. The
current object has no section-symbol relocations - numbers unchanged (357/0/0).
2026-11-30 17:39:55 +01:00
75c70e0b3f Define LINUX_VERSION_CODE and KERNEL_VERSION in the fixture mocks
PR #10 review comment 4741785453: the version guards in irq_adapter.c:17 and
rom_fw_adapter.c:185 are preprocessed in the host-fixture builds (the fixture .c
files include those adapters directly), but no mock defines KERNEL_VERSION, so
the #if lines are hard preprocessor errors - the documented old-name fallback
never runs. An undefined function-like macro in an #if is not a silent 0.

Defined LINUX_VERSION_CODE 0 + KERNEL_VERSION(a,b,c) in tests/irq-mock/irq_mock.h
and tests/rom-fw-mock/rom_fw_mock.h; with 0 every >= guard selects the old-name
branch, which the mocks already provide (PCI_IRQ_LEGACY, MAX_ORDER).

Verified: tools/check_irq_mock.sh 20/20; the rom-fw fixture C stage now preprocesses
(the full script still fails later at a pre-existing Rust-stage defect also present on
master). Only these two fixture builds compile guarded sources.
2026-11-30 17:39:55 +01:00
42dc565c12 The gate now judges what objtool enforces, and the strict rule stays visible as a count
- check_kernel_module.py: pass condition = every relocation in an allocatable non-executable section that resolves to code must target a landing-pad entry (addend 0). This be objtool's own rule (check.c:4611 accepts a target it knows is not an IBT target), so the gate can be green honestly instead of demanding something rustc cannot deliver.
- Strict every-entry check stays as an informational count (functions_without_endbr = 1332 on the current object) - visible, not a false failure.
- Proven against objtool on four cases, all agreeing: table without pads (both fail), table with branch protection (both pass), forced jump table (objtool errors, the check flags the mid-function relocations), current object (both pass).
- Gotchas written down: readelf pads [18] as one token but [ 5] as two, so flags were landing in the wrong column; objtool returns 0 on warnings unless --werror (CONFIG_OBJTOOL_WERROR=y adds it); the gate disassembles raw (-dr) so names match readelf.
- Gate is green on the current object: 357 data relocations to code, 0 missing pads, 0 mid-function. Counts move with the build, so read them as measured-at-the-time numbers.
2026-11-30 17:39:55 +01:00
94e9bbfeba Nightly -Z cf-protection=branch so the Rust object gets the ENDBR objtool demands
- utils.mk RUST_KERNEL_FLAGS (x86 kernel target) gains -Z cf-protection=branch; the ARM64 branch be left alone — IBT be an x86 CET feature and no BTI was ordered.
- rust-toolchain.toml moved from pinned stable 1.100.0 to nightly, since the flag be unstable. Verified against the tool: rustc --print=codegen-options on 1.100.0 lists nothing for CF protection, and the unstable book lists none/branch/full for the LLVM backend.
- Make RUSTC explicit so the pinned toolchain is what actually runs:
  - utils.mk: RUSTC ?= $(or $(shell rustup which rustc),$(shell command -v rustc)). Resolves the toolchain pinned in rust-toolchain.toml instead of trusting PATH order; still overridable with RUSTC=..., and no hardcoded ~/.cargo path that may not exist on another box.
  - The gotcha that made this necessary is recorded in the scroll: plain rustc here be the system stable 1.100.0 and rejects -Z. Boxes without rustup still fail - honest limit, no magic.
2026-11-30 17:39:55 +01:00
a96a43d238 Write down why the build still dies: objtool wants ENDBR and the Rust codegen gives it none
- CONFIG_X86_KERNEL_IBT=y + CONFIG_OBJTOOL_WERROR=y on the 7.3.6 box: nvidia_rs.o is deleted, no .ko, gate unsatisfiable.
- Measured, not guessed: C shims have ENDBR at every entry (21/37/9/58 across uvm_node/rmapi_node/diagnostic/gpu_owner .o files); nv-rust.o_binary has 1674 entries and ZERO. rustc 1.100.0 stable has no cf-protection option.
- The original driver DOES start its functions with ENDBR64 (own asserts, f30f1efac3 = ENDBR64; RET), so the fix path that emits ENDBR be the parity-correct one, not just the build-correct one.
2026-11-30 17:39:55 +01:00
6cca7388b1 MODULE_IMPORT_NS wants a string literal from 6.13 — the identifier form be dead
- Boundary proven at the tags: v5.16 `MODULE_IMPORT_NS(ns) MODULE_INFO(import_ns, #ns)`, v6.6/v6.12 `__stringify(ns)` (so an identifier worked), v6.13 `MODULE_INFO(import_ns, ns)` — with MODULE_INFO static_asserting sizeof(info)-1 == strlen(info), so the argument must be a literal. The running 7.3.6 headers show in-tree callers passing "PWM" and "PWM_MC33XS2410", confirming it.
- Kept the existing >=5.16 existence guard as an #elif; the literal form only became legal at 6.13, and the stringifying side must NOT be handed a literal (it would embed the quotes and change the namespace name).
2026-11-30 17:39:55 +01:00
b0cbb6c192 PCI_IRQ_LEGACY was renamed PCI_IRQ_INTX in 6.10 — same bit, new name
- Boundary proven at the tags: pci.h through v6.9 carries PCI_IRQ_LEGACY, v6.10 has only PCI_IRQ_INTX; INTX itself exists from v6.8 and both be (1 << 0), so no value changed — only the spelling.
- One compat define (NV_RS_PCI_IRQ_INTX) feeds both call sites instead of two clunky inline guards in expressions. The project already calls the flag NV_RS_IRQ_INTX, so the naming lines up.
- <linux/version.h> added inside the non-fixture branch; note the fixture builds do not see version.h, so they land on the old-name side and the mocks must keep PCI_IRQ_LEGACY.
2026-11-30 17:39:55 +01:00
ed430cf001 from_timer rotted in 6.16 — timer_container_of does the same job
- Boundary proven at the tags: timer.h defines from_timer through v6.15 and only timer_container_of from v6.16 (and the running 7.3.6 kernel).
- Same shape: timer_container_of(var, callback_timer, field) is container_of(callback_timer, typeof(*var), field) — a drop-in, no semantic change to the jiffy callback.
2026-11-30 17:39:55 +01:00
d9a08da230 hrtimer_init got buried in 6.15 — hrtimer_setup takes the job
- Boundary proven at the tags: hrtimer.h still declares hrtimer_init through v6.14 and not at v6.15/6.16/6.17; hrtimer_setup is there from v6.13. Guarded at the death point (6.15), so the old side stays valid for everything below.
- New side sets the callback in the call: hrtimer_setup(&owner->timer,fire,CLOCK_MONOTONIC,HRTIMER_MODE_REL); old side keeps init + owner->timer.function=fire. Same behavior, one less foot.
- <linux/version.h> added (the file had no guard before).
2026-11-30 17:39:55 +01:00
ee3f7ebcbf MAX_ORDER be six feet under since 6.8 — NR_PAGE_ORDERS takes over, no off-by-one
- Boundary proven at the tags: mmzone.h at v6.7 carries #define MAX_ORDER 10, v6.8 has MAX_PAGE_ORDER + NR_PAGE_ORDERS instead, and the running 7.3.6 kernel agrees.
- NR_PAGE_ORDERS == MAX_PAGE_ORDER + 1, and the old test was `order >= MAX_ORDER`, so the guarded test be exactly the same range check. Anyone writing `order > MAX_PAGE_ORDER` from memory would have shifted the limit by one — not here.
- <linux/version.h> added to the file (it had no guard before).
2026-11-30 17:39:55 +01:00
91ef1e1b6f vm_flags be const from 6.3 — five writes now use the helpers, ye blind bilge rats
- Boundary proven by fetching mm.h at the tags: vm_flags_set/vm_flags_clear absent at v6.2, present at v6.3, and the running 7.3.6 kernel has them. rmapi_node.c x4 and uvm_node.c x1 take the helpers on the >=6.3 side, plain |= / &= below.
- Reads be untouched: a const member is still readable, so vm_get_page_prot(vma->vm_flags) and the shared_rw test stand as they was.
2026-11-30 17:39:55 +01:00
c55ca81524 Guard the dead no_llseek for kernels >= 6.12 — the mangy symbol is two years six feet under
- The kernel took no_llseek out tree-wide in cb787f4ac0c2 (v6.12, 2024-09-27); the 7.3.6-gentoo build choked on the dead name, same as the in-tree drivers mechanically scrubbed.
- All 5 file_operations llseek initializers in kernel-open (diagnostic.c, gpu_owner.c, uvm_node.c, rmapi_node.c x2) now take no_llseek on kernels < 6.12 and noop_llseek on >= 6.12, with <linux/version.h> pulled in.
- Boundary proven from the kernel git itself + headers at the tags: 868941b14441 (v6.0) turned no_llseek into #define NULL, cb787f4ac0c2 (v6.12) took the name out. noop_llseek survived and is what in-tree DRM/accel use.
- Galley scroll docs/KERNEL_COMPAT.md + mast pointer line, per the chart law.
- The lseek behavior difference (noop_llseek returns f_pos, old side failed with -ESPIPE) is documented in the scroll — no silent semantics smuggled aboard.

Apply PR #7 review: UVM node keeps stock -ESPIPE, docs stop lying about seek mode

- uvm_node.c ≥6.12 branch: noop_llseek -> NULL. Verified stock 580.178.04 uvm.c uvm_fops carries NO llseek callback, so stock lseek() be -ESPIPE; noop_llseek returned f_pos — a bloody parity break against the exact-parity law. NULL keeps -ESPIPE because fs/open.c clears FMODE_LSEEK for nodes with NULL llseek (verified at the v6.12 tag and the running 7.3.6 kernel).
- docs/KERNEL_COMPAT.md: the behavior difference applies ONLY to nodes whose open path leaves seek mode enabled. The diagnostic node and both RMAPI nodes call nonseekable_open() in their open callbacks (diagnostic.c:78, rmapi_node.c:740,800), so they keep returning -ESPIPE on ≥6.12 — the old blanket claim was a lie. The GPU open node (open_gpu clears no seek mode) be the only node where lseek succeeds on ≥6.12.
- Other kernel branches unchanged, as the review asked.

GPU open node keeps stock -ESPIPE: kill the lie that stock used no_llseek

- gpu_owner.c >=6.12 branch: noop_llseek -> NULL. Stock ground truth at tag 580.178.04 (kernel-open/nvidia/nv.c:236 nvidia_fops) carries NO .llseek field at all -> NULL -> FMODE_LSEEK cleared at open -> lseek() = -ESPIPE, on every kernel version. Tags 470.256.02/535.104.05/550.144.03 show zero llseek references, so stock never had a llseek handler. Our noop_llseek there made lseek() SUCCEED (returns f_pos) — a real parity break, and CodeRabbit let it slide because it only looked at the handler name, not the open path. open_gpu clears no seek mode, so the handler actually runs.
- Retracted: 'U no_llseek' in reports/kernel-module-codegen-validation.json is OUR OWN module's undefined-symbol list, not stock evidence. No blob-level proof exists on this box: nv-kernel.o_binary is not shipped in the repo, no stock nvidia*.ko under /lib/modules/7.3.6-gentoo, and reports/original-live-init-pt-3/runtime-code/kcore covers only 2 PT_LOAD segments (0xffffffffaea00000+0x1003000, 0xffffffffc03a0000+0x25bc000) — nvidia_fops at 0xffffffffc7858ee0 falls outside, so the struct bytes can't be read. Only kallsyms proves the symbol exists in the live module.
- Docs seek-mode law rewritten: noop_llseek may only be used where seek mode is already disabled (the three nonseekable_open() nodes); nodes leaving FMODE_LSEEK set (uvm_node.c, gpu_owner.c) must take NULL. Verified mechanism: fs/open.c:969 clears FMODE_LSEEK for NULL llseek at v6.12; vfs_llseek returns -ESPIPE when the mode is clear and dereferences the handler only when set; on v5.15 no_llseek is the fallback for a NULL handler. no_llseek (NULL since v6.0) and NULL be behaviorally identical, so the pre-6.12 side be untouched as the review asked.
2026-11-30 17:39:55 +01:00
e77135892a Fix appendix links in blog post to absolute GitHub URLs
The relative links to reports/nvidia-580-artificial-restrictions-rea.md
404 on the published site; point them at the blob URL instead.
2026-11-29 15:54:36 +00:00
b88fc06274 gv100: add PGRAPH reload reset, set all-bin-safe 1290 MHz GPC default, and verify 8-GPU DDP & llama.cpp 2026-11-29 01:46:39 +00:00
77cfc897f3 gv100: wire live PROM BIT VBIOS version, stabilize 8-GPU NVLink PLL init, and publish 8x V100 milestone benchmarks 2026-11-29 00:29:10 +00:00
f03e4a2f7b docs: record DLCMD_INITPLL=0x20 (40.05/79.40 GB/s NV2 P2P) and reverted CE/MIF tests 2026-11-28 22:32:57 +00:00
4e77c1b9a1 docs: record Round 3 BAR1 WC and NVLink MINION equalization/MIF credit wins 2026-11-28 21:55:57 +00:00
608a45fc31 docs: mark R1-03 reverted after bare-metal multi-peer verification 2026-11-28 20:24:23 +00:00
d4ec973fc8 docs: record GV100 performance optimization results and experiment ledger 2026-11-28 20:12:44 +00:00
5bb56980fb feat(gv100): dynamic P0 thermal guard + 1425 MHz GPC / 1320 MHz XBAR / 1080 MHz HBM2 (>1 TB/s) 2026-11-28 06:34:25 +00:00
b5864d99ec feat(gv100): add P0 voltage + NAFLL boost bring-up and head-to-head benchmark suite 2026-11-28 06:08:32 +00:00
f62ba9cd73 docs: streamline README for general audience and move parity/unlock tables to docs/PARITY_AND_UNLOCKS.md 2026-11-28 05:24:55 +00:00
0fb20543ea Add accessible narrative intro and closing takeaway to artificial-restrictions blog post 2026-11-27 21:12:37 +00:00
e4b55ee68b Add technical blog post documenting NVIDIA 580.178.04 artificial restrictions, REA methodology, and nvdriver unlocks 2026-11-27 21:06:30 +00:00