-
Notifications
You must be signed in to change notification settings - Fork 18
Vmm inject interrupt #36
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
base: vmm
Are you sure you want to change the base?
Conversation
* 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
…o necessary crates
dc93ad7 to
42c2aab
Compare
…_interrupt_vgicv3
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]>
There was a problem hiding this 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
axipicrate 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}");
| // debug!("idle task: waiting for IRQs..."); | ||
| // #[cfg(feature = "irq")] | ||
| // axhal::arch::wait_for_irqs(); |
Copilot
AI
Jul 15, 2025
There was a problem hiding this comment.
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.
| // 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(); |
| // mod riscv64_qemu_virt; | ||
| // pub use self::riscv64_qemu_virt::*; |
Copilot
AI
Jul 15, 2025
There was a problem hiding this comment.
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.
| // mod riscv64_qemu_virt; | |
| // pub use self::riscv64_qemu_virt::*; |
| 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) {} |
Copilot
AI
Jul 15, 2025
There was a problem hiding this comment.
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.
| 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."); | |
| } |
No description provided.