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 g...@redhat.com wrote: On Wed, Jun 19, 2013 at 09:26:59AM +0800, 李春奇 Arthur Chunqi Li wrote: On Wed, Jun 19, 2013 at 12:44 AM, Gleb Natapov g...@redhat.com 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 g...@redhat.com wrote: On Wed, Jun 19, 2013 at 08:18:29PM +0800, 李春奇 Arthur Chunqi Li wrote: On Wed, Jun 19, 2013 at 5:31 PM, Gleb Natapov g...@redhat.com wrote: On Wed, Jun 19, 2013 at 09:26:59AM +0800, 李春奇 Arthur Chunqi Li 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 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 g...@redhat.com wrote: On Wed, Jun 19, 2013 at 08:30:33PM +0800, 李春奇 Arthur Chunqi Li wrote

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 g...@redhat.com wrote: On Wed, Jun 19, 2013 at 10:01:40PM +0800, 李春奇 Arthur

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

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 g...@redhat.com wrote: On Thu, Jun 13, 2013 at 05:30:03PM +0800, 李春奇 Arthur Chunqi Li 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 insn_page

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 g...@redhat.com wrote: On Thu, Jun 13, 2013 at 05:30:03PM +0800, 李春奇 Arthur Chunqi Li 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 insn_page

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 g...@redhat.com wrote: On Tue, Jun 18, 2013 at 10:28:59PM +0800, Ê??Ê?•Â•? Arthur Chunqi Li wrote: On Tue, Jun 18, 2013 at 8:45 PM, Gleb Natapov g...@redhat.com wrote: On Thu, Jun 13, 2013 at 05:30:03PM +0800, ÊùéÊò•Â•á Arthur Chunqi Li wrote:

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

2013-06-18 Thread
}; inregs = (struct regs){ 0 }; trap_emulator(mem, alt_insn, 10); report(64-bit mov imm2, outregs.rcx == 0xc3c3c3c3c3c3c3c3); } On Wed, Jun 19, 2013 at 12:09 AM, Gleb Natapov g...@redhat.com wrote: On Tue, Jun 18, 2013 at 11:56:24PM +0800, 李春奇 Arthur Chunqi Li wrote: On Tue, Jun 18

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 g...@redhat.com wrote: Send code in a form of a patch. On Wed, Jun 19, 2013 at 12:14:13AM +0800, 李春奇 Arthur Chunqi Li wrote: extern u8 insn_page[], insn_page_end[]; extern u8 test_insn[], test_insn_end[]; extern u8 alt_insn_page[]; asm

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

2013-06-13 Thread
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, 2013 at 12:50 PM, 李春奇 Arthur Chunqi Li

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 pbonz...@redhat.com 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

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 yzt...@gmail.com wrote: Change two functions (test_mmx_movq_mf and test_movabs) using unified trap_emulator. Signed-off-by: Arthur Chunqi Li yzt...@gmail.com ---

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 g...@redhat.com 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

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 g...@redhat.com wrote: On Sun, Jun 09, 2013 at 08:44:32PM +0800, 李春奇 Arthur Chunqi Li wrote: On Sun, Jun 9, 2013 at 7:07 PM, Gleb Natapov g...@redhat.com wrote: On Fri, Jun 07, 2013 at 10:31:38AM +0800, Arthur Chunqi Li wrote: Add a function

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 g...@redhat.com wrote: On Sun, Jun 09, 2013 at 08:44:32PM +0800, 李春奇 Arthur Chunqi Li wrote: On Sun, Jun 9, 2013 at 7:07 PM, Gleb Natapov g...@redhat.com wrote: On Fri, Jun 07, 2013 at 10:31:38AM +0800, Arthur Chunqi Li wrote: Add a function

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 g...@redhat.com wrote: On Sun, Jun 09, 2013 at 09:22:27PM +0800, 李春奇 Arthur Chunqi Li wrote: On Sun, Jun 9, 2013 at 8:49 PM, Gleb Natapov g...@redhat.com wrote: On Sun, Jun 09, 2013 at 08:44:32PM +0800, 李春奇 Arthur Chunqi Li wrote: On Sun, Jun 9

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

2013-06-09 Thread
, Gleb Natapov g...@redhat.com wrote: On Sun, Jun 09, 2013 at 11:23:26PM +0800, 李春奇 Arthur Chunqi Li wrote: On Sun, Jun 9, 2013 at 10:09 PM, Gleb Natapov g...@redhat.com wrote: On Sun, Jun 09, 2013 at 09:22:27PM +0800, 李春奇 Arthur Chunqi Li wrote: On Sun, Jun 9, 2013 at 8:49 PM, Gleb Natapov g

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

2013-06-09 Thread
(fnclex; emms); report(movq mmx generates #MF2, exceptions == 1); handle_exception(MF_VECTOR, 0); } On Mon, Jun 10, 2013 at 1:13 AM, Gleb Natapov g...@redhat.com wrote: On Mon, Jun 10, 2013 at 01:09:15AM +0800, 李春奇 Arthur Chunqi Li wrote: I have finished the infrastructure but after changing

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

2013-06-06 Thread
On Thu, Jun 6, 2013 at 1:45 PM, Gleb Natapov g...@redhat.com 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

Re: [PATCH] Test case of emulating multibyte NOP

2013-06-06 Thread
On Thu, Jun 6, 2013 at 1:40 PM, Gleb Natapov g...@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 g...@redhat.com wrote: This time the email is perfect :) On Thu, Jun 06, 2013 at 12:02:52AM +0800, Arthur

Re: [PATCH] Test case of emulating multibyte NOP

2013-06-06 Thread
On Thu, Jun 6, 2013 at 3:02 PM, Gleb Natapov g...@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 g...@redhat.com wrote: On Thu, Jun 06, 2013 at 12:28:16AM +0800, 李春奇 Arthur Chunqi Li wrote: On Thu, Jun 6

Re: [PATCH] Test case of emulating multibyte NOP

2013-06-06 Thread
On Thu, Jun 6, 2013 at 3:17 PM, 李春奇 Arthur Chunqi Li yzt...@gmail.com wrote: On Thu, Jun 6, 2013 at 3:02 PM, Gleb Natapov g...@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 g...@redhat.com wrote: On Thu

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 g...@redhat.com wrote: On Thu, Jun 06, 2013 at 02:47:49PM +0800, 李春奇 Arthur Chunqi Li wrote: On Thu, Jun 6, 2013 at 1:45 PM, Gleb Natapov g...@redhat.com wrote: On Thu, Jun 06, 2013 at 01:03:44PM +0800, Arthur Chunqi Li wrote: Test access to %bpl

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 g...@redhat.com wrote: On Thu, Jun 06, 2013 at 03:42:56PM +0800, 李春奇 Arthur Chunqi Li wrote: On Thu, Jun 6, 2013 at 3:01 PM, Gleb Natapov g...@redhat.com wrote: On Thu, Jun 06, 2013 at 02:47:49PM +0800, 李春奇 Arthur Chunqi Li wrote: On Thu, Jun 6

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

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

2013-06-05 Thread
...@redhat.com wrote: On Wed, Jun 05, 2013 at 10:16:46AM +0800, 李春奇 Arthur Chunqi Li 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. Signed-off-by: Arthur Chunqi Li yzt

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

2013-06-05 Thread
, Gleb Natapov g...@redhat.com wrote: On Wed, Jun 05, 2013 at 03:00:33PM +0800, 李春奇 Arthur Chunqi Li 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. The code is as follows

[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 yzt...@gmail.com --- x86/realmode.c | 24 1 file changed, 24 insertions(+) diff

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 g...@redhat.com wrote: On Wed, Jun 05, 2013 at 05:23:18PM +0800, 李春奇 Arthur Chunqi Li wrote: Yes, 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 yzt...@gmail.com wrote: Add multibyte NOP test

Re: [PATCH] Test case of emulating multibyte NOP

2013-06-05 Thread
On Wed, Jun 5, 2013 at 11:11 PM, Gleb Natapov g...@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

Re: [PATCH] Test case of emulating multibyte NOP

2013-06-05 Thread
On Wed, Jun 5, 2013 at 11:17 PM, Gleb Natapov g...@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 g...@redhat.com wrote: On Wed, Jun 05, 2013 at 10:56:54PM +0800, 李春奇 Arthur Chunqi Li wrote: Hi Gleb, I

Re: [PATCH] Test case of emulating multibyte NOP

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

[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 yzt...@gmail.com --- x86/emulator.c | 33 + 1 file changed, 33 insertions(+) diff --git a/x86/emulator.c b/x86/emulator.c

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,

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 jan.kis...@web.de wrote: On 2013-05-04 09:50, 李春奇 Arthur Chunqi Li wrote: Hi Jan and All, I find that when enable KVM with qemu, vendor ID of simulated

Re: CPU vendor in KVM

2013-05-04 Thread
On Sat, May 4, 2013 at 4:47 PM, Jan Kiszka jan.kis...@web.de wrote: Please don't top-post. On 2013-05-04 10:45, 李春奇 Arthur Chunqi Li 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. About which -cpu