mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-04 23:24:56 +00:00
HV:Treewide:Update the type of vcpu id as uint16_t
In the hypervisor, virtual cpu id is defined as "int" or "uint32_t"
type in the hypervisor. So there are some sign conversion issues
about virtual cpu id (vcpu_id) reported by static analysis tool.
Sign conversion violates the rules of MISRA C:2012.
BTW, virtual cpu id has different names (vcpu_id, cpu_id, logical_id)
for different modules of HV, its type is defined as "int" or "uint32_t"
in the HV. cpu_id type and logical_id type clean up will be done in
other patchs.
V1-->V2:
More clean up the type of vcpu id;
"%hu" is for vcpu id in the print function.
Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
This commit is contained in:
@@ -55,7 +55,7 @@ static void dump_guest_reg(struct vcpu *vcpu)
|
||||
printf("\n\n================================================");
|
||||
printf("================================\n\n");
|
||||
printf("Guest Registers:\r\n");
|
||||
printf("= VM ID %d ==== vCPU ID %d === pCPU ID %d ===="
|
||||
printf("= VM ID %d ==== vCPU ID %hu === pCPU ID %d ===="
|
||||
"world %d =============\r\n",
|
||||
vcpu->vm->attr.id, vcpu->vcpu_id, vcpu->pcpu_id,
|
||||
vcpu->arch_vcpu.cur_context);
|
||||
@@ -112,7 +112,7 @@ static void dump_guest_stack(struct vcpu *vcpu)
|
||||
}
|
||||
|
||||
printf("\r\nGuest Stack:\r\n");
|
||||
printf("Dump stack for vcpu %d, from gva 0x%016llx\r\n",
|
||||
printf("Dump stack for vcpu %hu, from gva 0x%016llx\r\n",
|
||||
vcpu->vcpu_id, cur_context->rsp);
|
||||
for (i = 0U; i < DUMP_STACK_SIZE/32U; i++) {
|
||||
printf("guest_rsp(0x%llx): 0x%016llx 0x%016llx "
|
||||
|
||||
Reference in New Issue
Block a user