提交 da56ff91 编写于 作者: P Peter Maydell 提交者: Anthony Liguori

target-ppc/kvm.c: Rename 'dprintf' to 'DPRINTF'

'dprintf' is the name of a POSIX standard function so we should not be
stealing it for our debug macro. Rename to 'DPRINTF' (in line with
a number of other source files.)
Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
Reviewed-by: NAndreas Färber <afaerber@suse.de>
Reviewed-by: NMORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Acked-by: NRichard Henderson <rth@twiddle.net>
Acked-by: NKevin Wolf <kwolf@redhat.com>
Message-id: 1375100199-13934-4-git-send-email-peter.maydell@linaro.org
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 e67137c6
...@@ -40,10 +40,10 @@ ...@@ -40,10 +40,10 @@
//#define DEBUG_KVM //#define DEBUG_KVM
#ifdef DEBUG_KVM #ifdef DEBUG_KVM
#define dprintf(fmt, ...) \ #define DPRINTF(fmt, ...) \
do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0) do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)
#else #else
#define dprintf(fmt, ...) \ #define DPRINTF(fmt, ...) \
do { } while (0) do { } while (0)
#endif #endif
...@@ -550,7 +550,7 @@ static int kvm_put_fp(CPUState *cs) ...@@ -550,7 +550,7 @@ static int kvm_put_fp(CPUState *cs)
reg.addr = (uintptr_t)&fpscr; reg.addr = (uintptr_t)&fpscr;
ret = kvm_vcpu_ioctl(cs, KVM_SET_ONE_REG, &reg); ret = kvm_vcpu_ioctl(cs, KVM_SET_ONE_REG, &reg);
if (ret < 0) { if (ret < 0) {
dprintf("Unable to set FPSCR to KVM: %s\n", strerror(errno)); DPRINTF("Unable to set FPSCR to KVM: %s\n", strerror(errno));
return ret; return ret;
} }
...@@ -564,7 +564,7 @@ static int kvm_put_fp(CPUState *cs) ...@@ -564,7 +564,7 @@ static int kvm_put_fp(CPUState *cs)
ret = kvm_vcpu_ioctl(cs, KVM_SET_ONE_REG, &reg); ret = kvm_vcpu_ioctl(cs, KVM_SET_ONE_REG, &reg);
if (ret < 0) { if (ret < 0) {
dprintf("Unable to set %s%d to KVM: %s\n", vsx ? "VSR" : "FPR", DPRINTF("Unable to set %s%d to KVM: %s\n", vsx ? "VSR" : "FPR",
i, strerror(errno)); i, strerror(errno));
return ret; return ret;
} }
...@@ -576,7 +576,7 @@ static int kvm_put_fp(CPUState *cs) ...@@ -576,7 +576,7 @@ static int kvm_put_fp(CPUState *cs)
reg.addr = (uintptr_t)&env->vscr; reg.addr = (uintptr_t)&env->vscr;
ret = kvm_vcpu_ioctl(cs, KVM_SET_ONE_REG, &reg); ret = kvm_vcpu_ioctl(cs, KVM_SET_ONE_REG, &reg);
if (ret < 0) { if (ret < 0) {
dprintf("Unable to set VSCR to KVM: %s\n", strerror(errno)); DPRINTF("Unable to set VSCR to KVM: %s\n", strerror(errno));
return ret; return ret;
} }
...@@ -585,7 +585,7 @@ static int kvm_put_fp(CPUState *cs) ...@@ -585,7 +585,7 @@ static int kvm_put_fp(CPUState *cs)
reg.addr = (uintptr_t)&env->avr[i]; reg.addr = (uintptr_t)&env->avr[i];
ret = kvm_vcpu_ioctl(cs, KVM_SET_ONE_REG, &reg); ret = kvm_vcpu_ioctl(cs, KVM_SET_ONE_REG, &reg);
if (ret < 0) { if (ret < 0) {
dprintf("Unable to set VR%d to KVM: %s\n", i, strerror(errno)); DPRINTF("Unable to set VR%d to KVM: %s\n", i, strerror(errno));
return ret; return ret;
} }
} }
...@@ -610,7 +610,7 @@ static int kvm_get_fp(CPUState *cs) ...@@ -610,7 +610,7 @@ static int kvm_get_fp(CPUState *cs)
reg.addr = (uintptr_t)&fpscr; reg.addr = (uintptr_t)&fpscr;
ret = kvm_vcpu_ioctl(cs, KVM_GET_ONE_REG, &reg); ret = kvm_vcpu_ioctl(cs, KVM_GET_ONE_REG, &reg);
if (ret < 0) { if (ret < 0) {
dprintf("Unable to get FPSCR from KVM: %s\n", strerror(errno)); DPRINTF("Unable to get FPSCR from KVM: %s\n", strerror(errno));
return ret; return ret;
} else { } else {
env->fpscr = fpscr; env->fpscr = fpscr;
...@@ -624,7 +624,7 @@ static int kvm_get_fp(CPUState *cs) ...@@ -624,7 +624,7 @@ static int kvm_get_fp(CPUState *cs)
ret = kvm_vcpu_ioctl(cs, KVM_GET_ONE_REG, &reg); ret = kvm_vcpu_ioctl(cs, KVM_GET_ONE_REG, &reg);
if (ret < 0) { if (ret < 0) {
dprintf("Unable to get %s%d from KVM: %s\n", DPRINTF("Unable to get %s%d from KVM: %s\n",
vsx ? "VSR" : "FPR", i, strerror(errno)); vsx ? "VSR" : "FPR", i, strerror(errno));
return ret; return ret;
} else { } else {
...@@ -641,7 +641,7 @@ static int kvm_get_fp(CPUState *cs) ...@@ -641,7 +641,7 @@ static int kvm_get_fp(CPUState *cs)
reg.addr = (uintptr_t)&env->vscr; reg.addr = (uintptr_t)&env->vscr;
ret = kvm_vcpu_ioctl(cs, KVM_GET_ONE_REG, &reg); ret = kvm_vcpu_ioctl(cs, KVM_GET_ONE_REG, &reg);
if (ret < 0) { if (ret < 0) {
dprintf("Unable to get VSCR from KVM: %s\n", strerror(errno)); DPRINTF("Unable to get VSCR from KVM: %s\n", strerror(errno));
return ret; return ret;
} }
...@@ -650,7 +650,7 @@ static int kvm_get_fp(CPUState *cs) ...@@ -650,7 +650,7 @@ static int kvm_get_fp(CPUState *cs)
reg.addr = (uintptr_t)&env->avr[i]; reg.addr = (uintptr_t)&env->avr[i];
ret = kvm_vcpu_ioctl(cs, KVM_GET_ONE_REG, &reg); ret = kvm_vcpu_ioctl(cs, KVM_GET_ONE_REG, &reg);
if (ret < 0) { if (ret < 0) {
dprintf("Unable to get VR%d from KVM: %s\n", DPRINTF("Unable to get VR%d from KVM: %s\n",
i, strerror(errno)); i, strerror(errno));
return ret; return ret;
} }
...@@ -672,7 +672,7 @@ static int kvm_get_vpa(CPUState *cs) ...@@ -672,7 +672,7 @@ static int kvm_get_vpa(CPUState *cs)
reg.addr = (uintptr_t)&env->vpa_addr; reg.addr = (uintptr_t)&env->vpa_addr;
ret = kvm_vcpu_ioctl(cs, KVM_GET_ONE_REG, &reg); ret = kvm_vcpu_ioctl(cs, KVM_GET_ONE_REG, &reg);
if (ret < 0) { if (ret < 0) {
dprintf("Unable to get VPA address from KVM: %s\n", strerror(errno)); DPRINTF("Unable to get VPA address from KVM: %s\n", strerror(errno));
return ret; return ret;
} }
...@@ -682,7 +682,7 @@ static int kvm_get_vpa(CPUState *cs) ...@@ -682,7 +682,7 @@ static int kvm_get_vpa(CPUState *cs)
reg.addr = (uintptr_t)&env->slb_shadow_addr; reg.addr = (uintptr_t)&env->slb_shadow_addr;
ret = kvm_vcpu_ioctl(cs, KVM_GET_ONE_REG, &reg); ret = kvm_vcpu_ioctl(cs, KVM_GET_ONE_REG, &reg);
if (ret < 0) { if (ret < 0) {
dprintf("Unable to get SLB shadow state from KVM: %s\n", DPRINTF("Unable to get SLB shadow state from KVM: %s\n",
strerror(errno)); strerror(errno));
return ret; return ret;
} }
...@@ -692,7 +692,7 @@ static int kvm_get_vpa(CPUState *cs) ...@@ -692,7 +692,7 @@ static int kvm_get_vpa(CPUState *cs)
reg.addr = (uintptr_t)&env->dtl_addr; reg.addr = (uintptr_t)&env->dtl_addr;
ret = kvm_vcpu_ioctl(cs, KVM_GET_ONE_REG, &reg); ret = kvm_vcpu_ioctl(cs, KVM_GET_ONE_REG, &reg);
if (ret < 0) { if (ret < 0) {
dprintf("Unable to get dispatch trace log state from KVM: %s\n", DPRINTF("Unable to get dispatch trace log state from KVM: %s\n",
strerror(errno)); strerror(errno));
return ret; return ret;
} }
...@@ -718,7 +718,7 @@ static int kvm_put_vpa(CPUState *cs) ...@@ -718,7 +718,7 @@ static int kvm_put_vpa(CPUState *cs)
reg.addr = (uintptr_t)&env->vpa_addr; reg.addr = (uintptr_t)&env->vpa_addr;
ret = kvm_vcpu_ioctl(cs, KVM_SET_ONE_REG, &reg); ret = kvm_vcpu_ioctl(cs, KVM_SET_ONE_REG, &reg);
if (ret < 0) { if (ret < 0) {
dprintf("Unable to set VPA address to KVM: %s\n", strerror(errno)); DPRINTF("Unable to set VPA address to KVM: %s\n", strerror(errno));
return ret; return ret;
} }
} }
...@@ -729,7 +729,7 @@ static int kvm_put_vpa(CPUState *cs) ...@@ -729,7 +729,7 @@ static int kvm_put_vpa(CPUState *cs)
reg.addr = (uintptr_t)&env->slb_shadow_addr; reg.addr = (uintptr_t)&env->slb_shadow_addr;
ret = kvm_vcpu_ioctl(cs, KVM_SET_ONE_REG, &reg); ret = kvm_vcpu_ioctl(cs, KVM_SET_ONE_REG, &reg);
if (ret < 0) { if (ret < 0) {
dprintf("Unable to set SLB shadow state to KVM: %s\n", strerror(errno)); DPRINTF("Unable to set SLB shadow state to KVM: %s\n", strerror(errno));
return ret; return ret;
} }
...@@ -738,7 +738,7 @@ static int kvm_put_vpa(CPUState *cs) ...@@ -738,7 +738,7 @@ static int kvm_put_vpa(CPUState *cs)
reg.addr = (uintptr_t)&env->dtl_addr; reg.addr = (uintptr_t)&env->dtl_addr;
ret = kvm_vcpu_ioctl(cs, KVM_SET_ONE_REG, &reg); ret = kvm_vcpu_ioctl(cs, KVM_SET_ONE_REG, &reg);
if (ret < 0) { if (ret < 0) {
dprintf("Unable to set dispatch trace log state to KVM: %s\n", DPRINTF("Unable to set dispatch trace log state to KVM: %s\n",
strerror(errno)); strerror(errno));
return ret; return ret;
} }
...@@ -748,7 +748,7 @@ static int kvm_put_vpa(CPUState *cs) ...@@ -748,7 +748,7 @@ static int kvm_put_vpa(CPUState *cs)
reg.addr = (uintptr_t)&env->vpa_addr; reg.addr = (uintptr_t)&env->vpa_addr;
ret = kvm_vcpu_ioctl(cs, KVM_SET_ONE_REG, &reg); ret = kvm_vcpu_ioctl(cs, KVM_SET_ONE_REG, &reg);
if (ret < 0) { if (ret < 0) {
dprintf("Unable to set VPA address to KVM: %s\n", strerror(errno)); DPRINTF("Unable to set VPA address to KVM: %s\n", strerror(errno));
return ret; return ret;
} }
} }
...@@ -866,7 +866,7 @@ int kvm_arch_put_registers(CPUState *cs, int level) ...@@ -866,7 +866,7 @@ int kvm_arch_put_registers(CPUState *cs, int level)
#ifdef TARGET_PPC64 #ifdef TARGET_PPC64
if (cap_papr) { if (cap_papr) {
if (kvm_put_vpa(cs) < 0) { if (kvm_put_vpa(cs) < 0) {
dprintf("Warning: Unable to set VPA information to KVM\n"); DPRINTF("Warning: Unable to set VPA information to KVM\n");
} }
} }
#endif /* TARGET_PPC64 */ #endif /* TARGET_PPC64 */
...@@ -1075,7 +1075,7 @@ int kvm_arch_get_registers(CPUState *cs) ...@@ -1075,7 +1075,7 @@ int kvm_arch_get_registers(CPUState *cs)
#ifdef TARGET_PPC64 #ifdef TARGET_PPC64
if (cap_papr) { if (cap_papr) {
if (kvm_get_vpa(cs) < 0) { if (kvm_get_vpa(cs) < 0) {
dprintf("Warning: Unable to get VPA information from KVM\n"); DPRINTF("Warning: Unable to get VPA information from KVM\n");
} }
} }
#endif #endif
...@@ -1129,7 +1129,7 @@ void kvm_arch_pre_run(CPUState *cs, struct kvm_run *run) ...@@ -1129,7 +1129,7 @@ void kvm_arch_pre_run(CPUState *cs, struct kvm_run *run)
*/ */
irq = KVM_INTERRUPT_SET; irq = KVM_INTERRUPT_SET;
dprintf("injected interrupt %d\n", irq); DPRINTF("injected interrupt %d\n", irq);
r = kvm_vcpu_ioctl(cs, KVM_INTERRUPT, &irq); r = kvm_vcpu_ioctl(cs, KVM_INTERRUPT, &irq);
if (r < 0) { if (r < 0) {
printf("cpu %d fail inject %x\n", cs->cpu_index, irq); printf("cpu %d fail inject %x\n", cs->cpu_index, irq);
...@@ -1193,20 +1193,20 @@ int kvm_arch_handle_exit(CPUState *cs, struct kvm_run *run) ...@@ -1193,20 +1193,20 @@ int kvm_arch_handle_exit(CPUState *cs, struct kvm_run *run)
switch (run->exit_reason) { switch (run->exit_reason) {
case KVM_EXIT_DCR: case KVM_EXIT_DCR:
if (run->dcr.is_write) { if (run->dcr.is_write) {
dprintf("handle dcr write\n"); DPRINTF("handle dcr write\n");
ret = kvmppc_handle_dcr_write(env, run->dcr.dcrn, run->dcr.data); ret = kvmppc_handle_dcr_write(env, run->dcr.dcrn, run->dcr.data);
} else { } else {
dprintf("handle dcr read\n"); DPRINTF("handle dcr read\n");
ret = kvmppc_handle_dcr_read(env, run->dcr.dcrn, &run->dcr.data); ret = kvmppc_handle_dcr_read(env, run->dcr.dcrn, &run->dcr.data);
} }
break; break;
case KVM_EXIT_HLT: case KVM_EXIT_HLT:
dprintf("handle halt\n"); DPRINTF("handle halt\n");
ret = kvmppc_handle_halt(cpu); ret = kvmppc_handle_halt(cpu);
break; break;
#if defined(TARGET_PPC64) #if defined(TARGET_PPC64)
case KVM_EXIT_PAPR_HCALL: case KVM_EXIT_PAPR_HCALL:
dprintf("handle PAPR hypercall\n"); DPRINTF("handle PAPR hypercall\n");
run->papr_hcall.ret = spapr_hypercall(cpu, run->papr_hcall.ret = spapr_hypercall(cpu,
run->papr_hcall.nr, run->papr_hcall.nr,
run->papr_hcall.args); run->papr_hcall.args);
...@@ -1214,12 +1214,12 @@ int kvm_arch_handle_exit(CPUState *cs, struct kvm_run *run) ...@@ -1214,12 +1214,12 @@ int kvm_arch_handle_exit(CPUState *cs, struct kvm_run *run)
break; break;
#endif #endif
case KVM_EXIT_EPR: case KVM_EXIT_EPR:
dprintf("handle epr\n"); DPRINTF("handle epr\n");
run->epr.epr = ldl_phys(env->mpic_iack); run->epr.epr = ldl_phys(env->mpic_iack);
ret = 0; ret = 0;
break; break;
case KVM_EXIT_WATCHDOG: case KVM_EXIT_WATCHDOG:
dprintf("handle watchdog expiry\n"); DPRINTF("handle watchdog expiry\n");
watchdog_perform_action(); watchdog_perform_action();
ret = 0; ret = 0;
break; break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册