Skip to content

Conversation

@liulog
Copy link
Contributor

@liulog liulog commented Dec 20, 2025

Axvisor's issue:
arceos-hypervisor/axvisor#303

Features:

  • Fix bugs about cause (e.g. modify SupervisorEnvCall to VirtualSupervisorEnvCall )
  • Support VS registers load/store at function bind/unbind
  • Add decode instruction read from htinst
  • Add EID_SRST sbi extension's simple support

Demo:

I run two vms (ArceOS + Linux), both them run in cpu0.

image

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the RISC-V hypervisor (axvisor) to support running 2 virtual machines simultaneously by fixing critical bugs and implementing missing features for proper VM context switching.

Key changes:

  • Fixed trap cause handling by correcting SupervisorEnvCall to VirtualSupervisorEnvCall and page fault exceptions to their guest equivalents
  • Implemented VS-mode CSR save/restore in bind/unbind operations to enable proper vCPU context switching
  • Added htinst register decoding support for handling transformed instructions and pseudo-instructions during guest page faults
  • Added basic SRST SBI extension support for VM shutdown capability

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 10 comments.

File Description
src/vcpu.rs Core changes including trap cause fixes, VS CSR load/store in bind/unbind, htinst-based instruction decoding, SRST extension handler, and GPR indexing corrections
src/lib.rs Modified RISCVVCpuCreateConfig to use raw usize for dtb_addr instead of GuestPhysAddr, and exported GprIndex publicly
Cargo.toml Updated riscv dependency to use a Git repository fork

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ZR233 ZR233 requested a review from Copilot December 22, 2025 10:52
@ZR233 ZR233 added the enhancement New feature or request label Dec 22, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ZR233 ZR233 self-assigned this Dec 26, 2025
ZR233
ZR233 previously approved these changes Dec 26, 2025
Co-authored-by: Copilot <[email protected]>
@ZR233 ZR233 merged commit dda3b4a into arceos-hypervisor:master Dec 26, 2025
3 checks passed
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

Successfully merging this pull request may close these issues.

2 participants