From fd6c16e20973c2a66ff6b3ed2b81f1d902adea91 Mon Sep 17 00:00:00 2001 From: Ruoqing He Date: Mon, 17 Mar 2025 17:16:05 +0800 Subject: [PATCH 1/3] kata-sys-util: Set NoProtection for riscv64 `available_guets_protection` is required for `runtime-rs` to infer while building it on riscv64 platforms. Set it to `NoProtection` as riscv64 does not support guest protection for now. Signed-off-by: Ruoqing He --- src/libs/kata-sys-util/src/protection.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/libs/kata-sys-util/src/protection.rs b/src/libs/kata-sys-util/src/protection.rs index 1b73017366..9cb11a1178 100644 --- a/src/libs/kata-sys-util/src/protection.rs +++ b/src/libs/kata-sys-util/src/protection.rs @@ -277,6 +277,13 @@ pub fn available_guest_protection() -> Result Ok(GuestProtection::NoProtection) } +#[cfg(target_arch = "riscv64")] +#[allow(dead_code)] +// Guest protection is not supported on RISC-V. +pub fn available_guest_protection() -> Result { + Ok(GuestProtection::NoProtection) +} + #[cfg(target_arch = "x86_64")] #[cfg(test)] mod tests { From 084fb2d7800b728f94e1f6bcfed6f7573a92d8e0 Mon Sep 17 00:00:00 2001 From: Ruoqing He Date: Mon, 17 Mar 2025 12:05:06 +0800 Subject: [PATCH 2/3] runtime-rs: Enable RISC-V build Define `riscv64gc-options.mk` to enable `runtime-rs` to be built on RISC-V platforms. Signed-off-by: Ruoqing He --- src/runtime-rs/arch/riscv64gc-options.mk | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/runtime-rs/arch/riscv64gc-options.mk diff --git a/src/runtime-rs/arch/riscv64gc-options.mk b/src/runtime-rs/arch/riscv64gc-options.mk new file mode 100644 index 0000000000..657a5ac6dd --- /dev/null +++ b/src/runtime-rs/arch/riscv64gc-options.mk @@ -0,0 +1,13 @@ +# Copyright (c) 2025 Institute of Software, CAS. +# Copyright (c) 2019-2022 Alibaba Cloud +# Copyright (c) 2019-2022 Ant Group +# +# SPDX-License-Identifier: Apache-2.0 +# + +MACHINETYPE := virt +KERNELPARAMS := cgroup_no_v1=all systemd.unified_cgroup_hierarchy=1 +MACHINEACCELERATORS := +CPUFEATURES := + +QEMUCMD := qemu-system-riscv64 From cb7508ffdc27edc5109d0ad5ff240222b7aa1921 Mon Sep 17 00:00:00 2001 From: Ruoqing He Date: Mon, 17 Mar 2025 17:38:59 +0800 Subject: [PATCH 3/3] ci: Enable runtime-rs component build-check on riscv64 `runtime-rs` is now buildable and testable on riscv64 platforms, enable `build-check` on `runtime-rs`. Signed-off-by: Ruoqing He --- .github/workflows/build-checks-preview-riscv64.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build-checks-preview-riscv64.yaml b/.github/workflows/build-checks-preview-riscv64.yaml index 6ab72157ba..d8af099413 100644 --- a/.github/workflows/build-checks-preview-riscv64.yaml +++ b/.github/workflows/build-checks-preview-riscv64.yaml @@ -43,6 +43,10 @@ jobs: - rust - musl-tools - protobuf-compiler + - name: runtime-rs + path: src/runtime-rs + needs: + - rust steps: - name: Adjust a permission for repo