hv: instr_emul: remove goto in get_gva_di_check
remove goto statement in get_gva_di_check() routine
Acked-by: Eddie Dong
@@ -999,14 +999,12 @@ static int32_t get_gva_di_check(struct acrn_vcpu *vcpu, struct instr_emul_vie *v
static int32_t emulate_movs(struct acrn_vcpu *vcpu, const struct instr_emul_vie *vie)
{
uint64_t src_gva, gpa, val = 0UL;
- uint64_t rcx, rdi, rsi, rflags;
+ uint64_t rcx = 0U, rdi, rsi, rflags;
uint32_t err_code;
enum cpu_reg_name seg;
- int32_t error;
uint8_t repeat, opsize = vie->opsize;
- bool is_mmio_write;
+ bool is_mmio_write, done = false;
- error = 0;
is_mmio_write = (vcpu->req.reqs.mmio.direction == REQUEST_WRITE);
/*
@@ -1026,11 +1024,11 @@ static int32_t emulate_movs(struct acrn_vcpu *vcpu, const struct instr_emul_vie
* address size of the instruction.
*/
if ((rcx & size2mask[vie->addrsize]) == 0UL) {
- error = 0;
- goto done;
+ done = true;
}
}
+ if (!done) {
seg = (vie->seg_override != 0U) ? (vie->segment_register) : CPU_REG_DS;
if (is_mmio_write) {
@@ -1075,8 +1073,9 @@ static int32_t emulate_movs(struct acrn_vcpu *vcpu, const struct instr_emul_vie
vcpu_retain_rip(vcpu);
}
}
-done:
- return error;
+ }
+
+ return 0;
}
static int32_t emulate_stos(struct acrn_vcpu *vcpu, const struct instr_emul_vie *vie)
