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 basic support for loongarch64 architecture #307

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

heiher
Copy link

@heiher heiher commented Feb 12, 2025

Summary of the PR

Add basic support for loongarch64 architecture.

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.

Signed-off-by: WANG Rui <wangrui@loongson.cn>
Signed-off-by: WANG Rui <wangrui@loongson.cn>
@roypat
Copy link
Collaborator

roypat commented Feb 13, 2025

Hi!
Before merging support for any new architecture, we'll definitely need some testing setup, similar to what we did with riscv recently (cc @TimePrinciple). But before any of that even I'd be interesting in learning more about the usecase for this. Are there any downstream projects based on rust-vmm that would like to support this architecture? E.g. riscv support was driving by CloudHypervisor wanting to support it. I don't think we should take on the maintenance burden of new architectures without any users :/

@Dandan336
Copy link

Dandan336 commented Feb 14, 2025

Hi maintainers,

Compiling the rust-kvm-ioctls failed for loong64 in the Debian Package Auto-Building environment.
Some of the error logs is as follows,

error[E0432]: unresolved import `kvm_bindings::kvm_device_attr`
  --> src/ioctls/device.rs:11:5
   |
11 | use kvm_bindings::kvm_device_attr;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `kvm_device_attr` in the root

warning: `vmm-sys-util` (lib) generated 3 warnings
error[E0425]: cannot find value `KVMIO` in this scope
  --> src/kvm_ioctls.rs:14:35
   |
14 | ioctl_io_nr!(KVM_GET_API_VERSION, KVMIO, 0x00);
   |                                   ^^^^^ not found in this scope

The full build log can be found at https://buildd.debian.org/status/logs.php?pkg=rust-kvm-ioctls&arch=loong64.
We need to add LoongArch64 support to upstream first.
The Homepage of Debian rust-kvm-ioctls source package is https://github.com/rust-vmm/kvm-ioctls.
Your opinions are welcome.

Enable custom build-gnu tests for LoongArch.

Signed-off-by: WANG Rui <wangrui@loongson.cn>
Signed-off-by: WANG Rui <wangrui@loongson.cn>
@TimePrinciple
Copy link

TimePrinciple commented Feb 17, 2025

Hi @heiher @Dandan336, thanks for reaching out and sorry for my late reply.

As @roypat said earlier, we introduced support for RISC-V because our downstream projects like Cloud-Hypervisor and etc. are demanding it. I'm afraid package like rust-kvm-ioctls could not be built is not a very good reason for us to take additional architecture forward.

If you want rust-kvm-ioctls to build you can put your work in a patch and apply it while building, and if you have better reason other than this please share with us 🙂

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.

4 participants