提交 b9a1ecb9 编写于 作者: N Nadav Amit 提交者: Paolo Bonzini

KVM: x86: Setting rflags.rf during rep-string emulation

This patch updates RF for rep-string emulation.  The flag is set upon the first
iteration, and cleared after the last (if emulated). It is intended to make
sure that if a trap (in future data/io #DB emulation) or interrupt is delivered
to the guest during the rep-string instruction, RF will be set correctly. RF
affects whether instruction breakpoint in the guest is masked.
Signed-off-by: NNadav Amit <namit@cs.technion.ac.il>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 c756ad03
......@@ -4683,7 +4683,10 @@ int x86_emulate_insn(struct x86_emulate_ctxt *ctxt)
goto done;
}
ctxt->eflags &= ~EFLG_RF;
if (ctxt->rep_prefix && (ctxt->d & String))
ctxt->eflags |= EFLG_RF;
else
ctxt->eflags &= ~EFLG_RF;
if (ctxt->execute) {
if (ctxt->d & Fastop) {
......@@ -4824,6 +4827,7 @@ int x86_emulate_insn(struct x86_emulate_ctxt *ctxt)
}
goto done; /* skip rip writeback */
}
ctxt->eflags &= ~EFLG_RF;
}
ctxt->eip = ctxt->_eip;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册