* [PATCH] KVM: x86 emulator: add CALL FAR instruction emulation (opcode 9a)
@ 2010-08-25 6:10 Wei Yongjun
2010-08-25 6:16 ` [PATCH] Add realmode test for CALL FAR IMM instruction Wei Yongjun
2010-08-25 22:54 ` [PATCH] KVM: x86 emulator: add CALL FAR instruction emulation (opcode 9a) Marcelo Tosatti
0 siblings, 2 replies; 6+ messages in thread
From: Wei Yongjun @ 2010-08-25 6:10 UTC (permalink / raw)
To: Avi Kivity, Marcelo Tosatti; +Cc: kvm
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
---
arch/x86/kvm/emulate.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 26f69c2..e5f7f5c 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -2487,7 +2487,7 @@ static struct opcode opcode_table[256] = {
X8(D(SrcAcc | DstReg)),
/* 0x98 - 0x9F */
D(DstAcc | SrcNone), I(ImplicitOps | SrcAcc, em_cwd),
- D(SrcImmFAddr | No64), N,
+ I(SrcImmFAddr | No64, em_call_far), N,
D(ImplicitOps | Stack), D(ImplicitOps | Stack), N, N,
/* 0xA0 - 0xA7 */
D(ByteOp | DstAcc | SrcMem | Mov | MemAbs), D(DstAcc | SrcMem | Mov | MemAbs),
--
1.7.0.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] Add realmode test for CALL FAR IMM instruction
2010-08-25 6:10 [PATCH] KVM: x86 emulator: add CALL FAR instruction emulation (opcode 9a) Wei Yongjun
@ 2010-08-25 6:16 ` Wei Yongjun
2010-08-25 6:50 ` Avi Kivity
2010-08-25 22:54 ` [PATCH] KVM: x86 emulator: add CALL FAR instruction emulation (opcode 9a) Marcelo Tosatti
1 sibling, 1 reply; 6+ messages in thread
From: Wei Yongjun @ 2010-08-25 6:16 UTC (permalink / raw)
To: Avi Kivity, Marcelo Tosatti; +Cc: kvm
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
---
x86/realmode.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/x86/realmode.c b/x86/realmode.c
index a833829..2e12680 100644
--- a/x86/realmode.c
+++ b/x86/realmode.c
@@ -437,6 +437,9 @@ void test_call(void)
"ret\n\t"
"2:\t");
MK_INSN(call_far1, "lcallw *(%ebx)\n\t");
+ MK_INSN(call_far2, ".byte 0x9a\n\t"
+ ".word retf\n\t"
+ ".word 0x00\n\t");
MK_INSN(ret_imm, "sub $10, %sp; jmp 2f; 1: retw $10; 2: callw 1b");
exec_in_big_real_mode(&insn_call1);
@@ -453,6 +456,9 @@ void test_call(void)
exec_in_big_real_mode(&insn_call_far1);
report("call far 1", 0, 1);
+ exec_in_big_real_mode(&insn_call_far2);
+ report("call far 2", 0, 1);
+
exec_in_big_real_mode(&insn_ret_imm);
report("ret imm 1", 0, 1);
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] Add realmode test for CALL FAR IMM instruction
2010-08-25 6:16 ` [PATCH] Add realmode test for CALL FAR IMM instruction Wei Yongjun
@ 2010-08-25 6:50 ` Avi Kivity
2010-08-25 7:05 ` Wei Yongjun
2010-08-25 7:06 ` [PATCHv2] " Wei Yongjun
0 siblings, 2 replies; 6+ messages in thread
From: Avi Kivity @ 2010-08-25 6:50 UTC (permalink / raw)
To: Wei Yongjun; +Cc: Marcelo Tosatti, kvm
On 08/25/2010 09:16 AM, Wei Yongjun wrote:
> Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
> ---
> x86/realmode.c | 6 ++++++
> 1 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/x86/realmode.c b/x86/realmode.c
> index a833829..2e12680 100644
> --- a/x86/realmode.c
> +++ b/x86/realmode.c
> @@ -437,6 +437,9 @@ void test_call(void)
> "ret\n\t"
> "2:\t");
> MK_INSN(call_far1, "lcallw *(%ebx)\n\t");
> + MK_INSN(call_far2, ".byte 0x9a\n\t"
> + ".word retf\n\t"
> + ".word 0x00\n\t");
Why .byte encoding? won't "lcallw $0, $retf" (or the other way round) work?
--
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Add realmode test for CALL FAR IMM instruction
2010-08-25 6:50 ` Avi Kivity
@ 2010-08-25 7:05 ` Wei Yongjun
2010-08-25 7:06 ` [PATCHv2] " Wei Yongjun
1 sibling, 0 replies; 6+ messages in thread
From: Wei Yongjun @ 2010-08-25 7:05 UTC (permalink / raw)
To: Avi Kivity; +Cc: Marcelo Tosatti, kvm
> On 08/25/2010 09:16 AM, Wei Yongjun wrote:
>
>> Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
>> ---
>> x86/realmode.c | 6 ++++++
>> 1 files changed, 6 insertions(+), 0 deletions(-)
>>
>> diff --git a/x86/realmode.c b/x86/realmode.c
>> index a833829..2e12680 100644
>> --- a/x86/realmode.c
>> +++ b/x86/realmode.c
>> @@ -437,6 +437,9 @@ void test_call(void)
>> "ret\n\t"
>> "2:\t");
>> MK_INSN(call_far1, "lcallw *(%ebx)\n\t");
>> + MK_INSN(call_far2, ".byte 0x9a\n\t"
>> + ".word retf\n\t"
>> + ".word 0x00\n\t");
>>
> Why .byte encoding? won't "lcallw $0, $retf" (or the other way round) work?
>
Oh, it works, I will fix this.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCHv2] Add realmode test for CALL FAR IMM instruction
2010-08-25 6:50 ` Avi Kivity
2010-08-25 7:05 ` Wei Yongjun
@ 2010-08-25 7:06 ` Wei Yongjun
1 sibling, 0 replies; 6+ messages in thread
From: Wei Yongjun @ 2010-08-25 7:06 UTC (permalink / raw)
To: Avi Kivity; +Cc: Marcelo Tosatti, kvm
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
---
x86/realmode.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/x86/realmode.c b/x86/realmode.c
index a833829..d171a56 100644
--- a/x86/realmode.c
+++ b/x86/realmode.c
@@ -437,6 +437,7 @@ void test_call(void)
"ret\n\t"
"2:\t");
MK_INSN(call_far1, "lcallw *(%ebx)\n\t");
+ MK_INSN(call_far2, "lcallw $0, $retf\n\t");
MK_INSN(ret_imm, "sub $10, %sp; jmp 2f; 1: retw $10; 2: callw 1b");
exec_in_big_real_mode(&insn_call1);
@@ -453,6 +454,9 @@ void test_call(void)
exec_in_big_real_mode(&insn_call_far1);
report("call far 1", 0, 1);
+ exec_in_big_real_mode(&insn_call_far2);
+ report("call far 2", 0, 1);
+
exec_in_big_real_mode(&insn_ret_imm);
report("ret imm 1", 0, 1);
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] KVM: x86 emulator: add CALL FAR instruction emulation (opcode 9a)
2010-08-25 6:10 [PATCH] KVM: x86 emulator: add CALL FAR instruction emulation (opcode 9a) Wei Yongjun
2010-08-25 6:16 ` [PATCH] Add realmode test for CALL FAR IMM instruction Wei Yongjun
@ 2010-08-25 22:54 ` Marcelo Tosatti
1 sibling, 0 replies; 6+ messages in thread
From: Marcelo Tosatti @ 2010-08-25 22:54 UTC (permalink / raw)
To: Wei Yongjun; +Cc: Avi Kivity, kvm
On Wed, Aug 25, 2010 at 02:10:53PM +0800, Wei Yongjun wrote:
> Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
> ---
> arch/x86/kvm/emulate.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
Applied (and v2 testcase), thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-08-25 23:15 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-25 6:10 [PATCH] KVM: x86 emulator: add CALL FAR instruction emulation (opcode 9a) Wei Yongjun
2010-08-25 6:16 ` [PATCH] Add realmode test for CALL FAR IMM instruction Wei Yongjun
2010-08-25 6:50 ` Avi Kivity
2010-08-25 7:05 ` Wei Yongjun
2010-08-25 7:06 ` [PATCHv2] " Wei Yongjun
2010-08-25 22:54 ` [PATCH] KVM: x86 emulator: add CALL FAR instruction emulation (opcode 9a) Marcelo Tosatti
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).