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

2013-06-20 Thread Paolo Bonzini
Il 19/06/2013 18:03, Gleb Natapov ha scritto: On Wed, Jun 19, 2013 at 11:07:18PM +0800, 李春奇 Arthur Chunqi Li wrote: 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

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

2013-06-20 Thread Gleb Natapov
On Thu, Jun 20, 2013 at 10:29:42AM +0200, Paolo Bonzini wrote: Il 19/06/2013 18:03, Gleb Natapov ha scritto: On Wed, Jun 19, 2013 at 11:07:18PM +0800, 李春奇 Arthur Chunqi Li wrote: Hi Gleb, This version can set %rsp before trapping into emulator, because insn_page and alt_insn_page is

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

2013-06-20 Thread Gleb Natapov
On Wed, Jun 19, 2013 at 11:00:56PM +0800, Arthur Chunqi Li wrote: 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 func with alt_insn_length. Get results in

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

2013-06-20 Thread Gmail
ok, I will handle all above in the following commit. Arthur Chunqi Li Department of Computer Science School of EECS Peking University Beijing, China From my iPhone 在 2013-6-20,16:48,Gleb Natapov g...@redhat.com 写道: On Wed, Jun 19, 2013 at 11:00:56PM +0800, Arthur Chunqi Li wrote: Add a

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

2013-06-20 Thread Arthur Chunqi Li
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 func with alt_insn_length. Get results in outregs. 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-20 Thread Jan Kiszka
On 2013-06-20 12:45, Arthur Chunqi Li wrote: 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 func with alt_insn_length. Get results in outregs. Small hint: You

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

2013-06-20 Thread Gleb Natapov
On Thu, Jun 20, 2013 at 06:45:21PM +0800, Arthur Chunqi Li wrote: 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 func with alt_insn_length. Get results in

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

2013-06-19 Thread Gleb Natapov
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, 李春奇 Arthur Chunqi Li wrote: extern u8 insn_page[], insn_page_end[];

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 Gleb Natapov
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, 2013 at 12:44 AM, Gleb Natapov g...@redhat.com wrote: Send code

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

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

2013-06-19 Thread Gleb Natapov
On Wed, Jun 19, 2013 at 08:30:33PM +0800, 李春奇 Arthur Chunqi Li wrote: 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

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 Gleb Natapov
On Wed, Jun 19, 2013 at 10:01:40PM +0800, 李春奇 Arthur Chunqi Li wrote: 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. Not sure what you mean. Your version of test_movabs does not use

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

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

2013-06-19 Thread Arthur Chunqi Li
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 func with alt_insn_length. Get results in outregs. 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-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-19 Thread Gleb Natapov
On Wed, Jun 19, 2013 at 11:07:18PM +0800, 李春奇 Arthur Chunqi Li wrote: 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. The position of the code is not

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

2013-06-19 Thread Gmail
在 2013-6-20,0:03,Gleb Natapov g...@redhat.com 写道: On Wed, Jun 19, 2013 at 11:07:18PM +0800, 李春奇 Arthur Chunqi Li wrote: 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

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

2013-06-19 Thread Gleb Natapov
On Thu, Jun 20, 2013 at 01:48:39AM +0800, Gmail wrote: 在 2013-6-20,0:03,Gleb Natapov g...@redhat.com 写道: On Wed, Jun 19, 2013 at 11:07:18PM +0800, 李春奇 Arthur Chunqi Li wrote: Hi Gleb, This version can set %rsp before trapping into emulator, because insn_page and alt_insn_page is

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

2013-06-18 Thread Gleb Natapov
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, so registers should be saved to (save) in insn_page. Because all the

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 Gleb Natapov
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: Hi Gleb, I'm trying to solve these problems in the past days and meet many

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 Gleb Natapov
On Tue, Jun 18, 2013 at 11:56:24PM +0800, 李春奇 Arthur Chunqi Li wrote: 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

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

2013-06-18 Thread 李春奇
extern u8 insn_page[], insn_page_end[]; extern u8 test_insn[], test_insn_end[]; extern u8 alt_insn_page[]; asm( .align 4096\n\t .global insn_page\n\t .global insn_page_end\n\t .global test_insn\n\t .global test_insn_end\n\t insn_page:\n\t ret \n\t push %rax; push %rbx\n\t push %rcx; push

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

2013-06-18 Thread Gleb Natapov
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( .align 4096\n\t .global insn_page\n\t .global insn_page_end\n\t .global

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 李春奇
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, so registers should be saved to (save) in insn_page. Because all the instructions should be generated outside and copy to insn_page, and the

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

2013-06-13 Thread Paolo Bonzini
Il 13/06/2013 05:30, 李春奇 Arthur Chunqi Li ha scritto: 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, so registers should be saved to (save) in insn_page. Because all the instructions

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

2013-06-13 Thread Arthur Chunqi Li
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 func with alt_insn_length. Get results in outregs. 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-12 Thread Paolo Bonzini
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 func with alt_insn_length. Get results in outregs.

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

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

2013-06-10 Thread Arthur Chunqi Li
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 func with alt_insn_length. Get results in outregs. 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-10 Thread Gleb Natapov
On Mon, Jun 10, 2013 at 09:38:32PM +0800, Arthur Chunqi Li wrote: 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 func with alt_insn_length. Get results in

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

2013-06-09 Thread Gleb Natapov
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 codec in alt_insn and call func with alt_insn_length. Get

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 Gleb Natapov
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 trap_emulator to run an instruction in emulator. Set inregs first (%rax,

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 Gleb Natapov
On Sun, Jun 09, 2013 at 08:56:04PM +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, 2013 at 7:07 PM, Gleb Natapov g...@redhat.com wrote: On Fri, Jun

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 Gleb Natapov
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, 2013 at 7:07 PM, Gleb Natapov g...@redhat.com wrote: On Fri, Jun

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
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...@redhat.com wrote: On Sun, Jun

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

2013-06-09 Thread 李春奇
I have finished the infrastructure but after changing test_mmx_movq_mf test case, it return error: unhandled excecption 6 Return value from qemu: 15 If I don't change %rsp and %rbp, it runs OK. So I wonder if this test case is strictly reply on %rsp and %rbp? On Mon, Jun 10, 2013 at 12:00 AM,

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

2013-06-09 Thread Gleb Natapov
On Mon, Jun 10, 2013 at 01:09:15AM +0800, 李春奇 Arthur Chunqi Li wrote: I have finished the infrastructure but after changing test_mmx_movq_mf test case, it return error: unhandled excecption 6 Return value from qemu: 15 If I don't change %rsp and %rbp, it runs OK. So I wonder if this test

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

2013-06-09 Thread 李春奇
I have trouble to send the address of inregs into alt_insn_page, so I use r9 and r10 to carry %rsp and %rbp into it. And r8 is used to trigger vmexit. I paste the relevant functions as follows: static void trap_emulator(uint64_t *mem, uint8_t *insn_page, uint8_t *alt_insn_page, void

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

2013-06-09 Thread Gleb Natapov
On Mon, Jun 10, 2013 at 01:28:48AM +0800, 李春奇 Arthur Chunqi Li wrote: I have trouble to send the address of inregs into alt_insn_page, so I use r9 and r10 to carry %rsp and %rbp into it. And r8 is used to trigger vmexit. If you going to use call you will need stack. I said how not to use it

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

2013-06-06 Thread Arthur Chunqi Li
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 func with alt_insn_length. Get results in outregs. 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-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

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

2013-06-06 Thread Arthur Chunqi Li
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 codec in alt_insn and call func with alt_insn_length. Get results in outregs. Signed-off-by: Arthur Chunqi Li yzt...@gmail.com