hv: refine 'uint64_t' string print format in debug moudle

Use "0x%lx" string to format 'uint64_t' type value,
  instead of "0x%llx".

Tracked-On: #4020
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
This commit is contained in:
Yonghua Huang 2019-11-07 15:21:33 +08:00 committed by wenlingz
parent 4aad66ed6b
commit fb29d1f99f
4 changed files with 36 additions and 44 deletions

View File

@ -76,38 +76,31 @@ static void dump_guest_reg(struct acrn_vcpu *vcpu)
"world %d =============\r\n",
vcpu->vm->vm_id, vcpu->vcpu_id, pcpu_id,
vcpu->arch.cur_context);
pr_acrnlog("= RIP=0x%016llx RSP=0x%016llx "
"RFLAGS=0x%016llx\r\n",
pr_acrnlog("= RIP=0x%016lx RSP=0x%016lx RFLAGS=0x%016lx\r\n",
vcpu_get_rip(vcpu),
vcpu_get_gpreg(vcpu, CPU_REG_RSP),
vcpu_get_rflags(vcpu));
pr_acrnlog("= CR0=0x%016llx CR2=0x%016llx "
" CR3=0x%016llx\r\n",
pr_acrnlog("= CR0=0x%016lx CR2=0x%016lx CR3=0x%016lx\r\n",
vcpu_get_cr0(vcpu),
vcpu_get_cr2(vcpu),
exec_vmread(VMX_GUEST_CR3));
pr_acrnlog("= RAX=0x%016llx RBX=0x%016llx "
"RCX=0x%016llx\r\n",
pr_acrnlog("= RAX=0x%016lx RBX=0x%016lx RCX=0x%016lx\r\n",
vcpu_get_gpreg(vcpu, CPU_REG_RAX),
vcpu_get_gpreg(vcpu, CPU_REG_RBX),
vcpu_get_gpreg(vcpu, CPU_REG_RCX));
pr_acrnlog("= RDX=0x%016llx RDI=0x%016llx "
"RSI=0x%016llx\r\n",
pr_acrnlog("= RDX=0x%016lx RDI=0x%016lx RSI=0x%016lx\r\n",
vcpu_get_gpreg(vcpu, CPU_REG_RDX),
vcpu_get_gpreg(vcpu, CPU_REG_RDI),
vcpu_get_gpreg(vcpu, CPU_REG_RSI));
pr_acrnlog("= RBP=0x%016llx R8=0x%016llx "
"R9=0x%016llx\r\n",
pr_acrnlog("= RBP=0x%016lx R8=0x%016lx R9=0x%016lx\r\n",
vcpu_get_gpreg(vcpu, CPU_REG_RBP),
vcpu_get_gpreg(vcpu, CPU_REG_R8),
vcpu_get_gpreg(vcpu, CPU_REG_R9));
pr_acrnlog("= R10=0x%016llx R11=0x%016llx "
"R12=0x%016llx\r\n",
pr_acrnlog("= R10=0x%016lx R11=0x%016lx R12=0x%016lx\r\n",
vcpu_get_gpreg(vcpu, CPU_REG_R10),
vcpu_get_gpreg(vcpu, CPU_REG_R11),
vcpu_get_gpreg(vcpu, CPU_REG_R12));
pr_acrnlog("= R13=0x%016llx R14=0x%016llx "
"R15=0x%016llx\r\n",
pr_acrnlog("= R13=0x%016lx R14=0x%016lx R15=0x%016lx\r\n",
vcpu_get_gpreg(vcpu, CPU_REG_R13),
vcpu_get_gpreg(vcpu, CPU_REG_R14),
vcpu_get_gpreg(vcpu, CPU_REG_R15));
@ -127,11 +120,10 @@ static void dump_guest_stack(struct acrn_vcpu *vcpu)
}
pr_acrnlog("\r\nGuest Stack:\r\n");
pr_acrnlog("Dump stack for vcpu %hu, from gva 0x%016llx\r\n",
pr_acrnlog("Dump stack for vcpu %hu, from gva 0x%016lx\r\n",
vcpu->vcpu_id, vcpu_get_gpreg(vcpu, CPU_REG_RSP));
for (i = 0U; i < (DUMP_STACK_SIZE >> 5U); i++) {
pr_acrnlog("guest_rsp(0x%llx): 0x%016llx 0x%016llx "
"0x%016llx 0x%016llx\r\n",
pr_acrnlog("guest_rsp(0x%lx): 0x%016lx 0x%016lx 0x%016lx 0x%016lx\r\n",
(vcpu_get_gpreg(vcpu, CPU_REG_RSP)+(i*32U)),
tmp[i*4], tmp[(i*4)+1],
tmp[(i*4)+2], tmp[(i*4)+3]);
@ -173,7 +165,7 @@ static void show_guest_call_trace(struct acrn_vcpu *vcpu)
return;
}
pr_acrnlog("BP_GVA(0x%016llx) RIP=0x%016llx\r\n", bp, parent_bp);
pr_acrnlog("BP_GVA(0x%016lx) RIP=0x%016lx\r\n", bp, parent_bp);
/* Get previous rbp*/
bp = parent_bp;
count++;
@ -201,8 +193,8 @@ static void show_host_call_trace(uint64_t rsp, uint64_t rbp_arg, uint16_t pcpu_i
pr_acrnlog("\r\nHost Stack: CPU_ID = %hu\r\n", pcpu_id);
for (i = 0U; i < (DUMP_STACK_SIZE >> 5U); i++) {
pr_acrnlog("addr(0x%llx) 0x%016llx 0x%016llx 0x%016llx "
"0x%016llx\r\n", (rsp + (i * 32U)), sp[i * 4U],
pr_acrnlog("addr(0x%lx) 0x%016lx 0x%016lx 0x%016lx 0x%016lx\r\n",
(rsp + (i * 32U)), sp[i * 4U],
sp[(i * 4U) + 1U], sp[(i * 4U) + 2U],
sp[(i * 4U) + 3U]);
}
@ -228,7 +220,7 @@ static void show_host_call_trace(uint64_t rsp, uint64_t rbp_arg, uint16_t pcpu_i
if (return_address == SP_BOTTOM_MAGIC) {
break;
}
pr_acrnlog("----> 0x%016llx\r\n",
pr_acrnlog("----> 0x%016lx\r\n",
*(uint64_t *)(rbp + sizeof(uint64_t)));
rbp = *(uint64_t *)rbp;
cb_hierarchy++;

View File

@ -77,7 +77,7 @@ void npk_log_setup(struct hv_npk_log_param *param)
uint16_t i;
uint16_t pcpu_nums;
pr_info("HV_NPK_LOG: cmd %d param 0x%llx\n", param->cmd,
pr_info("HV_NPK_LOG: cmd %d param 0x%lx\n", param->cmd,
param->mmio_addr);
param->res = HV_NPK_LOG_RES_KO;

View File

@ -79,7 +79,7 @@ static void profiling_initialize_pmi(void)
if (msrop->msr_op_type == (uint8_t)MSR_OP_WRITE) {
msr_write(msrop->msr_id, msrop->value);
dev_dbg(ACRN_DBG_PROFILING,
"%s: MSRWRITE cpu%d, msr_id=0x%x, msr_val=0x%llx",
"%s: MSRWRITE cpu%d, msr_id=0x%x, msr_val=0x%lx",
__func__, get_pcpu_id(), msrop->msr_id, msrop->value);
}
}
@ -114,11 +114,11 @@ static void profiling_enable_pmu(void)
/* Unmask LAPIC LVT entry for PMC register */
lvt_perf_ctr = (uint32_t) msr_read(MSR_IA32_EXT_APIC_LVT_PMI);
dev_dbg(ACRN_DBG_PROFILING, "%s: 0x%x, 0x%llx",
dev_dbg(ACRN_DBG_PROFILING, "%s: 0x%x, 0x%lx",
__func__, MSR_IA32_EXT_APIC_LVT_PMI, lvt_perf_ctr);
lvt_perf_ctr &= LVT_PERFCTR_BIT_UNMASK;
msr_write(MSR_IA32_EXT_APIC_LVT_PMI, lvt_perf_ctr);
dev_dbg(ACRN_DBG_PROFILING, "%s: 0x%x, 0x%llx",
dev_dbg(ACRN_DBG_PROFILING, "%s: 0x%x, 0x%lx",
__func__, MSR_IA32_EXT_APIC_LVT_PMI, lvt_perf_ctr);
if (ss->guest_debugctl_value != 0U) {
@ -155,7 +155,7 @@ static void profiling_enable_pmu(void)
if (msrop->msr_op_type == (uint8_t)MSR_OP_WRITE) {
msr_write(msrop->msr_id, msrop->value);
dev_dbg(ACRN_DBG_PROFILING,
"%s: MSRWRITE cpu%d, msr_id=0x%x, msr_val=0x%llx",
"%s: MSRWRITE cpu%d, msr_id=0x%x, msr_val=0x%lx",
__func__, get_pcpu_id(), msrop->msr_id, msrop->value);
}
}
@ -202,7 +202,7 @@ static void profiling_disable_pmu(void)
if (msrop->msr_op_type == (uint8_t)MSR_OP_WRITE) {
msr_write(msrop->msr_id, msrop->value);
dev_dbg(ACRN_DBG_PROFILING,
"%s: MSRWRITE cpu%d, msr_id=0x%x, msr_val=0x%llx",
"%s: MSRWRITE cpu%d, msr_id=0x%x, msr_val=0x%lx",
__func__, get_pcpu_id(), msrop->msr_id, msrop->value);
}
}
@ -502,7 +502,7 @@ static void profiling_handle_msrops(void)
my_msr_node->entries[i].value
= msr_read(my_msr_node->entries[i].msr_id);
dev_dbg(ACRN_DBG_PROFILING,
"%s: MSRREAD cpu%d, msr_id=0x%x, msr_val=0x%llx",
"%s: MSRREAD cpu%d, msr_id=0x%x, msr_val=0x%lx",
__func__, get_pcpu_id(), my_msr_node->entries[i].msr_id,
my_msr_node->entries[i].value);
break;
@ -510,7 +510,7 @@ static void profiling_handle_msrops(void)
my_msr_node->entries[i].value
= msr_read(my_msr_node->entries[i].msr_id);
dev_dbg(ACRN_DBG_PROFILING,
"%s: MSRREADCLEAR cpu%d, msr_id=0x%x, msr_val=0x%llx",
"%s: MSRREADCLEAR cpu%d, msr_id=0x%x, msr_val=0x%lx",
__func__, get_pcpu_id(), my_msr_node->entries[i].msr_id,
my_msr_node->entries[i].value);
msr_write(my_msr_node->entries[i].msr_id, 0U);
@ -519,7 +519,7 @@ static void profiling_handle_msrops(void)
msr_write(my_msr_node->entries[i].msr_id,
my_msr_node->entries[i].value);
dev_dbg(ACRN_DBG_PROFILING,
"%s: MSRWRITE cpu%d, msr_id=0x%x, msr_val=0x%llx",
"%s: MSRWRITE cpu%d, msr_id=0x%x, msr_val=0x%lx",
__func__, get_pcpu_id(), my_msr_node->entries[i].msr_id,
my_msr_node->entries[i].value);
break;

View File

@ -691,14 +691,14 @@ static void vcpu_dumpreg(void *data)
len = snprintf(str, size,
"= VM ID %d ==== CPU ID %hu========================\r\n"
"= RIP=0x%016llx RSP=0x%016llx RFLAGS=0x%016llx\r\n"
"= CR0=0x%016llx CR2=0x%016llx\r\n"
"= CR3=0x%016llx CR4=0x%016llx\r\n"
"= RAX=0x%016llx RBX=0x%016llx RCX=0x%016llx\r\n"
"= RDX=0x%016llx RDI=0x%016llx RSI=0x%016llx\r\n"
"= RBP=0x%016llx R8=0x%016llx R9=0x%016llx\r\n"
"= R10=0x%016llx R11=0x%016llx R12=0x%016llx\r\n"
"= R13=0x%016llx R14=0x%016llx R15=0x%016llx\r\n",
"= RIP=0x%016lx RSP=0x%016lx RFLAGS=0x%016lx\r\n"
"= CR0=0x%016lx CR2=0x%016lx\r\n"
"= CR3=0x%016lx CR4=0x%016lx\r\n"
"= RAX=0x%016lx RBX=0x%016lx RCX=0x%016lx\r\n"
"= RDX=0x%016lx RDI=0x%016lx RSI=0x%016lx\r\n"
"= RBP=0x%016lx R8=0x%016lx R9=0x%016lx\r\n"
"= R10=0x%016lx R11=0x%016lx R12=0x%016lx\r\n"
"= R13=0x%016lx R14=0x%016lx R15=0x%016lx\r\n",
vcpu->vm->vm_id, vcpu->vcpu_id,
vcpu_get_rip(vcpu),
vcpu_get_gpreg(vcpu, CPU_REG_RSP),
@ -739,7 +739,7 @@ static void vcpu_dumpreg(void *data)
size -= len;
str += len;
} else {
len = snprintf(str, size, "\r\nDump RSP for vm %hu, from gva 0x%016llx\r\n",
len = snprintf(str, size, "\r\nDump RSP for vm %hu, from gva 0x%016lx\r\n",
vcpu->vm->vm_id, vcpu_get_gpreg(vcpu, CPU_REG_RSP));
if (len >= size) {
goto overflow;
@ -748,7 +748,7 @@ static void vcpu_dumpreg(void *data)
str += len;
for (i = 0UL; i < 8UL; i++) {
len = snprintf(str, size, "= 0x%016llx 0x%016llx 0x%016llx 0x%016llx\r\n",
len = snprintf(str, size, "= 0x%016lx 0x%016lx 0x%016lx 0x%016lx\r\n",
tmp[i*4UL], tmp[(i*4UL)+1UL], tmp[(i*4UL)+2UL], tmp[(i*4UL)+3UL]);
if (len >= size) {
goto overflow;
@ -845,14 +845,14 @@ static int32_t shell_dumpmem(int32_t argc, char **argv)
}
snprintf(temp_str, MAX_STR_SIZE,
"Dump physical memory addr: 0x%016llx, length %d:\r\n",
"Dump physical memory addr: 0x%016lx, length %d:\r\n",
addr, length);
shell_puts(temp_str);
ptr = (uint64_t *)addr;
for (i = 0U; i < (length >> 5U); i++) {
snprintf(temp_str, MAX_STR_SIZE,
"= 0x%016llx 0x%016llx 0x%016llx 0x%016llx\r\n",
"= 0x%016lx 0x%016lx 0x%016lx 0x%016lx\r\n",
*(ptr + (i * 4U)), *(ptr + ((i * 4U) + 1U)),
*(ptr + ((i * 4U) + 2U)), *(ptr + ((i * 4U) + 3U)));
shell_puts(temp_str);
@ -860,7 +860,7 @@ static int32_t shell_dumpmem(int32_t argc, char **argv)
if ((length & 0x1fU) != 0U) {
snprintf(temp_str, MAX_STR_SIZE,
"= 0x%016llx 0x%016llx 0x%016llx 0x%016llx\r\n",
"= 0x%016lx 0x%016lx 0x%016lx 0x%016lx\r\n",
*(ptr + (i * 4U)), *(ptr + ((i * 4U) + 1U)),
*(ptr + ((i * 4U) + 2U)), *(ptr + ((i * 4U) + 3U)));
shell_puts(temp_str);
@ -1330,7 +1330,7 @@ static int32_t shell_rdmsr(int32_t argc, char **argv)
if (ret == 0) {
val = msr_read_pcpu(msr_index, pcpu_id);
snprintf(str, MAX_STR_SIZE, "rdmsr(0x%x):0x%llx\n", msr_index, val);
snprintf(str, MAX_STR_SIZE, "rdmsr(0x%x):0x%lx\n", msr_index, val);
shell_puts(str);
}