From 974e8c63ea5200883be749ec7eca3434cd8b212b Mon Sep 17 00:00:00 2001 From: Xue Bosheng Date: Sun, 28 Sep 2025 19:45:59 +0800 Subject: [PATCH] hv: refine make_reschedule_request in schedule module add arch_send_reschedule_request, which is called by make_reschedule_request, for X86 arch_send_reschedule_request will call kick_pcpu, arch_send_reschedule_request is arch public API, which is needed to be implemented by each architecture. Tracked-On: #8812 Signed-off-by: Xue Bosheng Acked-by: Wang, Yu1 --- hypervisor/arch/x86/notify.c | 6 ++++++ hypervisor/common/schedule.c | 7 +++---- hypervisor/include/common/schedule.h | 1 + 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/hypervisor/arch/x86/notify.c b/hypervisor/arch/x86/notify.c index 8a4f1a4b2..d433f3953 100644 --- a/hypervisor/arch/x86/notify.c +++ b/hypervisor/arch/x86/notify.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -96,3 +97,8 @@ void arch_smp_call_kick_pcpu(uint16_t pcpu_id) send_single_ipi(pcpu_id, NOTIFY_VCPU_VECTOR); } } + +void arch_send_reschedule_request(uint16_t pcpu_id) +{ + kick_pcpu(pcpu_id); +} diff --git a/hypervisor/common/schedule.c b/hypervisor/common/schedule.c index 363083771..e0626fd12 100644 --- a/hypervisor/common/schedule.c +++ b/hypervisor/common/schedule.c @@ -7,12 +7,11 @@ #include #include #include -#include +#include #include -#include #include #include -#include +#include #include bool is_idle_thread(const struct thread_object *obj) @@ -155,7 +154,7 @@ void make_reschedule_request(uint16_t pcpu_id) bitmap_set(NEED_RESCHEDULE, &ctl->flags); if (get_pcpu_id() != pcpu_id) { - kick_pcpu(pcpu_id); + arch_send_reschedule_request(pcpu_id); } } diff --git a/hypervisor/include/common/schedule.h b/hypervisor/include/common/schedule.h index 5278ab99c..dd701c1f6 100644 --- a/hypervisor/include/common/schedule.h +++ b/hypervisor/include/common/schedule.h @@ -153,6 +153,7 @@ void wake_thread(struct thread_object *obj); void yield_current(void); void schedule(void); +void arch_send_reschedule_request(uint16_t pcpu_id); void arch_switch_to(void *prev_sp, void *next_sp); void run_idle_thread(void); #endif /* SCHEDULE_H */