-
Notifications
You must be signed in to change notification settings - Fork 126
feat(riscv64): support dynamic platform on QEMU and SG2002 #961
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
Merged
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
fcfe3da
Add RISC-V support and IRQ handling improvements
ZR233 de5a67a
Merge remote-tracking branch 'upstream/dev' into feat/rv64-dyn2
ZR233 bda78dc
fix(axvisor): enable riscv64 qemu platform feature in CI
ZR233 afdffdb
Merge remote-tracking branch 'upstream/dev' into feat/rv64-dyn2
ZR233 ef54984
fix(axvisor): boot riscv64 dynamic hv
ZR233 81da8da
feat(riscv64): support dynamic platform drivers
ZR233 ee9cacd
Merge remote-tracking branch 'upstream/dev' into feat/rv64-dyn2
ZR233 9f22f02
Merge remote-tracking branch 'upstream/dev' into feat/rv64-dyn2
ZR233 30fbf97
fix(ax-driver): correct feature handling for plat-static and plat-dyn
ZR233 784fa4b
fix(somehal): use runtime CPU id for riscv64 PLIC context
ZR233 f33b1dd
fix(build): replace pci driver feature with plat-dyn in configuration
ZR233 068a923
Refactor platform feature configurations across various board TOML files
ZR233 459e14e
Merge remote-tracking branch 'upstream/dev' into feat/rv64-dyn2
ZR233 201d431
fix(build): remove unnecessary parameter from build_cargo_args call
ZR233 8508ed5
Merge remote-tracking branch 'upstream/dev' into feat/rv64-dyn2
ZR233 59410b1
feat: add riscv_goldfish dependency and support for Goldfish RTC
ZR233 af3e110
Merge remote-tracking branch 'upstream/dev' into feat/rv64-dyn2
ZR233 4a35043
refactor(smp): replace cpu_idx with early_current_cpu_idx for better …
ZR233 dc007ca
Merge remote-tracking branch 'upstream/dev' into feat/rv64-dyn2
ZR233 954843b
feat(build): add starry-kernel/input feature to the build configuration
ZR233 25f9dbd
refactor(axruntime): remove alloc feature, make it unconditional (#985)
ZR233 2109d06
Remove range-alloc-arceos crate and its associated files (#991)
ZCShou 00b427c
Refactor linker scripts and CI configuration (#992)
ZCShou 0394eed
feat(deps): update spin to version 0.12.0 and bump other dependencies
ZR233 d61404a
Merge branch 'dev' into feat/rv64-dyn2
ZR233 d7f95f1
feat: remove riscv64-qemu-virt references and update platform support…
ZR233 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,7 @@ efi = [] | |
| hv = [] | ||
| mmu = [] | ||
| percpu-prealloc = [] | ||
| thead-mae = [] | ||
| uspace = ["mmu"] | ||
|
|
||
| [dependencies] | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,11 @@ | ||
| include!(concat!(env!("OUT_DIR"), "/defines.rs")); | ||
|
|
||
| #[cfg(uspace)] | ||
| #[cfg(any(uspace, hv))] | ||
| pub const PAGE_OFFSET: usize = 0xffff_ffc0_0000_0000; | ||
| #[cfg(not(uspace))] | ||
| #[cfg(not(any(uspace, hv)))] | ||
| pub const PAGE_OFFSET: usize = 0; | ||
|
|
||
| #[cfg(uspace)] | ||
| #[cfg(any(uspace, hv))] | ||
| pub const PERCPU_BASE: usize = 0xffff_ffe0_0000_0000; | ||
| #[cfg(not(uspace))] | ||
| #[cfg(not(any(uspace, hv)))] | ||
| pub const PERCPU_BASE: usize = PAGE_OFFSET; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,6 @@ use core::{arch::global_asm, mem::offset_of}; | |
| use crate::irq; | ||
|
|
||
| const SCAUSE_INTERRUPT_BIT: usize = 1usize << (usize::BITS as usize - 1); | ||
| const SCAUSE_SUPERVISOR_TIMER: usize = 5; | ||
|
|
||
| #[repr(C)] | ||
| struct TrapFrame { | ||
|
|
@@ -66,11 +65,8 @@ pub fn trap_addr() -> usize { | |
| extern "C" fn __riscv64_handle_trap(tf: &mut TrapFrame) { | ||
| let scause = tf.scause; | ||
| if (scause & SCAUSE_INTERRUPT_BIT) != 0 { | ||
| let cause = scause & !SCAUSE_INTERRUPT_BIT; | ||
| if cause == SCAUSE_SUPERVISOR_TIMER { | ||
| irq::handle_irq(irq::systimer_irq()); | ||
| return; | ||
| } | ||
| irq::handle_irq(irq::IrqId::new(scause)); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 将完整 raw scause(含中断位)作为 IrqId 传递,替代原来仅判断 timer 的硬编码。这对动态平台是必要的——PLIC 外部中断、IPI 等都需要通过统一路径分发。逻辑正确。 |
||
| return; | ||
| } | ||
|
|
||
| panic!( | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
STACK_SIZE 从 0x4000 (16KB) 增至 0x40000 (256KB),16 倍增长。HV 场景下确实可能需要更大栈空间,可接受。建议后续如有内存压力可以测量实际栈深度再调整。