All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: "李春奇 <Arthur Chunqi Li>" <yzt356@gmail.com>
Cc: kvm <kvm@vger.kernel.org>, Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH] Test case of emulating multibyte NOP
Date: Thu, 6 Jun 2013 10:28:25 +0300	[thread overview]
Message-ID: <20130606072825.GV4725@redhat.com> (raw)
In-Reply-To: <CABpY8MLyF49U164c2jjDU8LXz6mpsZDXz+vB2YOsO54BGxPtDQ@mail.gmail.com>

On Thu, Jun 06, 2013 at 03:22:59PM +0800, 李春奇 <Arthur Chunqi Li> wrote:
> On Thu, Jun 6, 2013 at 3:17 PM, 李春奇 <Arthur Chunqi Li> <yzt356@gmail.com> wrote:
> > On Thu, Jun 6, 2013 at 3:02 PM, Gleb Natapov <gleb@redhat.com> wrote:
> >> On Thu, Jun 06, 2013 at 02:49:14PM +0800, 李春奇 <Arthur Chunqi Li> wrote:
> >>> On Thu, Jun 6, 2013 at 1:40 PM, Gleb Natapov <gleb@redhat.com> wrote:
> >>> > On Thu, Jun 06, 2013 at 12:28:16AM +0800, 李春奇 <Arthur Chunqi Li> wrote:
> >>> >> On Thu, Jun 6, 2013 at 12:13 AM, Gleb Natapov <gleb@redhat.com> wrote:
> >>> >> > This time the email is perfect :)
> >>> >> >
> >>> >> > On Thu, Jun 06, 2013 at 12:02:52AM +0800, Arthur Chunqi Li wrote:
> >>> >> >> Add multibyte NOP test case to kvm-unit-tests. This version adds test cases into x86/realmode.c. This can test one of bugs when booting RHEL5.9 64-bit.
> >>> >> >>
> >>> >> >> Signed-off-by: Arthur Chunqi Li <yzt356@gmail.com>
> >>> >> >> ---
> >>> >> >>  x86/realmode.c |   24 ++++++++++++++++++++++++
> >>> >> >>  1 file changed, 24 insertions(+)
> >>> >> >>
> >>> >> >> diff --git a/x86/realmode.c b/x86/realmode.c
> >>> >> >> index 981be08..e103ca6 100644
> >>> >> >> --- a/x86/realmode.c
> >>> >> >> +++ b/x86/realmode.c
> >>> >> >> @@ -1504,6 +1504,29 @@ static void test_fninit(void)
> >>> >> >>       report("fninit", 0, fsw == 0 && (fcw & 0x103f) == 0x003f);
> >>> >> >>  }
> >>> >> >>
> >>> >> >> +static void test_nopl(void)
> >>> >> >> +{
> >>> >> >> +     MK_INSN(nopl1, ".byte 0x90\n\r"); // 1 byte nop
> >>> >> >> +     MK_INSN(nopl2, ".byte 0x66, 0x90\n\r"); // 2 bytes nop
> >>> >> >> +     MK_INSN(nopl3, ".byte 0x0f, 0x1f, 0x00\n\r"); // 3 bytes nop
> >>> >> >> +     MK_INSN(nopl4, ".byte 0x0f, 0x1f, 0x40, 0x00\n\r"); // 4 bytes nop
> >>> >> > But all nops below that are not supported in 16 bit mode. You can
> >>> >> > disassemble realmode.elf in 16bit node (objdump -z -d -mi8086
> >>> >> > x86/realmode.elf) and check yourself. Lets not complicate things for now
> >>> >> > and test only those that are easy to test.
> >>> >> Yes. But what if a 7-bytes nop runs in 16bit mode? Just the same as
> >>> >> https://bugzilla.redhat.com/show_bug.cgi?id=967652
> >>> >>
> >>> > It cannot. In 16 bit mode it is decoded as two instructions:
> >>> >        0f 1f 80 00 00          nopw   0x0(%bx,%si)
> >>> >        00 00                   add    %al,(%bx,%si)
> >>> >
> >>> OK, I will just test the first four nop instructions. Should I commit
> >>> another patch?
> >>>
> >> Yes, all others will have to go into emulator.c.
> > You mean I need also add another test for nopl5~nop9 in emulator.c
> > with the "trick" emulator mode?
> > I will commit a modified one for realmode.c since some other works
> > should be done in emulator.c.
> Since we need to place some relevant codes in emulator.c, why don't we
> place all the tests in emulator.c?
> 
We can place those 4 in both. I do not always run all tests so it is
nice to cover as much as possible in both.

--
			Gleb.

  reply	other threads:[~2013-06-06  7:28 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-05 16:02 [PATCH] Test case of emulating multibyte NOP Arthur Chunqi Li
2013-06-05 16:13 ` Gleb Natapov
2013-06-05 16:28   ` 李春奇 <Arthur Chunqi Li>
2013-06-06  5:40     ` Gleb Natapov
2013-06-06  6:49       ` 李春奇 <Arthur Chunqi Li>
2013-06-06  7:02         ` Gleb Natapov
2013-06-06  7:17           ` 李春奇 <Arthur Chunqi Li>
2013-06-06  7:22             ` 李春奇 <Arthur Chunqi Li>
2013-06-06  7:28               ` Gleb Natapov [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-06-05 16:07 yzt356
     [not found] <1370444091-8814-1-git-send-email-yzt356@gmail.com>
2013-06-05 14:56 ` 李春奇 <Arthur Chunqi Li>
2013-06-05 15:11   ` Gleb Natapov
2013-06-05 15:13     ` 李春奇 <Arthur Chunqi Li>
2013-06-05 15:17       ` Gleb Natapov
2013-06-05 15:22         ` 李春奇 <Arthur Chunqi Li>
2013-06-05 15:29           ` Gleb Natapov
2013-06-05  9:41 李春奇 <Arthur Chunqi Li>
2013-06-05 13:22 ` Gleb Natapov

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=20130606072825.GV4725@redhat.com \
    --to=gleb@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=yzt356@gmail.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.