Skip to content

Commit b369098

Browse files
JasonChenCJlijinxia
authored andcommitted
[REVERT-ME]: disable turbo mode
there is a bug for system hang on SBL bootloader after we enabled turbo mode. so add tmp patch to disable turbo mode as the work-around. after SBL fixed it, we revert this patch. Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
1 parent 3fed57b commit b369098

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

hypervisor/arch/x86/cpu.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@ static void get_cpu_name(void)
368368
void bsp_boot_init(void)
369369
{
370370
uint64_t rsp;
371+
uint64_t misc_en;
371372

372373
start_tsc = rdtsc();
373374

@@ -436,6 +437,10 @@ void bsp_boot_init(void)
436437

437438
__bitmap_set(BOOT_CPU_ID, &pcpu_active_bitmap);
438439

440+
misc_en = msr_read(MSR_IA32_MISC_ENABLE);
441+
if ((misc_en & TURBO_MODE_DISABLE) == 0)
442+
msr_write(MSR_IA32_MISC_ENABLE, misc_en | TURBO_MODE_DISABLE);
443+
439444
/* Get CPU capabilities thru CPUID, including the physical address bit
440445
* limit which is required for initializing paging.
441446
*/
@@ -563,6 +568,7 @@ static void bsp_boot_post(void)
563568
void cpu_secondary_init(void)
564569
{
565570
uint64_t rsp;
571+
uint64_t misc_en;
566572

567573
/* Switch this CPU to use the same page tables set-up by the
568574
* primary/boot CPU
@@ -581,6 +587,10 @@ void cpu_secondary_init(void)
581587

582588
__bitmap_set(get_cpu_id(), &pcpu_active_bitmap);
583589

590+
misc_en = msr_read(MSR_IA32_MISC_ENABLE);
591+
if ((misc_en & TURBO_MODE_DISABLE) == 0)
592+
msr_write(MSR_IA32_MISC_ENABLE, misc_en | TURBO_MODE_DISABLE);
593+
584594
/* Switch to run-time stack */
585595
rsp = (uint64_t)(&get_cpu_var(stack)[CONFIG_STACK_SIZE - 1]);
586596
rsp &= ~(CPU_STACK_ALIGN - 1UL);

hypervisor/include/arch/x86/msr.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,4 +554,7 @@
554554
#define SPEC_ENABLE_STIBP (1U<<1)
555555
#define PRED_SET_IBPB (1U<<0)
556556

557+
/* Turbo config bit */
558+
#define TURBO_MODE_DISABLE (1UL<<38)
559+
557560
#endif /* MSR_H */

0 commit comments

Comments
 (0)