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

KVM: x86: Fix update RCX/RDI/RSI on REP-string

When REP-string instruction is preceded with an address-size prefix,
ECX/EDI/ESI are used as the operation counter and pointers.  When they are
updated, the high 32-bits of RCX/RDI/RSI are cleared, similarly to the way they
are updated on every 32-bit register operation.  Fix it.
Signed-off-by: NNadav Amit <namit@cs.technion.ac.il>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 3db176d5
...@@ -524,13 +524,9 @@ static void masked_increment(ulong *reg, ulong mask, int inc) ...@@ -524,13 +524,9 @@ static void masked_increment(ulong *reg, ulong mask, int inc)
static inline void static inline void
register_address_increment(struct x86_emulate_ctxt *ctxt, int reg, int inc) register_address_increment(struct x86_emulate_ctxt *ctxt, int reg, int inc)
{ {
ulong mask; ulong *preg = reg_rmw(ctxt, reg);
if (ctxt->ad_bytes == sizeof(unsigned long)) assign_register(preg, *preg + inc, ctxt->ad_bytes);
mask = ~0UL;
else
mask = ad_mask(ctxt);
masked_increment(reg_rmw(ctxt, reg), mask, inc);
} }
static void rsp_increment(struct x86_emulate_ctxt *ctxt, int inc) static void rsp_increment(struct x86_emulate_ctxt *ctxt, int inc)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册