mirror of
https://github.com/morluto/rea.git
synced 2026-11-05 06:45:22 +00:00
[GH-ISSUE #8463] [Design] Admit ESP32-P4 ELF that declares Espressif vendor extensions, and report what Ghidra cannot decode #6613
Open
opened 2026-11-01 21:12:41 +00:00 by bsakaguchi
·
0 comments
No Branch/Tag specified
main
codex/procedure-reference-stacked
release-please--branches--main--components--rea-agents
release-please--branches--main--components--rea-agents--release-notes
codex/kuna-independent-retry
codex/byte-search-overlay-coverage
codex/open-failure-target-receipt
codex/kuna-xref-evidence
codex/ghidra-ambiguous-procedure-recovery
codex/function-source-bundle
codex/trace-function-integration-prototype
codex/snapshot-source-closure
codex/recorded-evidence-array-pages
codex/evidence-recovery-redesign
codex/trace-feature-address-scope
codex/call-discovery-scope
codex/ghidra-literal-candidate-evidence
codex/decompile-directory-independent-retry
codex/retry-provenance-base
codex/value-flow-capability-experiment
codex/ghidra-containing-instruction
cursor/readme-discord-button-ef9f
dependabot/github_actions/actions/setup-node-7.1.0
dependabot/github_actions/actions/upload-artifact-7.0.2
dependabot/npm_and_yarn/npm-minor-and-patch-d8d97ce6df
codex/kuna-1989
fix/8559-native-ui-fixture-ownership
fix/8555-go-verifier-mcp-ownership
codex/provider-capability-recovery
fix/8642-rizin-target-stdin
codex/ghidra-memory-effect-scope
codex/ghidra-annotation-entry-selector
codex/ghidra-readonly-recovery
codex/ghidra-regex-verifier-recovery
codex/evidence-discovery-view-guidance
fix/8545-bulk-append-overflow
fix/8428-navigation-refusal-alternatives
codex/address-context-recovery
codex/matching-member-limitations
codex/unknown-scope-contract
codex/evidence-view-guidance
feat/8373-native-trace-views
codex/ghidra-snapshot-verifier-binding
codex/elf-export-visibility
codex/evidence-view-recovery
codex/native-reference-cli-help
codex/provider-candidate-observation-scope
codex/kuna-session-verification
codex/ghidra-switch-lifetime-guidance
codex/pseudocode-paging-discovery
codex/clarify-evidence-view-support
codex/kuna-xrefs-selector-recovery
codex/context-capacity-recovery
codex/evidence-closure-large-links
codex/same-function-evidence-identity
codex/ghidra-verifier-inspected-jdk
codex/audit-guided-workflows
codex/crash-prompt-retained-dossiers
codex/analysis-view-error-recovery
codex/kuna-verifier-target-selection
codex/ghidra-selected-project-call-coverage
codex/docs-native-analysis-scope
codex/ghidra-java-socket-boundary
codex/ghidra-retained-snapshot-verifier
codex/ghidra-search-inventory-facts
fix/8284-zero-argument-parameter-bindings
fix/8198-ui-action-handler-offset
fix/8257-elf-entry-label-identity
fix/8304-deferred-output-schema-projection
fix/8277-call-path-computed-target-uncertainty
fix/pr-8089-conflicts
fix/ci-static-duplicate-export
dependabot/npm_and_yarn/lint-staged-17.6.0
dependabot/github_actions/actions/download-artifact-8.0.2
dependabot/npm_and_yarn/write-file-atomic-8.0.0
dependabot/npm_and_yarn/canonicalize-5.1.0
dependabot/github_actions/actions/cache/restore-6.1.0
dependabot/npm_and_yarn/toon-format/toon-4.4.0
dependabot/github_actions/actions/deploy-pages-5.0.1
codex/review-fixes-pr-2403
codex/review-fixes-pr-2400
codex/process-terminal-width
codex/test-brittleness-cleanup
verify/7167-browser-connect-macos
fix/7167-browser-connect
feat/native-matching-allowance-setting
feat/browser-scenario-dry-run
test/managed-caller-parameters-20261024
codex/parser-fortythird-boundaries
fix/6926-pinvoke-platform-decorations-20261023
fix/6889-har-body-encoding-20261023
fix/6888-sqlite-schema-budget-20261023
fix/dependency-security-gates-6708
cursor/evidence-overwrite-rebase-b4ac
feat/4057-verify-native-exports
fix/windows-acl-observer-overhead-20261022
cursor/erlang-beam-restack-4476
cursor/pe-certificate-review-bf32
fix/6116-javascript-application-fs-errors
fix/6061-unmapped-runtime-script-unknown
feat/browser-scenario-summary
fix/pe-certificates
codex/verify-3407
cursor/rebase-5699
cursor/rebase-5352
cursor/rebase-5600
cursor/fix-cli-schema-omission-10a8
codex/audit-hopper-shutdown-reasons-20261021
fix/demangle-swift-omitted-record
fix/nib-boolean-value-types
cursor/cancellation-partial-observation-a5ac
fix/ib-object-limit-reasons
fix/electron-fuse-limit-advice
fix/kuna-doctor-dangling-cache
fix/fixed-budget-refusal-advice
fix/js-ipc-listener-dedup
fix/js-return-member-provenance
fix/dmg-integrity-retry-advice
fix/ida-doctor-readiness
fix/kuna-version-probe-output-drain
fix/legacy-swift-runtime-name-matching
fix/dylib-lazy-load-commands
fix/browser-scenario-startup-cancel
fix/swift-nested-punycode-classification
fix/compare-unselected-scopes
fix/objc-method-budget-coverage
fix/dmg-mounted-root-observations
audit/ci-tests-20261019-round2
release/6.7.0
fix/wabt-cleanup-retry-resolution
fix/electron-fuse-elf-pe-architecture
fix/native-plist-descriptor-ownership
fix/kuna-caller-cleanup-ownership
experiment/atomic-codemode-20261016
review/first-contributor-3776
fix/call-resolution-full-read-cycles
fix/member-mutation-selection-repeat
experiment/atomic-re-tools-20261015
perf/member-mutation-lazy-origins
perf/static-network-mutation-index
fix/hopper-startup-lifecycle
audit/3050-windows-proof-20261015
feat/windows-window-capture-2183
audit/3049-windows-proof-20261015
audit/3735-macos-fixtures-20261015
fix/batch-decompile-null-pseudocode
fix/kuna-inventory-honors-jobs
experiment/browser-codemode-tool-design-20261015
fix/hopper-clean-runtime-argv
codex/review-2049-27f1b367
review-fixes/pr-2787-routing
fix/3360-scoped-this-emitters
fix/3367-replaced-global-effects
fix/3838-compact-any-value-items
test/hopper-download-probe-20261015
codex/windows-runtime-creation-red-green-20261015
codex/windows-readonly-root-red-green-20261015
codex/windows-root-share-red-green-20261015
codex/exp-1685-win-mcp-startup
codex/bug-sweep-20261015
investigate/2190-windows-package-phases
investigate/3543-macos-cli-deadline
perf/3281-reverse-tools-feedback-quality
fix/3406-hopper-doctor-fixture
fix/3341-wrapper-require-test-context
fix/3301-owned-uninstall-fixtures
fix/3164-compiler-input-ownership
fix/pcap-cleanup-stdout-newline-20261014
perf/interface-builder-summary
codex/review-fixes-pr-1977
fix/ghidra-effective-jvm-platform
fix/docs-turkish-rust-link-20261013
fix/main-maintenance-ci-20261010
fix/recover-binary-session-process-effects
codex/review-fixes-pr-2457
codex/ci-required-cancellation-gate
fix/main-format-baseline-20261013
fix/setup-preserve-entry-fields
cursor/restore-main-checks-1ffc
fix/ghidra-bridge-hashmap-import
codex/shared-ci-jadx-json-default-20261013
codex/shared-ci-ghidra-test-groups-20261013
codex/shared-ci-java-fixture-format-20261013
codex/fix-intrinsic-invocation-boundaries
test/release-preflight-reusable-jobs
test/js-parameter-provenance-expectation
fix/linux-hopper-verification-current
test/2419-ghidra-elf-probe-size
followup/pr-1544-native-ida
codex/fold-pr-2230-contribution
docs/readme-responsible-use
fix/issue-2064
fix/issue-2050
fix/issue-2053
fix/issue-1968
fix/issue-1945
experiment/codemode-bridge-20261011
fix/tool-effects-negative-wording-1904-20261012
fix/1842-electron-interop-provenance
feat/recover-javascript-multi-input
refactor/website-i18n-prep
fix/nativeaot-pe-virtual-extent
fix/browser-verifier-ci-hang
fix/pe-resources-input-selection
docs/beginner-friendly-guides
docs/beginner-setup-guide
fix/javascript-analysis-worker-1563
fix/1649-ghidra-duplicate-names
fix/javascript-export-keys-integration-1369
test/maintenance-boundary-contracts-20261011
review/javascript-export-keys-1369
review/process-live-progress-1483
test/javascript-1495-growth-ratio
fix/ci-escape-timing
docs/normalized-terminal-geometry-1450
release/6.3.0
archive/release-6.3.0-pr1381
release/6.2.0
fix/electron-preload-dynamic-override
fix/javascript-self-referential-bundler-edges
release/6.1.0
cursor/grok-client-cherry-pick-0b56
feat/signature-posture
feat/dyld-shared-cache
feat/artifact-integrity-policy
feat/pkg-inventory
release/6.0.0
chore/sync-release-5.0.0
release/5.0.0
cursor/cloud-agent-node-787e
fix/javascript-xhr-open-endpoints
review/pr-711-realpath-fallback-wording
cleanup/replay-confinement
codex/test-suite-performance
codex/issue-foundations
codex/address-open-issues-2026-07-20
agent/javascript-vite-rollup-esbuild-adapters
agent/process-cleanup
agent/triage-integration
agent/unknown-commands-registry
feat/mcp-identity-metadata
morlvps/issue_cleanup
codex/installer-redesign
morl/roadmap-investigation-core
morl/roadmap-investigation-docs
release-please--branches--main--components--rea
rea-agents-6.8.0
rea-agents-6.7.0
rea-agents-6.6.0
experiment/atomic-codemode-wait-runtime-20261016
rea-agents-6.5.0
rea-agents-6.4.0
rea-agents-6.3.0
rea-agents-6.2.0
rea-agents-6.1.0
rea-agents-6.0.0
rea-agents-5.0.0
rea-agents-4.1.0
rea-agents-4.0.1
rea-agents-4.0.0
rea-agents-3.2.1
rea-agents-3.2.0
rea-agents-3.1.0
rea-agents-3.0.0
rea-agents-2.7.0
rea-agents-2.6.0
rea-agents-2.5.1
rea-agents-2.5.0
rea-agents-2.4.0
rea-agents-2.3.0
rea-agents-2.2.0
rea-agents-2.1.0
rea-agents-2.0.0
rea-agents-1.7.0
rea-agents-1.6.0
rea-agents-1.5.0
rea-agents-1.4.0
rea-agents-1.3.0
rea-agents-1.2.0
rea-agents-1.1.0
rea-agents-1.0.0
rea-agents-0.5.0
rea-agents-0.4.0
rea-agents-0.3.0
rea-0.2.1
rea-0.2.0
Labels
Clear labels
area: bridge
area: bridge
area: build
area: build
area: build
area: cli
area: domain
area: evidence
area: mcp
area: native
area: providers
area: runtime
area: server
area: setup
area: tests
bug
design
documentation
enhancement
enhancement
enhancement
experiment
help wanted
i18n
invalid
P0: critical
P1: high
P2: medium
P2: medium
P2: medium
P3: low
performance
provider-request
pull-request
Mirrored from GitHub Pull Request
question
roadmap
triage
No labels
area: bridge
area: bridge
area: build
area: build
area: build
area: cli
area: domain
area: evidence
area: mcp
area: native
area: providers
area: runtime
area: server
area: setup
area: tests
bug
design
documentation
enhancement
enhancement
enhancement
experiment
help wanted
i18n
invalid
P0: critical
P1: high
P2: medium
P2: medium
P2: medium
P3: low
performance
provider-request
pull-request
question
roadmap
triage
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set.
Reference
morluto/rea#6613
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Entrpi on GitHub (Nov 1, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/8463
Before submitting
Decision needed
Should the decoded-extension rule of D3 (#7477) gain a vendor-extension mode? In that mode the single-float lane would admit an RV32I image whose
Tag_RISCV_archdeclares only decoded extensions plus Espressif'sxesploop,xesppieandxespv. After analysis, the bridge would report each instruction that Ghidra 12.1.4 could not decode or decoded only as a placeholder. REA would no longer refuse these images.Context and evidence
Every ESP32-P4 image declares Espressif extensions, so the ilp32f lane refuses all of them. ESP-IDF v5.5.2 builds
hello_worldfor P4 with these declarations (observed):rv32i2p1_m2p0_a2p1_f2p2_c2p0_zicsr2p0_zifencei2p0_zmmul1p0_zaamo1p0_zalrsc1p0_xesploop1p0_xesppie1p0_xespv2p2CONFIG_ESP32P4_SELECTS_REV_LESS_V3=n): the same withoutxesppie1p0.From v5.5.6 on, rev 3 is the Kconfig default (source-derived from the tags v5.5.6, v6.0.3 and v6.1). Every ESP build that declares B also declares a vendor extension, so B support alone, such as NationalSecurityAgency/ghidra#8848, would admit no ESP build (source-derived).
Espressif GCC's backend has no vendor-instruction patterns (source-derived, not run), so its C output is standard. Hand-written assembly is not: FreeRTOS saves and restores the PIE registers in every P4 image.
I measured both
hello_worldbuilds and IDF's owngdbstub_runtimetest app with Ghidra 12.1.4 and REA's ilp32f lane. A local experiment that only adds the names to the admission check let them through; it is not pushed. Observed:rtos_save_pie_coproc(portasm.S). newlib, libgcc and the other IDF components contain none. The test app adds one hardware-loop setup.customNplaceholders. Some of those model writes tos8,a6or, for hardware loop 1's setup,ra. Others become unrelated draft instructions such assaes32.encsm. A hardware loop's back edge lives in loop CSRs, so Ghidra shows the body once. In the test app,test_xesppie_loopsruns its body three times but decompiles ascustom1.rd(); return;, with no warning.rea analyzesucceeds and the ilp32f policy refuses no signature (1,340 functions, 587 definitions). No limitation mentions a decode failure. One limitation becomes false: "Every declared extension is in the set this lane decodes". Onlyrea functionon the routine shows Ghidra'shalt_baddata()warning, inside the pseudocode.unimpinpanic_abort, and 3 zero fills after calls to a ROM reset routine that never returns.xesppie1p0andxespv2p2encode the same instructions as different words, and a default rev < 3 image declares both. Espressif's own objdump decodes none of that image's PIE words until a copy declares onlyxesppie.Ghidra 12.1.4 decoding each instruction of IDF's PIE test file (rv_decode/xesppie.S), pinned RISCV:LE:32:default
xesppie1p0(rev < 3)xespv2p2(rev 3)esp.lp.*(7 forms)customNplaceholderunimplp-coderadd16,saes32.encsm)saes32.encsm)The six bad-instruction bookmarks in hello_world (rev < 3)
rtos_save_pie_coprocportasm.S0x4ff065068201223besp.vst.128.iprtos_save_pie_coprocportasm.S0x4ff065760201223besp.vld.128.ippanic_abortesp_system/panic.c0x4ff047ae0000unimpesp_cpu_configure_region_protectionesp_hw_support/cpu_region_protect.c0x4000a38a,0x4000a39e,0x4000a3b2esp_rom_software_reset_systemInferred, not measured: GCC-built ESP-IDF 5.5 P4 apps without esp-dsp, esp-dl or other hand-written PIE assembly have this same small footprint. DSP-heavy apps have many more vendor instructions, including the silent kinds.
Expected interaction with targets
Boundary details (optional)
Tag_RISCV_archnames. An image that also declares any other undecoded extension stays refused. That includes B (zba,zbb,zbc,zbs) andzcb,zcmp,zcmt: compilers emit those in ordinary code, and Ghidra would decode Zcmp and Zcmt silently as float stores (source-derived).xesppie, which S31 builds from 6.1 do not declare, such as v5.5.2's default build before rev 3;xespdsp); and any P4 rev 3 or S31 build that opts in toCONFIG_COMPILER_ENABLE_RISCV_ZCMP, which adds Zcb/Zcmp/Zcmt.esp_app_desc_t) has no chip ID, which only the flashed image header carries (source-derived, v5.5.2). Until REA can read a fact that identifies a P4 image (question 8), an image with that shared declaration stays refused.Options and tradeoffs
Proposed: a vendor mode with a decode report.
elf32-exec-le-single-float-espressif-v1, with the same pinned language, compiler specification and__rea_ilp32fpolicy. The generic lane keeps its meaning. The profile commitsriscv_vendor_extensions(the declared names) and a report policy such asriscv_decode_report: undecoded-instructions-v1. REA requires the report exactly when the profile commits it, as it does forriscv_calling_convention, and refuses the session when the report is missing or malformed.unimplp-code (the draft constructors that some vendor words land on).ra.unimpor zero fill). This classifies the encoding space; it does not decode.Alternatives.
ghidra-allegrexmodel (docs/ghidra-psp.md): REA fingerprints a bring-your-own extension and pins its language. This gives the best fidelity, but no such extension exists. Ghidra has no issue or PR for Espressif extensions.b1n4ri0/RP2350_RISCV_Ghidrapatches the stock RISCV language in place, so REA could not pin it separately. An extension would need both PIE encodings, a way to choose one that does not rely onTag_RISCV_archalone, the Q/QACC/XACC state and hardware-loop flow. That is large work, better owned by Espressif or the community. The vendor mode stays useful until then and could select such an extension later.Verification available so far
I have a prototype or observed results
Success criteria and open questions
Proposed verification in
npm run verify:ghidra:riscv, which acquires no tools:.4bytevalues: measured words of both PIE encodings, custom-2 and custom-3 placeholders,esp.lp.setupfor loops 0 and 1, andesp.lp.count. The fixture also holds anunimp, and a call to an unknown routine followed by zero fill.llvm-objcopy --update-sectionthen writes the rev < 3 and rev 3 attribute strings, like the lane's existing header mutations.zbborzcmpto the declaration keeps the image refused. Generic-lane profile digests do not change.Open questions
xespdspnow? No admissible image declares it without B, and its encodings are unmeasured. Proposed: not yet.xespv2p1,xespv2p2). Without decoding, the name is enough for admission; the version matters only for classification and for a future decoder.esp.lp.*encodings?esp-15.2.0_20251204, is not installed here; this includes the pre-rev-3 encodingxespv2p1), and whether ilp32f storage is correct for these images. No refusal is not verification.References
not-in-listingis not a decode failure)docs/ghidra-riscv.md(ISA declarations),docs/ghidra-psp.md(bring-your-own extension model)components/freertos/FreeRTOS-Kernel/portable/riscv/portasm.S,components/esp_hw_support/port/esp32p4/Kconfig.hw_support,components/esp_hw_support/CMakeLists.txt,tools/cmake/toolchain-esp32p4.cmake,components/esp_gdbstub/test_gdbstub_host/rv_decode/xesppie.S,tools/test_apps/system/gdbstub_runtimeGhidra/Processors/RISCV/data/languages/riscv.custom.sinc; NationalSecurityAgency/ghidra#8848 (ratified B) and NationalSecurityAgency/ghidra#6390 (WCH vendor extension, open since 2024); b1n4ri0/RP2350_RISCV_Ghidraesp-14.2.0_20251107(GCC 14.2.0, binutils 2.43.1), Ghidra 12.1.4 PUBLIC, OpenJDK 21.0.12.1