From 8d218c0b37641e29e9ba6c63ddfe5a20b8bd957a Mon Sep 17 00:00:00 2001 From: Jian Jun Chen Date: Fri, 12 Sep 2025 09:41:57 +0800 Subject: [PATCH] hv: multi-arch: move asm_pause to common Tracked-On: #8791 Signed-off-by: Jian Jun Chen Acked-by: Wang, Yu1 --- hypervisor/include/arch/x86/asm/cpu.h | 2 +- hypervisor/include/common/cpu.h | 6 ++++++ hypervisor/include/debug/logmsg.h | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/hypervisor/include/arch/x86/asm/cpu.h b/hypervisor/include/arch/x86/asm/cpu.h index 194e7f5bd..16bd0c256 100644 --- a/hypervisor/include/arch/x86/asm/cpu.h +++ b/hypervisor/include/arch/x86/asm/cpu.h @@ -502,7 +502,7 @@ static inline void cpu_msr_write(uint32_t reg, uint64_t msr_val) asm volatile (" wrmsr " : : "c" (reg), "a" ((uint32_t)msr_val), "d" ((uint32_t)(msr_val >> 32U))); } -static inline void asm_pause(void) +static inline void arch_asm_pause(void) { asm volatile ("pause" ::: "memory"); } diff --git a/hypervisor/include/common/cpu.h b/hypervisor/include/common/cpu.h index 2069fca76..fcb11b38b 100644 --- a/hypervisor/include/common/cpu.h +++ b/hypervisor/include/common/cpu.h @@ -33,6 +33,7 @@ enum pcpu_boot_state { static inline uint16_t arch_get_pcpu_id(void); static inline void arch_set_current_pcpu_id(uint16_t pcpu_id); void arch_start_pcpu(uint16_t pcpu_id); +static inline void arch_asm_pause(void); uint16_t arch_get_pcpu_num(void); uint16_t get_pcpu_nums(void); bool is_pcpu_active(uint16_t pcpu_id); @@ -57,4 +58,9 @@ static inline void set_current_pcpu_id(uint16_t pcpu_id) arch_set_current_pcpu_id(pcpu_id); } +static inline void asm_pause(void) +{ + arch_asm_pause(); +} + #endif /* COMMON_CPU_H */ diff --git a/hypervisor/include/debug/logmsg.h b/hypervisor/include/debug/logmsg.h index a99266787..f737a0ab4 100644 --- a/hypervisor/include/debug/logmsg.h +++ b/hypervisor/include/debug/logmsg.h @@ -6,7 +6,7 @@ #ifndef LOGMSG_H #define LOGMSG_H -#include +#include /* Logging severity levels */ #define LOG_FATAL 1U