All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Wei Yongjun <yjwei@cn.fujitsu.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH] Add realmode test for jcxz instruction
Date: Thu, 19 Aug 2010 16:05:42 +0300	[thread overview]
Message-ID: <4C6D2C26.7030604@redhat.com> (raw)
In-Reply-To: <4C6CCEF7.9040404@cn.fujitsu.com>

 On 08/19/2010 09:28 AM, Wei Yongjun wrote:
> Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
>
> diff --git a/x86/realmode.c b/x86/realmode.c
> index ce8fb18..0caf388 100644
> --- a/x86/realmode.c
> +++ b/x86/realmode.c
> @@ -1262,6 +1262,32 @@ void test_cbw(void)
>  		print_serial("cwde test 1: PASS\n");
>  }
>  
> +void test_jcxz(void)
> +{
> +	struct regs inregs = { 0 }, outregs;
> +
> +	MK_INSN(jcxz, "jcxz 1f\n\t"
> +		      "mov $0x1234, %eax\n\t"
> +		      "1:\n\t");
> +	MK_INSN(jecxz, "jecxz 1f\n\t"
> +		       "mov $0x1234, %eax\n\t"
> +		       "1:\n\t");
> +
> +	exec_in_big_real_mode(&inregs, &outregs,
> +			insn_jcxz, insn_jcxz_end - insn_jcxz);
> +	if(!regs_equal(&inregs, &outregs, 0))
> +		print_serial("JCXZ short Test 1: FAIL\n");
> +	else
> +		print_serial("JCXZ short Test 1: PASS\n");
> +
> +	exec_in_big_real_mode(&inregs, &outregs,
> +			insn_jecxz, insn_jecxz_end - insn_jecxz);
> +	if(!regs_equal(&inregs, &outregs, 0))
> +		print_serial("JECXZ short Test 1: FAIL\n");
> +	else
> +		print_serial("JECXZ short Test 1: PASS\n");
> +}
> +

What about tests for jump-not-taken?

As a bonus, check jcxz with ecx=0x10000 and jecxz with ecx=0x10000.

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


  reply	other threads:[~2010-08-19 13:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-19  6:25 [PATCH] KVM: x86 emulator: add JrCXZ instruction emulation Wei Yongjun
2010-08-19  6:28 ` [PATCH] Add realmode test for jcxz instruction Wei Yongjun
2010-08-19 13:05   ` Avi Kivity [this message]
2010-08-20  0:52     ` [PATCH v2] " Wei Yongjun
2010-08-24  0:00       ` Marcelo Tosatti
2010-08-24  2:57         ` [PATCH v3] " Wei Yongjun
2010-08-24 13:18           ` Marcelo Tosatti

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=4C6D2C26.7030604@redhat.com \
    --to=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=yjwei@cn.fujitsu.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 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.