LoongArch: non-root zone cannot boot normally after shutdown and restart
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 18/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- rust
- Lĩnh vực
- operating-systems
Hướng nghiên cứu
Start with the zone shutdown path in hv_zone_shutdown(), where the wait for CPU3 to reach Stopped times out, and the restart path in hv_zone_start(), which only wakes the boot CPU. Also check the event drain and idle handling in hvisor::event and the LoongArch cpu code, and the driver call in hvisor-tool/driver/hvisor_main.c. Done means a non-root zone shut down and restarted on ls3a6000 reaches its console login, with all zone CPUs brought up.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
On LoongArch ls3a6000, a non-root Linux zone (linux1, CPUs 2-3) can boot the first time, but after hvisor zone shutdown -id 1 and then ./start.sh 1, it no longer boots normally. The hypercall path reports the zone as running, but the non-root console does not reach login and screen /dev/pts/0 times out.
Environment
- Board: Loongson 3A6000 / ls3a6000
- Branch under test:
fix-interrupt-la - Root Linux:
6.11.6 - Non-root linux1:
6.13.7 - Non-root zone config:
linux1, CPU mask0xc(pCPU 2 and 3)
Reproduction
- Boot hvisor on ls3a6000.
- In root Linux, start daemon and then start linux1:
./daemon.sh ./start.sh 1 - Confirm linux1 boots and can reach its console.
- Shut down linux1:
hvisor zone shutdown -id 1 - Start linux1 again:
./start.sh 1 - Check zone list and console:
hvisor zone list timeout -k 2s 12s screen /dev/pts/0
Observed behavior
During shutdown, both shutdown events are enqueued, but CPU3 may not enter Stopped before MAX_WAIT_TIMES expires:
hvisor zone shutdown -id 1;
[INFO 0] (hvisor::hypercall:269) handle hvc zone shutdown, id=1
[INFO 0] (hvisor::event:87) [HVDBG:event-enqueue] seq=8884 src_cpu=0 dst_cpu=2 event=1 armed=true queue_len=1 kick=true
[INFO 0] (hvisor::event:87) [HVDBG:event-enqueue] seq=8885 src_cpu=0 dst_cpu=3 event=1 armed=true queue_len=1 kick=true
[INFO 2] (hvisor::event:240) [HVDBG:event-drain] seq=8886 cpu=2 event=1 more_pending=false
[INFO 2] (hvisor::arch::loongarch64::cpu:144) loongarch64: ArchCpu::idle: cpuid=2
[ERROR 0] (hvisor::hypercall:316) cpu 3 cannot be shut down
[INFO 3] (hvisor::event:240) [HVDBG:event-drain] seq=8887 cpu=3 event=1 more_pending=false
[INFO 3] (hvisor::arch::loongarch64::cpu:144) loongarch64: ArchCpu::idle: cpuid=3
[INFO 0] (hvisor::hypercall:346) zone 1 has been shutdown
The shutdown ioctl still returns success and the zone is removed. The following restart returns success and reports the zone as running, but only CPU2 is observed to run; the log does not show the expected CPU3 wakeup/drain sequence before the console test:
./start.sh 1;
booting zone linux1 with configuration: /tool/linux1.json
[INFO 0] (hvisor::zone:914) zone cpu_set: 0b1100
[INFO 0] (hvisor::hypercall:255) boot_cpu: 2
[INFO 0] (hvisor::event:87) [HVDBG:event-enqueue] seq=8922 src_cpu=0 dst_cpu=2 event=0 armed=true queue_len=1 kick=true
hvisor zone list
| zone_id | cpus | name | status |
| 0 | 0, 1 | root-linux-la64 | running |
| 1 | 2, 3 | linux1 | running |
timeout -k 2s 12s screen /dev/pts/0
A later iteration with additional idle IRQ logging shows the boot CPU does drain the wakeup event and enters guest at the kernel entry, but the console still times out:
[INFO 1] (hvisor::hypercall:255) boot_cpu: 2
[INFO 1] (hvisor::event:87) [HVDBG:event-enqueue] seq=9077 src_cpu=1 dst_cpu=2 event=0 armed=true queue_len=1 kick=true
[INFO 2] (hvisor::event:240) [HVDBG:event-drain] seq=9078 cpu=2 event=0 more_pending=false
[INFO 2] (hvisor::arch::loongarch64::cpu:90) [[CPU virtualization]] CPU2 run@0x900000021da22000
hvisor zone list
| zone_id | cpus | name | status |
| 0 | 0, 1 | root-linux-la64 | running |
| 1 | 2, 3 | linux1 | running |
timeout -k 2s 12s screen /dev/pts/0
Expected behavior
After a successful hvisor zone shutdown -id 1, starting the same non-root zone again should reproduce the first boot behavior: linux1 should boot, bring up its secondary CPU if configured, and the non-root console should reach login.
Initial investigation
The failure appears related to LoongArch zone lifecycle cleanup/reinitialization rather than the userspace CLI path:
HVISOR_ZONE_SHUTDOWNmaps directly tohvisor_call(HVISOR_HC_SHUTDOWN_ZONE, arg, 0)inhvisor-tool/driver/hvisor_main.c.hv_zone_shutdown()enqueuesIPI_EVENT_SHUTDOWNto each zone CPU, then busy-waits for all CPUs to becomeStopped. The log shows CPU3 can process shutdown after the wait path has already emittedcpu 3 cannot be shut down.- The shutdown function still proceeds to clear
zone, reset irqchip state, remove the zone, and return success. - On restart,
hv_zone_start()only sendsIPI_EVENT_WAKEUPto the boot CPU. The non-root kernel is then expected to bring up CPU3 through virtual IPI/SMP. In the failing run, linux1 does not reach a usable console.
- Ngôn ngữ chính
- Rust
- Star
- 209
- Fork
- 62
- Merge trung bình
- 1 ngày 21 giờ
- Pull request đã merge (30 ngày)
- 20
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của syswonder/hvisor
-
aarch64 good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug ci enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
syswonder/hvisor#459 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
aarch64 enhancement loongarch64 riscv64 x86_64
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
Maintainer thường phản hồi trong vòng 1 ngày
-
aarch64 bug documentation
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
aarch64 bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của syswonder/hvisor
Issue tương tự
-
[Bug] 查看密码Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
AnalyseDeCircuit/oxideterm#889 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
marketing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 69/100
haowjy/mars-agents#519 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug impeccable priority: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
nledford/Ladderback#1897 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
agent:linux priority:high
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
fa0311/better-tokuly#1204 ·
Maintainer thường phản hồi trong vòng 1 ngày