Skip to content

Commit f05e2fc

Browse files
junjiemao1lijinxia
authored andcommitted
HV: vlapic: cleanup types in formatting strings
Make the type indicators in formatting strings aligned with the actual variables passed. Signed-off-by: Junjie Mao <junjie.mao@intel.com> Acked-by: Dong Eddie <eddie.dong@intel.com>
1 parent 6dd78d5 commit f05e2fc

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

hypervisor/arch/x86/guest/vlapic.c

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ vm_lapic_from_pcpuid(struct vm *vm, uint16_t pcpu_id)
115115
struct vcpu *vcpu;
116116

117117
vcpu = vcpu_from_pid(vm, pcpu_id);
118-
ASSERT(vcpu != NULL, "vm%d, pcpu%d", vm->attr.id, pcpu_id);
118+
ASSERT(vcpu != NULL, "vm%d, pcpu%hu", vm->attr.id, pcpu_id);
119119

120120
return vcpu->arch_vcpu.vlapic;
121121
}
@@ -131,7 +131,7 @@ static uint16_t vm_apicid2vcpu_id(struct vm *vm, uint8_t lapicid)
131131
}
132132
}
133133

134-
pr_err("%s: bad lapicid %d", __func__, lapicid);
134+
pr_err("%s: bad lapicid %hhu", __func__, lapicid);
135135

136136
return phys_cpu_num;
137137
}
@@ -451,20 +451,20 @@ vlapic_set_intr_ready(struct vlapic *vlapic, uint32_t vector, bool level)
451451
uint32_t idx;
452452

453453
ASSERT(vector <= NR_MAX_VECTOR,
454-
"invalid vector %d", vector);
454+
"invalid vector %u", vector);
455455

456456
lapic = vlapic->apic_page;
457457
if ((lapic->svr & APIC_SVR_ENABLE) == 0U) {
458458
dev_dbg(ACRN_DBG_LAPIC,
459-
"vlapic is software disabled, ignoring interrupt %d",
459+
"vlapic is software disabled, ignoring interrupt %u",
460460
vector);
461461
return 0;
462462
}
463463

464464
if (vector < 16U) {
465465
vlapic_set_error(vlapic, APIC_ESR_RECEIVE_ILLEGAL_VECTOR);
466466
dev_dbg(ACRN_DBG_LAPIC,
467-
"vlapic ignoring interrupt to vector %d", vector);
467+
"vlapic ignoring interrupt to vector %u", vector);
468468
return 1;
469469
}
470470

@@ -488,7 +488,7 @@ vlapic_set_intr_ready(struct vlapic *vlapic, uint32_t vector, bool level)
488488
tmrptr = &lapic->tmr[0];
489489
if ((tmrptr[idx].val & mask) != (level ? mask : 0U)) {
490490
dev_dbg(ACRN_DBG_LAPIC,
491-
"vlapic TMR[%d] is 0x%08x but interrupt is %s-triggered",
491+
"vlapic TMR[%u] is 0x%08x but interrupt is %s-triggered",
492492
idx, tmrptr[idx].val, level ? "level" : "edge");
493493
}
494494

@@ -527,7 +527,7 @@ lvt_off_to_idx(uint32_t offset)
527527
break;
528528
}
529529
ASSERT(index <= VLAPIC_MAXLVT_INDEX,
530-
"%s: invalid lvt index %d for offset %#x",
530+
"%s: invalid lvt index %u for offset %#x",
531531
__func__, index, offset);
532532

533533
return index;
@@ -804,7 +804,7 @@ vlapic_process_eoi(struct vlapic *vlapic)
804804
}
805805
isrptr[i].val &= ~(1U << bitpos);
806806
vector = i * 32U + bitpos;
807-
dev_dbg(ACRN_DBG_LAPIC, "EOI vector %d", vector);
807+
dev_dbg(ACRN_DBG_LAPIC, "EOI vector %u", vector);
808808
vlapic_dump_isr(vlapic, "vlapic_process_eoi");
809809
vlapic->isrvec_stk_top--;
810810
vlapic_update_ppr(vlapic);
@@ -1067,7 +1067,7 @@ vlapic_icrlo_write_handler(struct vlapic *vlapic)
10671067

10681068
if (mode == APIC_DELMODE_FIXED && vec < 16U) {
10691069
vlapic_set_error(vlapic, APIC_ESR_SEND_ILLEGAL_VECTOR);
1070-
dev_dbg(ACRN_DBG_LAPIC, "Ignoring invalid IPI %d", vec);
1070+
dev_dbg(ACRN_DBG_LAPIC, "Ignoring invalid IPI %u", vec);
10711071
return 0;
10721072
}
10731073

@@ -1108,7 +1108,7 @@ vlapic_icrlo_write_handler(struct vlapic *vlapic)
11081108
vlapic_set_intr(target_vcpu, vec,
11091109
LAPIC_TRIG_EDGE);
11101110
dev_dbg(ACRN_DBG_LAPIC,
1111-
"vlapic sending ipi %d to vcpu_id %hu",
1111+
"vlapic sending ipi %u to vcpu_id %hu",
11121112
vec, vcpu_id);
11131113
} else if (mode == APIC_DELMODE_NMI){
11141114
vcpu_inject_nmi(target_vcpu);
@@ -1120,7 +1120,7 @@ vlapic_icrlo_write_handler(struct vlapic *vlapic)
11201120
}
11211121

11221122
dev_dbg(ACRN_DBG_LAPIC,
1123-
"Sending INIT from VCPU %d to %hu",
1123+
"Sending INIT from VCPU %hu to %hu",
11241124
vlapic->vcpu->vcpu_id, vcpu_id);
11251125

11261126
/* put target vcpu to INIT state and wait for SIPI */
@@ -1139,7 +1139,7 @@ vlapic_icrlo_write_handler(struct vlapic *vlapic)
11391139
}
11401140

11411141
dev_dbg(ACRN_DBG_LAPIC,
1142-
"Sending SIPI from VCPU %d to %hu with vector %d",
1142+
"Sending SIPI from VCPU %hu to %hu with vector %u",
11431143
vlapic->vcpu->vcpu_id, vcpu_id, vec);
11441144

11451145
target_vcpu->arch_vcpu.nr_sipi--;
@@ -1149,7 +1149,7 @@ vlapic_icrlo_write_handler(struct vlapic *vlapic)
11491149

11501150
target_vcpu->arch_vcpu.cpu_mode = CPU_MODE_REAL;
11511151
target_vcpu->arch_vcpu.sipi_vector = vec;
1152-
pr_err("Start Secondary VCPU%d for VM[%d]...",
1152+
pr_err("Start Secondary VCPU%hu for VM[%d]...",
11531153
target_vcpu->vcpu_id,
11541154
target_vcpu->vm->attr.id);
11551155
schedule_vcpu(target_vcpu);
@@ -1223,7 +1223,7 @@ vlapic_intr_accepted(struct vlapic *vlapic, uint32_t vector)
12231223

12241224
stk_top = vlapic->isrvec_stk_top;
12251225
if (stk_top >= ISRVEC_STK_SIZE) {
1226-
panic("isrvec_stk_top overflow %d", stk_top);
1226+
panic("isrvec_stk_top overflow %u", stk_top);
12271227
}
12281228

12291229
vlapic->isrvec_stk[stk_top] = vector;
@@ -1286,7 +1286,7 @@ vlapic_read(struct vlapic *vlapic, int mmio_access, uint64_t offset,
12861286
* XXX Generate GP fault for MSR accesses in xAPIC mode
12871287
*/
12881288
dev_dbg(ACRN_DBG_LAPIC,
1289-
"x2APIC MSR read from offset %#lx in xAPIC mode",
1289+
"x2APIC MSR read from offset %#x in xAPIC mode",
12901290
offset);
12911291
*data = 0UL;
12921292
goto done;
@@ -1379,7 +1379,7 @@ vlapic_read(struct vlapic *vlapic, int mmio_access, uint64_t offset,
13791379
#ifdef INVARIANTS
13801380
reg = vlapic_get_lvtptr(vlapic, offset);
13811381
ASSERT(*data == *reg,
1382-
"inconsistent lvt value at offset %#lx: %#lx/%#x",
1382+
"inconsistent lvt value at offset %#x: %#lx/%#x",
13831383
offset, *data, *reg);
13841384
#endif
13851385
break;
@@ -1422,10 +1422,10 @@ vlapic_write(struct vlapic *vlapic, int mmio_access, uint64_t offset,
14221422
uint32_t *regptr;
14231423
int retval;
14241424

1425-
ASSERT((offset & 0xfUL) == 0 && offset < CPU_PAGE_SIZE,
1426-
"%s: invalid offset %#lx", __func__, offset);
1425+
ASSERT((offset & 0xfU) == 0U && offset < CPU_PAGE_SIZE,
1426+
"%s: invalid offset %#x", __func__, offset);
14271427

1428-
dev_dbg(ACRN_DBG_LAPIC, "vlapic write offset %#lx, data %#lx",
1428+
dev_dbg(ACRN_DBG_LAPIC, "vlapic write offset %#x, data %#lx",
14291429
offset, data);
14301430

14311431
if (offset > sizeof(*lapic)) {
@@ -1437,7 +1437,7 @@ vlapic_write(struct vlapic *vlapic, int mmio_access, uint64_t offset,
14371437
*/
14381438
if (mmio_access == 0) {
14391439
dev_dbg(ACRN_DBG_LAPIC,
1440-
"x2APIC MSR write of %#lx to offset %#lx in xAPIC mode",
1440+
"x2APIC MSR write of %#lx to offset %#x in xAPIC mode",
14411441
data, offset);
14421442
return 0;
14431443
}
@@ -1750,14 +1750,14 @@ vlapic_set_tmr_one_vec(struct vlapic *vlapic, __unused int delmode,
17501750
uint32_t vector, bool level)
17511751
{
17521752
ASSERT(vector <= NR_MAX_VECTOR,
1753-
"invalid vector %d", vector);
1753+
"invalid vector %u", vector);
17541754

17551755
/*
17561756
* A level trigger is valid only for fixed and lowprio delivery modes.
17571757
*/
17581758
if (delmode != APIC_DELMODE_FIXED && delmode != APIC_DELMODE_LOWPRIO) {
17591759
dev_dbg(ACRN_DBG_LAPIC,
1760-
"Ignoring level trigger-mode for delivery-mode %d",
1760+
"Ignoring level trigger-mode for delivery-mode %u",
17611761
delmode);
17621762
return;
17631763
}
@@ -1769,7 +1769,7 @@ vlapic_set_tmr_one_vec(struct vlapic *vlapic, __unused int delmode,
17691769
* If there is new caller to this function, need to refine this
17701770
* part of work.
17711771
*/
1772-
dev_dbg(ACRN_DBG_LAPIC, "vector %d set to level-triggered", vector);
1772+
dev_dbg(ACRN_DBG_LAPIC, "vector %u set to level-triggered", vector);
17731773
vlapic_set_tmr(vlapic, vector, level);
17741774
}
17751775

@@ -1862,7 +1862,7 @@ vlapic_intr_msi(struct vm *vm, uint64_t addr, uint64_t msg)
18621862
delmode = msg & APIC_DELMODE_MASK;
18631863
vec = msg & 0xffUL;
18641864

1865-
dev_dbg(ACRN_DBG_LAPIC, "lapic MSI %s dest %#x, vec %d",
1865+
dev_dbg(ACRN_DBG_LAPIC, "lapic MSI %s dest %#x, vec %u",
18661866
phys ? "physical" : "logical", dest, vec);
18671867

18681868
vlapic_deliver_intr(vm, LAPIC_TRIG_EDGE, dest, phys, delmode, vec);

0 commit comments

Comments
 (0)