hypervisor: x86: emulator: set IP properly for newly fetched stream
The default value of IP is zero. If the decoder's state not set properly, then the guest state is going to be wrong. Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
parent
9f3bea3e3f
commit
1eb4133034
1 changed files with 1 additions and 0 deletions
|
|
@ -588,6 +588,7 @@ impl<'a, T: CpuStateManager> Emulator<'a, T> {
|
|||
// Once we have the new stream, we must create a new decoder
|
||||
// and emulate one last instruction from the last decoded IP.
|
||||
decoder = Decoder::new(64, &fetched_insn_stream, DecoderOptions::NONE);
|
||||
decoder.set_ip(last_decoded_ip);
|
||||
decoder.decode_out(&mut insn);
|
||||
if decoder.last_error() != DecoderError::None {
|
||||
return Err(EmulationError::InstructionFetchingError(anyhow!(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue