Skip to content
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

PANIC after entering guest VM under riscv64 with arceos's "irq" feature enabled #42

Closed
hky1999 opened this issue Nov 20, 2024 · 2 comments
Assignees

Comments

@hky1999
Copy link
Contributor

hky1999 commented Nov 20, 2024

When we enabled "irq" feature for hypervisor level IRQ, it won't work under RISCV64 currently.

# arceos-vmm/Cargo.toml

# System dependent modules provided by ArceOS.
axstd = { workspace = true, features = [
    "alloc",
    "paging",
    "fs",
    "irq", # It has to be disabed in riscv64. Todo: fix it.
    "hv",
    "multitask",
    # "sched_rr"
] }
  • command
make ARCH=riscv64 VM_CONFIGS=configs/nimbos-riscv64.toml run
  • phenomena
       d8888                            .d88888b.   .d8888b.
      d88888                           d88P" "Y88b d88P  Y88b
     d88P888                           888     888 Y88b.
    d88P 888 888d888  .d8888b  .d88b.  888     888  "Y888b.
   d88P  888 888P"   d88P"    d8P  Y8b 888     888     "Y88b.
  d88P   888 888     888      88888888 888     888       "888
 d8888888888 888     Y88b.    Y8b.     Y88b. .d88P Y88b  d88P
d88P     888 888      "Y8888P  "Y8888   "Y88888P"   "Y8888P"

arch = riscv64
platform = riscv64-qemu-virt
target = riscv64gc-unknown-none-elf
smp = 1
build_mode = release
log_level = warn

[  0.154169 0 fatfs::dir:139] Is a directory
[  0.172770 0 fatfs::dir:139] Is a directory
[  0.193889 0 fatfs::dir:139] Is a directory
[  0.215718 0 fatfs::dir:139] Is a directory
[  0.338912 0:5 axruntime::lang_items:5] panicked at /home/hky/.cargo/git/checkouts/riscv_vcpu-0ecce50bd3948e2b/e3c9929/src/vcpu.rs:499:17:
Unhandled trap: Exception(InstructionPageFault), sepc: 0x90200000, stval: 0x90200000
@PeizhongQiu
Copy link
Contributor

It may take some time to fix this bug. Because if irq is enabled, clock interrupts will be involved. Since the virtual machine timer interrupt and arceos timer interrupt in riscv cannot be distinguished, timerlist is needed to help judge. However, the current timer design has not yet been added to the main line, so this problem can only be fixed after the timer design is added to the main line.

@PeizhongQiu
Copy link
Contributor

Now during vmexit the relevant interrupts are disabled to support the enable irq function.Related PR: arceos-hypervisor/riscv_vcpu#12

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

No branches or pull requests

2 participants