Skip to content

Commit c585172

Browse files
wuxyintellijinxia
authored andcommitted
Rename phy_cpu_num as phys_cpu_num
phys_cpu_num is more popular than phy_cpu_num, update them through command. Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
1 parent 3892bd0 commit c585172

File tree

14 files changed

+34
-34
lines changed

14 files changed

+34
-34
lines changed

hypervisor/arch/x86/cpu.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ spinlock_t up_count_spinlock = {
2323
};
2424

2525
struct per_cpu_region *per_cpu_data_base_ptr;
26-
uint16_t phy_cpu_num = 0U;
26+
uint16_t phys_cpu_num = 0U;
2727
unsigned long pcpu_sync = 0;
2828
volatile uint32_t up_count = 0;
2929

@@ -226,7 +226,7 @@ static int hardware_detect_support(void)
226226

227227
static void alloc_phy_cpu_data(uint16_t pcpu_num)
228228
{
229-
phy_cpu_num = pcpu_num;
229+
phys_cpu_num = pcpu_num;
230230

231231
per_cpu_data_base_ptr = calloc(pcpu_num, sizeof(struct per_cpu_region));
232232
ASSERT(per_cpu_data_base_ptr != NULL, "");
@@ -606,7 +606,7 @@ int cpu_find_logical_id(uint32_t lapic_id)
606606
{
607607
int i;
608608

609-
for (i = 0; i < phy_cpu_num; i++) {
609+
for (i = 0; i < phys_cpu_num; i++) {
610610
if (per_cpu(lapic_id, i) == lapic_id)
611611
return i;
612612
}
@@ -690,7 +690,7 @@ void start_cpus()
690690
/* Set flag showing number of CPUs expected to be up to all
691691
* cpus
692692
*/
693-
expected_up = phy_cpu_num;
693+
expected_up = phys_cpu_num;
694694

695695
/* Broadcast IPIs to all other CPUs */
696696
send_startup_ipi(INTR_CPU_STARTUP_ALL_EX_SELF,
@@ -725,7 +725,7 @@ void stop_cpus()
725725
uint32_t timeout, expected_up;
726726

727727
timeout = CONFIG_CPU_UP_TIMEOUT * 1000;
728-
for (i = 0; i < phy_cpu_num; i++) {
728+
for (i = 0; i < phys_cpu_num; i++) {
729729
if (get_cpu_id() == i) /* avoid offline itself */
730730
continue;
731731

hypervisor/arch/x86/guest/vlapic.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ static uint16_t vm_apicid2vcpu_id(struct vm *vm, uint8_t lapicid)
137137

138138
pr_err("%s: bad lapicid %d", __func__, lapicid);
139139

140-
return phy_cpu_num;
140+
return phys_cpu_num;
141141
}
142142

143143
static uint64_t
@@ -895,7 +895,7 @@ vlapic_calcdest(struct vm *vm, uint64_t *dmask, uint32_t dest,
895895
*/
896896
*dmask = 0;
897897
vcpu_id = vm_apicid2vcpu_id(vm, dest);
898-
if (vcpu_id < phy_cpu_num)
898+
if (vcpu_id < phys_cpu_num)
899899
bitmap_set(vcpu_id, dmask);
900900
} else {
901901
/*
@@ -1537,7 +1537,7 @@ vlapic_init(struct vlapic *vlapic)
15371537
{
15381538
ASSERT(vlapic->vm != NULL, "%s: vm is not initialized", __func__);
15391539
ASSERT(vlapic->vcpu->vcpu_id >= 0 &&
1540-
vlapic->vcpu->vcpu_id < phy_cpu_num,
1540+
vlapic->vcpu->vcpu_id < phys_cpu_num,
15411541
"%s: vcpu_id is not initialized", __func__);
15421542
ASSERT(vlapic->apic_page != NULL,
15431543
"%s: apic_page is not initialized", __func__);
@@ -1765,7 +1765,7 @@ vlapic_set_local_intr(struct vm *vm, int vcpu_id, uint32_t vector)
17651765
uint64_t dmask = 0;
17661766
int error;
17671767

1768-
if (vcpu_id < -1 || vcpu_id >= phy_cpu_num)
1768+
if (vcpu_id < -1 || vcpu_id >= phys_cpu_num)
17691769
return -EINVAL;
17701770

17711771
if (vcpu_id == -1)

hypervisor/arch/x86/guest/vm.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ static void init_vm(struct vm_description *vm_desc,
3131
/* Populate VM attributes from VM description */
3232
if (is_vm0(vm_handle)) {
3333
/* Allocate all cpus to vm0 at the beginning */
34-
vm_handle->hw.num_vcpus = phy_cpu_num;
34+
vm_handle->hw.num_vcpus = phys_cpu_num;
3535
vm_handle->hw.exp_num_vcpus = vm_desc->vm_hw_num_cores;
3636
} else {
3737
vm_handle->hw.num_vcpus = vm_desc->vm_hw_num_cores;
@@ -88,7 +88,7 @@ int create_vm(struct vm_description *vm_desc, struct vm **rtn_vm)
8888
INIT_LIST_HEAD(&vm->mmio_list);
8989

9090
if (vm->hw.num_vcpus == 0)
91-
vm->hw.num_vcpus = phy_cpu_num;
91+
vm->hw.num_vcpus = phys_cpu_num;
9292

9393
vm->hw.vcpu_array =
9494
calloc(1, sizeof(struct vcpu *) * vm->hw.num_vcpus);
@@ -299,7 +299,7 @@ int prepare_vm0(void)
299299
return ret;
300300

301301
/* Allocate all cpus to vm0 at the beginning */
302-
for (i = 0; i < phy_cpu_num; i++)
302+
for (i = 0; i < phys_cpu_num; i++)
303303
prepare_vcpu(vm, i);
304304

305305
/* start vm0 BSP automatically */

hypervisor/arch/x86/irq.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ static void _irq_desc_free_vector(uint32_t irq)
177177
if (vector_to_irq[vr] == irq)
178178
vector_to_irq[vr] = IRQ_INVALID;
179179

180-
for (pcpu_id = 0; pcpu_id < phy_cpu_num; pcpu_id++)
180+
for (pcpu_id = 0; pcpu_id < phys_cpu_num; pcpu_id++)
181181
per_cpu(irq_count, pcpu_id)[irq] = 0;
182182
}
183183

@@ -699,7 +699,7 @@ void get_cpu_interrupt_info(char *str, int str_max)
699699
len = snprintf(str, size, "\r\nIRQ\tVECTOR");
700700
size -= len;
701701
str += len;
702-
for (pcpu_id = 0; pcpu_id < phy_cpu_num; pcpu_id++) {
702+
for (pcpu_id = 0; pcpu_id < phys_cpu_num; pcpu_id++) {
703703
len = snprintf(str, size, "\tCPU%d", pcpu_id);
704704
size -= len;
705705
str += len;
@@ -716,7 +716,7 @@ void get_cpu_interrupt_info(char *str, int str_max)
716716
len = snprintf(str, size, "\r\n%d\t0x%X", irq, vector);
717717
size -= len;
718718
str += len;
719-
for (pcpu_id = 0; pcpu_id < phy_cpu_num; pcpu_id++) {
719+
for (pcpu_id = 0; pcpu_id < phys_cpu_num; pcpu_id++) {
720720
len = snprintf(str, size, "\t%d",
721721
per_cpu(irq_count, pcpu_id)[irq]);
722722
size -= len;

hypervisor/arch/x86/mmu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,9 +413,9 @@ static uint32_t map_mem_region(void *vaddr, void *paddr,
413413
* TODO: add shootdown APs operation if MMU will be
414414
* modified after AP start in the future.
415415
*/
416-
if ((phy_cpu_num != 0) &&
416+
if ((phys_cpu_num != 0) &&
417417
((pcpu_active_bitmap &
418-
((1UL << phy_cpu_num) - 1))
418+
((1UL << phys_cpu_num) - 1))
419419
!= (1UL << CPU_BOOT_ID))) {
420420
panic("need shootdown for invlpg");
421421
}

hypervisor/arch/x86/softirq.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ void init_softirq(void)
2020
{
2121
uint16_t cpu_id;
2222

23-
for (cpu_id = 0; cpu_id < phy_cpu_num; cpu_id++) {
23+
for (cpu_id = 0; cpu_id < phys_cpu_num; cpu_id++) {
2424
per_cpu(softirq_pending, cpu_id) = 0;
2525
bitmap_set(SOFTIRQ_ATOMIC, &per_cpu(softirq_pending, cpu_id));
2626
}
@@ -31,7 +31,7 @@ void raise_softirq(int softirq_id)
3131
uint16_t cpu_id = get_cpu_id();
3232
uint64_t *bitmap = &per_cpu(softirq_pending, cpu_id);
3333

34-
if (cpu_id >= phy_cpu_num)
34+
if (cpu_id >= phys_cpu_num)
3535
return;
3636

3737
bitmap_set(softirq_id, bitmap);
@@ -44,7 +44,7 @@ void exec_softirq(void)
4444

4545
int softirq_id;
4646

47-
if (cpu_id >= phy_cpu_num)
47+
if (cpu_id >= phys_cpu_num)
4848
return;
4949

5050
if (((*bitmap) & SOFTIRQ_MASK) == 0UL)

hypervisor/arch/x86/timer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ static int request_timer_irq(uint16_t pcpu_id,
105105
{
106106
struct dev_handler_node *node = NULL;
107107

108-
if (pcpu_id >= phy_cpu_num)
108+
if (pcpu_id >= phys_cpu_num)
109109
return -EINVAL;
110110

111111
if (per_cpu(timer_node, pcpu_id) != NULL) {

hypervisor/common/hv_main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ int hv_main(uint16_t cpu_id)
111111
pr_info("%s, Starting common entry point for CPU %d",
112112
__func__, cpu_id);
113113

114-
if (cpu_id >= phy_cpu_num) {
114+
if (cpu_id >= phys_cpu_num) {
115115
pr_err("%s, cpu_id %d out of range %d\n",
116-
__func__, cpu_id, phy_cpu_num);
116+
__func__, cpu_id, phys_cpu_num);
117117
return -EINVAL;
118118
}
119119

@@ -154,7 +154,7 @@ void get_vmexit_profile(char *str, int str_max)
154154
size -= len;
155155
str += len;
156156

157-
for (cpu = 0; cpu < phy_cpu_num; cpu++) {
157+
for (cpu = 0; cpu < phys_cpu_num; cpu++) {
158158
len = snprintf(str, size, "\t CPU%d\t US", cpu);
159159
size -= len;
160160
str += len;
@@ -164,7 +164,7 @@ void get_vmexit_profile(char *str, int str_max)
164164
len = snprintf(str, size, "\r\n0x%x", i);
165165
size -= len;
166166
str += len;
167-
for (cpu = 0; cpu < phy_cpu_num; cpu++) {
167+
for (cpu = 0; cpu < phys_cpu_num; cpu++) {
168168
len = snprintf(str, size, "\t%10lld\t%10lld",
169169
per_cpu(vmexit_cnt, cpu)[i],
170170
TICKS_TO_US(per_cpu(vmexit_time, cpu)[i]));

hypervisor/common/schedule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ void init_scheduler(void)
1313
{
1414
int i;
1515

16-
for (i = 0; i < phy_cpu_num; i++) {
16+
for (i = 0; i < phys_cpu_num; i++) {
1717
spinlock_init(&per_cpu(sched_ctx, i).runqueue_lock);
1818
spinlock_init(&per_cpu(sched_ctx, i).scheduler_lock);
1919
INIT_LIST_HEAD(&per_cpu(sched_ctx, i).runqueue);
@@ -36,7 +36,7 @@ int allocate_pcpu(void)
3636
{
3737
int i;
3838

39-
for (i = 0; i < phy_cpu_num; i++) {
39+
for (i = 0; i < phys_cpu_num; i++) {
4040
if (bitmap_test_and_set(i, &pcpu_used_bitmap) == 0)
4141
return i;
4242
}

hypervisor/debug/logmsg.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ static struct logmsg logmsg;
2323
static inline void alloc_earlylog_sbuf(uint32_t cpu_id)
2424
{
2525
uint32_t ele_size = LOG_ENTRY_SIZE;
26-
uint32_t ele_num = ((HVLOG_BUF_SIZE >> 1) / phy_cpu_num
26+
uint32_t ele_num = ((HVLOG_BUF_SIZE >> 1) / phys_cpu_num
2727
- SBUF_HEAD_SIZE) / ele_size;
2828

2929
per_cpu(earlylog_sbuf, cpu_id) = sbuf_allocate(ele_num, ele_size);
@@ -75,7 +75,7 @@ void init_logmsg(__unused uint32_t mem_size, uint32_t flags)
7575
logmsg.seq = 0;
7676

7777
/* allocate sbuf for log before sos booting */
78-
for (idx = 0; idx < phy_cpu_num; idx++)
78+
for (idx = 0; idx < phys_cpu_num; idx++)
7979
alloc_earlylog_sbuf(idx);
8080
}
8181

@@ -168,7 +168,7 @@ void print_logmsg_buffer(uint32_t cpu_id)
168168
struct shared_buf **sbuf;
169169
int is_earlylog = 0;
170170

171-
if (cpu_id >= (uint32_t)phy_cpu_num)
171+
if (cpu_id >= (uint32_t)phys_cpu_num)
172172
return;
173173

174174
if (per_cpu(earlylog_sbuf, cpu_id) != NULL) {

0 commit comments

Comments
 (0)