* [Patch] (big) real mode emulation - push reg
@ 2007-08-16 23:46 Nitin A Kamble
[not found] ` <1187307993.10269.8.camel-mpPvwfgnXtFHIUuj5cj4Omt3HXsI98Cx0E9HWUfgJXw@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Nitin A Kamble @ 2007-08-16 23:46 UTC (permalink / raw)
To: Avi Kivity; +Cc: kvm-devel, Yu, Wilfred
[-- Attachment #1.1.1: Type: text/plain, Size: 333 bytes --]
Hi Avi,
Attached is a patch to implement instruction:
push reg (opcode 0x50 - 0x57)
Please apply or comment.
--
Thanks & Regards,
Nitin
Open Source Technology Center, Intel Corporation
-----------------------------------------------------------------
The mind is like a parachute; it works much better when it's open
[-- Attachment #1.1.2: push_reg.patch --]
[-- Type: text/x-patch, Size: 1484 bytes --]
commit 7f712b2d8cda67299e17473356050490a5c05be5
Author: Nitin A Kamble <nitin.a.kamble@intel.com>
Date: Thu Aug 16 19:47:19 2007 -0700
Implementing emulation of instructions:
push reg (opcode 0x50-0x57)
Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c
index cfdbaa5..09ca692 100644
--- a/drivers/kvm/x86_emulate.c
+++ b/drivers/kvm/x86_emulate.c
@@ -99,7 +99,8 @@ static u8 opcode_table[256] = {
/* 0x40 - 0x4F */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/* 0x50 - 0x57 */
- 0, 0, 0, 0, 0, 0, 0, 0,
+ ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps,
+ ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps,
/* 0x58 - 0x5F */
ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps,
ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps,
@@ -1247,7 +1248,21 @@ pop_instruction:
register_address_increment(_regs[VCPU_REGS_RSP], op_bytes);
no_wb = 1; /* Disable writeback. */
break;
+ case 0x50 ... 0x57: /* push reg */
+ if (op_bytes == 2)
+ src.val = (u16) _regs[b & 0x7];
+ else
+ src.val = (u32) _regs[b & 0x7];
+ dst.type = OP_MEM;
+ dst.bytes = op_bytes;
+ dst.val = src.val;
+ register_address_increment(_regs[VCPU_REGS_RSP], -op_bytes);
+ dst.ptr = (void *) register_address(
+ ctxt->ss_base, _regs[VCPU_REGS_RSP]);
+ d |= Mov; /* force writeback */
+ break;
}
+
goto writeback;
twobyte_insn:
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
[-- Attachment #2: Type: text/plain, Size: 315 bytes --]
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
[-- Attachment #3: Type: text/plain, Size: 186 bytes --]
_______________________________________________
kvm-devel mailing list
kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/kvm-devel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Patch] (big) real mode emulation - push reg
[not found] ` <1187307993.10269.8.camel-mpPvwfgnXtFHIUuj5cj4Omt3HXsI98Cx0E9HWUfgJXw@public.gmane.org>
@ 2007-08-17 12:21 ` Avi Kivity
[not found] ` <46C592B6.8030700-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Avi Kivity @ 2007-08-17 12:21 UTC (permalink / raw)
To: nitin.a.kamble-ral2JQCrhuEAvxtiuMwx3w; +Cc: kvm-devel, Yu, Wilfred
Nitin A Kamble wrote:
> Hi Avi,
> Attached is a patch to implement instruction:
> push reg (opcode 0x50 - 0x57)
> Please apply or comment.
>
>
> + case 0x50 ... 0x57: /* push reg */
> + if (op_bytes == 2)
> + src.val = (u16) _regs[b & 0x7];
> + else
> + src.val = (u32) _regs[b & 0x7];
> + dst.type = OP_MEM;
> + dst.bytes = op_bytes;
> + dst.val = src.val;
> + register_address_increment(_regs[VCPU_REGS_RSP], -op_bytes);
> + dst.ptr = (void *) register_address(
> + ctxt->ss_base, _regs[VCPU_REGS_RSP]);
> + d |= Mov; /* force writeback */
> + break;
> }
>
I don't thing 'd |= Mov' is necessary any more to force writeback.
Please check.
Also, please keep opcodes in sorted order.
--
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Patch] (big) real mode emulation - push reg
[not found] ` <46C592B6.8030700-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
@ 2007-08-17 22:32 ` Nitin A Kamble
[not found] ` <1187389929.9011.18.camel-mpPvwfgnXtFHIUuj5cj4Omt3HXsI98Cx0E9HWUfgJXw@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Nitin A Kamble @ 2007-08-17 22:32 UTC (permalink / raw)
To: Avi Kivity; +Cc: kvm-devel, Yu, Wilfred
[-- Attachment #1.1.1: Type: text/plain, Size: 551 bytes --]
On Fri, 2007-08-17 at 05:21 -0700, Avi Kivity wrote:
> I don't thing 'd |= Mov' is necessary any more to force writeback.
> Please check.
>
Hi Avi,
You are right, it was a bit stale code.
> Also, please keep opcodes in sorted order.
It is now.
Resending the updated "push reg" emulation patch.
Please Apply or comment.
--
Thanks & Regards,
Nitin
Open Source Technology Center, Intel Corporation
-----------------------------------------------------------------
The mind is like a parachute; it works much better when it's open
[-- Attachment #1.1.2: push_reg_4.patch --]
[-- Type: text/x-patch, Size: 1660 bytes --]
commit 8e55a4dad9f74ed9d883f1faccd11405d6775344
Author: Nitin A Kamble <nitin.a.kamble@intel.com>
Date: Fri Aug 17 18:47:18 2007 -0700
Implementing emulation of instructions:
push reg (opcode 0x50-0x57)
Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c
index fed0b2a..4eec909 100644
--- a/drivers/kvm/x86_emulate.c
+++ b/drivers/kvm/x86_emulate.c
@@ -99,7 +99,8 @@ static u8 opcode_table[256] = {
/* 0x40 - 0x4F */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/* 0x50 - 0x57 */
- 0, 0, 0, 0, 0, 0, 0, 0,
+ ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps,
+ ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps,
/* 0x58 - 0x5F */
ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps,
ImplicitOps, ImplicitOps, ImplicitOps, ImplicitOps,
@@ -1148,6 +1149,19 @@ special_insn:
if (twobyte)
goto twobyte_special_insn;
switch(b) {
+ case 0x50 ... 0x57: /* push reg */
+ if (op_bytes == 2)
+ src.val = (u16) _regs[b & 0x7];
+ else
+ src.val = (u32) _regs[b & 0x7];
+ dst.type = OP_MEM;
+ dst.bytes = op_bytes;
+ dst.val = src.val;
+ register_address_increment(_regs[VCPU_REGS_RSP], -op_bytes);
+ dst.ptr = (void *) register_address(
+ ctxt->ss_base, _regs[VCPU_REGS_RSP]);
+ no_wb = 1; /* force writeback */
+ break;
case 0x6c: /* insb */
case 0x6d: /* insw/insd */
if (kvm_emulate_pio_string(ctxt->vcpu, NULL,
@@ -1384,6 +1398,7 @@ btc: /* btc */
dst.val = (d & ByteOp) ? (s8) src.val : (s16) src.val;
break;
}
+
goto writeback;
twobyte_special_insn:
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
[-- Attachment #2: Type: text/plain, Size: 315 bytes --]
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
[-- Attachment #3: Type: text/plain, Size: 186 bytes --]
_______________________________________________
kvm-devel mailing list
kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/kvm-devel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Patch] (big) real mode emulation - push reg
[not found] ` <1187389929.9011.18.camel-mpPvwfgnXtFHIUuj5cj4Omt3HXsI98Cx0E9HWUfgJXw@public.gmane.org>
@ 2007-08-19 8:07 ` Avi Kivity
0 siblings, 0 replies; 4+ messages in thread
From: Avi Kivity @ 2007-08-19 8:07 UTC (permalink / raw)
To: nitin.a.kamble-ral2JQCrhuEAvxtiuMwx3w; +Cc: kvm-devel, Yu, Wilfred
Nitin A Kamble wrote:
>
>> Also, please keep opcodes in sorted order.
>>
> It is now.
> Resending the updated "push reg" emulation patch.
> Please Apply or comment.
>
Applied, thanks.
--
error compiling committee.c: too many arguments to function
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-08-19 8:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-16 23:46 [Patch] (big) real mode emulation - push reg Nitin A Kamble
[not found] ` <1187307993.10269.8.camel-mpPvwfgnXtFHIUuj5cj4Omt3HXsI98Cx0E9HWUfgJXw@public.gmane.org>
2007-08-17 12:21 ` Avi Kivity
[not found] ` <46C592B6.8030700-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-08-17 22:32 ` Nitin A Kamble
[not found] ` <1187389929.9011.18.camel-mpPvwfgnXtFHIUuj5cj4Omt3HXsI98Cx0E9HWUfgJXw@public.gmane.org>
2007-08-19 8:07 ` Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox