Skip to content

Commit 3225b16

Browse files
YadongQilijinxia
authored andcommitted
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>
1 parent 9ba14da commit 3225b16

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

hypervisor/arch/x86/trusty.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
#include <hypervisor.h>
88
#include <hkdf.h>
99

10+
#define ACRN_DBG_TRUSTY 6U
11+
1012
#define TRUSTY_VERSION 1U
1113
#define TRUSTY_VERSION_2 2U
1214

@@ -430,7 +432,7 @@ bool initialize_trusty(struct vcpu *vcpu, uint64_t param)
430432
}
431433

432434
if (boot_param.version > TRUSTY_VERSION_2) {
433-
pr_err("%s: Version(%u) not supported!\n",
435+
dev_dbg(ACRN_DBG_TRUSTY, "%s: Version(%u) not supported!\n",
434436
__func__, boot_param.version);
435437
return false;
436438
}

hypervisor/common/trusty_hypercall.c

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
#include <hypervisor.h>
88
#include <hypercall.h>
99

10+
#define ACRN_DBG_TRUSTY_HYCALL 6U
11+
1012
/* this hcall is only come from trusty enabled vcpu itself, and cannot be
1113
* called from other vcpus
1214
*/
@@ -15,18 +17,21 @@ int32_t hcall_world_switch(struct vcpu *vcpu)
1517
int32_t next_world_id = !(vcpu->arch_vcpu.cur_context);
1618

1719
if (next_world_id >= NR_WORLD) {
18-
pr_err("%s world_id %d exceed max number of Worlds\n",
20+
dev_dbg(ACRN_DBG_TRUSTY_HYCALL,
21+
"%s world_id %d exceed max number of Worlds\n",
1922
__func__, next_world_id);
2023
return -EINVAL;
2124
}
2225

2326
if (!vcpu->vm->sworld_control.flag.supported) {
24-
pr_err("Secure World is not supported!\n");
27+
dev_dbg(ACRN_DBG_TRUSTY_HYCALL,
28+
"Secure World is not supported!\n");
2529
return -EPERM;
2630
}
2731

2832
if (!vcpu->vm->sworld_control.flag.active) {
29-
pr_err("Trusty is not initialized!\n");
33+
dev_dbg(ACRN_DBG_TRUSTY_HYCALL,
34+
"Trusty is not initialized!\n");
3035
return -EPERM;
3136
}
3237

@@ -40,17 +45,20 @@ int32_t hcall_world_switch(struct vcpu *vcpu)
4045
int32_t hcall_initialize_trusty(struct vcpu *vcpu, uint64_t param)
4146
{
4247
if (!vcpu->vm->sworld_control.flag.supported) {
43-
pr_err("Secure World is not supported!\n");
48+
dev_dbg(ACRN_DBG_TRUSTY_HYCALL,
49+
"Secure World is not supported!\n");
4450
return -EPERM;
4551
}
4652

4753
if (vcpu->vm->sworld_control.flag.active) {
48-
pr_err("Trusty already initialized!\n");
54+
dev_dbg(ACRN_DBG_TRUSTY_HYCALL,
55+
"Trusty already initialized!\n");
4956
return -EPERM;
5057
}
5158

5259
if (vcpu->arch_vcpu.cur_context != NORMAL_WORLD) {
53-
pr_err("%s, must initialize Trusty from Normal World!\n",
60+
dev_dbg(ACRN_DBG_TRUSTY_HYCALL,
61+
"%s, must initialize Trusty from Normal World!\n",
5462
__func__);
5563
return -EPERM;
5664
}

0 commit comments

Comments
 (0)