Skip to content

Commit 2e31350

Browse files
yonghuahlijinxia
authored andcommitted
HV: Rename 'CPU_BOOT_ID' to 'BOOT_CPU_ID'
- code cleanup to set a more smooth name Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
1 parent e7aa00b commit 2e31350

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

hypervisor/arch/x86/cpu.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ void bsp_boot_init(void)
430430
CPU_CONTEXT_OFFSET_IA32_SPEC_CTRL,
431431
"run_context ia32_spec_ctrl offset not match");
432432

433-
__bitmap_set(CPU_BOOT_ID, &pcpu_active_bitmap);
433+
__bitmap_set(BOOT_CPU_ID, &pcpu_active_bitmap);
434434

435435
/* Get CPU capabilities thru CPUID, including the physical address bit
436436
* limit which is required for initializing paging.
@@ -467,7 +467,7 @@ static void bsp_boot_post(void)
467467
cpu_xsave_init();
468468

469469
/* Set state for this CPU to initializing */
470-
cpu_set_current_state(CPU_BOOT_ID, CPU_STATE_INITIALIZING);
470+
cpu_set_current_state(BOOT_CPU_ID, CPU_STATE_INITIALIZING);
471471

472472
/* Perform any necessary BSP initialization */
473473
init_bsp();
@@ -502,7 +502,7 @@ static void bsp_boot_post(void)
502502

503503
pr_acrnlog("Detect processor: %s", boot_cpu_data.model_name);
504504

505-
pr_dbg("Core %hu is up", CPU_BOOT_ID);
505+
pr_dbg("Core %hu is up", BOOT_CPU_ID);
506506

507507
if (hardware_detect_support() != 0) {
508508
pr_fatal("hardware not support!\n");
@@ -522,7 +522,7 @@ static void bsp_boot_post(void)
522522
shell_init();
523523

524524
/* Initialize interrupts */
525-
interrupt_init(CPU_BOOT_ID);
525+
interrupt_init(BOOT_CPU_ID);
526526

527527
timer_init();
528528
setup_notification();
@@ -536,7 +536,7 @@ static void bsp_boot_post(void)
536536
/* Trigger event to allow secondary CPUs to continue */
537537
__bitmap_set(0U, &pcpu_sync);
538538

539-
ASSERT(get_cpu_id() == CPU_BOOT_ID, "");
539+
ASSERT(get_cpu_id() == BOOT_CPU_ID, "");
540540

541541
if (init_iommu() != 0) {
542542
pr_fatal("%s, init iommu failed\n", __func__);
@@ -546,11 +546,11 @@ static void bsp_boot_post(void)
546546
console_setup_timer();
547547

548548
/* Start initializing the VM for this CPU */
549-
if (hv_main(CPU_BOOT_ID) != 0)
549+
if (hv_main(BOOT_CPU_ID) != 0)
550550
panic("failed to start VM for bsp\n");
551551

552552
/* Control should not come here */
553-
cpu_dead(CPU_BOOT_ID);
553+
cpu_dead(BOOT_CPU_ID);
554554
}
555555

556556
/* NOTE: this function is using temp stack, and after SWITCH_TO(runtime_sp, to)
@@ -928,7 +928,7 @@ static void cpu_xsave_init(void)
928928
val64 |= CR4_OSXSAVE;
929929
CPU_CR_WRITE(cr4, val64);
930930

931-
if (get_cpu_id() == CPU_BOOT_ID) {
931+
if (get_cpu_id() == BOOT_CPU_ID) {
932932
uint32_t ecx, unused;
933933
cpuid(CPUID_FEATURES, &unused, &unused, &ecx, &unused);
934934

hypervisor/arch/x86/irq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ uint32_t dev_to_vector(struct dev_handler_node *node)
361361

362362
int init_default_irqs(uint16_t cpu_id)
363363
{
364-
if (cpu_id != CPU_BOOT_ID)
364+
if (cpu_id != BOOT_CPU_ID)
365365
return 0;
366366

367367
init_irq_desc();

hypervisor/arch/x86/mmu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ static uint32_t map_mem_region(void *vaddr, void *paddr,
418418
if ((phys_cpu_num != 0U) &&
419419
((pcpu_active_bitmap &
420420
((1UL << phys_cpu_num) - 1))
421-
!= (1UL << CPU_BOOT_ID))) {
421+
!= (1UL << BOOT_CPU_ID))) {
422422
panic("need shootdown for invlpg");
423423
}
424424
inv_tlb_one_page(vaddr);

hypervisor/common/io_request.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ static void fire_vhm_interrupt(void)
1111
{
1212
/*
1313
* use vLAPIC to inject vector to SOS vcpu 0 if vlapic is enabled
14-
* otherwise, send IPI hardcoded to CPU_BOOT_ID
14+
* otherwise, send IPI hardcoded to BOOT_CPU_ID
1515
*/
1616
struct vm *vm0;
1717
struct vcpu *vcpu;

hypervisor/include/arch/x86/cpu.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@
130130
#define CPU_MHZ_TO_KHZ 1000
131131

132132
/* Boot CPU ID */
133-
#define CPU_BOOT_ID 0U
133+
#define BOOT_CPU_ID 0U
134134

135135
/* hypervisor stack bottom magic('intl') */
136136
#define SP_BOTTOM_MAGIC 0x696e746cUL

0 commit comments

Comments
 (0)