diff --git a/hypervisor/arch/riscv/cpu.c b/hypervisor/arch/riscv/cpu.c index af7be2c5a..10ee0477c 100644 --- a/hypervisor/arch/riscv/cpu.c +++ b/hypervisor/arch/riscv/cpu.c @@ -15,6 +15,7 @@ #include #include #include +#include /* * This array contains the hart IDs for each physial cpu. @@ -114,3 +115,16 @@ void arch_start_pcpu(uint16_t pcpu_id) pr_fatal("Failed to start cpu%hu by SBI HSM", pcpu_id); } } + +void arch_cpu_do_idle(void) +{ + asm volatile ("wfi"::); +} + +/** + * FIXME: This is a temp solution for now. The formal solution should clear up and put pcpu into a low power state. + */ +void arch_cpu_dead(void) +{ + while (true) {}; +} diff --git a/hypervisor/include/arch/riscv/asm/cpu.h b/hypervisor/include/arch/riscv/asm/cpu.h index cb2c75e1b..fdfe908cc 100644 --- a/hypervisor/include/arch/riscv/asm/cpu.h +++ b/hypervisor/include/arch/riscv/asm/cpu.h @@ -108,14 +108,6 @@ struct stack_frame { /* Define CPU stack alignment */ #define CPU_STACK_ALIGN 16UL -/** - * FIXME: This is a temp solution for now. The formal solution should clear up and put pcpu into a low power state. - */ -static inline void cpu_dead(void) -{ - while (true) {}; -} - /* In ACRN, struct per_cpu_region is a critical data structure * containing key per-CPU data frequently accessed via get_cpu_var(). * We use the tp register to store the current logical pCPU ID to