Skip to content

First-step interrupt injection support - #195

Closed
aarkegz wants to merge 75 commits into
masterfrom
inject_interrupt
Closed

First-step interrupt injection support#195
aarkegz wants to merge 75 commits into
masterfrom
inject_interrupt

Conversation

@aarkegz

@aarkegz aarkegz commented Jul 16, 2025

Copy link
Copy Markdown
Contributor

No description provided.

aarkegz and others added 30 commits December 19, 2024 20:04
- Add VGICv2 support for virtual interrupt controller
- Integrate VirtIO drivers for block and network devices
- Update VM configuration to include VGICv2 and VirtIO devices
- Remove unused timer code and mock timer device
@aarkegz
aarkegz requested review from Copilot and hky1999 July 16, 2025 03:19
@aarkegz aarkegz self-assigned this Jul 16, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request implements first-step interrupt injection support for the ArceOS hypervisor. The changes introduce Inter-VM Communication (IVC) capabilities, hypercall handling infrastructure, and comprehensive interrupt management for virtualized environments.

  • Adds IVC channel management with publish/subscribe mechanisms for VM communication
  • Implements hypercall handler supporting IVC operations and SendIPI functionality
  • Integrates interrupt injection APIs and timer management for VM scheduling

Reviewed Changes

Copilot reviewed 40 out of 45 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/vmm/vcpus.rs Core vCPU management with hypercall handling and interrupt processing
src/vmm/ivc.rs Inter-VM communication channel implementation
src/vmm/hvc.rs Hypercall handler for IVC operations
src/vmm/mod.rs VMM module integration with new APIs
src/hal.rs Hardware abstraction layer with memory and interrupt APIs
Multiple config files VM and platform configuration updates
Comments suppressed due to low confidence (1)

src/vmm/mod.rs:81

  • Function name 'with_wm' is unclear and inconsistent with similar functions 'with_vm_and_vcpu'. Consider renaming to 'with_vm' for clarity and consistency.
pub fn with_wm<T>(vm_id: usize, f: impl FnOnce(VMRef) -> T) -> Option<T> {

Comment thread src/vmm/mod.rs
.ok_or_else(|| ax_err_type!(NotFound))?;

use std::os::arceos::modules::axipi;
Ok(axipi::send_ipi_event_to_one(pcpu_id as usize, move || {

Copilot AI Jul 16, 2025

Copy link

Choose a reason for hiding this comment

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

Recursive call to 'with_vm_and_vcpu_on_pcpu' inside the IPI handler could lead to infinite recursion or stack overflow if the target vCPU task is not found. Consider adding recursion depth tracking or alternative handling.

Copilot uses AI. Check for mistakes.
Comment thread src/vmm/ivc.rs
/// The base address of the shared memory region in guest physical address of the publisher VM.
/// `None` if the channel has been unpublished (but still has subscribers).
base_gpa: Option<GuestPhysAddr>,
_phatom: core::marker::PhantomData<H>,

Copilot AI Jul 16, 2025

Copy link

Choose a reason for hiding this comment

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

Typo in field name '_phatom' should be '_phantom'.

Suggested change
_phatom: core::marker::PhantomData<H>,
_phantom: core::marker::PhantomData<H>,

Copilot uses AI. Check for mistakes.
Comment thread src/vmm/ivc.rs
shared_region_base,
shared_region_size,
base_gpa: Some(base_gpa),
_phatom: core::marker::PhantomData,

Copilot AI Jul 16, 2025

Copy link

Choose a reason for hiding this comment

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

Typo in field name '_phatom' should be '_phantom'.

Suggested change
_phatom: core::marker::PhantomData,
_phantom: core::marker::PhantomData,

Copilot uses AI. Check for mistakes.
Comment thread src/vmm/vcpus.rs
let vcpu_id = vcpu.id();

// boot delay
let boot_delay_sec = (vm_id - 1) * 5;

Copilot AI Jul 16, 2025

Copy link

Choose a reason for hiding this comment

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

Magic number '5' for boot delay calculation should be defined as a named constant to improve maintainability and make the delay configurable.

Suggested change
let boot_delay_sec = (vm_id - 1) * 5;
const BOOT_DELAY_MULTIPLIER: u64 = 5;
let boot_delay_sec = (vm_id - 1) * BOOT_DELAY_MULTIPLIER;

Copilot uses AI. Check for mistakes.
Comment thread src/vmm/timer.rs
Comment thread src/utils/arch/aarch64/cache.rs
Comment thread src/vmm/images.rs
}

// Load Ramdisk image
if let Some(buffer) = vm_imags.ramdisk {

Copilot AI Jul 16, 2025

Copy link

Choose a reason for hiding this comment

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

Variable name 'vm_imags' appears to be a typo, should likely be 'vm_images' based on context.

Copilot uses AI. Check for mistakes.
@ZR233 ZR233 mentioned this pull request Jul 21, 2025
29 tasks
* fix: update toml crate

* Style: cargo fmt
@ZCShou ZCShou closed this Nov 24, 2025
@ZCShou
ZCShou deleted the inject_interrupt branch November 24, 2025 04:48
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.

7 participants