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

HMX extension #84

Open
Rot127 opened this issue Oct 11, 2023 · 1 comment
Open

HMX extension #84

Rot127 opened this issue Oct 11, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@Rot127
Copy link
Member

Rot127 commented Oct 11, 2023

We miss the HMX extension. The currently most up-to-date IDA plugin idp_hexagon supports it.

Since there is almost no public information about the extension, we could use the source of idp_hexagon to create our json files for import.

@Rot127 Rot127 added the enhancement New feature or request label Oct 11, 2023
@Rot127
Copy link
Member Author

Rot127 commented Nov 23, 2023

To summerize from n-o-o-n/idp_hexagon#17

logs from hexagon-sim can be used to retrieve the information needed.

  • Hexagon_SDK/x.y.z.w/tools/HEXAGON_Tools/a.b.cd/Tools/target/hexagon/include/hmx_hexagon_protos.h contains intrinsics.
  • For generating logs:
    @hexagon-sim --pmu_statsfile $(TARGET_DIR)/pmu.log \
                --archstring "--QDSP6_MX_PRESENT 1 --hmxdebuglvl 5 --hmxdebugfile hmx.log" \
                --mv69 --mhmx -- $(TARGET) $(ARG)
    
  • Bit 26 in SSR register must be set to enable HMX:
    static void hmx_enable( void )
    {
        // set bit SSR[26]: 2nd Coprocessor Enable
        asm volatile(
            "r0 = ssr\n\t"
            "r0 = setbit(r0, #26)\n\t"
            "ssr = r0\n\t"
            ::: "r0"
        );
    }
    

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant