mirror of
https://github.com/QuixiAI/nvdriver.git
synced 2026-12-06 06:28:39 +00:00
- Updated tools/post_reboot.sh to check kernel oops taint bit and stuck driver tasks instead of <86400s uptime - Level 7 hardware regression passed on 0000:b3:00.0 (module 37e6fa430835eee2b426019db3ad70eeb7a9e9070c09c84bd9b973cf56cbe529, 107 inventory words, 0 static mismatches, CUDA baseline verified before and after) - Updated .gitignore to exclude build archives (*.a, *.rlib), __pycache__, and raw trace dumps
414 lines
20 KiB
Python
414 lines
20 KiB
Python
#!/usr/bin/env python3
|
|
"""Run the original producers of the NVDEC HS run's inputs and write an oracle.
|
|
|
|
The NVDEC HS run (core gpu::nvdec_hs_run, tools/check_gpu_nvdec_hs_run_binary.py)
|
|
takes several answers from its fixture. This harness executes the original code
|
|
that produces four of them, so the kernel can supply them without constants
|
|
borrowed from a test:
|
|
|
|
X KernelFifo+1b8 (_nv040256rm with _nv040255rm) over the 16 engine records the
|
|
original constructor builds from the physical V100 device-info table
|
|
(reports/engine-cache-binary.json, physical_gv100.table_bytes): every input
|
|
type 0..14, 16 and 17 with every value a record holds in that column plus a
|
|
missing one, and every output type 0..14. The NVDEC run asks (0, 8) for the
|
|
engine descriptor and (8, 6) for the OBJMC engine index.
|
|
B The OBJBSP object as its object-create routine _nv006624rm builds it: the
|
|
creator _nv005713rm and the constructor _nv003356rm on zeroed storage, with
|
|
the interface constructor _nv003365rm, which stores the interface byte +10
|
|
(OBJBSP+f8) and tail-calls the Falcon object creation _nv028792rm, and the
|
|
property initializer _nv005811rm.
|
|
C The NVDEC engine constructor _nv046468rm (OBJBSP+1c8): the registry values
|
|
RmDisableBsp, RmDisableBspLoad and RMForceNvdecUcodeEncryption, the engine
|
|
descriptor and the bytes it stores.
|
|
S _nv031478rm (gpu, 0, 0, begin, name) with _nv031447rm and _nv031395rm:
|
|
whether it touches the thread state, by GPU+cac and the manager's device.
|
|
|
|
Fixture-supplied: diagnostics, the registry read _nv049786rm, the Falcon object
|
|
creation _nv028792rm (recorded, returns zero), the Falcon configuration
|
|
_nv028412rm (recorded), the base constructors _nv003389rm and _nv037808rm
|
|
(recorded, return zero), the system object with its manager and device table,
|
|
the device's mask _nv031338rm, the thread state _nv059477rm and the KernelFifo
|
|
function at +170. No hardware is involved.
|
|
"""
|
|
import bisect
|
|
import hashlib
|
|
import itertools
|
|
import json
|
|
from pathlib import Path
|
|
import struct
|
|
|
|
from elftools.elf.elffile import ELFFile
|
|
from unicorn import UC_ARCH_X86, UC_HOOK_CODE, UC_HOOK_MEM_WRITE, UC_MODE_64, Uc
|
|
from unicorn.x86_const import (UC_X86_REG_R8, UC_X86_REG_R9, UC_X86_REG_RAX, UC_X86_REG_RBP,
|
|
UC_X86_REG_RCX, UC_X86_REG_RDI, UC_X86_REG_RDX, UC_X86_REG_RIP,
|
|
UC_X86_REG_RSI, UC_X86_REG_RSP)
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
ORIGINAL = Path("/home/geodd/nvidia-driver/analysis-580.178.04/extracted/kernel/nvidia/nv-kernel.o_binary")
|
|
DIGEST = "5269a23ffba19a17fe16f076463e7ad4151254659441d1711bee6c6221ff6f4b"
|
|
TEXT, RODATA, DATA, STACK, STOP = 0x10000000, 0x20000000, 0x30000000, 0x40000000, 0x50000000
|
|
OTHER = 0x60000000
|
|
(GPU, KFIFO, TABLE, NVDEC, FLCN, CHIP, RM, THREAD, OUT, SYSTEM, MANAGER, DEVICE) = (
|
|
DATA, DATA + 0x10000, DATA + 0x12000, DATA + 0x14000, DATA + 0x16000, DATA + 0x18000,
|
|
DATA + 0x19000, DATA + 0x1a000, DATA + 0x1b000, DATA + 0x1c000, DATA + 0x1d000,
|
|
DATA + 0x1f000)
|
|
INDIRECT, KFIFO_170 = STOP + 0x100, STOP + 0x200
|
|
OBJECT_BYTES = 0x4f8
|
|
ROOTS = ("_nv040256rm", "_nv005713rm", "_nv003356rm", "_nv046468rm", "_nv031478rm")
|
|
HOOKED = ("_nv047869rm", "_nv046745rm", "_nv046747rm", "_nv049786rm", "_nv028792rm",
|
|
"_nv028412rm", "_nv003389rm", "_nv037808rm", "_nv031338rm", "_nv059477rm",
|
|
"_nv047868rm")
|
|
KEYS = ("RmDisableBsp", "RmDisableBspLoad", "RMForceNvdecUcodeEncryption")
|
|
|
|
assert hashlib.sha256(ORIGINAL.read_bytes()).hexdigest() == DIGEST
|
|
physical = json.loads((ROOT / "reports/engine-cache-binary.json").read_text())
|
|
assert physical["artifact_sha256"] == DIGEST
|
|
physical = physical["physical_gv100"]
|
|
table = bytes(physical["table_bytes"])
|
|
assert len(table) == 100 * physical["record_count"] == 1600
|
|
bindings = json.loads((ROOT / "reports/gv100-engine-hal-bindings.json").read_text())
|
|
assert bindings["original_sha256"] == DIGEST
|
|
nvdec_class = next(entry for entry in bindings["classes"] if entry["class_label"] == "OBJBSP")
|
|
assert nvdec_class["object_creators"] == ["_nv005713rm"]
|
|
# Since the 2026-11-19 correction the report also lists the interface
|
|
# constructors _nv003365rm and _nv003371rm, which section B runs here itself.
|
|
assert "_nv005811rm" in nvdec_class["property_binders"]
|
|
assert nvdec_class["argument_conventions"]["_nv005811rm"]["order"] == "chip, RM"
|
|
assert {offset: nvdec_class["hal_properties"][offset]["value"]
|
|
for offset in ("0xf8", "0xfa", "0xfb")} == {"0xf8": "0x1", "0xfa": "0x0", "0xfb": "0x1"}
|
|
|
|
with ORIGINAL.open("rb") as stream:
|
|
elf = ELFFile(stream)
|
|
symbols = list(elf.get_section_by_name(".symtab").iter_symbols())
|
|
by_name = {symbol.name: symbol for symbol in symbols}
|
|
text = bytearray(elf.get_section_by_name(".text").data())
|
|
rodata = elf.get_section_by_name(".rodata").data()
|
|
text_section = elf.get_section_index(".text")
|
|
rodata_section = elf.get_section_index(".rodata")
|
|
starts = sorted((symbol["st_value"], symbol["st_size"], symbol.name) for symbol in symbols
|
|
if symbol["st_shndx"] == text_section and symbol["st_size"])
|
|
relocations = sorted((relocation["r_offset"], relocation["r_info_type"],
|
|
relocation["r_info_sym"], relocation["r_addend"])
|
|
for relocation in elf.get_section_by_name(".rela.text").iter_relocations())
|
|
|
|
|
|
|
|
def other(symbol):
|
|
section = symbol["st_shndx"]
|
|
return OTHER + ((section if isinstance(section, int) else 0xff) << 24) + symbol["st_value"]
|
|
|
|
|
|
offsets = [entry[0] for entry in relocations]
|
|
entries = {symbol[0]: symbol[2] for symbol in starts}
|
|
bounds = [symbol[0] for symbol in starts]
|
|
executed, pending = [], list(ROOTS)
|
|
while pending:
|
|
name = pending.pop()
|
|
if name in executed or name in HOOKED:
|
|
continue
|
|
executed.append(name)
|
|
start, size = by_name[name]["st_value"], by_name[name]["st_size"]
|
|
for offset, kind, index, addend in relocations[bisect.bisect_left(offsets, start):
|
|
bisect.bisect_left(offsets, start + size)]:
|
|
target = symbols[index]
|
|
if target.name == "__x86_indirect_thunk_rax":
|
|
address = INDIRECT
|
|
elif target["st_shndx"] == rodata_section:
|
|
address = RODATA + target["st_value"]
|
|
elif target["st_shndx"] != text_section:
|
|
# Data of other sections is not mapped, except the page of the
|
|
# system-object pointer; any other access would stop the run.
|
|
address = other(target)
|
|
else:
|
|
address = TEXT + target["st_value"]
|
|
# Follow direct calls and tail calls only, not stored pointers.
|
|
if kind in (2, 4) and text[offset - 1] in (0xe8, 0xe9):
|
|
callee = entries.get(target["st_value"] + addend + 4)
|
|
if callee and callee not in HOOKED:
|
|
pending.append(callee)
|
|
value = address + addend
|
|
if kind in (2, 4):
|
|
value -= TEXT + offset
|
|
else:
|
|
assert kind == 11, kind
|
|
struct.pack_into("<i", text, offset, value)
|
|
|
|
cpu = Uc(UC_ARCH_X86, UC_MODE_64)
|
|
for address, size in ((TEXT, (len(text) + 4095) & ~4095), (RODATA, (len(rodata) + 4095) & ~4095),
|
|
(DATA, 0x20000), (STACK, 0x10000), (STOP, 0x1000)):
|
|
cpu.mem_map(address, size)
|
|
cpu.mem_write(TEXT, bytes(text))
|
|
cpu.mem_write(RODATA, rodata)
|
|
# The system object pointer _nv029075rm, the manager at +1e0 of that object
|
|
# and the manager's 32 device pointers at +970.
|
|
SYSTEM_POINTER = other(by_name["_nv029075rm"])
|
|
cpu.mem_map(SYSTEM_POINTER & ~4095, 0x1000)
|
|
cpu.mem_write(SYSTEM_POINTER, struct.pack("<Q", SYSTEM))
|
|
cpu.mem_write(SYSTEM + 0x1e0, struct.pack("<Q", MANAGER))
|
|
case, trace = {}, []
|
|
|
|
|
|
def function_at(address):
|
|
index = bisect.bisect_right(bounds, address - TEXT) - 1
|
|
start, size, name = starts[index]
|
|
return name if address - TEXT < start + size else None
|
|
|
|
|
|
def string(address):
|
|
data = bytes(cpu.mem_read(address, 64))
|
|
return data[:data.index(0)].decode()
|
|
|
|
|
|
def leave(emu, value=0):
|
|
rsp = emu.reg_read(UC_X86_REG_RSP)
|
|
emu.reg_write(UC_X86_REG_RSP, rsp + 8)
|
|
emu.reg_write(UC_X86_REG_RAX, value)
|
|
emu.reg_write(UC_X86_REG_RIP, struct.unpack("<Q", emu.mem_read(rsp, 8))[0])
|
|
|
|
|
|
def leaf(name):
|
|
def run(emu, address, size, unused):
|
|
full = [emu.reg_read(register) for register in (
|
|
UC_X86_REG_RDI, UC_X86_REG_RSI, UC_X86_REG_RDX, UC_X86_REG_RCX, UC_X86_REG_R8,
|
|
UC_X86_REG_R9)]
|
|
low = [value & 0xffffffff for value in full]
|
|
value = 0
|
|
if name in ("_nv047869rm", "_nv047868rm", "_nv046745rm", "_nv046747rm"):
|
|
case["diagnostics"] += 1
|
|
elif name == "_nv049786rm":
|
|
# (gpu, key, &value): the status; the value only on success.
|
|
assert full[0] == GPU
|
|
status, answer = case["registry"][string(full[1])]
|
|
trace.append(f"k:{string(full[1])}")
|
|
if status == 0:
|
|
emu.mem_write(full[2], struct.pack("<I", answer))
|
|
value = status
|
|
elif name == "_nv028792rm":
|
|
trace.append(f"flcn:{full[0] - NVDEC:x}")
|
|
elif name == "_nv028412rm":
|
|
assert (full[0], full[1]) == (GPU, FLCN)
|
|
trace.append("cfg")
|
|
elif name in ("_nv003389rm", "_nv037808rm"):
|
|
trace.append(f"{name}:{full[0] - NVDEC:x}")
|
|
elif name == "_nv031338rm":
|
|
# The device object of the manager's table: its GPU mask.
|
|
assert full[0] == DEVICE
|
|
trace.append("mask")
|
|
value = case["mask"]
|
|
elif name == "_nv059477rm":
|
|
# (&thread state, gpu): the status.
|
|
assert full[1] == GPU
|
|
trace.append("ts")
|
|
emu.mem_write(full[0], struct.pack("<Q", THREAD))
|
|
value = case["thread_status"]
|
|
elif name == "KFIFO_170":
|
|
assert (full[0], full[1]) == (GPU, KFIFO)
|
|
value = case["subcontexts"]
|
|
else:
|
|
raise AssertionError(name)
|
|
leave(emu, value)
|
|
return run
|
|
|
|
|
|
cpu.hook_add(UC_HOOK_CODE, lambda emu, address, size, unused: emu.reg_write(
|
|
UC_X86_REG_RIP, emu.reg_read(UC_X86_REG_RAX)), begin=INDIRECT, end=INDIRECT)
|
|
for hooked in HOOKED:
|
|
entry = TEXT + by_name[hooked]["st_value"]
|
|
cpu.hook_add(UC_HOOK_CODE, leaf(hooked), begin=entry, end=entry)
|
|
cpu.hook_add(UC_HOOK_CODE, leaf("KFIFO_170"), begin=KFIFO_170, end=KFIFO_170)
|
|
stores = []
|
|
cpu.hook_add(UC_HOOK_MEM_WRITE, lambda emu, access, address, size, value, unused: stores.append(
|
|
(address - NVDEC, size, value & ((1 << 8 * size) - 1),
|
|
function_at(emu.reg_read(UC_X86_REG_RIP)))), begin=NVDEC + 0xf8, end=NVDEC + 0xff)
|
|
|
|
|
|
def call(name, *arguments):
|
|
for register, argument in zip((UC_X86_REG_RDI, UC_X86_REG_RSI, UC_X86_REG_RDX,
|
|
UC_X86_REG_RCX, UC_X86_REG_R8, UC_X86_REG_R9), arguments):
|
|
cpu.reg_write(register, argument)
|
|
rsp = STACK + 0xffc8
|
|
cpu.reg_write(UC_X86_REG_RSP, rsp)
|
|
cpu.reg_write(UC_X86_REG_RBP, STACK + 0x8000)
|
|
cpu.mem_write(rsp, struct.pack("<Q", STOP))
|
|
case["diagnostics"] = 0
|
|
cpu.emu_start(TEXT + by_name[name]["st_value"], STOP, count=400000)
|
|
assert cpu.reg_read(UC_X86_REG_RIP) == STOP, name
|
|
return cpu.reg_read(UC_X86_REG_RAX) & 0xffffffff
|
|
|
|
|
|
def q(address, value):
|
|
cpu.mem_write(address, struct.pack("<Q", value))
|
|
|
|
|
|
def d(address, value):
|
|
cpu.mem_write(address, struct.pack("<I", value))
|
|
|
|
|
|
def word(address):
|
|
return struct.unpack("<I", cpu.mem_read(address, 4))[0]
|
|
|
|
|
|
def byte(address):
|
|
return cpu.mem_read(address, 1)[0]
|
|
|
|
|
|
rows = []
|
|
|
|
# X: the engine lookup over the physical table. The engine-info structure is
|
|
# at KernelFifo+2f0: the record count at +50 and the record pointer at +58.
|
|
cpu.mem_write(TABLE, table)
|
|
d(KFIFO + 0x340, physical["record_count"])
|
|
q(KFIFO + 0x348, TABLE)
|
|
q(KFIFO + 0x170, KFIFO_170)
|
|
records = [struct.unpack("<21I", table[index * 100:index * 100 + 84]) for index in range(16)]
|
|
rows.append("T " + table.hex())
|
|
lookups = 0
|
|
for input_type in (*range(15), 16, 17):
|
|
if input_type < 15:
|
|
values = sorted({record[input_type] for record in records} | {0xdeadbeef})
|
|
elif input_type == 16:
|
|
values = [0, 4, 15, 16, 0xffffffff]
|
|
else:
|
|
values = sorted({record[16] for record in records} | {record[17] for record in records}
|
|
| {0x2f, 0xdeadbeef})
|
|
# Input type 4 asks the function at KernelFifo+170 for the number of
|
|
# values after the Graphics engine's that mean the Graphics engine.
|
|
for value, subcontexts in itertools.product(values, (0, 1, 64) if input_type == 4 else (0,)):
|
|
for output_type in range(15):
|
|
case["subcontexts"] = subcontexts
|
|
d(OUT, 0xaabbccdd)
|
|
status = call("_nv040256rm", GPU, KFIFO, input_type, value, output_type, OUT)
|
|
rows.append(f"X {input_type:x} {value:x} {output_type:x} {subcontexts:x};"
|
|
f"{status:x} {word(OUT):x}")
|
|
lookups += 1
|
|
case["subcontexts"] = 0
|
|
d(OUT, 0xaabbccdd)
|
|
assert call("_nv040256rm", GPU, KFIFO, 0, 0x8f99e100, 8, OUT) == 0
|
|
engine_index = word(OUT)
|
|
assert call("_nv040256rm", GPU, KFIFO, 8, engine_index, 6, OUT) == 0
|
|
reset_bit = word(OUT)
|
|
physical_answers = {"descriptor 0x8f99e100 to OBJMC engine index": f"{engine_index:#x}",
|
|
"that index to PMC enable bit": reset_bit}
|
|
|
|
# B: object creation. _nv006624rm clears 0x4f8 bytes, stores the creation flags
|
|
# at +3c, then calls the creator and the constructor with the two objects its
|
|
# class casts return; the functions executed here read only word +10 of each.
|
|
cpu.mem_write(CHIP + 0x10, struct.pack("<H", 0x23))
|
|
cpu.mem_write(RM + 0x10, struct.pack("<H", 2))
|
|
constructed = []
|
|
for fill in (0, 0xa5):
|
|
cpu.mem_write(NVDEC, bytes(OBJECT_BYTES))
|
|
# The interface bytes the constructor does not store keep the allocation's
|
|
# contents; a second pass with other contents shows which ones it stores.
|
|
cpu.mem_write(NVDEC + 0xf8, bytes([fill] * 8))
|
|
stores.clear()
|
|
trace.clear()
|
|
call("_nv005713rm", NVDEC, CHIP, RM)
|
|
status = call("_nv003356rm", NVDEC, CHIP, RM)
|
|
interface = [byte(NVDEC + 0xf8 + index) for index in range(8)]
|
|
properties = (byte(NVDEC + 0x50), byte(NVDEC + 0x423))
|
|
rows.append(f"B {fill:x};{status:x};" + " ".join(f"{value:x}" for value in interface)
|
|
+ f";{properties[0]:x} {properties[1]:x};" + " ".join(trace))
|
|
constructed.append({
|
|
"allocation_fill": f"{fill:#x}", "status": status,
|
|
"interface_bytes_f8_to_ff": [f"{value:#x}" for value in interface],
|
|
"stores_to_f8_to_fe": [{"offset": f"{offset:#x}", "bytes": size, "value": f"{value:#x}",
|
|
"function": function}
|
|
for offset, size, value, function in stores],
|
|
"OBJBSP+0x50": properties[0], "OBJBSP+0x423": properties[1], "calls": list(trace)})
|
|
assert status == 0 and interface[0] == 1 and interface[1] == fill, constructed[-1]
|
|
# Byte +10 (f8), +12, +13 and +14 by the interface constructor, +14 (fc)
|
|
# again by the property initializer; +11 (f9) and f9..ff otherwise untouched.
|
|
assert [store[:3] for store in stores if store[3] == "_nv003365rm"] == [
|
|
(0xf8, 1, 1), (0xfa, 1, 0), (0xfc, 1, 0), (0xfb, 1, 1)], stores
|
|
assert [store for store in stores if store[3] != "_nv003365rm"] == [
|
|
(0xfc, 1, 0, "_nv005811rm")], stores
|
|
assert "flcn:e8" in trace, trace
|
|
assert struct.unpack("<Q", cpu.mem_read(NVDEC + 0x1a0, 8))[0] == NVDEC + 0xe8
|
|
|
|
# C: the engine constructor on that object, with its Falcon attached as
|
|
# _nv028792rm does (interface +18) and engine instance 0 at +4a0.
|
|
ANSWERS = ((0xffff, 0), (0, 0), (0, 1), (0, 2), (0x40, 1))
|
|
for answers in itertools.product(ANSWERS, repeat=3):
|
|
for instance, byte_fb in ((0, 0), (0, 1), (1, 0)):
|
|
cpu.mem_write(NVDEC, bytes(OBJECT_BYTES))
|
|
cpu.mem_write(FLCN, bytes(0x700))
|
|
call("_nv005713rm", NVDEC, CHIP, RM)
|
|
trace.clear()
|
|
assert call("_nv003356rm", NVDEC, CHIP, RM) == 0
|
|
q(NVDEC + 0x100, FLCN)
|
|
d(NVDEC + 0x4a0, instance)
|
|
cpu.mem_write(NVDEC + 0xfb, bytes([byte_fb]))
|
|
d(NVDEC + 0x448, 0x77777777)
|
|
case["registry"] = dict(zip(KEYS, answers))
|
|
trace.clear()
|
|
status = call("_nv046468rm", GPU, NVDEC)
|
|
state = (byte(NVDEC + 0x50), byte(NVDEC + 0x420), byte(NVDEC + 0x421),
|
|
word(NVDEC + 0x448), word(FLCN + 0x5ec), word(FLCN + 0x57c), byte(FLCN + 0x3a2))
|
|
assert trace == [f"k:{key}" for key in KEYS] + ["cfg"], trace
|
|
rows.append("C " + " ".join(f"{status:x} {value:x}" for status, value in answers)
|
|
+ f" {instance:x} {byte_fb:x};{status:x};"
|
|
+ " ".join(f"{value:x}" for value in state))
|
|
|
|
# S: the section call. The thread state's counter is the dword at +3c.
|
|
sections = 0
|
|
for cac, mask, begin, first, second, depth, thread_status in itertools.product(
|
|
(0, 7, 0x1f, 0x20, 0x21, 0xffffffff), (None, 0, 1, 0x80, 3, 0xff), (0, 1), (0, 1),
|
|
(0, 1), (0, 1, 5), (0, 0x40)):
|
|
d(GPU + 0xcac, cac)
|
|
d(THREAD + 0x3c, depth)
|
|
# `mask` of None: the manager has no device in that slot.
|
|
cpu.mem_write(MANAGER + 0x970, struct.pack("<32Q", *([0 if mask is None else DEVICE] * 32)))
|
|
case.update(cac=cac, mask=mask or 0, thread_status=thread_status)
|
|
trace.clear()
|
|
call("_nv031478rm", GPU, first, second, begin, RODATA)
|
|
rows.append(f"S {cac:x} {'-' if mask is None else format(mask, 'x')} {begin:x} {first:x} "
|
|
f"{second:x} {depth:x} {thread_status:x};"
|
|
f"{word(THREAD + 0x3c):x} {int('ts' in trace):x} {int('mask' in trace):x}")
|
|
if cac > 0x1f or mask is None:
|
|
assert trace == [] and word(THREAD + 0x3c) == depth, (cac, trace)
|
|
sections += 1
|
|
|
|
out = ROOT / "target/gpu-stage"
|
|
out.mkdir(parents=True, exist_ok=True)
|
|
oracle = "\n".join(rows) + "\n"
|
|
(out / "original-nvdec-hs-inputs.txt").write_text(oracle)
|
|
counts = {kind: sum(1 for row in rows if row[0] == kind) for kind in "XBCS"}
|
|
report = {
|
|
"original_sha256": DIGEST, "chip_hal": "0x23", "rm_hal": 2, "executed": sorted(executed),
|
|
"fixture_supplied": list(HOOKED) + ["KernelFifo function at +170"],
|
|
"cases": counts, "total_cases": sum(counts.values()),
|
|
"oracle": "target/gpu-stage/original-nvdec-hs-inputs.txt",
|
|
"oracle_sha256": hashlib.sha256(oracle.encode()).hexdigest(),
|
|
"engine_lookup": {
|
|
"function": "KernelFifo+1b8 = _nv040256rm, body _nv040255rm",
|
|
"table": "reports/engine-cache-binary.json physical_gv100.table_bytes (the original "
|
|
"constructor's 16 records for 0000:b3:00.0)",
|
|
"physical_answers": physical_answers},
|
|
"object_creation": {
|
|
"chain": "_nv006624rm clears 0x4f8 bytes and calls _nv005713rm then _nv003356rm; "
|
|
"_nv003356rm calls _nv003365rm on OBJBSP+e8, which stores byte +10 = 1 for "
|
|
"every chip and tail-calls _nv028792rm (Falcon object creation, which stores "
|
|
"the Falcon at interface +18); _nv003356rm ends with _nv005811rm",
|
|
"passes": constructed},
|
|
"engine_constructor": {
|
|
"function": "_nv046468rm",
|
|
"registry_keys": list(KEYS),
|
|
"effect": "RmDisableBsp read as 1 stores OBJBSP+50 = 1; RmDisableBspLoad read as 1 "
|
|
"stores +420 = 1; RMForceNvdecUcodeEncryption read stores +421 = (value != 0); "
|
|
"Falcon+5ec = 0x8f99e100 | instance, Falcon+57c = instance + 0xe, "
|
|
"Falcon+3a2 = OBJBSP+fb; then _nv028412rm; +448 = 0; status 0"},
|
|
"section": {
|
|
"function": "_nv031478rm with _nv031447rm and _nv031395rm",
|
|
"effect": "_nv031395rm returns zero for GPU+cac above 0x1f or an empty device slot "
|
|
"of the manager (system object +1e0, table at +970), otherwise the device's "
|
|
"mask (_nv031338rm). With at most one bit set _nv031478rm returns without "
|
|
"touching the thread state; otherwise it increments or decrements the dword "
|
|
"at +3c of the thread state _nv059477rm returns."},
|
|
"scope": "Original producers of four inputs of the NVDEC HS run. Registry answers, the "
|
|
"manager's device table and the thread state are fixture-supplied; no hardware "
|
|
"executed."}
|
|
(ROOT / "reports/gpu-nvdec-hs-inputs-original.json").write_text(json.dumps(report, indent=2) + "\n")
|
|
print(f"{sum(counts.values())} original cases {counts}; physical answers {physical_answers}; "
|
|
f"executed {len(executed)} functions")
|