mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-21 16:57:20 +00:00
hv:Change pcpu_active_bitmap to static
-- Change pcpu_active_bitmap to static, only used in cpu.c -- add get_pcpu_active_bitmap() Tracked-On: #1842 Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com> Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
@@ -20,7 +20,7 @@ static uint16_t up_count = 0U;
|
|||||||
static uint64_t startup_paddr = 0UL;
|
static uint64_t startup_paddr = 0UL;
|
||||||
|
|
||||||
/* physical cpu active bitmap, support up to 64 cpus */
|
/* physical cpu active bitmap, support up to 64 cpus */
|
||||||
uint64_t pcpu_active_bitmap = 0UL;
|
static uint64_t pcpu_active_bitmap = 0UL;
|
||||||
|
|
||||||
static void cpu_xsave_init(void);
|
static void cpu_xsave_init(void);
|
||||||
static void set_current_cpu_id(uint16_t pcpu_id);
|
static void set_current_cpu_id(uint16_t pcpu_id);
|
||||||
@@ -77,6 +77,12 @@ bool is_pcpu_active(uint16_t pcpu_id)
|
|||||||
{
|
{
|
||||||
return bitmap_test(pcpu_id, &pcpu_active_bitmap);
|
return bitmap_test(pcpu_id, &pcpu_active_bitmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint64_t get_active_pcpu_bitmap(void)
|
||||||
|
{
|
||||||
|
return pcpu_active_bitmap;
|
||||||
|
}
|
||||||
|
|
||||||
void init_cpu_pre(uint16_t pcpu_id_args)
|
void init_cpu_pre(uint16_t pcpu_id_args)
|
||||||
{
|
{
|
||||||
uint16_t pcpu_id = pcpu_id_args;
|
uint16_t pcpu_id = pcpu_id_args;
|
||||||
|
@@ -747,7 +747,7 @@ static void profiling_start_pmu(void)
|
|||||||
per_cpu(profiling_info.sep_state, i).pmu_state = PMU_RUNNING;
|
per_cpu(profiling_info.sep_state, i).pmu_state = PMU_RUNNING;
|
||||||
}
|
}
|
||||||
|
|
||||||
smp_call_function(pcpu_active_bitmap, profiling_ipi_handler, NULL);
|
smp_call_function(get_active_pcpu_bitmap(), profiling_ipi_handler, NULL);
|
||||||
|
|
||||||
in_pmu_profiling = true;
|
in_pmu_profiling = true;
|
||||||
|
|
||||||
@@ -798,7 +798,7 @@ static void profiling_stop_pmu(void)
|
|||||||
per_cpu(profiling_info.sep_state, i).nofrozen_pmi = 0U;
|
per_cpu(profiling_info.sep_state, i).nofrozen_pmi = 0U;
|
||||||
}
|
}
|
||||||
|
|
||||||
smp_call_function(pcpu_active_bitmap, profiling_ipi_handler, NULL);
|
smp_call_function(get_active_pcpu_bitmap(), profiling_ipi_handler, NULL);
|
||||||
|
|
||||||
in_pmu_profiling = false;
|
in_pmu_profiling = false;
|
||||||
|
|
||||||
@@ -831,7 +831,7 @@ int32_t profiling_msr_ops_all_cpus(struct acrn_vm *vm, uint64_t addr)
|
|||||||
per_cpu(profiling_info.msr_node, i) = &(msr_list[i]);
|
per_cpu(profiling_info.msr_node, i) = &(msr_list[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
smp_call_function(pcpu_active_bitmap, profiling_ipi_handler, NULL);
|
smp_call_function(get_active_pcpu_bitmap(), profiling_ipi_handler, NULL);
|
||||||
|
|
||||||
if (copy_to_gpa(vm, &msr_list, addr, sizeof(msr_list)) != 0) {
|
if (copy_to_gpa(vm, &msr_list, addr, sizeof(msr_list)) != 0) {
|
||||||
pr_err("%s: Unable to copy addr from vm\n", __func__);
|
pr_err("%s: Unable to copy addr from vm\n", __func__);
|
||||||
@@ -1163,7 +1163,7 @@ int32_t profiling_configure_pmi(struct acrn_vm *vm, uint64_t addr)
|
|||||||
sizeof(struct profiling_msr_op)*MAX_MSR_LIST_NUM*MAX_GROUP_NUM);
|
sizeof(struct profiling_msr_op)*MAX_MSR_LIST_NUM*MAX_GROUP_NUM);
|
||||||
}
|
}
|
||||||
|
|
||||||
smp_call_function(pcpu_active_bitmap, profiling_ipi_handler, NULL);
|
smp_call_function(get_active_pcpu_bitmap(), profiling_ipi_handler, NULL);
|
||||||
|
|
||||||
if (copy_to_gpa(vm, &pmi_config, addr, sizeof(pmi_config)) != 0) {
|
if (copy_to_gpa(vm, &pmi_config, addr, sizeof(pmi_config)) != 0) {
|
||||||
pr_err("%s: Unable to copy addr to vm\n", __func__);
|
pr_err("%s: Unable to copy addr to vm\n", __func__);
|
||||||
@@ -1217,7 +1217,7 @@ int32_t profiling_configure_vmsw(struct acrn_vm *vm, uint64_t addr)
|
|||||||
sizeof(struct profiling_msr_op)*MAX_MSR_LIST_NUM);
|
sizeof(struct profiling_msr_op)*MAX_MSR_LIST_NUM);
|
||||||
}
|
}
|
||||||
|
|
||||||
smp_call_function(pcpu_active_bitmap, profiling_ipi_handler, NULL);
|
smp_call_function(get_active_pcpu_bitmap(), profiling_ipi_handler, NULL);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case COLLECT_POWER_DATA:
|
case COLLECT_POWER_DATA:
|
||||||
|
@@ -464,6 +464,7 @@ static inline void clac(void)
|
|||||||
|
|
||||||
uint16_t get_pcpu_nums(void);
|
uint16_t get_pcpu_nums(void);
|
||||||
bool is_pcpu_active(uint16_t pcpu_id);
|
bool is_pcpu_active(uint16_t pcpu_id);
|
||||||
|
uint64_t get_active_pcpu_bitmap(void);
|
||||||
#else /* ASSEMBLER defined */
|
#else /* ASSEMBLER defined */
|
||||||
|
|
||||||
#endif /* ASSEMBLER defined */
|
#endif /* ASSEMBLER defined */
|
||||||
|
@@ -56,7 +56,6 @@ struct per_cpu_region {
|
|||||||
} __aligned(PAGE_SIZE); /* per_cpu_region size aligned with PAGE_SIZE */
|
} __aligned(PAGE_SIZE); /* per_cpu_region size aligned with PAGE_SIZE */
|
||||||
|
|
||||||
extern struct per_cpu_region per_cpu_data[];
|
extern struct per_cpu_region per_cpu_data[];
|
||||||
extern uint64_t pcpu_active_bitmap;
|
|
||||||
/*
|
/*
|
||||||
* get percpu data for pcpu_id.
|
* get percpu data for pcpu_id.
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user