From 3225b16e5fe548feca588fc87922623cd1723783 Mon Sep 17 00:00:00 2001 From: Qi Yadong Date: Fri, 3 Aug 2018 09:54:58 +0800 Subject: [PATCH] HV: trusty: log printing cleanup Replace some pr_err() with dev_dbg(). Signed-off-by: Qi Yadong Acked-by: Eddie Dong --- hypervisor/arch/x86/trusty.c | 4 +++- hypervisor/common/trusty_hypercall.c | 20 ++++++++++++++------ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/hypervisor/arch/x86/trusty.c b/hypervisor/arch/x86/trusty.c index dcb89d4b2..3c0c11f06 100644 --- a/hypervisor/arch/x86/trusty.c +++ b/hypervisor/arch/x86/trusty.c @@ -7,6 +7,8 @@ #include #include +#define ACRN_DBG_TRUSTY 6U + #define TRUSTY_VERSION 1U #define TRUSTY_VERSION_2 2U @@ -430,7 +432,7 @@ bool initialize_trusty(struct vcpu *vcpu, uint64_t param) } if (boot_param.version > TRUSTY_VERSION_2) { - pr_err("%s: Version(%u) not supported!\n", + dev_dbg(ACRN_DBG_TRUSTY, "%s: Version(%u) not supported!\n", __func__, boot_param.version); return false; } diff --git a/hypervisor/common/trusty_hypercall.c b/hypervisor/common/trusty_hypercall.c index 49c866acf..fe884b77f 100644 --- a/hypervisor/common/trusty_hypercall.c +++ b/hypervisor/common/trusty_hypercall.c @@ -7,6 +7,8 @@ #include #include +#define ACRN_DBG_TRUSTY_HYCALL 6U + /* this hcall is only come from trusty enabled vcpu itself, and cannot be * called from other vcpus */ @@ -15,18 +17,21 @@ int32_t hcall_world_switch(struct vcpu *vcpu) int32_t next_world_id = !(vcpu->arch_vcpu.cur_context); if (next_world_id >= NR_WORLD) { - pr_err("%s world_id %d exceed max number of Worlds\n", + dev_dbg(ACRN_DBG_TRUSTY_HYCALL, + "%s world_id %d exceed max number of Worlds\n", __func__, next_world_id); return -EINVAL; } if (!vcpu->vm->sworld_control.flag.supported) { - pr_err("Secure World is not supported!\n"); + dev_dbg(ACRN_DBG_TRUSTY_HYCALL, + "Secure World is not supported!\n"); return -EPERM; } if (!vcpu->vm->sworld_control.flag.active) { - pr_err("Trusty is not initialized!\n"); + dev_dbg(ACRN_DBG_TRUSTY_HYCALL, + "Trusty is not initialized!\n"); return -EPERM; } @@ -40,17 +45,20 @@ int32_t hcall_world_switch(struct vcpu *vcpu) int32_t hcall_initialize_trusty(struct vcpu *vcpu, uint64_t param) { if (!vcpu->vm->sworld_control.flag.supported) { - pr_err("Secure World is not supported!\n"); + dev_dbg(ACRN_DBG_TRUSTY_HYCALL, + "Secure World is not supported!\n"); return -EPERM; } if (vcpu->vm->sworld_control.flag.active) { - pr_err("Trusty already initialized!\n"); + dev_dbg(ACRN_DBG_TRUSTY_HYCALL, + "Trusty already initialized!\n"); return -EPERM; } if (vcpu->arch_vcpu.cur_context != NORMAL_WORLD) { - pr_err("%s, must initialize Trusty from Normal World!\n", + dev_dbg(ACRN_DBG_TRUSTY_HYCALL, + "%s, must initialize Trusty from Normal World!\n", __func__); return -EPERM; }