|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH v2 0/3] xen/riscv: make machine_restart() reboot
On RISC-V, machine_restart() ignores its delay and powers off instead of rebooting, so a panic's "Reboot in five seconds..." ends in an immediate power-off. Patch 1 implements udelay() using the time CSR, as Linux does. Until the timebase frequency is known, it returns without waiting. Patch 2 uses the SBI SRST extension, when present, to reboot after the delay. Without SRST, it falls back to the legacy SHUTDOWN call as before, now after the delay. Like Arm and x86, it calls console_start_sync() first, so pending console output isn't lost. Patch 3 passes -no-reboot to QEMU in the RISC-V smoke test. Without it, a panic there would now reboot until the test times out, instead of failing the job straight away. A panic that recurs early in every boot (e.g. "-cpu rv64,svpbmt=off" on QEMU virt) is now a reboot loop. "noreboot" still powers off. machine_halt() still uses the legacy SHUTDOWN call. I intend to switch it to SRST in a follow-up. Tested on QEMU 10.2.1 virt with OpenSBI v1.8: early and late panics, "noreboot", SRST missing or failing, timebase-frequency overridden in the DT, and the smoke test script with a passing and a panicking Xen. Not tested on real hardware. Changes in v2: - Patch 1: reword the commit message and return early when cpu_khz is 0 (Baptiste). - Patch 2: call console_start_sync() first and add comments (Baptiste). - New patch 3: pass -no-reboot to QEMU in the RISC-V smoke test (Baptiste). v1: https://lore.kernel.org/xen-devel/MA0PR01MB92178FEAFBB95A225781351CFD412@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/ Anandu Padinhare (3): xen/riscv: implement udelay() xen/riscv: use the SBI SRST extension to reboot in machine_restart() CI: Pass -no-reboot to QEMU in the RISC-V smoke test automation/scripts/qemu-smoke-riscv64.sh | 1 + xen/arch/riscv/Makefile | 1 + xen/arch/riscv/delay.c | 21 +++++++++++++++++++++ xen/arch/riscv/include/asm/sbi.h | 11 +++++++++++ xen/arch/riscv/sbi.c | 21 +++++++++++++++++++++ xen/arch/riscv/shutdown.c | 16 +++++++++++----- xen/arch/riscv/stubs.c | 7 ------- 7 files changed, 66 insertions(+), 12 deletions(-) create mode 100644 xen/arch/riscv/delay.c base-commit: 091d3c200281ea44846ccdf1e5d39985321c643e -- 2.53.0
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |