Skip to content

Conversation

@hky1999
Copy link

@hky1999 hky1999 commented Dec 19, 2024

No description provided.

hky1999 and others added 8 commits December 31, 2024 20:49
* update aarch64 hv part in arceos (#15)

* Modify platform configuration of aarch64-qemu-virt-hv for GICv2 with virtualization (#20)

* refactor: totally remove hv related trap handlers from axhal/arch/aarch64 (#22)

* Add gic trait impl (#26)

* [refactor] remove hv related scripts and configs from arceos
* [feat] update allocator version to support alloc_pages_at
* [feat] set phys-virt-offset as 0xffff_8000_0000_0000 for x86_64 qemu
)

* [FIX] Fix the bug of smp startup on a1000

* [feat] adapt hypervisor for a1000b
@aarkegz aarkegz force-pushed the vmm_inject_interrupt branch from dc93ad7 to 42c2aab Compare January 9, 2025 08:01
aarkegz and others added 25 commits May 26, 2025 20:29
Co-authored-by: Copilot <[email protected]>
* Add GICv3 Support (#49)

* feat:support gicv3

* modify some code according to arm-gic-driver

* support for rk3588 smp

* bugfix:fix the gicr init bug accoring to the latest arm-gic-driver

* build(aarch64): Update platform configuration and interrupt controller dependencies

- Modify aarch64-qemu-virt platform configuration, add GIC Rdistributor base address
- Update axhal module dependencies:
- Remove arm_gicv2 direct dependency
- Add conditional dependency to use arm_gicv2 for non-GICv3 architectures
- Update other dependency versions
- In aarch64_rk3588j platform, keep UART initialization comments

* build(AXHal): Update GICv2 dependency version and add configuration conditions

- Add GICv2 EL2 features for scenarios that support virtualization
- Add GICv2 base version for scenarios that do not support virtualization
- Optimize dependency versions through conditional compilation configuration

* fixes for mistakes in #49

* `inject_interrupt` on GICv3 based on hVisor

* add sgi ipi interface for gicv3 driver

* fix missing irm field in `send_sgi_inner`

* [wip] only init necessery gicr settings

* [wip] boot on qemu

* Fix mistakes in #49, including GICv3 driver and config files (#63)

* fixes after merge

* update gicv3_tester

* disable el2 time ticks to allow axvisor run correctly

* re-enabling `init_interrupt` when not in aarch64-hv mode

* update `memory_addr`

* some small fixes

* rename `gicv3_tester` to `ticker`

* allow `init_interrupt` when building `hv` on `aarch64`, as timer is disabled

* fix type

Co-authored-by: Copilot <[email protected]>

* reformatted

* fix a compiler error caused by an update of `stvec::write` in `riscv` crate

* rename IPI-related functions in `axhal`, add dummy implementation for loongarch64

* fix unit-test errors

* fix unit-test error

* fix missing docs

---------

Co-authored-by: bhxh <[email protected]>
Co-authored-by: hky1999 <[email protected]>
Co-authored-by: Copilot <[email protected]>
@aarkegz aarkegz marked this pull request as ready for review July 15, 2025 13:38
@aarkegz aarkegz requested review from aarkegz and Copilot July 15, 2025 13:38
Copy link

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 introduces full Inter-Processor Interrupt (IPI) support by adding a new axipi crate, updating task and runtime components to track and dispatch IPIs, and extending platform drivers and Cargo configurations to wire everything together.

  • Add axipi crate for managing IPI event queues and callbacks
  • Extend scheduler and task structures to record and propagate CPU IDs under SMP
  • Update architecture-specific interrupt controllers (x86 APIC, RISC-V SBI, ARM GIC) to send and handle IPIs

Reviewed Changes

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

Show a summary per file
File Description
ulib/axstd/Cargo.toml Added ipi feature flag to pull in IPI APIs
modules/axipi/src/lib.rs Implemented IPI event queue, send, and handler logic
modules/axtask/src/task.rs Extended TaskInner with cpu_id field and accessors
modules/axhal/src/platform/x86_pc/apic.rs Defined IPI vector and added send_ipi_* functions
api/arceos_posix_api/build.rs Updated bindgen build script to strip -softfloat suffix
Comments suppressed due to low confidence (1)

api/arceos_posix_api/build.rs:79

  • The formatting string uses a named placeholder {fname} without supplying a named argument. This will fail to compile. Use positional formatting instead, e.g., println!("cargo:rerun-if-changed={}", fname);.
                    println!("cargo:rerun-if-changed={fname}");

Comment on lines +213 to +215
// debug!("idle task: waiting for IRQs...");
// #[cfg(feature = "irq")]
// axhal::arch::wait_for_irqs();
Copy link

Copilot AI Jul 15, 2025

Choose a reason for hiding this comment

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

[nitpick] This commented-out debug and IRQ-wait code clutters the idle loop. Consider removing or restoring it under a feature flag to keep the codebase clean.

Suggested change
// debug!("idle task: waiting for IRQs...");
// #[cfg(feature = "irq")]
// axhal::arch::wait_for_irqs();
#[cfg(feature = "debug")]
debug!("idle task: waiting for IRQs...");
#[cfg(feature = "irq")]
axhal::arch::wait_for_irqs();

Copilot uses AI. Check for mistakes.
Comment on lines +37 to +38
// mod riscv64_qemu_virt;
// pub use self::riscv64_qemu_virt::*;
Copy link

Copilot AI Jul 15, 2025

Choose a reason for hiding this comment

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

[nitpick] Commented-out platform module may be vestigial. If RISC-V support is not needed here, remove these lines; otherwise re-enable the import.

Suggested change
// mod riscv64_qemu_virt;
// pub use self::riscv64_qemu_virt::*;

Copilot uses AI. Check for mistakes.
Comment on lines +47 to +51
pub fn send_ipi_one(dest_cpu: usize, irq_num: usize) {}

/// Send a broadcast IPI to all CPUs.
#[cfg(feature = "ipi")]
pub fn send_ipi_all_others(irq_num: usize) {}
Copy link

Copilot AI Jul 15, 2025

Choose a reason for hiding this comment

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

[nitpick] This IPI stub is empty. Consider adding a // TODO or a unimplemented!() to clarify that LoongArch64 IPI support is pending.

Suggested change
pub fn send_ipi_one(dest_cpu: usize, irq_num: usize) {}
/// Send a broadcast IPI to all CPUs.
#[cfg(feature = "ipi")]
pub fn send_ipi_all_others(irq_num: usize) {}
pub fn send_ipi_one(dest_cpu: usize, irq_num: usize) {
// TODO: Implement IPI support for LoongArch64.
unimplemented!("IPI support is not yet implemented for LoongArch64.");
}
/// Send a broadcast IPI to all CPUs.
#[cfg(feature = "ipi")]
pub fn send_ipi_all_others(irq_num: usize) {
// TODO: Implement broadcast IPI support for LoongArch64.
unimplemented!("Broadcast IPI support is not yet implemented for LoongArch64.");
}

Copilot uses AI. Check for mistakes.
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.

5 participants