Call monitor_cap_detect in bsp_boot_init

On the APL NUC board (CPU family: 0x6 model: 92), the monitor is buggy.
We can't use it to wake up CPU core from mwait by memory monitor.

Signed-off-by: Li, Fei1 <fei1.li@intel.com>
This commit is contained in:
Li, Fei1 2018-03-08 22:45:07 +08:00 committed by Jack Ren
parent 78649c4a52
commit b0f8781500

View File

@ -74,9 +74,10 @@ struct cpu_capability {
static struct cpu_capability cpu_caps;
static void apicv_cap_detect(void);
static void monitor_cap_detect(void);
static void cpu_set_logical_id(uint32_t logical_id);
static void print_hv_banner(void);
bool check_monitor_support(void);
static inline bool get_monitor_cap(void);
int cpu_find_logical_id(uint32_t lapic_id);
#ifndef CONFIG_EFI_STUB
static void start_cpus();
@ -310,6 +311,8 @@ void bsp_boot_init(void)
apicv_cap_detect();
monitor_cap_detect();
/* Set state for this CPU to initializing */
cpu_set_current_state(CPU_BOOT_ID, CPU_STATE_INITIALIZING);
@ -557,7 +560,7 @@ static void pcpu_sync_sleep(unsigned long *sync, int mask_bit)
{
int wake_sync = (1 << mask_bit);
if (check_monitor_support()) {
if (get_monitor_cap()) {
/* Wait for the event to be set using monitor/mwait */
asm volatile ("1: cmpl %%ebx,(%%eax)\n"
" je 2f\n"
@ -653,7 +656,7 @@ static void monitor_cap_detect(void)
}
}
bool check_monitor_support(void)
static inline bool get_monitor_cap(void)
{
return cpu_caps.monitor_supported;
}