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 support for RISC-V code cross compilation test #101

Closed

Conversation

TimePrinciple
Copy link
Collaborator

Add steps needed for RISC-V specific code to cross-compile.

Summary of the PR

I'm proposing using x86_64 platform to cross-compile RISC-V code and qemu-riscv64-static to test the compiled binary as a temporary solution, since RISC-V machines are yet available on BuildKite.

Requirements

Before submitting your PR, please make sure you addressed the following
requirements:

  • All commits in this PR have Signed-Off-By trailers (with
    git commit -s), and the commit message has max 60 characters for the
    summary and max 75 characters for each description line.
  • All added/changed functionality has a corresponding unit/integration
    test.
  • All added/changed public-facing functionality has entries in the "Upcoming
    Release" section of CHANGELOG.md (if no such section exists, please create one).
  • Any newly added unsafe code is properly documented.

Add steps needed for RISC-V specific code to cross-compile.

Signed-off-by: Ruoqing He <[email protected]>
@TimePrinciple TimePrinciple force-pushed the add-qemu-riscv-support branch from a320453 to 1521c36 Compare May 16, 2024 03:11
@endeneer
Copy link

endeneer commented May 18, 2024

@TimePrinciple Appreciate the alternative workaround. Just FYI, last time I proposed using qemu-system (see this PR) instead of qemu-user-static, because, correct me if I'm wrong, qemu-user-static has some limitations such as:

  • no support for emulation of RISC-V hypervisor extension
  • limited system call support (kvm_ioctls might fail)
  • lack of hardware access (vfio might fail)

But for cross-compilation, qemu-user-static should suffice and looks much simpler.

@TimePrinciple
Copy link
Collaborator Author

@TimePrinciple Appreciate the alternative workaround. Just FYI, last time I proposed using qemu-system (see this PR) instead of qemu-user-static, because, correct me if I'm wrong, qemu-user-static has some limitations such as:

  • no support for emulation of RISC-V hypervisor extension
  • limited system call support (kvm_ioctls might fail)
  • lack of hardware access (vfio might fail)

But for cross-compilation, qemu-user-static should suffice and looks much simpler.

Indeed, I'm proposing this approach because of it was mentioned in this issue.

@TimePrinciple TimePrinciple mentioned this pull request Aug 5, 2024
4 tasks
TimePrinciple added a commit to TimePrinciple/rust-vmm-container that referenced this pull request Aug 7, 2024
Add build scripts for v6.10 riscv64 kernel, qemu-system-riscv64 and
opensbi required to boot qemu-system inside docker container.

With this approach, we are able to run tests inside qemu-system, while
preserving the original output as much as possbile with ssh.

This work was inspired by the work done by @endeneer in PR rust-vmm#91, and is
the third draft proceeds rust-vmm#101, rust-vmm#104. It is expected to be replaced by

Signed-off-by: Ruoqing He <[email protected]>
TimePrinciple added a commit to TimePrinciple/rust-vmm-container that referenced this pull request Aug 7, 2024
Add build scripts for v6.10 riscv64 kernel, qemu-system-riscv64 and
opensbi required to boot qemu-system inside docker container.

With this approach, we are able to run tests inside qemu-system, while
preserving the original output as much as possbile with ssh.

This work was inspired by the work done by @endeneer in PR rust-vmm#91, and is
the third draft proceeds rust-vmm#101, rust-vmm#104. It is expected to be replaced by

Signed-off-by: Ruoqing He <[email protected]>
TimePrinciple added a commit to TimePrinciple/rust-vmm-container that referenced this pull request Aug 7, 2024
Add build scripts for v6.10 riscv64 kernel, qemu-system-riscv64 and
opensbi required to boot qemu-system inside docker container.

With this approach, we are able to run tests inside qemu-system, while
preserving the original output as much as possbile with ssh.

This work was inspired by the work done by @endeneer in PR rust-vmm#91, and is
the third draft proceeds rust-vmm#101, rust-vmm#104. It is expected to be replaced by
the second draft rust-vmm#104 in the future which standardise `riscv64`.

Signed-off-by: Ruoqing He <[email protected]>
TimePrinciple added a commit to TimePrinciple/rust-vmm-container that referenced this pull request Aug 8, 2024
Add build scripts for v6.10 riscv64 kernel, qemu-system-riscv64 and
opensbi required to boot qemu-system inside docker container.

With this approach, we are able to run tests inside qemu-system, while
preserving the original output as much as possbile with ssh.

This work was inspired by the work done by @endeneer in PR rust-vmm#91, and is
the third draft proceeds rust-vmm#101, rust-vmm#104. It is expected to be replaced by
the second draft rust-vmm#104 in the future which standardise `riscv64`.

Signed-off-by: Ruoqing He <[email protected]>
TimePrinciple added a commit to TimePrinciple/rust-vmm-container that referenced this pull request Aug 12, 2024
Add build scripts for v6.10 riscv64 kernel, qemu-system-riscv64 and
opensbi required to boot qemu-system inside docker container.

With this approach, we are able to run tests inside qemu-system, while
preserving the original output as much as possbile with ssh.

This is the third draft proceeds rust-vmm#101, rust-vmm#104. It is expected to be
replaced by the second draft rust-vmm#104 in the future which standardise
`riscv64`.

Signed-off-by: Ruoqing He <[email protected]>
TimePrinciple added a commit to TimePrinciple/rust-vmm-container that referenced this pull request Aug 27, 2024
Add build scripts for v6.10 riscv64 kernel, qemu-system-riscv64 and
opensbi required to boot qemu-system inside docker container.

With this approach, we are able to run tests inside qemu-system, while
preserving the original output as much as possbile with ssh.

This is the third draft proceeds rust-vmm#101, rust-vmm#104. It is expected to be
replaced by the second draft rust-vmm#104 in the future which standardise
`riscv64`.

Signed-off-by: Ruoqing He <[email protected]>
TimePrinciple added a commit to TimePrinciple/rust-vmm-container that referenced this pull request Aug 27, 2024
Add build scripts for v6.10 riscv64 kernel, qemu-system-riscv64 and
opensbi required to boot qemu-system inside docker container.

With this approach, we are able to run tests inside qemu-system, while
preserving the original output as much as possbile with ssh.

This is the third draft proceeds rust-vmm#101, rust-vmm#104. It is expected to be
replaced by the second draft rust-vmm#104 in the future which standardise
`riscv64`.

Signed-off-by: Ruoqing He <[email protected]>
stefano-garzarella pushed a commit that referenced this pull request Aug 27, 2024
Add build scripts for v6.10 riscv64 kernel, qemu-system-riscv64 and
opensbi required to boot qemu-system inside docker container.

With this approach, we are able to run tests inside qemu-system, while
preserving the original output as much as possbile with ssh.

This is the third draft proceeds #101, #104. It is expected to be
replaced by the second draft #104 in the future which standardise
`riscv64`.

Signed-off-by: Ruoqing He <[email protected]>
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

Successfully merging this pull request may close these issues.

2 participants