All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Guillaume Thouvenin <guillaume.thouvenin@ext.bull.net>
Cc: kvm <kvm@vger.kernel.org>
Subject: Re: [PATCH] x86 emulator: Add Src2 decode set
Date: Thu, 09 Oct 2008 10:11:57 +0200	[thread overview]
Message-ID: <48EDBCCD.4010705@redhat.com> (raw)
In-Reply-To: <20081009095253.66737bf1@frecb000711>

Guillaume Thouvenin wrote:
> Instruction like shld has three operands, so we need to add a Src2
> decode set. We start with Src2None, Src2CL, and Src2Imm8 to support
> shld and we will expand it later.
>
>   

Please add Src2One (implied '1') as well, so we can switch the existing
shift operators to Src2 later.

> Signed-off-by: Guillaume Thouvenin <guillaume.thouvenin@ext.bull.net>
> ---
>  arch/x86/kvm/x86_emulate.c        |   47 ++++++++++++++++++++++++++++----------
>  include/asm-x86/kvm_x86_emulate.h |    1 
>  2 files changed, 36 insertions(+), 12 deletions(-)
>
> diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c
> index a391e21..c9ef2da 100644
> --- a/arch/x86/kvm/x86_emulate.c
> +++ b/arch/x86/kvm/x86_emulate.c
> @@ -59,16 +59,21 @@
>  #define SrcImm      (5<<4)	/* Immediate operand. */
>  #define SrcImmByte  (6<<4)	/* 8-bit sign-extended immediate operand. */
>  #define SrcMask     (7<<4)
> +/* Source 2 operand type */
> +#define Src2None    (0<<7)
> +#define Src2CL      (1<<7)
> +#define Src2Imm8    (2<<7)
> +#define Src2Mask    (7<<7)
>   

Please allocate bits for this at the end to avoid renumbering.

>  
> +	/*
> +	 * Decode and fetch the second source operand: register, memory
> +	 * or immediate.
> +	 */
> +	switch (c->d & Src2Mask) {
> +	case Src2None:
> +		break;
> +	case Src2CL:
> +		c->src2.val = c->regs[VCPU_REGS_RCX];
>   

Mask to a single byte; also set the operand length.

-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


  reply	other threads:[~2008-10-09  8:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-08 12:52 Emulation of shld instruction doesn't work Guillaume Thouvenin
2008-10-08 13:05 ` Guillaume Thouvenin
2008-10-08 14:14 ` Avi Kivity
2008-10-09  7:52   ` [PATCH] x86 emulator: Add Src2 decode set Guillaume Thouvenin
2008-10-09  8:11     ` Avi Kivity [this message]
2008-10-09  8:24       ` Avi Kivity
2008-10-09  8:57       ` Guillaume Thouvenin
2008-10-09  9:06         ` Avi Kivity
2008-10-09  9:30           ` Guillaume Thouvenin
2008-10-09 11:23       ` [PATCH] x86 emulator: Add a Src2 decode set and SrcOne operand type Guillaume Thouvenin
2008-10-22 10:29         ` 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=48EDBCCD.4010705@redhat.com \
    --to=avi@redhat.com \
    --cc=guillaume.thouvenin@ext.bull.net \
    --cc=kvm@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.