public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Nitin A Kamble <nitin.a.kamble-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
Cc: kvm-devel
	<kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>,
	"Yu,
	 Wilfred" <wilfred.yu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Subject: Re: [Patch] (big) real mode emulation - push reg
Date: Fri, 17 Aug 2007 15:32:09 -0700	[thread overview]
Message-ID: <1187389929.9011.18.camel@lnitindesktop.sc.intel.com> (raw)
In-Reply-To: <46C592B6.8030700-atKUWr5tajBWk0Htik3J/w@public.gmane.org>


[-- 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

  parent reply	other threads:[~2007-08-17 22:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
     [not found]         ` <1187389929.9011.18.camel-mpPvwfgnXtFHIUuj5cj4Omt3HXsI98Cx0E9HWUfgJXw@public.gmane.org>
2007-08-19  8:07           ` Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1187389929.9011.18.camel@lnitindesktop.sc.intel.com \
    --to=nitin.a.kamble-ral2jqcrhueavxtiumwx3w@public.gmane.org \
    --cc=avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=wilfred.yu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox