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

Is aarch64 supported? #111

Open
Eren121 opened this issue Apr 11, 2024 · 2 comments
Open

Is aarch64 supported? #111

Eren121 opened this issue Apr 11, 2024 · 2 comments

Comments

@Eren121
Copy link
Contributor

Eren121 commented Apr 11, 2024

I achieved to make it compile on this architecture with minor changes in src/util/timer.h:

static inline size_t rdtsc() {
  uint64_t tsc;
  asm volatile("mrs %0, cntvct_el0" : "=r"(tsc));
  return tsc;
}

static double measure_rdtsc_freq() {
    uint32_t freq_hz;
    asm volatile ("mrs %0, cntfrq_el0; isb; " : "=r"(freq_hz) :: "memory");
    return static_cast<double(freq_hz);
}

But I don't know if there can be others compatibility problems at runtime?

@Eren121 Eren121 changed the title Support for aarch64 Is eRPC supported on aarch64? Apr 11, 2024
@Eren121 Eren121 changed the title Is eRPC supported on aarch64? Is aarch64 supported? Apr 11, 2024
@anujkaliaiitd
Copy link
Collaborator

Interesting, good to know that the code compiles with minor changes. It'll be great if you could submit a PR for this, ifdef-ed by the architecture.

I haven't tried eRPC on an ARM server, but I can't think of any issues that'll prevent it from working. I'm curious to learn if it ends up working for you.

@Eren121
Copy link
Contributor Author

Eren121 commented May 15, 2024

This works, but there is one assertion that fails:

rt_assert(freq_ghz >= 0.5 && freq_ghz <= 5.0, "Invalid RDTSC frequency");

Because on Arm, the frequency is not tied to the CPU frequency and is much lower (0.2 Ghz on my machine). It also does not scale with CPU frequency scaling (independant timer).

Why is this assertion there? Can it affect wrongly eRPC if we remove it?

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

No branches or pull requests

2 participants