lkml.org 
[lkml]   [2012]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] KVM: Fix MOVSX emulation
On 01/14/2012 08:34 PM, Nadav Amit wrote:
> The destination register of MOVSX should be decoded similarily to MOVZX.
>
> Signed-off-by: Nadav Amit <nadav.amit@gmail.com>
> ---
> arch/x86/kvm/emulate.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
> index 05a562b..7644a83 100644
> --- a/arch/x86/kvm/emulate.c
> +++ b/arch/x86/kvm/emulate.c
> @@ -3553,7 +3553,8 @@ static int decode_operand(struct x86_emulate_ctxt *ctxt, struct operand *op,
> case OpReg:
> decode_register_operand(ctxt, op,
> op == &ctxt->dst &&
> - ctxt->twobyte && (ctxt->b == 0xb6 || ctxt->b == 0xb7));
> + ctxt->twobyte && ((ctxt->b & 0xfe) == 0xb6 ||
> + (ctxt->b & 0xfe) == 0xbe));
> break;
> case OpImmUByte:
> rc = decode_imm(ctxt, op, 1, false);

Please post a unit test for this. See
git://git.kernel.org/pub/scm/virt/kvm/kvm-unit-tests.git x86/emulate.c.

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



\
 
 \ /
  Last update: 2012-01-15 10:59    [from the cache]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog