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

support riscv64 build #10

Open
jyao1 opened this issue Jan 10, 2024 · 2 comments
Open

support riscv64 build #10

jyao1 opened this issue Jan 10, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@jyao1
Copy link
Member

jyao1 commented Jan 10, 2024

Current spdm-rs project can pass build for x86_64.

Need to investigate how to support riscv64.

@taprinz taprinz added the enhancement New feature or request label Jan 11, 2024
@taprinz
Copy link
Contributor

taprinz commented Jan 11, 2024

The idea behind this is that many SPDM responder implementations may be on an embedded devices, riscv64 being a popular architecture. Ideally, this project should be compliable for any target - but picking a specific baremetal target to formally support is good to iron out issues and minimize regressions in this functionality.

According to the rustc documentation, all the riscv targets are considered "Tier 2" targets. This means that the rustc nightly will ensure that riscv builds will always work, but there are not functionality guarantees. Since we are pinning a specific nightly version, this should be fine, but I'll watch for weird quirks. We can't compile directly on target, but that's okay since the envisioned scenario is cross compiling for embedded devices.

For now, I will plan to target riscv64gc-unknown-none-elf, which is a RISCV64 architecture with the following features RV64IMAFDC.

Eventually, it would be good to add automated build and test workflow support for riscv64 platforms on the repo as well, but I will visit that only after I have been able to get the riscv64 building and running locally first.

@taprinz
Copy link
Contributor

taprinz commented Jan 25, 2024

To provide an update here - I'm still working on this (fell sick the past week which didn't help progress). Getting the core spdmlib crate to compile for the riscv64gc-unknown-none-elf target was straightforward - however, things fall apart pretty quickly with the crate dependencies. Seems like some of them either don't support riscv64 or need some additional underlying patches to get them to work.

Regarding the crypto library, is mbedtls formally supported as a backing crypto implementation? I see it in the README list of features, but trying to pass it in the build script or building directly, it doesn't seem like mbedtls is recognized as a feature.

I ask because some of the crate dependencies I'm having issues with are coming from ring, which from what I can tell, should support riscv64 but might need more patching than is initially worthwhile to get this up and running.

Otherwise, do we support a NULL crypto implementation like in libspdm? I may attempt to just build that and test that out on riscv64 as a start. The integrator may want to be able to swap their own crypto implementation anyways.

Edit: misclicked "close with comment" when typing

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

2 participants