From bfd269ee74d166be4f386640f8b5daad31d5d6ed Mon Sep 17 00:00:00 2001 From: Arthur Hanson Rasmusson Date: Sun, 13 Sep 2026 19:28:03 -0400 Subject: Phase 4: Portable Architecture Implementation - Firmware Analyzer: Runtime firmware signature computation (CRC32, SHA256) and pattern-based RPC handler address discovery - Dynamic RPC Dispatcher: Version-aware dispatch with native firmware handlers (550/560/570/580) and emulation fallback - Hardware Architecture Layer: Turing, Ampere, Blackwell configs with BAR layouts, doorbell offsets, MSI-X vectors - Driver Version Adaptation Layer: Feature detection per driver version - Declarative YAML configs for hardware (turing/ampere/blackwell) and versions (550/560/570/580) - Kernel unit tests for GSP emulation (gsp_emulation_test.c) - Test infrastructure scripts (test_gsp_emu.sh, test_guest_driver.sh, test_cuda_workloads.sh, test_graphics_workloads.sh, test_windows_guest.sh, test_vgpu_stack.sh) - Updated kernel Makefile with new source files --- kernel/firmware_analyzer.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 kernel/firmware_analyzer.h (limited to 'kernel/firmware_analyzer.h') diff --git a/kernel/firmware_analyzer.h b/kernel/firmware_analyzer.h new file mode 100644 index 0000000..69a4ec3 --- /dev/null +++ b/kernel/firmware_analyzer.h @@ -0,0 +1,36 @@ +#ifndef _FW_ANALYZER_H_ +#define _FW_ANALYZER_H_ + +#include +#include "gsp_rpc_client.h" + +/* Firmware addresses discovered from analysis */ +struct fw_addresses { + u64 rpc_dispatch_primary; + u64 rpc_jump_table; + u64 alloc_main; + u64 schedule_main; + u64 bar_trap_handler; + u64 wpr_handler1; + u64 wpr_handler2; + u64 migration_table1; + u64 migration_table2; + u64 entry_point; +}; + +/* Analysis result */ +struct fw_analysis_result { + char version[32]; + size_t fw_size; + u32 crc32; + u8 sha256[32]; + struct fw_addresses addresses; + bool matched; +}; + +/* Public API */ +int fw_analyzer_analyze(const u8 *fw_data, size_t fw_len, struct fw_analysis_result *result); +int fw_analyzer_load_and_analyze(const char *fw_path, struct fw_analysis_result *result); +void fw_analyzer_print_result(const struct fw_analysis_result *result); + +#endif /* _FW_ANALYZER_H_ */ \ No newline at end of file -- cgit v1.2.3