mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-08-12 13:32:31 +00:00
cpu_dead should only run on current pcpu
no need for input param pcpu_id. Tracked-On: #1842 Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
parent
d2627ecfcc
commit
d2bac7cc5d
@ -598,12 +598,16 @@ void cpu_do_idle(void)
|
|||||||
__asm __volatile("pause" ::: "memory");
|
__asm __volatile("pause" ::: "memory");
|
||||||
}
|
}
|
||||||
|
|
||||||
void cpu_dead(uint16_t pcpu_id)
|
/**
|
||||||
|
* only run on current pcpu
|
||||||
|
*/
|
||||||
|
void cpu_dead(void)
|
||||||
{
|
{
|
||||||
/* For debug purposes, using a stack variable in the while loop enables
|
/* For debug purposes, using a stack variable in the while loop enables
|
||||||
* us to modify the value using a JTAG probe and resume if needed.
|
* us to modify the value using a JTAG probe and resume if needed.
|
||||||
*/
|
*/
|
||||||
int32_t halt = 1;
|
int32_t halt = 1;
|
||||||
|
uint16_t pcpu_id = get_cpu_id();
|
||||||
|
|
||||||
if (bitmap_test_and_clear_lock(pcpu_id, &pcpu_active_bitmap)) {
|
if (bitmap_test_and_clear_lock(pcpu_id, &pcpu_active_bitmap)) {
|
||||||
/* clean up native stuff */
|
/* clean up native stuff */
|
||||||
|
@ -72,7 +72,7 @@ static void enter_guest_mode(uint16_t pcpu_id)
|
|||||||
default_idle();
|
default_idle();
|
||||||
|
|
||||||
/* Control should not come here */
|
/* Control should not come here */
|
||||||
cpu_dead(pcpu_id);
|
cpu_dead();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void bsp_boot_post(void)
|
static void bsp_boot_post(void)
|
||||||
|
@ -376,7 +376,7 @@ void dispatch_exception(struct intr_excp_ctx *ctx)
|
|||||||
spinlock_release(&exception_spinlock);
|
spinlock_release(&exception_spinlock);
|
||||||
|
|
||||||
/* Halt the CPU */
|
/* Halt the CPU */
|
||||||
cpu_dead(pcpu_id);
|
cpu_dead();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PARTITION_MODE
|
#ifdef CONFIG_PARTITION_MODE
|
||||||
|
@ -175,7 +175,7 @@ void default_idle(void)
|
|||||||
if (need_reschedule(pcpu_id) != 0) {
|
if (need_reschedule(pcpu_id) != 0) {
|
||||||
schedule();
|
schedule();
|
||||||
} else if (need_offline(pcpu_id) != 0) {
|
} else if (need_offline(pcpu_id) != 0) {
|
||||||
cpu_dead(pcpu_id);
|
cpu_dead();
|
||||||
} else {
|
} else {
|
||||||
CPU_IRQ_ENABLE();
|
CPU_IRQ_ENABLE();
|
||||||
handle_complete_ioreq(pcpu_id);
|
handle_complete_ioreq(pcpu_id);
|
||||||
|
@ -306,7 +306,7 @@ extern struct cpuinfo_x86 boot_cpu_data;
|
|||||||
|
|
||||||
/* Function prototypes */
|
/* Function prototypes */
|
||||||
void cpu_do_idle(void);
|
void cpu_do_idle(void);
|
||||||
void cpu_dead(uint16_t pcpu_id);
|
void cpu_dead(void);
|
||||||
void trampoline_start16(void);
|
void trampoline_start16(void);
|
||||||
bool is_apicv_reg_virtualization_supported(void);
|
bool is_apicv_reg_virtualization_supported(void);
|
||||||
bool is_apicv_intr_delivery_supported(void);
|
bool is_apicv_intr_delivery_supported(void);
|
||||||
|
Loading…
Reference in New Issue
Block a user