* [PATCH] x86 emulator: Add decode entries for 0x05 opcode
@ 2008-10-20 6:52 Guillaume Thouvenin
2008-10-20 7:21 ` Avi Kivity
0 siblings, 1 reply; 9+ messages in thread
From: Guillaume Thouvenin @ 2008-10-20 6:52 UTC (permalink / raw)
To: kvm; +Cc: Avi Kivity
Add decode entries for 0x05 (ADD) opcode, execution is already
implemented.
Signed-off-by: Guillaume Thouvenin <guillaume.thouvenin@ext.bull.net>
---
x86_emulate.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c
index a391e21..8425aa9 100644
--- a/arch/x86/kvm/x86_emulate.c
+++ b/arch/x86/kvm/x86_emulate.c
@@ -80,7 +80,7 @@ static u16 opcode_table[256] = {
/* 0x00 - 0x07 */
ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM,
ByteOp | DstReg | SrcMem | ModRM, DstReg | SrcMem | ModRM,
- 0, 0, 0, 0,
+ 0, SrcImm | DstAcc, 0, 0,
/* 0x08 - 0x0F */
ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM,
ByteOp | DstReg | SrcMem | ModRM, DstReg | SrcMem | ModRM,
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] x86 emulator: Add decode entries for 0x05 opcode
2008-10-20 6:52 [PATCH] x86 emulator: Add decode entries for 0x05 opcode Guillaume Thouvenin
@ 2008-10-20 7:21 ` Avi Kivity
2008-10-20 7:31 ` Guillaume Thouvenin
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Avi Kivity @ 2008-10-20 7:21 UTC (permalink / raw)
To: Guillaume Thouvenin; +Cc: kvm
Guillaume Thouvenin wrote:
> Add decode entries for 0x05 (ADD) opcode, execution is already
> implemented.
>
>
Please send a unit test entry.
Also, why not implement opcode 4 (add al, imm8) at the same time?
--
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] x86 emulator: Add decode entries for 0x05 opcode
2008-10-20 7:21 ` Avi Kivity
@ 2008-10-20 7:31 ` Guillaume Thouvenin
2008-10-20 8:42 ` Guillaume Thouvenin
2008-10-20 11:11 ` [PATCH] x86 emulator: Add decode entries for 0x04 and 0x05 opcodes Guillaume Thouvenin
2 siblings, 0 replies; 9+ messages in thread
From: Guillaume Thouvenin @ 2008-10-20 7:31 UTC (permalink / raw)
To: Avi Kivity; +Cc: kvm
On Mon, 20 Oct 2008 09:21:20 +0200
Avi Kivity <avi@redhat.com> wrote:
> Please send a unit test entry.
>
> Also, why not implement opcode 4 (add al, imm8) at the same time?
You're right, I'm doing it.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] x86 emulator: Add decode entries for 0x05 opcode
2008-10-20 7:21 ` Avi Kivity
2008-10-20 7:31 ` Guillaume Thouvenin
@ 2008-10-20 8:42 ` Guillaume Thouvenin
2008-10-20 8:47 ` Avi Kivity
2008-10-20 11:11 ` [PATCH] x86 emulator: Add decode entries for 0x04 and 0x05 opcodes Guillaume Thouvenin
2 siblings, 1 reply; 9+ messages in thread
From: Guillaume Thouvenin @ 2008-10-20 8:42 UTC (permalink / raw)
To: Avi Kivity; +Cc: kvm
On Mon, 20 Oct 2008 09:21:20 +0200
Avi Kivity <avi@redhat.com> wrote:
> Guillaume Thouvenin wrote:
> > Add decode entries for 0x05 (ADD) opcode, execution is already
> > implemented.
> >
> >
>
> Please send a unit test entry.
I added an "add imm" test case in user/test/x86/emulator.c but kvmctl
doesn't start the test. I use the following command:
# ./user/kvmctl ./user/test/x86/emulator.flat
It seems that file emulator.flat is loaded in kvm machine. In the
main procedure kvm_run() is called but after nothing happens. There is
no message in dmesg. It happens with the last kvm-userspace tree.
I observe the same behaviour with simple.flat but it works with
realmode.flat. I tried to run simple.flat in protected mode but it
didn't change anything.
Any clues?
Regards,
Guillaume
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] x86 emulator: Add decode entries for 0x05 opcode
2008-10-20 8:42 ` Guillaume Thouvenin
@ 2008-10-20 8:47 ` Avi Kivity
2008-10-20 8:52 ` Guillaume Thouvenin
0 siblings, 1 reply; 9+ messages in thread
From: Avi Kivity @ 2008-10-20 8:47 UTC (permalink / raw)
To: Guillaume Thouvenin; +Cc: kvm
Guillaume Thouvenin wrote:
> I added an "add imm" test case in user/test/x86/emulator.c but kvmctl
> doesn't start the test. I use the following command:
>
> # ./user/kvmctl ./user/test/x86/emulator.flat
>
>
For 64-bit tests you need the bootstrap code:
./user/kvmctl ./user/test/x86/bootstrap ./user/test/x86/emulator.flat
but emulator.c is only able to test instructions that access memory. For
add acc, imm you need realmode.c.
--
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] x86 emulator: Add decode entries for 0x05 opcode
2008-10-20 8:47 ` Avi Kivity
@ 2008-10-20 8:52 ` Guillaume Thouvenin
2008-10-20 9:04 ` Avi Kivity
0 siblings, 1 reply; 9+ messages in thread
From: Guillaume Thouvenin @ 2008-10-20 8:52 UTC (permalink / raw)
To: Avi Kivity; +Cc: kvm
On Mon, 20 Oct 2008 10:47:07 +0200
Avi Kivity <avi@redhat.com> wrote:
> Guillaume Thouvenin wrote:
> > I added an "add imm" test case in user/test/x86/emulator.c but kvmctl
> > doesn't start the test. I use the following command:
> >
> > # ./user/kvmctl ./user/test/x86/emulator.flat
> >
> >
>
> For 64-bit tests you need the bootstrap code:
>
> ./user/kvmctl ./user/test/x86/bootstrap ./user/test/x86/emulator.flat
Yes right, I've tested that too and it produced an error:
kvm_run: failed entry, reason 7
rax 0000000000004000 rbx 0000000000000000 rcx 0000000000000080 rdx 0000000000000600
rsi 0000000000000000 rdi 0000000000000000 rsp 000000000000fffe rbp 0000000000000000
r8 0000000000000000 r9 0000000000000000 r10 0000000000000000 r11 0000000000000000
r12 0000000000000000 r13 0000000000000000 r14 0000000000000000 r15 0000000000000000
rip 000000000001002a rflags 00033046
cs f000 (000f0000/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
ds 0000 (00000000/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
es 0000 (00000000/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
ss 0000 (00000000/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
fs 0000 (00000000/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
gs 0000 (00000000/0000ffff p 1 dpl 3 db 0 s 1 type 3 l 0 g 0 avl 0)
tr 0000 (fffbd000/00002088 p 1 dpl 0 db 0 s 0 type b l 0 g 0 avl 0)
ldt 0000 (00000000/0000ffff p 1 dpl 0 db 0 s 0 type 2 l 0 g 0 avl 0)
gdt 0/0
idt 0/ffff
cr0 60000010 cr2 0 cr3 4000 cr4 20 cr8 0 efer 0
And I got the following message:
kvm: 15727: cpu0 unhandled rdmsr: 0x80
> but emulator.c is only able to test instructions that access memory. For
> add acc, imm you need realmode.c.
Thanks for your help,
Regards,
Guillaume
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] x86 emulator: Add decode entries for 0x05 opcode
2008-10-20 8:52 ` Guillaume Thouvenin
@ 2008-10-20 9:04 ` Avi Kivity
0 siblings, 0 replies; 9+ messages in thread
From: Avi Kivity @ 2008-10-20 9:04 UTC (permalink / raw)
To: Guillaume Thouvenin; +Cc: kvm
Guillaume Thouvenin wrote:
> On Mon, 20 Oct 2008 10:47:07 +0200
> Avi Kivity <avi@redhat.com> wrote:
>
>
>> Guillaume Thouvenin wrote:
>>
>>> I added an "add imm" test case in user/test/x86/emulator.c but kvmctl
>>> doesn't start the test. I use the following command:
>>>
>>> # ./user/kvmctl ./user/test/x86/emulator.flat
>>>
>>>
>>>
>> For 64-bit tests you need the bootstrap code:
>>
>> ./user/kvmctl ./user/test/x86/bootstrap ./user/test/x86/emulator.flat
>>
>
> Yes right, I've tested that too and it produced an error:
>
>
You should probably disable invalid state emulation for this (though
eventually it should work there too).
--
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] x86 emulator: Add decode entries for 0x04 and 0x05 opcodes
2008-10-20 7:21 ` Avi Kivity
2008-10-20 7:31 ` Guillaume Thouvenin
2008-10-20 8:42 ` Guillaume Thouvenin
@ 2008-10-20 11:11 ` Guillaume Thouvenin
2008-10-22 10:02 ` Avi Kivity
2 siblings, 1 reply; 9+ messages in thread
From: Guillaume Thouvenin @ 2008-10-20 11:11 UTC (permalink / raw)
To: Avi Kivity; +Cc: kvm
Add decode entries for 0x04 and 0x05 (ADD) opcodes, execution is already
implemented.
Signed-off-by: Guillaume Thouvenin <guillaume.thouvenin@ext.bull.net>
---
x86_emulate.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c
index a391e21..57d7cc4 100644
--- a/arch/x86/kvm/x86_emulate.c
+++ b/arch/x86/kvm/x86_emulate.c
@@ -80,7 +80,7 @@ static u16 opcode_table[256] = {
/* 0x00 - 0x07 */
ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM,
ByteOp | DstReg | SrcMem | ModRM, DstReg | SrcMem | ModRM,
- 0, 0, 0, 0,
+ ByteOp | DstAcc | SrcImm, DstAcc | SrcImm, 0, 0,
/* 0x08 - 0x0F */
ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM,
ByteOp | DstReg | SrcMem | ModRM, DstReg | SrcMem | ModRM,
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] x86 emulator: Add decode entries for 0x04 and 0x05 opcodes
2008-10-20 11:11 ` [PATCH] x86 emulator: Add decode entries for 0x04 and 0x05 opcodes Guillaume Thouvenin
@ 2008-10-22 10:02 ` Avi Kivity
0 siblings, 0 replies; 9+ messages in thread
From: Avi Kivity @ 2008-10-22 10:02 UTC (permalink / raw)
To: Guillaume Thouvenin; +Cc: kvm
Guillaume Thouvenin wrote:
> Add decode entries for 0x04 and 0x05 (ADD) opcodes, execution is already
> implemented.
>
Applied, thanks.
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2008-10-22 10:02 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-20 6:52 [PATCH] x86 emulator: Add decode entries for 0x05 opcode Guillaume Thouvenin
2008-10-20 7:21 ` Avi Kivity
2008-10-20 7:31 ` Guillaume Thouvenin
2008-10-20 8:42 ` Guillaume Thouvenin
2008-10-20 8:47 ` Avi Kivity
2008-10-20 8:52 ` Guillaume Thouvenin
2008-10-20 9:04 ` Avi Kivity
2008-10-20 11:11 ` [PATCH] x86 emulator: Add decode entries for 0x04 and 0x05 opcodes Guillaume Thouvenin
2008-10-22 10:02 ` Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).