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 <bosheng.xue@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
This commit is contained in:
Xue Bosheng
2025-09-28 19:45:59 +08:00
committed by acrnsi-robot
parent 6abe2e950c
commit 974e8c63ea
3 changed files with 10 additions and 4 deletions

View File

@@ -15,6 +15,7 @@
#include <asm/guest/vm.h> #include <asm/guest/vm.h>
#include <asm/guest/virq.h> #include <asm/guest/virq.h>
#include <common/notify.h> #include <common/notify.h>
#include <schedule.h>
#include <irq.h> #include <irq.h>
#include <logmsg.h> #include <logmsg.h>
@@ -96,3 +97,8 @@ void arch_smp_call_kick_pcpu(uint16_t pcpu_id)
send_single_ipi(pcpu_id, NOTIFY_VCPU_VECTOR); send_single_ipi(pcpu_id, NOTIFY_VCPU_VECTOR);
} }
} }
void arch_send_reschedule_request(uint16_t pcpu_id)
{
kick_pcpu(pcpu_id);
}

View File

@@ -7,12 +7,11 @@
#include <rtl.h> #include <rtl.h>
#include <list.h> #include <list.h>
#include <bits.h> #include <bits.h>
#include <asm/cpu.h> #include <cpu.h>
#include <per_cpu.h> #include <per_cpu.h>
#include <asm/lapic.h>
#include <schedule.h> #include <schedule.h>
#include <sprintf.h> #include <sprintf.h>
#include <asm/irq.h> #include <irq.h>
#include <trace.h> #include <trace.h>
bool is_idle_thread(const struct thread_object *obj) 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); bitmap_set(NEED_RESCHEDULE, &ctl->flags);
if (get_pcpu_id() != pcpu_id) { if (get_pcpu_id() != pcpu_id) {
kick_pcpu(pcpu_id); arch_send_reschedule_request(pcpu_id);
} }
} }

View File

@@ -153,6 +153,7 @@ void wake_thread(struct thread_object *obj);
void yield_current(void); void yield_current(void);
void schedule(void); void schedule(void);
void arch_send_reschedule_request(uint16_t pcpu_id);
void arch_switch_to(void *prev_sp, void *next_sp); void arch_switch_to(void *prev_sp, void *next_sp);
void run_idle_thread(void); void run_idle_thread(void);
#endif /* SCHEDULE_H */ #endif /* SCHEDULE_H */