public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@qumranet.com>
To: Guillaume Thouvenin <guillaume.thouvenin@ext.bull.net>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	Anthony Liguori <aliguori@linux.vnet.ibm.com>,
	Mohammed Gamal <m.gamal005@gmail.com>,
	"Kamble, Nitin A" <nitin.a.kamble@intel.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	laurent.vivier@bull.net, Alexander Graf <alex@csgraf.de>
Subject: Re: [Patch 7/7] RealMode: Adds support for mov r, sreg (0x8c) instruction
Date: Tue, 27 May 2008 13:14:36 +0300	[thread overview]
Message-ID: <483BDF0C.9080000@qumranet.com> (raw)
In-Reply-To: <20080527101933.68cdc7de@frecb000711.frec.bull.fr>

Guillaume Thouvenin wrote:
> Adds support for mov r, sreg (0x8c) instruction
>
> Signed-off-by: Guillaume Thouvenin <guillaume.thouvenin@ext.bull.net>
> Signed-off-by: Laurent Vivier <laurent.vivier@bull.net>
>
> ---
>  arch/x86/kvm/x86_emulate.c |   21 ++++++++++++++++++++-
>  1 files changed, 20 insertions(+), 1 deletions(-)
>
> diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c
> index 106d714..35767e7 100644
> --- a/arch/x86/kvm/x86_emulate.c
> +++ b/arch/x86/kvm/x86_emulate.c
> @@ -138,7 +138,7 @@ static u16 opcode_table[256] = {
>  	/* 0x88 - 0x8F */
>  	ByteOp | DstMem | SrcReg | ModRM | Mov, DstMem | SrcReg | ModRM | Mov,
>  	ByteOp | DstReg | SrcMem | ModRM | Mov, DstReg | SrcMem | ModRM | Mov,
> -	0, ModRM | DstReg,
> +	DstMem | SrcReg | ModRM | Mov, ModRM | DstReg,
>  	DstReg | SrcMem | ModRM | Mov, Group | Group1A,
>  	/* 0x90 - 0x9F */
>  	0, 0, 0, 0, 0, 0, 0, 0,
> @@ -1531,6 +1531,25 @@ special_insn:
>  		break;
>  	case 0x88 ... 0x8b:	/* mov */
>  		goto mov;
> +	case 0x8c: { /* mov r/m, sreg */
> +		struct kvm_segment segreg;
> +
> +		if (c->modrm_mod == 0x3)
> +			c->src.val = c->modrm_val;
>   

What's this bit?

> +
> +		if (c->modrm_reg <= 5)
> +			kvm_get_segment(ctxt->vcpu, &segreg, vcpu_sreg_table[c->modrm_reg]);
> +		else {
> +			printk(KERN_INFO "0x8c: Invalid segreg in modrm byte 0x%02x\n",
> +					 c->modrm);
> +			goto cannot_emulate;
> +		}
> +		c->dst.val = segreg.selector;
> +		c->dst.bytes = 2;
> +		c->dst.ptr = (unsigned long *)decode_register(c->modrm_rm, c->regs,
> +							      c->d & ByteOp);
>   

Aren't dst.bytes and dst.ptr already set by the decoder?

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


  parent reply	other threads:[~2008-05-27 10:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20080527084115.2b0cfae1@frecb000711.frec.bull.fr>
     [not found] ` <20080527101923.77e62e21@frecb000711.frec.bull.fr>
2008-05-27 10:12   ` [Patch 6/7] RealMode: Adds support for mov seg, r (0x8e) instruction Avi Kivity
2008-05-27 12:49     ` Guillaume Thouvenin
     [not found] ` <20080527101933.68cdc7de@frecb000711.frec.bull.fr>
2008-05-27 10:14   ` Avi Kivity [this message]
2008-05-27 13:05     ` [Patch 7/7] RealMode: Adds support for mov r, sreg (0x8c) instruction Guillaume Thouvenin
2008-05-27 13:13       ` Guillaume Thouvenin
     [not found] ` <20080527101908.749cff41@frecb000711.frec.bull.fr>
2008-05-27 18:32   ` [Patch 4/7] RealMode: Adds support for jmp far 0xea Anthony Liguori
2008-05-28  6:30     ` Avi Kivity

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=483BDF0C.9080000@qumranet.com \
    --to=avi@qumranet.com \
    --cc=alex@csgraf.de \
    --cc=aliguori@linux.vnet.ibm.com \
    --cc=guillaume.thouvenin@ext.bull.net \
    --cc=kvm@vger.kernel.org \
    --cc=laurent.vivier@bull.net \
    --cc=m.gamal005@gmail.com \
    --cc=mtosatti@redhat.com \
    --cc=nitin.a.kamble@intel.com \
    /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