* [PATCH] Test case of emulating multibyte NOP
@ 2013-06-05 16:02 Arthur Chunqi Li
2013-06-05 16:13 ` Gleb Natapov
0 siblings, 1 reply; 18+ messages in thread
From: Arthur Chunqi Li @ 2013-06-05 16:02 UTC (permalink / raw)
To: kvm; +Cc: pbonzini, gleb, Arthur Chunqi Li
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
+ MK_INSN(nopl5, ".byte 0x0f, 0x1f, 0x44, 0x00, 0x00\n\r"); // 5 bytes nop
+ MK_INSN(nopl6, ".byte 0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00\n\r"); // 6 bytes nop
+ MK_INSN(nopl7, ".byte 0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00\n\r"); // 7 bytes nop
+ MK_INSN(nopl8, ".byte 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00\n\r"); // 8 bytes nop
+ MK_INSN(nopl9, ".byte 0x66, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00\n\r"); // 9 bytes nop
+ exec_in_big_real_mode(&insn_nopl1);
+ exec_in_big_real_mode(&insn_nopl2);
+ exec_in_big_real_mode(&insn_nopl3);
+ exec_in_big_real_mode(&insn_nopl4);
+ exec_in_big_real_mode(&insn_nopl5);
+ exec_in_big_real_mode(&insn_nopl6);
+ exec_in_big_real_mode(&insn_nopl7);
+ exec_in_big_real_mode(&insn_nopl8);
+ exec_in_big_real_mode(&insn_nopl9);
+ report("nopl", 0, 1);
+}
+
void realmode_start(void)
{
test_null();
@@ -1548,6 +1571,7 @@ void realmode_start(void)
test_xlat();
test_salc();
test_fninit();
+ test_nopl();
exit(0);
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH] Test case of emulating multibyte NOP
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>
0 siblings, 1 reply; 18+ messages in thread
From: Gleb Natapov @ 2013-06-05 16:13 UTC (permalink / raw)
To: Arthur Chunqi Li; +Cc: kvm, pbonzini
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.
> + MK_INSN(nopl5, ".byte 0x0f, 0x1f, 0x44, 0x00, 0x00\n\r"); // 5 bytes nop
> + MK_INSN(nopl6, ".byte 0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00\n\r"); // 6 bytes nop
> + MK_INSN(nopl7, ".byte 0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00\n\r"); // 7 bytes nop
> + MK_INSN(nopl8, ".byte 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00\n\r"); // 8 bytes nop
> + MK_INSN(nopl9, ".byte 0x66, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00\n\r"); // 9 bytes nop
> + exec_in_big_real_mode(&insn_nopl1);
> + exec_in_big_real_mode(&insn_nopl2);
> + exec_in_big_real_mode(&insn_nopl3);
> + exec_in_big_real_mode(&insn_nopl4);
> + exec_in_big_real_mode(&insn_nopl5);
> + exec_in_big_real_mode(&insn_nopl6);
> + exec_in_big_real_mode(&insn_nopl7);
> + exec_in_big_real_mode(&insn_nopl8);
> + exec_in_big_real_mode(&insn_nopl9);
> + report("nopl", 0, 1);
> +}
> +
> void realmode_start(void)
> {
> test_null();
> @@ -1548,6 +1571,7 @@ void realmode_start(void)
> test_xlat();
> test_salc();
> test_fninit();
> + test_nopl();
>
> exit(0);
> }
> --
> 1.7.9.5
--
Gleb.
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] Test case of emulating multibyte NOP
2013-06-05 16:13 ` Gleb Natapov
@ 2013-06-05 16:28 ` 李春奇 <Arthur Chunqi Li>
2013-06-06 5:40 ` Gleb Natapov
0 siblings, 1 reply; 18+ messages in thread
From: 李春奇 <Arthur Chunqi Li> @ 2013-06-05 16:28 UTC (permalink / raw)
To: Gleb Natapov; +Cc: kvm, Paolo Bonzini
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
DR6=00000000ffff0ff0 DR7=0000000000000400
EFER=0000000000000500
Code=00 00 e9 50 ff ff ff 00 00 00 00 85 d2 74 20 45 31 c0 31 c9 <0f>
1f 80 00 00 00 00 0f b6 04 31 41 83 c0 01 88 04 39 48 83 c1 01 41 39
d0 75 ec 48 89 f8
The error code is "0f 1f 80 00 00 00 00", which is a 7-bytes nop. Will
the emulator runs well in that case when booting RHEL5.9 64-bit?
Arthur
>
>> + MK_INSN(nopl5, ".byte 0x0f, 0x1f, 0x44, 0x00, 0x00\n\r"); // 5 bytes nop
>> + MK_INSN(nopl6, ".byte 0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00\n\r"); // 6 bytes nop
>> + MK_INSN(nopl7, ".byte 0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00\n\r"); // 7 bytes nop
>> + MK_INSN(nopl8, ".byte 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00\n\r"); // 8 bytes nop
>> + MK_INSN(nopl9, ".byte 0x66, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00\n\r"); // 9 bytes nop
>> + exec_in_big_real_mode(&insn_nopl1);
>> + exec_in_big_real_mode(&insn_nopl2);
>> + exec_in_big_real_mode(&insn_nopl3);
>> + exec_in_big_real_mode(&insn_nopl4);
>> + exec_in_big_real_mode(&insn_nopl5);
>> + exec_in_big_real_mode(&insn_nopl6);
>> + exec_in_big_real_mode(&insn_nopl7);
>> + exec_in_big_real_mode(&insn_nopl8);
>> + exec_in_big_real_mode(&insn_nopl9);
>> + report("nopl", 0, 1);
>> +}
>> +
>> void realmode_start(void)
>> {
>> test_null();
>> @@ -1548,6 +1571,7 @@ void realmode_start(void)
>> test_xlat();
>> test_salc();
>> test_fninit();
>> + test_nopl();
>>
>> exit(0);
>> }
>> --
>> 1.7.9.5
>
> --
> Gleb.
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] Test case of emulating multibyte NOP
2013-06-05 16:28 ` 李春奇 <Arthur Chunqi Li>
@ 2013-06-06 5:40 ` Gleb Natapov
2013-06-06 6:49 ` 李春奇 <Arthur Chunqi Li>
0 siblings, 1 reply; 18+ messages in thread
From: Gleb Natapov @ 2013-06-06 5:40 UTC (permalink / raw)
To: 李春奇 <Arthur Chunqi Li>; +Cc: kvm, Paolo Bonzini
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)
> DR6=00000000ffff0ff0 DR7=0000000000000400
> EFER=0000000000000500
> Code=00 00 e9 50 ff ff ff 00 00 00 00 85 d2 74 20 45 31 c0 31 c9 <0f>
> 1f 80 00 00 00 00 0f b6 04 31 41 83 c0 01 88 04 39 48 83 c1 01 41 39
> d0 75 ec 48 89 f8
>
> The error code is "0f 1f 80 00 00 00 00", which is a 7-bytes nop. Will
> the emulator runs well in that case when booting RHEL5.9 64-bit?
>
> Arthur
>
>
> >
> >> + MK_INSN(nopl5, ".byte 0x0f, 0x1f, 0x44, 0x00, 0x00\n\r"); // 5 bytes nop
> >> + MK_INSN(nopl6, ".byte 0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00\n\r"); // 6 bytes nop
> >> + MK_INSN(nopl7, ".byte 0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00\n\r"); // 7 bytes nop
> >> + MK_INSN(nopl8, ".byte 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00\n\r"); // 8 bytes nop
> >> + MK_INSN(nopl9, ".byte 0x66, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00\n\r"); // 9 bytes nop
> >> + exec_in_big_real_mode(&insn_nopl1);
> >> + exec_in_big_real_mode(&insn_nopl2);
> >> + exec_in_big_real_mode(&insn_nopl3);
> >> + exec_in_big_real_mode(&insn_nopl4);
> >> + exec_in_big_real_mode(&insn_nopl5);
> >> + exec_in_big_real_mode(&insn_nopl6);
> >> + exec_in_big_real_mode(&insn_nopl7);
> >> + exec_in_big_real_mode(&insn_nopl8);
> >> + exec_in_big_real_mode(&insn_nopl9);
> >> + report("nopl", 0, 1);
> >> +}
> >> +
> >> void realmode_start(void)
> >> {
> >> test_null();
> >> @@ -1548,6 +1571,7 @@ void realmode_start(void)
> >> test_xlat();
> >> test_salc();
> >> test_fninit();
> >> + test_nopl();
> >>
> >> exit(0);
> >> }
> >> --
> >> 1.7.9.5
> >
> > --
> > Gleb.
--
Gleb.
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] Test case of emulating multibyte NOP
2013-06-06 5:40 ` Gleb Natapov
@ 2013-06-06 6:49 ` 李春奇 <Arthur Chunqi Li>
2013-06-06 7:02 ` Gleb Natapov
0 siblings, 1 reply; 18+ messages in thread
From: 李春奇 <Arthur Chunqi Li> @ 2013-06-06 6:49 UTC (permalink / raw)
To: Gleb Natapov; +Cc: kvm, Paolo Bonzini
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?
Arthur.
>> DR6=00000000ffff0ff0 DR7=0000000000000400
>> EFER=0000000000000500
>> Code=00 00 e9 50 ff ff ff 00 00 00 00 85 d2 74 20 45 31 c0 31 c9 <0f>
>> 1f 80 00 00 00 00 0f b6 04 31 41 83 c0 01 88 04 39 48 83 c1 01 41 39
>> d0 75 ec 48 89 f8
>>
>> The error code is "0f 1f 80 00 00 00 00", which is a 7-bytes nop. Will
>> the emulator runs well in that case when booting RHEL5.9 64-bit?
>>
>> Arthur
>>
>>
>> >
>> >> + MK_INSN(nopl5, ".byte 0x0f, 0x1f, 0x44, 0x00, 0x00\n\r"); // 5 bytes nop
>> >> + MK_INSN(nopl6, ".byte 0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00\n\r"); // 6 bytes nop
>> >> + MK_INSN(nopl7, ".byte 0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00\n\r"); // 7 bytes nop
>> >> + MK_INSN(nopl8, ".byte 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00\n\r"); // 8 bytes nop
>> >> + MK_INSN(nopl9, ".byte 0x66, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00\n\r"); // 9 bytes nop
>> >> + exec_in_big_real_mode(&insn_nopl1);
>> >> + exec_in_big_real_mode(&insn_nopl2);
>> >> + exec_in_big_real_mode(&insn_nopl3);
>> >> + exec_in_big_real_mode(&insn_nopl4);
>> >> + exec_in_big_real_mode(&insn_nopl5);
>> >> + exec_in_big_real_mode(&insn_nopl6);
>> >> + exec_in_big_real_mode(&insn_nopl7);
>> >> + exec_in_big_real_mode(&insn_nopl8);
>> >> + exec_in_big_real_mode(&insn_nopl9);
>> >> + report("nopl", 0, 1);
>> >> +}
>> >> +
>> >> void realmode_start(void)
>> >> {
>> >> test_null();
>> >> @@ -1548,6 +1571,7 @@ void realmode_start(void)
>> >> test_xlat();
>> >> test_salc();
>> >> test_fninit();
>> >> + test_nopl();
>> >>
>> >> exit(0);
>> >> }
>> >> --
>> >> 1.7.9.5
>> >
>> > --
>> > Gleb.
>
> --
> Gleb.
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] Test case of emulating multibyte NOP
2013-06-06 6:49 ` 李春奇 <Arthur Chunqi Li>
@ 2013-06-06 7:02 ` Gleb Natapov
2013-06-06 7:17 ` 李春奇 <Arthur Chunqi Li>
0 siblings, 1 reply; 18+ messages in thread
From: Gleb Natapov @ 2013-06-06 7:02 UTC (permalink / raw)
To: 李春奇 <Arthur Chunqi Li>; +Cc: kvm, Paolo Bonzini
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.
> Arthur.
>
> >> DR6=00000000ffff0ff0 DR7=0000000000000400
> >> EFER=0000000000000500
> >> Code=00 00 e9 50 ff ff ff 00 00 00 00 85 d2 74 20 45 31 c0 31 c9 <0f>
> >> 1f 80 00 00 00 00 0f b6 04 31 41 83 c0 01 88 04 39 48 83 c1 01 41 39
> >> d0 75 ec 48 89 f8
> >>
> >> The error code is "0f 1f 80 00 00 00 00", which is a 7-bytes nop. Will
> >> the emulator runs well in that case when booting RHEL5.9 64-bit?
> >>
> >> Arthur
> >>
> >>
> >> >
> >> >> + MK_INSN(nopl5, ".byte 0x0f, 0x1f, 0x44, 0x00, 0x00\n\r"); // 5 bytes nop
> >> >> + MK_INSN(nopl6, ".byte 0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00\n\r"); // 6 bytes nop
> >> >> + MK_INSN(nopl7, ".byte 0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00\n\r"); // 7 bytes nop
> >> >> + MK_INSN(nopl8, ".byte 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00\n\r"); // 8 bytes nop
> >> >> + MK_INSN(nopl9, ".byte 0x66, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00\n\r"); // 9 bytes nop
> >> >> + exec_in_big_real_mode(&insn_nopl1);
> >> >> + exec_in_big_real_mode(&insn_nopl2);
> >> >> + exec_in_big_real_mode(&insn_nopl3);
> >> >> + exec_in_big_real_mode(&insn_nopl4);
> >> >> + exec_in_big_real_mode(&insn_nopl5);
> >> >> + exec_in_big_real_mode(&insn_nopl6);
> >> >> + exec_in_big_real_mode(&insn_nopl7);
> >> >> + exec_in_big_real_mode(&insn_nopl8);
> >> >> + exec_in_big_real_mode(&insn_nopl9);
> >> >> + report("nopl", 0, 1);
> >> >> +}
> >> >> +
> >> >> void realmode_start(void)
> >> >> {
> >> >> test_null();
> >> >> @@ -1548,6 +1571,7 @@ void realmode_start(void)
> >> >> test_xlat();
> >> >> test_salc();
> >> >> test_fninit();
> >> >> + test_nopl();
> >> >>
> >> >> exit(0);
> >> >> }
> >> >> --
> >> >> 1.7.9.5
> >> >
> >> > --
> >> > Gleb.
> >
> > --
> > Gleb.
--
Gleb.
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] Test case of emulating multibyte NOP
2013-06-06 7:02 ` Gleb Natapov
@ 2013-06-06 7:17 ` 李春奇 <Arthur Chunqi Li>
2013-06-06 7:22 ` 李春奇 <Arthur Chunqi Li>
0 siblings, 1 reply; 18+ messages in thread
From: 李春奇 <Arthur Chunqi Li> @ 2013-06-06 7:17 UTC (permalink / raw)
To: Gleb Natapov; +Cc: kvm, Paolo Bonzini
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.
>
>> Arthur.
>>
>> >> DR6=00000000ffff0ff0 DR7=0000000000000400
>> >> EFER=0000000000000500
>> >> Code=00 00 e9 50 ff ff ff 00 00 00 00 85 d2 74 20 45 31 c0 31 c9 <0f>
>> >> 1f 80 00 00 00 00 0f b6 04 31 41 83 c0 01 88 04 39 48 83 c1 01 41 39
>> >> d0 75 ec 48 89 f8
>> >>
>> >> The error code is "0f 1f 80 00 00 00 00", which is a 7-bytes nop. Will
>> >> the emulator runs well in that case when booting RHEL5.9 64-bit?
>> >>
>> >> Arthur
>> >>
>> >>
>> >> >
>> >> >> + MK_INSN(nopl5, ".byte 0x0f, 0x1f, 0x44, 0x00, 0x00\n\r"); // 5 bytes nop
>> >> >> + MK_INSN(nopl6, ".byte 0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00\n\r"); // 6 bytes nop
>> >> >> + MK_INSN(nopl7, ".byte 0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00\n\r"); // 7 bytes nop
>> >> >> + MK_INSN(nopl8, ".byte 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00\n\r"); // 8 bytes nop
>> >> >> + MK_INSN(nopl9, ".byte 0x66, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00\n\r"); // 9 bytes nop
>> >> >> + exec_in_big_real_mode(&insn_nopl1);
>> >> >> + exec_in_big_real_mode(&insn_nopl2);
>> >> >> + exec_in_big_real_mode(&insn_nopl3);
>> >> >> + exec_in_big_real_mode(&insn_nopl4);
>> >> >> + exec_in_big_real_mode(&insn_nopl5);
>> >> >> + exec_in_big_real_mode(&insn_nopl6);
>> >> >> + exec_in_big_real_mode(&insn_nopl7);
>> >> >> + exec_in_big_real_mode(&insn_nopl8);
>> >> >> + exec_in_big_real_mode(&insn_nopl9);
>> >> >> + report("nopl", 0, 1);
>> >> >> +}
>> >> >> +
>> >> >> void realmode_start(void)
>> >> >> {
>> >> >> test_null();
>> >> >> @@ -1548,6 +1571,7 @@ void realmode_start(void)
>> >> >> test_xlat();
>> >> >> test_salc();
>> >> >> test_fninit();
>> >> >> + test_nopl();
>> >> >>
>> >> >> exit(0);
>> >> >> }
>> >> >> --
>> >> >> 1.7.9.5
>> >> >
>> >> > --
>> >> > Gleb.
>> >
>> > --
>> > Gleb.
>
> --
> Gleb.
--
Arthur Chunqi Li
Department of Computer Science
School of EECS
Peking University
Beijing, China
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] Test case of emulating multibyte NOP
2013-06-06 7:17 ` 李春奇 <Arthur Chunqi Li>
@ 2013-06-06 7:22 ` 李春奇 <Arthur Chunqi Li>
2013-06-06 7:28 ` Gleb Natapov
0 siblings, 1 reply; 18+ messages in thread
From: 李春奇 <Arthur Chunqi Li> @ 2013-06-06 7:22 UTC (permalink / raw)
To: Gleb Natapov; +Cc: kvm, Paolo Bonzini
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?
Arthur.
>
>>
>>> Arthur.
>>>
>>> >> DR6=00000000ffff0ff0 DR7=0000000000000400
>>> >> EFER=0000000000000500
>>> >> Code=00 00 e9 50 ff ff ff 00 00 00 00 85 d2 74 20 45 31 c0 31 c9 <0f>
>>> >> 1f 80 00 00 00 00 0f b6 04 31 41 83 c0 01 88 04 39 48 83 c1 01 41 39
>>> >> d0 75 ec 48 89 f8
>>> >>
>>> >> The error code is "0f 1f 80 00 00 00 00", which is a 7-bytes nop. Will
>>> >> the emulator runs well in that case when booting RHEL5.9 64-bit?
>>> >>
>>> >> Arthur
>>> >>
>>> >>
>>> >> >
>>> >> >> + MK_INSN(nopl5, ".byte 0x0f, 0x1f, 0x44, 0x00, 0x00\n\r"); // 5 bytes nop
>>> >> >> + MK_INSN(nopl6, ".byte 0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00\n\r"); // 6 bytes nop
>>> >> >> + MK_INSN(nopl7, ".byte 0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00\n\r"); // 7 bytes nop
>>> >> >> + MK_INSN(nopl8, ".byte 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00\n\r"); // 8 bytes nop
>>> >> >> + MK_INSN(nopl9, ".byte 0x66, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00\n\r"); // 9 bytes nop
>>> >> >> + exec_in_big_real_mode(&insn_nopl1);
>>> >> >> + exec_in_big_real_mode(&insn_nopl2);
>>> >> >> + exec_in_big_real_mode(&insn_nopl3);
>>> >> >> + exec_in_big_real_mode(&insn_nopl4);
>>> >> >> + exec_in_big_real_mode(&insn_nopl5);
>>> >> >> + exec_in_big_real_mode(&insn_nopl6);
>>> >> >> + exec_in_big_real_mode(&insn_nopl7);
>>> >> >> + exec_in_big_real_mode(&insn_nopl8);
>>> >> >> + exec_in_big_real_mode(&insn_nopl9);
>>> >> >> + report("nopl", 0, 1);
>>> >> >> +}
>>> >> >> +
>>> >> >> void realmode_start(void)
>>> >> >> {
>>> >> >> test_null();
>>> >> >> @@ -1548,6 +1571,7 @@ void realmode_start(void)
>>> >> >> test_xlat();
>>> >> >> test_salc();
>>> >> >> test_fninit();
>>> >> >> + test_nopl();
>>> >> >>
>>> >> >> exit(0);
>>> >> >> }
>>> >> >> --
>>> >> >> 1.7.9.5
>>> >> >
>>> >> > --
>>> >> > Gleb.
>>> >
>>> > --
>>> > Gleb.
>>
>> --
>> Gleb.
>
>
>
> --
> Arthur Chunqi Li
> Department of Computer Science
> School of EECS
> Peking University
> Beijing, China
--
Arthur Chunqi Li
Department of Computer Science
School of EECS
Peking University
Beijing, China
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] Test case of emulating multibyte NOP
2013-06-06 7:22 ` 李春奇 <Arthur Chunqi Li>
@ 2013-06-06 7:28 ` Gleb Natapov
0 siblings, 0 replies; 18+ messages in thread
From: Gleb Natapov @ 2013-06-06 7:28 UTC (permalink / raw)
To: 李春奇 <Arthur Chunqi Li>; +Cc: kvm, Paolo Bonzini
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.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH] Test case of emulating multibyte NOP
@ 2013-06-05 16:07 yzt356
0 siblings, 0 replies; 18+ messages in thread
From: yzt356 @ 2013-06-05 16:07 UTC (permalink / raw)
To: kvm; +Cc: pbonzini, gleb, Arthur Chunqi Li
From: Arthur Chunqi Li <yzt356@gmail.com>
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
+ MK_INSN(nopl5, ".byte 0x0f, 0x1f, 0x44, 0x00, 0x00\n\r"); // 5 bytes nop
+ MK_INSN(nopl6, ".byte 0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00\n\r"); // 6 bytes nop
+ MK_INSN(nopl7, ".byte 0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00\n\r"); // 7 bytes nop
+ MK_INSN(nopl8, ".byte 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00\n\r"); // 8 bytes nop
+ MK_INSN(nopl9, ".byte 0x66, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00\n\r"); // 9 bytes nop
+ exec_in_big_real_mode(&insn_nopl1);
+ exec_in_big_real_mode(&insn_nopl2);
+ exec_in_big_real_mode(&insn_nopl3);
+ exec_in_big_real_mode(&insn_nopl4);
+ exec_in_big_real_mode(&insn_nopl5);
+ exec_in_big_real_mode(&insn_nopl6);
+ exec_in_big_real_mode(&insn_nopl7);
+ exec_in_big_real_mode(&insn_nopl8);
+ exec_in_big_real_mode(&insn_nopl9);
+ report("nopl", 0, 1);
+}
+
void realmode_start(void)
{
test_null();
@@ -1548,6 +1571,7 @@ void realmode_start(void)
test_xlat();
test_salc();
test_fninit();
+ test_nopl();
exit(0);
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 18+ messages in thread
[parent not found: <1370444091-8814-1-git-send-email-yzt356@gmail.com>]
* Re: [PATCH] Test case of emulating multibyte NOP
[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
0 siblings, 1 reply; 18+ messages in thread
From: 李春奇 <Arthur Chunqi Li> @ 2013-06-05 14:56 UTC (permalink / raw)
To: kvm; +Cc: Paolo Bonzini, Gleb Natapov, Arthur Chunqi Li
Hi Gleb,
I generate this mail by git send-email and I think the format is OK.
This is my first try to commit a patch in open source community. Sorry
for annoying you guys so much.
Thanks,
Arthur
On Wed, Jun 5, 2013 at 10:54 PM, Arthur Chunqi Li <yzt356@gmail.com> 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
> + MK_INSN(nopl5, ".byte 0x0f, 0x1f, 0x44, 0x00, 0x00\n\r"); // 5 bytes nop
> + MK_INSN(nopl6, ".byte 0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00\n\r"); // 6 bytes nop
> + MK_INSN(nopl7, ".byte 0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00\n\r"); // 7 bytes nop
> + MK_INSN(nopl8, ".byte 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00\n\r"); // 8 bytes nop
> + MK_INSN(nopl9, ".byte 0x66, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00\n\r"); // 9 bytes nop
> + exec_in_big_real_mode(&insn_nopl1);
> + exec_in_big_real_mode(&insn_nopl2);
> + exec_in_big_real_mode(&insn_nopl3);
> + exec_in_big_real_mode(&insn_nopl4);
> + exec_in_big_real_mode(&insn_nopl5);
> + exec_in_big_real_mode(&insn_nopl6);
> + exec_in_big_real_mode(&insn_nopl7);
> + exec_in_big_real_mode(&insn_nopl8);
> + exec_in_big_real_mode(&insn_nopl9);
> + report("nopl", 0, 1);
> +}
> +
> void realmode_start(void)
> {
> test_null();
> @@ -1548,6 +1571,7 @@ void realmode_start(void)
> test_xlat();
> test_salc();
> test_fninit();
> + test_nopl();
>
> exit(0);
> }
> --
> 1.7.9.5
>
--
Arthur Chunqi Li
Department of Computer Science
School of EECS
Peking University
Beijing, China
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] Test case of emulating multibyte NOP
2013-06-05 14:56 ` 李春奇 <Arthur Chunqi Li>
@ 2013-06-05 15:11 ` Gleb Natapov
2013-06-05 15:13 ` 李春奇 <Arthur Chunqi Li>
0 siblings, 1 reply; 18+ messages in thread
From: Gleb Natapov @ 2013-06-05 15:11 UTC (permalink / raw)
To: 李春奇 <Arthur Chunqi Li>; +Cc: kvm, Paolo Bonzini
On Wed, Jun 05, 2013 at 10:56:54PM +0800, 李春奇 <Arthur Chunqi Li> wrote:
> Hi Gleb,
> I generate this mail by git send-email and I think the format is OK.
>
But I have not received the email, only this your reply to it.
> This is my first try to commit a patch in open source community. Sorry
> for annoying you guys so much.
>
> Thanks,
No problem.
> Arthur
>
> On Wed, Jun 5, 2013 at 10:54 PM, Arthur Chunqi Li <yzt356@gmail.com> 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
> > + MK_INSN(nopl5, ".byte 0x0f, 0x1f, 0x44, 0x00, 0x00\n\r"); // 5 bytes nop
> > + MK_INSN(nopl6, ".byte 0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00\n\r"); // 6 bytes nop
> > + MK_INSN(nopl7, ".byte 0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00\n\r"); // 7 bytes nop
> > + MK_INSN(nopl8, ".byte 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00\n\r"); // 8 bytes nop
> > + MK_INSN(nopl9, ".byte 0x66, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00\n\r"); // 9 bytes nop
> > + exec_in_big_real_mode(&insn_nopl1);
> > + exec_in_big_real_mode(&insn_nopl2);
> > + exec_in_big_real_mode(&insn_nopl3);
> > + exec_in_big_real_mode(&insn_nopl4);
> > + exec_in_big_real_mode(&insn_nopl5);
> > + exec_in_big_real_mode(&insn_nopl6);
> > + exec_in_big_real_mode(&insn_nopl7);
> > + exec_in_big_real_mode(&insn_nopl8);
> > + exec_in_big_real_mode(&insn_nopl9);
> > + report("nopl", 0, 1);
> > +}
> > +
> > void realmode_start(void)
> > {
> > test_null();
> > @@ -1548,6 +1571,7 @@ void realmode_start(void)
> > test_xlat();
> > test_salc();
> > test_fninit();
> > + test_nopl();
> >
> > exit(0);
> > }
> > --
> > 1.7.9.5
> >
>
>
>
> --
> Arthur Chunqi Li
> Department of Computer Science
> School of EECS
> Peking University
> Beijing, China
--
Gleb.
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] Test case of emulating multibyte NOP
2013-06-05 15:11 ` Gleb Natapov
@ 2013-06-05 15:13 ` 李春奇 <Arthur Chunqi Li>
2013-06-05 15:17 ` Gleb Natapov
0 siblings, 1 reply; 18+ messages in thread
From: 李春奇 <Arthur Chunqi Li> @ 2013-06-05 15:13 UTC (permalink / raw)
To: Gleb Natapov; +Cc: kvm, Paolo Bonzini
On Wed, Jun 5, 2013 at 11:11 PM, Gleb Natapov <gleb@redhat.com> wrote:
> On Wed, Jun 05, 2013 at 10:56:54PM +0800, 李春奇 <Arthur Chunqi Li> wrote:
>> Hi Gleb,
>> I generate this mail by git send-email and I think the format is OK.
>>
> But I have not received the email, only this your reply to it.
Maybe the initial mail is in your spam box.
>
>> This is my first try to commit a patch in open source community. Sorry
>> for annoying you guys so much.
>>
>> Thanks,
> No problem.
>
>> Arthur
>>
>> On Wed, Jun 5, 2013 at 10:54 PM, Arthur Chunqi Li <yzt356@gmail.com> 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
>> > + MK_INSN(nopl5, ".byte 0x0f, 0x1f, 0x44, 0x00, 0x00\n\r"); // 5 bytes nop
>> > + MK_INSN(nopl6, ".byte 0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00\n\r"); // 6 bytes nop
>> > + MK_INSN(nopl7, ".byte 0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00\n\r"); // 7 bytes nop
>> > + MK_INSN(nopl8, ".byte 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00\n\r"); // 8 bytes nop
>> > + MK_INSN(nopl9, ".byte 0x66, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00\n\r"); // 9 bytes nop
>> > + exec_in_big_real_mode(&insn_nopl1);
>> > + exec_in_big_real_mode(&insn_nopl2);
>> > + exec_in_big_real_mode(&insn_nopl3);
>> > + exec_in_big_real_mode(&insn_nopl4);
>> > + exec_in_big_real_mode(&insn_nopl5);
>> > + exec_in_big_real_mode(&insn_nopl6);
>> > + exec_in_big_real_mode(&insn_nopl7);
>> > + exec_in_big_real_mode(&insn_nopl8);
>> > + exec_in_big_real_mode(&insn_nopl9);
>> > + report("nopl", 0, 1);
>> > +}
>> > +
>> > void realmode_start(void)
>> > {
>> > test_null();
>> > @@ -1548,6 +1571,7 @@ void realmode_start(void)
>> > test_xlat();
>> > test_salc();
>> > test_fninit();
>> > + test_nopl();
>> >
>> > exit(0);
>> > }
>> > --
>> > 1.7.9.5
>> >
>>
>>
>>
>> --
>> Arthur Chunqi Li
>> Department of Computer Science
>> School of EECS
>> Peking University
>> Beijing, China
>
> --
> Gleb.
--
Arthur Chunqi Li
Department of Computer Science
School of EECS
Peking University
Beijing, China
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] Test case of emulating multibyte NOP
2013-06-05 15:13 ` 李春奇 <Arthur Chunqi Li>
@ 2013-06-05 15:17 ` Gleb Natapov
2013-06-05 15:22 ` 李春奇 <Arthur Chunqi Li>
0 siblings, 1 reply; 18+ messages in thread
From: Gleb Natapov @ 2013-06-05 15:17 UTC (permalink / raw)
To: 李春奇 <Arthur Chunqi Li>; +Cc: kvm, Paolo Bonzini
On Wed, Jun 05, 2013 at 11:13:37PM +0800, 李春奇 <Arthur Chunqi Li> wrote:
> On Wed, Jun 5, 2013 at 11:11 PM, Gleb Natapov <gleb@redhat.com> wrote:
> > On Wed, Jun 05, 2013 at 10:56:54PM +0800, 李春奇 <Arthur Chunqi Li> wrote:
> >> Hi Gleb,
> >> I generate this mail by git send-email and I think the format is OK.
> >>
> > But I have not received the email, only this your reply to it.
> Maybe the initial mail is in your spam box.
>
Doubt it. I do not see it in mailing list archive either:
http://news.gmane.org/gmane.comp.emulators.kvm.devel
What git command line you've used to sent the email?
> >
> >> This is my first try to commit a patch in open source community. Sorry
> >> for annoying you guys so much.
> >>
> >> Thanks,
> > No problem.
> >
> >> Arthur
> >>
> >> On Wed, Jun 5, 2013 at 10:54 PM, Arthur Chunqi Li <yzt356@gmail.com> 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
> >> > + MK_INSN(nopl5, ".byte 0x0f, 0x1f, 0x44, 0x00, 0x00\n\r"); // 5 bytes nop
> >> > + MK_INSN(nopl6, ".byte 0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00\n\r"); // 6 bytes nop
> >> > + MK_INSN(nopl7, ".byte 0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00\n\r"); // 7 bytes nop
> >> > + MK_INSN(nopl8, ".byte 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00\n\r"); // 8 bytes nop
> >> > + MK_INSN(nopl9, ".byte 0x66, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00\n\r"); // 9 bytes nop
> >> > + exec_in_big_real_mode(&insn_nopl1);
> >> > + exec_in_big_real_mode(&insn_nopl2);
> >> > + exec_in_big_real_mode(&insn_nopl3);
> >> > + exec_in_big_real_mode(&insn_nopl4);
> >> > + exec_in_big_real_mode(&insn_nopl5);
> >> > + exec_in_big_real_mode(&insn_nopl6);
> >> > + exec_in_big_real_mode(&insn_nopl7);
> >> > + exec_in_big_real_mode(&insn_nopl8);
> >> > + exec_in_big_real_mode(&insn_nopl9);
> >> > + report("nopl", 0, 1);
> >> > +}
> >> > +
> >> > void realmode_start(void)
> >> > {
> >> > test_null();
> >> > @@ -1548,6 +1571,7 @@ void realmode_start(void)
> >> > test_xlat();
> >> > test_salc();
> >> > test_fninit();
> >> > + test_nopl();
> >> >
> >> > exit(0);
> >> > }
> >> > --
> >> > 1.7.9.5
> >> >
> >>
> >>
> >>
> >> --
> >> Arthur Chunqi Li
> >> Department of Computer Science
> >> School of EECS
> >> Peking University
> >> Beijing, China
> >
> > --
> > Gleb.
>
>
>
> --
> Arthur Chunqi Li
> Department of Computer Science
> School of EECS
> Peking University
> Beijing, China
--
Gleb.
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] Test case of emulating multibyte NOP
2013-06-05 15:17 ` Gleb Natapov
@ 2013-06-05 15:22 ` 李春奇 <Arthur Chunqi Li>
2013-06-05 15:29 ` Gleb Natapov
0 siblings, 1 reply; 18+ messages in thread
From: 李春奇 <Arthur Chunqi Li> @ 2013-06-05 15:22 UTC (permalink / raw)
To: Gleb Natapov; +Cc: kvm, Paolo Bonzini
On Wed, Jun 5, 2013 at 11:17 PM, Gleb Natapov <gleb@redhat.com> wrote:
> On Wed, Jun 05, 2013 at 11:13:37PM +0800, 李春奇 <Arthur Chunqi Li> wrote:
>> On Wed, Jun 5, 2013 at 11:11 PM, Gleb Natapov <gleb@redhat.com> wrote:
>> > On Wed, Jun 05, 2013 at 10:56:54PM +0800, 李春奇 <Arthur Chunqi Li> wrote:
>> >> Hi Gleb,
>> >> I generate this mail by git send-email and I think the format is OK.
>> >>
>> > But I have not received the email, only this your reply to it.
>> Maybe the initial mail is in your spam box.
>>
> Doubt it. I do not see it in mailing list archive either:
> http://news.gmane.org/gmane.comp.emulators.kvm.devel
>
> What git command line you've used to sent the email?
git send-email --to kvm@vger.kernel.org --cc pbonzini@redhat.com --cc
gleb@redhat.com 0001-Test-case-of-emulating-multibyte-NOP.patch
Should I need to add some smtp options?
Arthur
>
>> >
>> >> This is my first try to commit a patch in open source community. Sorry
>> >> for annoying you guys so much.
>> >>
>> >> Thanks,
>> > No problem.
>> >
>> >> Arthur
>> >>
>> >> On Wed, Jun 5, 2013 at 10:54 PM, Arthur Chunqi Li <yzt356@gmail.com> 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
>> >> > + MK_INSN(nopl5, ".byte 0x0f, 0x1f, 0x44, 0x00, 0x00\n\r"); // 5 bytes nop
>> >> > + MK_INSN(nopl6, ".byte 0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00\n\r"); // 6 bytes nop
>> >> > + MK_INSN(nopl7, ".byte 0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00\n\r"); // 7 bytes nop
>> >> > + MK_INSN(nopl8, ".byte 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00\n\r"); // 8 bytes nop
>> >> > + MK_INSN(nopl9, ".byte 0x66, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00\n\r"); // 9 bytes nop
>> >> > + exec_in_big_real_mode(&insn_nopl1);
>> >> > + exec_in_big_real_mode(&insn_nopl2);
>> >> > + exec_in_big_real_mode(&insn_nopl3);
>> >> > + exec_in_big_real_mode(&insn_nopl4);
>> >> > + exec_in_big_real_mode(&insn_nopl5);
>> >> > + exec_in_big_real_mode(&insn_nopl6);
>> >> > + exec_in_big_real_mode(&insn_nopl7);
>> >> > + exec_in_big_real_mode(&insn_nopl8);
>> >> > + exec_in_big_real_mode(&insn_nopl9);
>> >> > + report("nopl", 0, 1);
>> >> > +}
>> >> > +
>> >> > void realmode_start(void)
>> >> > {
>> >> > test_null();
>> >> > @@ -1548,6 +1571,7 @@ void realmode_start(void)
>> >> > test_xlat();
>> >> > test_salc();
>> >> > test_fninit();
>> >> > + test_nopl();
>> >> >
>> >> > exit(0);
>> >> > }
>> >> > --
>> >> > 1.7.9.5
>> >> >
>> >>
>> >>
>> >>
>> >> --
>> >> Arthur Chunqi Li
>> >> Department of Computer Science
>> >> School of EECS
>> >> Peking University
>> >> Beijing, China
>> >
>> > --
>> > Gleb.
>>
>>
>>
>> --
>> Arthur Chunqi Li
>> Department of Computer Science
>> School of EECS
>> Peking University
>> Beijing, China
>
> --
> Gleb.
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] Test case of emulating multibyte NOP
2013-06-05 15:22 ` 李春奇 <Arthur Chunqi Li>
@ 2013-06-05 15:29 ` Gleb Natapov
0 siblings, 0 replies; 18+ messages in thread
From: Gleb Natapov @ 2013-06-05 15:29 UTC (permalink / raw)
To: 李春奇 <Arthur Chunqi Li>; +Cc: kvm, Paolo Bonzini
On Wed, Jun 05, 2013 at 11:22:19PM +0800, 李春奇 <Arthur Chunqi Li> wrote:
> On Wed, Jun 5, 2013 at 11:17 PM, Gleb Natapov <gleb@redhat.com> wrote:
> > On Wed, Jun 05, 2013 at 11:13:37PM +0800, 李春奇 <Arthur Chunqi Li> wrote:
> >> On Wed, Jun 5, 2013 at 11:11 PM, Gleb Natapov <gleb@redhat.com> wrote:
> >> > On Wed, Jun 05, 2013 at 10:56:54PM +0800, 李春奇 <Arthur Chunqi Li> wrote:
> >> >> Hi Gleb,
> >> >> I generate this mail by git send-email and I think the format is OK.
> >> >>
> >> > But I have not received the email, only this your reply to it.
> >> Maybe the initial mail is in your spam box.
> >>
> > Doubt it. I do not see it in mailing list archive either:
> > http://news.gmane.org/gmane.comp.emulators.kvm.devel
> >
> > What git command line you've used to sent the email?
> git send-email --to kvm@vger.kernel.org --cc pbonzini@redhat.com --cc
> gleb@redhat.com 0001-Test-case-of-emulating-multibyte-NOP.patch
>
> Should I need to add some smtp options?
>
You need to configure smtp server. Just like you need to do that for any
other email application.
> Arthur
> >
> >> >
> >> >> This is my first try to commit a patch in open source community. Sorry
> >> >> for annoying you guys so much.
> >> >>
> >> >> Thanks,
> >> > No problem.
> >> >
> >> >> Arthur
> >> >>
> >> >> On Wed, Jun 5, 2013 at 10:54 PM, Arthur Chunqi Li <yzt356@gmail.com> 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
> >> >> > + MK_INSN(nopl5, ".byte 0x0f, 0x1f, 0x44, 0x00, 0x00\n\r"); // 5 bytes nop
> >> >> > + MK_INSN(nopl6, ".byte 0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00\n\r"); // 6 bytes nop
> >> >> > + MK_INSN(nopl7, ".byte 0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00\n\r"); // 7 bytes nop
> >> >> > + MK_INSN(nopl8, ".byte 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00\n\r"); // 8 bytes nop
> >> >> > + MK_INSN(nopl9, ".byte 0x66, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00\n\r"); // 9 bytes nop
> >> >> > + exec_in_big_real_mode(&insn_nopl1);
> >> >> > + exec_in_big_real_mode(&insn_nopl2);
> >> >> > + exec_in_big_real_mode(&insn_nopl3);
> >> >> > + exec_in_big_real_mode(&insn_nopl4);
> >> >> > + exec_in_big_real_mode(&insn_nopl5);
> >> >> > + exec_in_big_real_mode(&insn_nopl6);
> >> >> > + exec_in_big_real_mode(&insn_nopl7);
> >> >> > + exec_in_big_real_mode(&insn_nopl8);
> >> >> > + exec_in_big_real_mode(&insn_nopl9);
> >> >> > + report("nopl", 0, 1);
> >> >> > +}
> >> >> > +
> >> >> > void realmode_start(void)
> >> >> > {
> >> >> > test_null();
> >> >> > @@ -1548,6 +1571,7 @@ void realmode_start(void)
> >> >> > test_xlat();
> >> >> > test_salc();
> >> >> > test_fninit();
> >> >> > + test_nopl();
> >> >> >
> >> >> > exit(0);
> >> >> > }
> >> >> > --
> >> >> > 1.7.9.5
> >> >> >
> >> >>
> >> >>
> >> >>
> >> >> --
> >> >> Arthur Chunqi Li
> >> >> Department of Computer Science
> >> >> School of EECS
> >> >> Peking University
> >> >> Beijing, China
> >> >
> >> > --
> >> > Gleb.
> >>
> >>
> >>
> >> --
> >> Arthur Chunqi Li
> >> Department of Computer Science
> >> School of EECS
> >> Peking University
> >> Beijing, China
> >
> > --
> > Gleb.
--
Gleb.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH] Test case of emulating multibyte NOP
@ 2013-06-05 9:41 李春奇 <Arthur Chunqi Li>
2013-06-05 13:22 ` Gleb Natapov
0 siblings, 1 reply; 18+ messages in thread
From: 李春奇 <Arthur Chunqi Li> @ 2013-06-05 9:41 UTC (permalink / raw)
To: kvm; +Cc: Paolo Bonzini, Gleb Natapov
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..e6e48c9 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
+ MK_INSN(nopl5, ".byte 0x0f, 0x1f, 0x44, 0x00, 0x00\n\r"); //
5 bytes nop
+ MK_INSN(nopl6, ".byte 0x66, 0x0f, 0x1f, 0x44, 0x00,
0x00\n\r"); // 6 bytes nop
+ MK_INSN(nopl7, ".byte 0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00,
0x00\n\r"); // 7 bytes nop
+ MK_INSN(nopl8, ".byte 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00,
0x00, 0x00\n\r"); // 8 bytes nop
+ MK_INSN(nopl9, ".byte 0x66, 0x0f, 0x1f, 0x84, 0x00, 0x00,
0x00, 0x00, 0x00\n\r"); // 9 bytes nop
+ exec_in_big_real_mode(&insn_nopl1);
+ exec_in_big_real_mode(&insn_nopl2);
+ exec_in_big_real_mode(&insn_nopl3);
+ exec_in_big_real_mode(&insn_nopl4);
+ exec_in_big_real_mode(&insn_nopl5);
+ exec_in_big_real_mode(&insn_nopl6);
+ exec_in_big_real_mode(&insn_nopl7);
+ exec_in_big_real_mode(&insn_nopl8);
+ exec_in_big_real_mode(&insn_nopl9);
+ report("nopl", 0, 1);
+}
+
void realmode_start(void)
{
test_null();
@@ -1548,6 +1571,7 @@ void realmode_start(void)
test_xlat();
test_salc();
test_fninit();
+ test_nopl();
exit(0);
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH] Test case of emulating multibyte NOP
2013-06-05 9:41 李春奇 <Arthur Chunqi Li>
@ 2013-06-05 13:22 ` Gleb Natapov
0 siblings, 0 replies; 18+ messages in thread
From: Gleb Natapov @ 2013-06-05 13:22 UTC (permalink / raw)
To: 李春奇 <Arthur Chunqi Li>; +Cc: kvm, Paolo Bonzini
On Wed, Jun 05, 2013 at 05:41:41PM +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.
>
The patch is mangled. Lines are wrapped, tabs are replaced with spaces.
> 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..e6e48c9 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
> + MK_INSN(nopl5, ".byte 0x0f, 0x1f, 0x44, 0x00, 0x00\n\r"); //
> 5 bytes nop
> + MK_INSN(nopl6, ".byte 0x66, 0x0f, 0x1f, 0x44, 0x00,
> 0x00\n\r"); // 6 bytes nop
> + MK_INSN(nopl7, ".byte 0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00,
> 0x00\n\r"); // 7 bytes nop
> + MK_INSN(nopl8, ".byte 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00,
> 0x00, 0x00\n\r"); // 8 bytes nop
> + MK_INSN(nopl9, ".byte 0x66, 0x0f, 0x1f, 0x84, 0x00, 0x00,
> 0x00, 0x00, 0x00\n\r"); // 9 bytes nop
> + exec_in_big_real_mode(&insn_nopl1);
> + exec_in_big_real_mode(&insn_nopl2);
> + exec_in_big_real_mode(&insn_nopl3);
> + exec_in_big_real_mode(&insn_nopl4);
> + exec_in_big_real_mode(&insn_nopl5);
> + exec_in_big_real_mode(&insn_nopl6);
> + exec_in_big_real_mode(&insn_nopl7);
> + exec_in_big_real_mode(&insn_nopl8);
> + exec_in_big_real_mode(&insn_nopl9);
> + report("nopl", 0, 1);
> +}
> +
> void realmode_start(void)
> {
> test_null();
> @@ -1548,6 +1571,7 @@ void realmode_start(void)
> test_xlat();
> test_salc();
> test_fninit();
> + test_nopl();
>
> exit(0);
> }
> --
> 1.7.9.5
--
Gleb.
^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2013-06-06 7:28 UTC | newest]
Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
-- 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
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.