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

Add RzIL implementation of MIPS32 ops #4882

Merged
merged 11 commits into from
Feb 18, 2025
Merged

Add RzIL implementation of MIPS32 ops #4882

merged 11 commits into from
Feb 18, 2025

Conversation

wargio
Copy link
Member

@wargio wargio commented Feb 6, 2025

Your checklist for this pull request

  • I've read the guidelines for contributing to this repository.
  • I made sure to follow the project's coding style.
  • I've documented every RZ_API function and struct this PR changes.
  • I've added tests that prove my changes are effective (required for changes to RZ_API).
  • I've updated the Rizin book with the relevant information (if needed).

Detailed description

Adds RzIL uplifting for capstone mips.

  • Implemented all 75 common ops from MIPS32 spec
  • Implemented 7 common ops from MIPS64 spec (lwu, ld, dadd, etc...)
  • Implemented 35 special ops (interrupts, cache sync, cache prefetch, TLB, breakpoints, traps, etc..) as NOP
  • Ignored most of the 58 floating point ops from MIPS32 spec (will be done in another PR)
  • Ignored 20 Hardware ops (syscall, interrupt return, etc..) from MIPS32 spec (will be done in another PR)

Test plan

Add emulateme binaries.

@wargio
Copy link
Member Author

wargio commented Feb 6, 2025

I am thinking to add a sha1 emulateme binary which will add more operations to check the correctness of the execution

@notxvilka notxvilka added this to the 0.8.0 milestone Feb 6, 2025
test/db/rzil/mips Outdated Show resolved Hide resolved
librz/arch/isa/mips/il/common.c Show resolved Hide resolved
librz/arch/isa/mips/il/mips32.c Outdated Show resolved Hide resolved
librz/arch/isa/mips/il/mips32.c Outdated Show resolved Hide resolved
librz/arch/isa/mips/il/mips32.c Outdated Show resolved Hide resolved
librz/arch/isa/mips/il/common.c Outdated Show resolved Hide resolved
librz/arch/isa/mips/il/mips32.c Outdated Show resolved Hide resolved
librz/arch/isa/mips/il/mips32.c Outdated Show resolved Hide resolved
librz/arch/isa/mips/il/mips32.c Outdated Show resolved Hide resolved
librz/arch/isa/mips/il/mips32.c Outdated Show resolved Hide resolved
@wargio wargio marked this pull request as ready for review February 16, 2025 03:07
librz/arch/isa/mips/il/atomic.c Show resolved Hide resolved
librz/arch/isa/mips/il/hw.c Show resolved Hide resolved
librz/arch/isa/mips/mips_internal.h Show resolved Hide resolved
librz/arch/p/asm/asm_arm_cs.c Outdated Show resolved Hide resolved
librz/arch/dwarf_process.c Outdated Show resolved Hide resolved
librz/core/cconfig.c Outdated Show resolved Hide resolved
@notxvilka
Copy link

Could you please provide a coverage? How many instructions are implemented and how many - aren't? Floating point aside, I see there are many still aren't implemented, judging by the source code. Or at least explain what is implemented and what currently isn't in the PR description.

@wargio wargio changed the title RzIL for mips Add RzIL implementation of MIPS32 ops Feb 16, 2025
@wargio wargio requested review from notxvilka and Rot127 February 17, 2025 05:48
Copy link
Member

@Rot127 Rot127 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just those little things.
Please run the asm tests with ASAN and the leak sanitizer, if not done yet.

librz/arch/isa/mips/il/common.c Outdated Show resolved Hide resolved
librz/arch/isa/mips/il/common.c Outdated Show resolved Hide resolved
librz/arch/isa/mips/il/common.c Show resolved Hide resolved
librz/arch/isa/mips/il/fp.c Show resolved Hide resolved
librz/arch/p/arch_mips_cs.c Outdated Show resolved Hide resolved
@wargio
Copy link
Member Author

wargio commented Feb 17, 2025

Please run the asm tests with ASAN and the leak sanitizer, if not done yet.

Already done. no changes.

Copy link

@notxvilka notxvilka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM once you address @Rot127 feedback.

notxvilka

This comment was marked as resolved.

@wargio wargio merged commit cd4cd62 into dev Feb 18, 2025
59 checks passed
@wargio wargio deleted the dist-il-mips branch February 18, 2025 10:07
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.

3 participants