Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] PPC uplifting #2497

Closed
wants to merge 176 commits into from
Closed

[WIP] PPC uplifting #2497

wants to merge 176 commits into from

Conversation

Rot127
Copy link
Member

@Rot127 Rot127 commented Apr 4, 2022

WIP

Bugs

  • Broken in QEMU/Capstone
    • PPC_INS_SLDI -> Seems to be a broken capstone version in rizin. Imm missing in instruction. Not in v5.0
    • Some frames are not closed properly.

Rough roadmap

  • QEMU tests -> Most common instructions are implemented and tested. (common = >=1% occurrence in libc, libglib, libslang etc.)
  • QEMU trace ppc64_fp bin
  • Almost all ESIL instructions implemented in RZIL.
  • Traps, sys instructions -> NOPed
  • sraw set ca, ca32
  • Fix rizin tests.
    • Fix asm tests.
    • Fix il test with new instruction addresses.
    • Add asm/il tests for: CMDB, EQV, DCBZ, MTXER, DIV, MUL
  • More sophisticated ops (vec, float...)
    • Implemented in ESIL
      • PPC_INS_LFD
      • PPC_INS_LFDU
      • PPC_INS_LFDX
      • PPC_INS_LFIWZX
      • PPC_INS_LFS
      • PPC_INS_LFSU
      • PPC_INS_LFSUX
      • PPC_INS_LFSX
    • stmw, lmw -> Needs new il effects which allow to iterate over certain global vars.
    • Tested

Some todos

  • This weird cr0 bug if R16 is 0 (see add test).
  • Inconsistent naming of helper functions (either with ppc_ prefix or without. But not both.

TODOs after merge

  • The dcbz instruction zeros a cache line/block. The size of this line depends on the PPC implementation (ESIL hardcodes it to 128. RZIL to 32). It should be replaced with a plugin config option once RzArch is done.
    Also, if this PR is merged before RzArch, an issue should be opened.

@XVilka XVilka mentioned this pull request Apr 9, 2022
38 tasks
librz/il/il_opcodes.c Outdated Show resolved Hide resolved
librz/il/il_opcodes.c Outdated Show resolved Hide resolved
@wargio
Copy link
Member

wargio commented Jul 18, 2022

you should really rebase

@Rot127
Copy link
Member Author

Rot127 commented Jul 18, 2022

Rebasing forces me to solve a conflict every 10 commits or so :( Is there any trick? Otherwise I just open a new PR.

@Rot127
Copy link
Member Author

Rot127 commented Jul 19, 2022

Superseded by #2823

@Rot127 Rot127 closed this Jul 19, 2022
@Rot127 Rot127 removed this from the 0.5.0 milestone Jul 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants