public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
To: "Yang, Sheng" <sheng.yang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [PATCH 1/2]KVM: x86_emulator: Decode the memory operand for 'mov'
Date: Fri, 26 Oct 2007 11:02:38 +0200	[thread overview]
Message-ID: <4721AD2E.3050307@qumranet.com> (raw)
In-Reply-To: <DB3BD37E3533EE46BED2FBA80995557F9BED4A-wq7ZOvIWXbM/UvCtAeCM4rfspsVTdybXVpNB7YpNyf8@public.gmane.org>

Yang, Sheng wrote:
> >From ebfc23b71051e5ab19d22fb3f9c3d57721566ea9 Mon Sep 17 00:00:00 2001
> From: Sheng Yang <sheng.yang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> Date: Fri, 26 Oct 2007 13:41:28 +0800
> Subject: [PATCH] KVM: x86_emulator: Decode the memory operand for 'mov'
>
> For the following TPR patch, we must get gva for executing instructions.
> Most
> memory operands are decoded in ModR/M part, except some kinds of 'mov'.
> This
> patch decoded the memory operand for these 'mov' instructions, instead
> of using
> CR2.
>
> Signed-off-by: Sheng Yang <sheng.yang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> ---
>  drivers/kvm/x86_emulate.c |   11 +++++++++++
>  1 files changed, 11 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c
> index f858c01..f75f75a 100644
> --- a/drivers/kvm/x86_emulate.c
> +++ b/drivers/kvm/x86_emulate.c
> @@ -837,6 +837,11 @@ modrm_done:
>  				    && c->modrm_reg == 7)
>  			break;
>  	      srcmem_common:
> +		/* Decode memory operand for mov(0xa0 ... 0xa1)*/
> +		if ((c->b == 0xa0) || (c->b == 0xa1)) {
> +			ctxt->cr2 = insn_fetch(u32, c->src.bytes,
> c->eip);
> +			c->eip -= c->src.bytes;
> +		}
>   

We're moving eip backwards here, then forwards in x86_emulate_insn()... 
I'm getting dizzy.

How about add a MemAbs bitflag in decode it outside, similar to the 
ModRM flag and decoding?


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


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/

  parent reply	other threads:[~2007-10-26  9:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-26  6:15 [PATCH 1/2]KVM: x86_emulator: Decode the memory operand for 'mov' Yang, Sheng
     [not found] ` <DB3BD37E3533EE46BED2FBA80995557F9BED4A-wq7ZOvIWXbM/UvCtAeCM4rfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2007-10-26  9:02   ` Avi Kivity [this message]
     [not found]     ` <4721AD2E.3050307-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-10-26  9:11       ` Yang, Sheng
2007-10-26  9:28       ` Yang, Sheng
     [not found]         ` <DB3BD37E3533EE46BED2FBA80995557F9BEE42-wq7ZOvIWXbM/UvCtAeCM4rfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2007-10-28 16:43           ` Avi Kivity
     [not found]             ` <4724BC38.3050701-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-10-29  4:53               ` Yang, Sheng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4721AD2E.3050307@qumranet.com \
    --to=avi-atkuwr5tajbwk0htik3j/w@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=sheng.yang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox