#!/bin/sh # Fetch the upstream F32 disassembler used by the RLC/SDMA analysis, and apply our # one-hunk fix. Not tracked: upstream work, no LICENSE file in the repo, and # regenerable. # # ref/radeon-tools/f32/f32dis.py fail0verflow's F32 disassembler (CI-era CP/RLC) # # Pinned to the commit this analysis was done against. The patch makes # out-of-range branch targets print as addresses instead of the string "True"; # see f32dis-loc.patch for why that matters. set -e cd "$(dirname "$0")" mkdir -p ref # Positive controls for f32_audit.py --selftest: CI-era blobs the upstream # disassembler was actually written for. Without these the selftest can only run # its negative controls. LF=https://gitlab.com/kernel-firmware/linux-firmware/-/raw/main/radeon for f in BONAIRE_rlc.bin BONAIRE_pfp.bin BONAIRE_mec.bin; do [ -f "ref/$f" ] || curl -sS -f -o "ref/$f" "$LF/$f" || echo "warn: could not fetch $f" done PIN=e2eb366 if [ ! -d ref/radeon-tools/.git ]; then git clone https://github.com/fail0verflow/radeon-tools ref/radeon-tools fi cd ref/radeon-tools git fetch --all -q || true git checkout -q "$PIN" 2>/dev/null || echo "note: pinned commit $PIN not found, using default branch" cd f32 if patch --dry-run -p1 -s -i ../../../f32dis-loc.patch >/dev/null 2>&1; then patch -p1 -i ../../../f32dis-loc.patch echo "applied f32dis-loc.patch" else echo "f32dis-loc.patch already applied (or does not apply) -- check manually" fi