Currently, this function is only available in MSHV. If a different accelerator
is used, and the code jumps to this section, a segfault will occur.
(I ran into this with HVF)
Signed-off-by: Nguyen Dinh Phi <phind.uet@gmail.com>
Link: https://lore.kernel.org/r/20251114082915.71884-2-phind.uet@gmail.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
memcpy(&val, decode->stream->bytes + decode->len, size);
} else {
target_ulong va = linear_rip(env_cpu(env), env->eip) + decode->len;
- emul_ops->fetch_instruction(env_cpu(env), &val, va, size);
+ if (emul_ops->fetch_instruction) {
+ emul_ops->fetch_instruction(env_cpu(env), &val, va, size);
+ } else {
+ emul_ops->read_mem(env_cpu(env), &val, va, size);
+ }
}
decode->len += size;