Skip to content

Populate Linux RV64 AT_HWCAP from misa - #1697

Open
carlosqwqqwq wants to merge 1 commit into
qilingframework:devfrom
carlosqwqqwq:codex/qiling-d103-rv64-hwcap
Open

carlosqwqqwq wants to merge 1 commit into
qilingframework:devfrom
carlosqwqqwq:codex/qiling-d103-rv64-hwcap

Conversation

@carlosqwqqwq

Copy link
Copy Markdown

Checklist

Which kind of PR do you create?

  • This PR only contains minor fixes.
  • This PR contains major feature update.
  • This PR introduces a new function/api for Qiling Framework.

Coding convention?

  • The new code conforms to Qiling Framework naming convention.
  • The imports are arranged properly.
  • Essential comments are added.
  • References for Linux RISC-V HWCAP behavior are included below.

Extra tests?

  • No extra tests are needed for this PR.
  • I have added enough tests for this PR.
  • Tests will be added after some discussion and review.

Changelog?

  • This PR doesn't need to update Changelog.
  • Changelog will be updated after some proper review.
  • Changelog has been updated in my PR.

Target branch?

  • The target branch is dev branch.

One last thing

Summary

For Linux RV64 ELF loads, derive AT_HWCAP from the configured CPU's misa register for the enabled I/M/A/F/D/C extensions. Apply Linux's rule that F is not advertised when D is absent. Other OS and architecture paths are unchanged; this does not add V or AT_HWCAP2 support.

Fixes #1696.

Validation

  • cd tests && PYTHONPATH=.. python3 -m unittest test_elf_hwcap_projection — passed.
  • cd tests && PYTHONPATH=.. python3 test_posix.py ElfHwcapProjectionTests — passed.
  • The focused tests cover MISA-to-HWCAP projection and preserve the non-Linux behavior.

References

@carlosqwqqwq
carlosqwqqwq force-pushed the codex/qiling-d103-rv64-hwcap branch from e1a6af2 to c1de6c0 Compare November 23, 2026 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant