hv: inject invalid opcode if decode instruction fails

We inject invalid opcode if instruction decode fails.

We don't support many instruction. If new type guest hit
the invalid opcode and it's necessary to emulate that
instruction, we could add new instruction then.

Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
Yin Fengwei 2018-08-07 20:40:15 +08:00 committed by lijinxia
parent 1a00d6c943
commit fa9fec50e9
1 changed files with 2 additions and 1 deletions

View File

@ -2287,7 +2287,8 @@ int decode_instruction(struct vcpu *vcpu)
if (retval != 0) {
pr_err("decode instruction failed @ 0x%016llx:",
vcpu_get_rip(vcpu));
return -EINVAL;
vcpu_inject_ud(vcpu);
return -EFAULT;
}
return emul_ctxt->vie.opsize;