HV: trusty: log printing cleanup

Replace some pr_err() with dev_dbg().

Signed-off-by: Qi Yadong <yadong.qi@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Qi Yadong 2018-08-03 09:54:58 +08:00 committed by lijinxia
parent 9ba14dac31
commit 3225b16e5f
2 changed files with 17 additions and 7 deletions

View File

@ -7,6 +7,8 @@
#include <hypervisor.h>
#include <hkdf.h>
#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;
}

View File

@ -7,6 +7,8 @@
#include <hypervisor.h>
#include <hypercall.h>
#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;
}