Re: CPU vendor in KVM

2013-05-04 Thread
But will the difference between the vendor ID and family number cause confusion to the OS in VM? On Sat, May 4, 2013 at 4:05 PM, Jan Kiszka wrote: > On 2013-05-04 09:50, 李春奇 wrote: >> Hi Jan and All, >> I find that when enable KVM with qemu, vendor ID of simulated CPU will be >

Re: CPU vendor in KVM

2013-05-04 Thread
On Sat, May 4, 2013 at 4:47 PM, Jan Kiszka wrote: > Please don't top-post. > > On 2013-05-04 10:45, 李春奇 wrote: >> But will the difference between the vendor ID and family number cause >> confusion to the OS in VM? > > The confusion is not yet clear to me.

Why some test suite in kvm-unit-tests designed for 64bit only?

2013-05-30 Thread
Hi there, I'm now reading codes of kvm-unit-tests and I found that some of the test cases for x86 is only designed for x86_64 (including access.flat, apic.flat, emulator.flat, idt_test.flat and so on). I wonder why these cases are not designed for i386? Or is there any other concerns? Thanks, Arth

[PATCH] Test case of multibyte NOP in emulation mode

2013-06-04 Thread
Add multibyte NOP test case to kvm-unit-tests. This case can test one of bugs when booting RHEL5.9 64-bit. Signed-off-by: Arthur Chunqi Li --- x86/emulator.c | 33 + 1 file changed, 33 insertions(+) diff --git a/x86/emulator.c b/x86/emulator.c index 96576e5..f2

Re: [PATCH] Test case of multibyte NOP in emulation mode

2013-06-05 Thread
PM, Gleb Natapov wrote: > > On Wed, Jun 05, 2013 at 10:16:46AM +0800, 李春奇 wrote: > > Add multibyte NOP test case to kvm-unit-tests. This case can test one > > of bugs when booting RHEL5.9 64-bit. > > > Adding the test to x86/realmode.c will be much easier. > > >

Re: [PATCH] Test case of multibyte NOP in emulation mode

2013-06-05 Thread
, Gleb Natapov wrote: > On Wed, Jun 05, 2013 at 03:00:33PM +0800, 李春奇 wrote: >> Yes, that should be the point. x86/realmode.c is always running in >> emulation mode. I added the testing here there but no error occurred. I >> cannot find the reason. >> >> Th

[PATCH] Test case of emulating multibyte NOP

2013-06-05 Thread
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 --- x86/realmode.c | 24 1 file changed, 24 insertions(+) diff --git a/x86/realmode

Re: [PATCH] Test case of multibyte NOP in emulation mode

2013-06-05 Thread
I mean after adding unrestricted_guest=0, the error is reproduced. Sorry for confused expression. I have committed another patch in x86/realmode.c. On Wed, Jun 5, 2013 at 5:28 PM, Gleb Natapov wrote: > On Wed, Jun 05, 2013 at 05:23:18PM +0800, 李春奇 wrote: >> Yes, I load kvm-i

Re: [PATCH] Test case of emulating multibyte NOP

2013-06-05 Thread
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 wrote: > Add multibyte NOP test case to kvm-unit-t

Re: [PATCH] Test case of emulating multibyte NOP

2013-06-05 Thread
On Wed, Jun 5, 2013 at 11:11 PM, Gleb Natapov wrote: > On Wed, Jun 05, 2013 at 10:56:54PM +0800, 李春奇 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

Re: [PATCH] Test case of emulating multibyte NOP

2013-06-05 Thread
On Wed, Jun 5, 2013 at 11:17 PM, Gleb Natapov wrote: > On Wed, Jun 05, 2013 at 11:13:37PM +0800, 李春奇 wrote: >> On Wed, Jun 5, 2013 at 11:11 PM, Gleb Natapov wrote: >> > On Wed, Jun 05, 2013 at 10:56:54PM +0800, 李春奇 wrote: >> >> Hi Gleb, >> >> I genera

Re: [PATCH] Test case of emulating multibyte NOP

2013-06-05 Thread
On Thu, Jun 6, 2013 at 12:13 AM, Gleb Natapov 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 boot

Re: [PATCH] kvm-unit-tests: Add test case for accessing bpl via modr/m

2013-06-05 Thread
On Thu, Jun 6, 2013 at 1:45 PM, Gleb Natapov wrote: > On Thu, Jun 06, 2013 at 01:03:44PM +0800, Arthur Chunqi Li wrote: >> Test access to %bpl via modr/m addressing mode. This case can test another >> bug in the boot of RHEL5.9 64-bit. >> > We have growing number of instructions tests using the s

Re: [PATCH] Test case of emulating multibyte NOP

2013-06-05 Thread
On Thu, Jun 6, 2013 at 1:40 PM, Gleb Natapov wrote: > On Thu, Jun 06, 2013 at 12:28:16AM +0800, 李春奇 wrote: >> On Thu, Jun 6, 2013 at 12:13 AM, Gleb Natapov wrote: >> > This time the email is perfect :) >> > >> > On Thu, Jun 06, 2013 at 12:02:52AM +080

Re: [PATCH] Test case of emulating multibyte NOP

2013-06-06 Thread
On Thu, Jun 6, 2013 at 3:02 PM, Gleb Natapov wrote: > On Thu, Jun 06, 2013 at 02:49:14PM +0800, 李春奇 wrote: >> On Thu, Jun 6, 2013 at 1:40 PM, Gleb Natapov wrote: >> > On Thu, Jun 06, 2013 at 12:28:16AM +0800, 李春奇 wrote: >> >> On Thu, Jun 6, 2013 at 12:13 AM, Gle

Re: [PATCH] Test case of emulating multibyte NOP

2013-06-06 Thread
On Thu, Jun 6, 2013 at 3:17 PM, 李春奇 wrote: > On Thu, Jun 6, 2013 at 3:02 PM, Gleb Natapov wrote: >> On Thu, Jun 06, 2013 at 02:49:14PM +0800, 李春奇 wrote: >>> On Thu, Jun 6, 2013 at 1:40 PM, Gleb Natapov wrote: >>> > On Thu, Jun 06, 2013 at 12:28:16AM +0800, 李春

Re: [PATCH] kvm-unit-tests: Add test case for accessing bpl via modr/m

2013-06-06 Thread
On Thu, Jun 6, 2013 at 3:01 PM, Gleb Natapov wrote: > On Thu, Jun 06, 2013 at 02:47:49PM +0800, 李春奇 wrote: >> On Thu, Jun 6, 2013 at 1:45 PM, Gleb Natapov wrote: >> > On Thu, Jun 06, 2013 at 01:03:44PM +0800, Arthur Chunqi Li wrote: >> >> Test access to %bpl vi

Re: [PATCH] kvm-unit-tests: Add test case for accessing bpl via modr/m

2013-06-06 Thread
On Thu, Jun 6, 2013 at 3:45 PM, Gleb Natapov wrote: > On Thu, Jun 06, 2013 at 03:42:56PM +0800, 李春奇 wrote: >> On Thu, Jun 6, 2013 at 3:01 PM, Gleb Natapov wrote: >> > On Thu, Jun 06, 2013 at 02:47:49PM +0800, 李春奇 wrote: >> >> On Thu, Jun 6, 2013 at 1:45 PM, Gleb

Re: [PATCH 1/2] kvm-unit-tests: Add a func to run instruction in emulator

2013-06-06 Thread
This version of save/restore general register seems a bit too ugly, I will change it and commit another patch. Some of the registers cannot be set as realmode.c do, for example %rax used to save return value, wrong %esp %ebp may cause crash, and I think changed %rflags may cause some unknown error

Re: [PATCH 1/2] kvm-unit-tests: Add a func to run instruction in emulator

2013-06-09 Thread
On Sun, Jun 9, 2013 at 7:07 PM, Gleb Natapov wrote: > On Fri, Jun 07, 2013 at 10:31:38AM +0800, Arthur Chunqi Li wrote: >> Add a function trap_emulator to run an instruction in emulator. >> Set inregs first (%rax, %rsp, %rbp, %rflags have special usage and >> cannot set in inregs), put instruction

Re: [PATCH 1/2] kvm-unit-tests: Add a func to run instruction in emulator

2013-06-09 Thread
On Sun, Jun 9, 2013 at 8:49 PM, Gleb Natapov wrote: > On Sun, Jun 09, 2013 at 08:44:32PM +0800, 李春奇 wrote: >> On Sun, Jun 9, 2013 at 7:07 PM, Gleb Natapov wrote: >> > On Fri, Jun 07, 2013 at 10:31:38AM +0800, Arthur Chunqi Li wrote: >> >> Add a function trap_emu

Re: [PATCH 1/2] kvm-unit-tests: Add a func to run instruction in emulator

2013-06-09 Thread
On Sun, Jun 9, 2013 at 8:49 PM, Gleb Natapov wrote: > On Sun, Jun 09, 2013 at 08:44:32PM +0800, 李春奇 wrote: >> On Sun, Jun 9, 2013 at 7:07 PM, Gleb Natapov wrote: >> > On Fri, Jun 07, 2013 at 10:31:38AM +0800, Arthur Chunqi Li wrote: >> >> Add a function trap_emu

Re: [PATCH 1/2] kvm-unit-tests: Add a func to run instruction in emulator

2013-06-09 Thread
On Sun, Jun 9, 2013 at 10:09 PM, Gleb Natapov wrote: > On Sun, Jun 09, 2013 at 09:22:27PM +0800, 李春奇 wrote: >> On Sun, Jun 9, 2013 at 8:49 PM, Gleb Natapov wrote: >> > On Sun, Jun 09, 2013 at 08:44:32PM +0800, 李春奇 wrote: >> >> On Sun, Jun 9, 2013 at 7:07 PM, Gleb

Re: [PATCH 1/2] kvm-unit-tests: Add a func to run instruction in emulator

2013-06-09 Thread
00 AM, Gleb Natapov wrote: > On Sun, Jun 09, 2013 at 11:23:26PM +0800, 李春奇 wrote: >> On Sun, Jun 9, 2013 at 10:09 PM, Gleb Natapov wrote: >> > On Sun, Jun 09, 2013 at 09:22:27PM +0800, 李春奇 wrote: >> >> On Sun, Jun 9, 2013 at 8:49 PM, Gleb Natapov wrote: >> >

Re: [PATCH 1/2] kvm-unit-tests: Add a func to run instruction in emulator

2013-06-09 Thread
// Place the instruction we want the hypervisor to see in the alternate page for (i=0; i wrote: > On Mon, Jun 10, 2013 at 01:09:15AM +0800, 李春奇 wrote: >> I have finished the infrastructure but after changing test_mmx_movq_mf >> test case, it return error: >> unhandled e

Re: [PATCH 2/2] kvm-unit-tests: Change two cases to use trap_emulator

2013-06-10 Thread
Sorry, there are some small mistakes in the first path, recommit it. Arthur On Mon, Jun 10, 2013 at 9:45 PM, Arthur Chunqi Li wrote: > Change two functions (test_mmx_movq_mf and test_movabs) using > unified trap_emulator. > > Signed-off-by: Arthur Chunqi Li > --- > x86/emulator.c | 63 > +++

Re: [PATCH 1/2] kvm-unit-tests: Add a func to run instruction in emulator

2013-06-12 Thread
On Thu, Jun 13, 2013 at 4:50 AM, Paolo Bonzini wrote: > Il 06/06/2013 11:24, Arthur Chunqi Li ha scritto: >> Add a function trap_emulator to run an instruction in emulator. >> Set inregs first (%rax is invalid because it is used as return >> address), put instruction codec in alt_insn and call fun

Re: [PATCH 1/2] kvm-unit-tests: Add a func to run instruction in emulator

2013-06-13 Thread
feature may specified to some newer C compiler. This may not be a good solution. If we don't set %rsp and %rbp when executing emulator code, we can just use “push/pop" to save other general registers. If you have any better solutions, please let me know. Thanks, Arthur On Thu, Jun 13,

Re: [PATCH 1/2] kvm-unit-tests: Add a func to run instruction in emulator

2013-06-18 Thread
On Tue, Jun 18, 2013 at 8:45 PM, Gleb Natapov wrote: > On Thu, Jun 13, 2013 at 05:30:03PM +0800, 李春奇 wrote: >> Hi Gleb, >> I'm trying to solve these problems in the past days and meet many >> difficulties. You want to save all the general registers in calling >> i

Re: [PATCH 1/2] kvm-unit-tests: Add a func to run instruction in emulator

2013-06-18 Thread
On Tue, Jun 18, 2013 at 8:45 PM, Gleb Natapov wrote: > On Thu, Jun 13, 2013 at 05:30:03PM +0800, 李春奇 wrote: >> Hi Gleb, >> I'm trying to solve these problems in the past days and meet many >> difficulties. You want to save all the general registers in calling >> i

Re: [PATCH 1/2] kvm-unit-tests: Add a func to run instruction in emulator

2013-06-18 Thread
On Tue, Jun 18, 2013 at 11:47 PM, Gleb Natapov wrote: > On Tue, Jun 18, 2013 at 10:28:59PM +0800, Ê??Ê?••? wrote: >> On Tue, Jun 18, 2013 at 8:45 PM, Gleb Natapov wrote: >> > On Thu, Jun 13, 2013 at 05:30:03PM +0800, ÊùéÊò••á >> > wrote: >> >> Hi Gleb, >> >> I'm trying to solve these problem

Re: [PATCH 1/2] kvm-unit-tests: Add a func to run instruction in emulator

2013-06-18 Thread
" "mov %r13, 104+save \n\t" "mov %r14, 112+save \n\t" "mov %r15, 120+save \n\t" "popf \n\t" "pop %r15; pop %r14 \n\t" "pop %r13; pop %r12 \n\t" "pop %r11; pop %r10 \n\t" "pop %r9; pop %r8 \n\t" "pop %rbp \n\t

Re: [PATCH 1/2] kvm-unit-tests: Add a func to run instruction in emulator

2013-06-18 Thread
On Wed, Jun 19, 2013 at 12:44 AM, Gleb Natapov wrote: > Send code in a form of a patch. > > On Wed, Jun 19, 2013 at 12:14:13AM +0800, 李春奇 wrote: >> extern u8 insn_page[], insn_page_end[]; >> extern u8 test_insn[], test_insn_end[]; >> extern u8 alt_insn_page[]; >

Re: [PATCH 1/2] kvm-unit-tests: Add a func to run instruction in emulator

2013-06-19 Thread
On Wed, Jun 19, 2013 at 5:31 PM, Gleb Natapov wrote: > On Wed, Jun 19, 2013 at 09:26:59AM +0800, 李春奇 wrote: >> On Wed, Jun 19, 2013 at 12:44 AM, Gleb Natapov wrote: >> > Send code in a form of a patch. >> > >> > On Wed, Jun 19, 2013 at 12:14:13AM +0800, 李

Re: [PATCH 1/2] kvm-unit-tests: Add a func to run instruction in emulator

2013-06-19 Thread
On Wed, Jun 19, 2013 at 8:26 PM, Gleb Natapov wrote: > On Wed, Jun 19, 2013 at 08:18:29PM +0800, 李春奇 wrote: >> On Wed, Jun 19, 2013 at 5:31 PM, Gleb Natapov wrote: >> > On Wed, Jun 19, 2013 at 09:26:59AM +0800, 李春奇 wrote: >> >> On Wed, Jun 19, 2013 at

Re: [PATCH 1/2] kvm-unit-tests: Add a func to run instruction in emulator

2013-06-19 Thread
I found the final reason! The initial use of init_ram is also used by test_rip_relative(), which will cause conflict. I changed it and everything runs well. On Wed, Jun 19, 2013 at 8:32 PM, Gleb Natapov wrote: > On Wed, Jun 19, 2013 at 08:30:33PM +0800, 李春奇 wrote: >> On Wed, Jun 19,

Re: [PATCH 1/2] kvm-unit-tests: Add a func to run instruction in emulator

2013-06-19 Thread
I use insn_ram as what the origin/master done before. I don't know how to describe it clearly, I will commit a patch later and you can get to know from my codes. Arthur On Wed, Jun 19, 2013 at 10:13 PM, Gleb Natapov wrote: > On Wed, Jun 19, 2013 at 10:01:40PM +0800, 李春奇 wrote: >&g

Re: [PATCH 1/2] kvm-unit-tests: Add a func to run instruction in emulator

2013-06-19 Thread
Hi Gleb, This version can set %rsp before trapping into emulator, because insn_page and alt_insn_page is statically defined and their relative position to (save) is fixed during execution. In this way, test case of test_mmx_movq_mf needs to pre-define its own stack, this change is in the next patc