public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Correct inconcistency in x86_emulate_insn() between cr2 and ctxt->cr2.
@ 2007-09-19 11:41 Laurent Vivier
       [not found] ` <11902021152603-git-send-email-Laurent.Vivier-6ktuUTfB/bM@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Laurent Vivier @ 2007-09-19 11:41 UTC (permalink / raw)
  To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f; +Cc: Laurent Vivier

This patch corrects an inconcistency of cr2 introduced by the x86 emulator 
split.

Signed-off-by: Laurent Vivier <Laurent.Vivier-6ktuUTfB/bM@public.gmane.org>
---
 drivers/kvm/x86_emulate.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c
index 3a1c712..663dc57 100644
--- a/drivers/kvm/x86_emulate.c
+++ b/drivers/kvm/x86_emulate.c
@@ -776,7 +776,6 @@ done_prefixes:
 		}
 		if (c->ad_bytes != 8)
 			c->modrm_ea = (u32)c->modrm_ea;
-		ctxt->cr2 = c->modrm_ea;
 	modrm_done:
 		;
 	}
@@ -910,10 +909,10 @@ x86_emulate_insn(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops)
 	int rc = 0;
 
 	if ((c->d & ModRM) && (c->modrm_mod != 3))
-		ctxt->cr2 = c->modrm_ea;
+		cr2 = c->modrm_ea;
 
 	if (c->src.type == OP_MEM) {
-		c->src.ptr = (unsigned long *)ctxt->cr2;
+		c->src.ptr = (unsigned long *)cr2;
 		c->src.val = 0;
 		if ((rc = ops->read_emulated((unsigned long)c->src.ptr,
 					     &c->src.val,
@@ -928,7 +927,7 @@ x86_emulate_insn(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops)
 
 
 	if (c->dst.type == OP_MEM) {
-		c->dst.ptr = (unsigned long *)ctxt->cr2;
+		c->dst.ptr = (unsigned long *)cr2;
 		c->dst.bytes = (c->d & ByteOp) ? 1 : c->op_bytes;
 		c->dst.val = 0;
 		if (c->d & BitOp) {
-- 
1.5.2.4


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Correct inconcistency in x86_emulate_insn() between cr2 and ctxt->cr2.
       [not found] ` <11902021152603-git-send-email-Laurent.Vivier-6ktuUTfB/bM@public.gmane.org>
@ 2007-09-19 12:13   ` Avi Kivity
  0 siblings, 0 replies; 2+ messages in thread
From: Avi Kivity @ 2007-09-19 12:13 UTC (permalink / raw)
  To: Laurent Vivier; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Laurent Vivier wrote:
> This patch corrects an inconcistency of cr2 introduced by the x86 emulator 
> split.
>
>   

Applied, thanks.

-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-09-19 12:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-19 11:41 [PATCH] Correct inconcistency in x86_emulate_insn() between cr2 and ctxt->cr2 Laurent Vivier
     [not found] ` <11902021152603-git-send-email-Laurent.Vivier-6ktuUTfB/bM@public.gmane.org>
2007-09-19 12:13   ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox