hv:remove redundant memset in some cases

No need to memset since it will overwrite the memory
by copy_from_gpa in some cases.

Tracked-On: #861
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
This commit is contained in:
Mingqiang Chi
2019-09-19 15:35:33 +08:00
committed by wenlingz
parent 9e759bcfa0
commit c36908dce2
4 changed files with 9 additions and 37 deletions

View File

@@ -55,13 +55,12 @@ int32_t hcall_world_switch(struct acrn_vcpu *vcpu)
int32_t hcall_initialize_trusty(struct acrn_vcpu *vcpu, uint64_t param)
{
int32_t ret = -EFAULT;
struct trusty_boot_param boot_param;
if ((vcpu->vm->sworld_control.flag.supported != 0UL)
&& (vcpu->vm->sworld_control.flag.active == 0UL)
&& (vcpu->arch.cur_context == NORMAL_WORLD)) {
struct trusty_boot_param boot_param;
(void)memset(&boot_param, 0U, sizeof(boot_param));
if (copy_from_gpa(vcpu->vm, &boot_param, param, sizeof(boot_param)) == 0) {
if (initialize_trusty(vcpu, &boot_param)) {
vcpu->vm->sworld_control.flag.active = 1UL;