From f53a7ec03d7d58121dfcc7597e56915f01680da2 Mon Sep 17 00:00:00 2001 From: Arthur Hanson Rasmusson Date: Thu, 1 Oct 2026 11:46:07 -0400 Subject: guest-diag: allow selecting the staged GSP firmware with --fw --- tools/guest-diag/phys_claim_cycle.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'tools/guest-diag') diff --git a/tools/guest-diag/phys_claim_cycle.sh b/tools/guest-diag/phys_claim_cycle.sh index 3b146c6..6f13d75 100755 --- a/tools/guest-diag/phys_claim_cycle.sh +++ b/tools/guest-diag/phys_claim_cycle.sh @@ -22,7 +22,7 @@ # # Usage: phys_claim_cycle.sh --yes [--hold SECONDS] [--cycles N] [--layout] # [--dryrun] [--boot-dryrun] [--boot] [--keep] -# [--ko PATH] [--no-restore] +# [--ko PATH] [--fw NAME] [--no-restore] # # --yes required: acknowledge the host-freeze hazard # --hold S seconds to keep the GPU claimed (default 30) @@ -60,6 +60,9 @@ # It is refused immediately and never reaches insmod. Use # --boot; never stop after FWSEC alone on this host. # --ko PATH module to insmod (default kernel/open-iov-vfio.ko) +# --fw NAME GSP firmware to stage (request_firmware name under +# /lib/firmware; default: the module's own default, currently +# nvidia/570.211.01/gsp_tu10x.bin) # --no-restore do not restore power/control=auto or restart persistenced # at the end of each cycle (leaves the D0 hold in place) # @@ -92,6 +95,7 @@ BOOT_DRYRUN=0 KEEP=0 NO_RESTORE=0 KO="$REPO_ROOT/kernel/open-iov-vfio.ko" +FW="" GPU_BDF="${GPU_BDF:-0000:01:00.0}" if [ -z "${PORT_BDF:-}" ] && [ -e "/sys/bus/pci/devices/$GPU_BDF" ]; then @@ -125,6 +129,7 @@ Never stop after FWSEC alone on this host. Use --boot (full boot lifecycle). EOF exit 1 ;; --ko) KO="${2:-}"; shift ;; + --fw) FW="${2:-}"; shift ;; --no-restore) NO_RESTORE=1 ;; -h|--help) usage; exit 0 ;; *) echo "unknown argument: $1" >&2; usage >&2; exit 1 ;; @@ -342,10 +347,12 @@ for n in $(seq 1 "$CYCLES"); do [ "$BOOT_DRYRUN" -eq 1 ] && BOOTDRY_ARG="gsp_phys_boot_dryrun=1" BOOT_ARG="" [ "$BOOT" -eq 1 ] && BOOT_ARG="gsp_phys_boot=1" + FW_ARG="" + [ -n "$FW" ] && FW_ARG="gsp_phys_fw=$FW" # One command: stop persistenced and insmod with the D0 pre-lock in place. # gsp_phys_fwsec=1 is never passed: --fwsec refuses before this point. if ! { sudo systemctl stop nvidia-persistenced && sudo insmod "$KO" \ - gsp_phys_gpu=1 gsp_phys_hazard_ack=1 $LAYOUT_ARG $DRYRUN_ARG $BOOTDRY_ARG $BOOT_ARG; }; then + gsp_phys_gpu=1 gsp_phys_hazard_ack=1 $LAYOUT_ARG $DRYRUN_ARG $BOOTDRY_ARG $BOOT_ARG $FW_ARG; }; then save_dmesg "$DLOG" echo "ABORT: cycle $n: stop-persistenced && insmod failed" >&2 exit 2 -- cgit v1.2.3