HV: hypercall: make hypercall functions return int32_t

The error code in the hypervisor is 32-bit signed integers. To reduce implicit
conversions, this patch make hcall_xxx returns int32_t, and finally converts it
to uint64_t when assigned to rax whose semantics is properly defined in C99.

Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Junjie Mao
2018-07-19 23:17:38 +08:00
committed by lijinxia
parent ad73bb511c
commit 1a1ee93656
4 changed files with 69 additions and 66 deletions

View File

@@ -10,7 +10,7 @@
/* this hcall is only come from trusty enabled vcpu itself, and cannot be
* called from other vcpus
*/
int64_t hcall_world_switch(struct vcpu *vcpu)
int32_t hcall_world_switch(struct vcpu *vcpu)
{
int32_t next_world_id = !(vcpu->arch_vcpu.cur_context);
@@ -37,7 +37,7 @@ int64_t hcall_world_switch(struct vcpu *vcpu)
/* this hcall is only come from trusty enabled vcpu itself, and cannot be
* called from other vcpus
*/
int64_t hcall_initialize_trusty(struct vcpu *vcpu, uint64_t param)
int32_t hcall_initialize_trusty(struct vcpu *vcpu, uint64_t param)
{
if (!vcpu->vm->sworld_control.sworld_enabled) {
pr_err("%s, Secure World is not enabled!\n", __func__);