public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM: x86 emulator: implement 'movnti mem, reg'
@ 2007-10-15  9:20 Yang, Sheng
       [not found] ` <DB3BD37E3533EE46BED2FBA80995557F97021F-wq7ZOvIWXbM/UvCtAeCM4rfspsVTdybXVpNB7YpNyf8@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Yang, Sheng @ 2007-10-15  9:20 UTC (permalink / raw)
  To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

[-- Attachment #1: Type: text/plain, Size: 1467 bytes --]

>From 1b7892787f1b619a52e52275cf41248f1131d1b6 Mon Sep 17 00:00:00 2001
From: Sheng Yang <sheng.yang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Date: Mon, 15 Oct 2007 14:24:20 +0800
Subject: [PATCH] KVM: x86 emulator: implement 'movnti mem, reg'

Implement emulation of instruction:
    movnti m32/m64, r32/r64
    opcode: 0x0f 0xc3

Signed-off-by: Sheng Yang <sheng.yang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/kvm/x86_emulate.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c
index fa33fcd..e974ace 100644
--- a/drivers/kvm/x86_emulate.c
+++ b/drivers/kvm/x86_emulate.c
@@ -212,7 +212,8 @@ static u16 twobyte_table[256] = {
 	0, 0, ByteOp | DstReg | SrcMem | ModRM | Mov,
 	    DstReg | SrcMem16 | ModRM | Mov,
 	/* 0xC0 - 0xCF */
-	0, 0, 0, 0, 0, 0, 0, ImplicitOps | ModRM, 0, 0, 0, 0, 0, 0, 0,
0,
+	0, 0, 0, DstMem | SrcReg | ModRM | Mov, 0, 0, 0, ImplicitOps |
ModRM,
+	0, 0, 0, 0, 0, 0, 0, 0,
 	/* 0xD0 - 0xDF */
 	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 	/* 0xE0 - 0xEF */
@@ -1686,6 +1687,11 @@ twobyte_insn:
 		c->dst.val = (c->d & ByteOp) ? (s8) c->src.val :
 							(s16)
c->src.val;
 		break;
+	case 0xc3:		/* movnti */
+		c->dst.bytes = c->op_bytes;
+		c->dst.val = (c->op_bytes == 4) ? (u32) c->src.val :
+							(u64)
c->src.val;
+		break;
 	}
 	goto writeback;
 
-- 
1.5.2


Thanks
Yang, Sheng

[-- Attachment #2: 0001-KVM-x86-emulator-implement-movnti-mem-reg.patch --]
[-- Type: application/octet-stream, Size: 1336 bytes --]

From 1b7892787f1b619a52e52275cf41248f1131d1b6 Mon Sep 17 00:00:00 2001
From: Sheng Yang <sheng.yang@intel.com>
Date: Mon, 15 Oct 2007 14:24:20 +0800
Subject: [PATCH] KVM: x86 emulator: implement 'movnti mem, reg'

Implement emulation of instruction:
    movnti m32/m64, r32/r64
    opcode: 0x0f 0xc3

Signed-off-by: Sheng Yang <sheng.yang@intel.com>
---
 drivers/kvm/x86_emulate.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c
index fa33fcd..e974ace 100644
--- a/drivers/kvm/x86_emulate.c
+++ b/drivers/kvm/x86_emulate.c
@@ -212,7 +212,8 @@ static u16 twobyte_table[256] = {
 	0, 0, ByteOp | DstReg | SrcMem | ModRM | Mov,
 	    DstReg | SrcMem16 | ModRM | Mov,
 	/* 0xC0 - 0xCF */
-	0, 0, 0, 0, 0, 0, 0, ImplicitOps | ModRM, 0, 0, 0, 0, 0, 0, 0, 0,
+	0, 0, 0, DstMem | SrcReg | ModRM | Mov, 0, 0, 0, ImplicitOps | ModRM,
+	0, 0, 0, 0, 0, 0, 0, 0,
 	/* 0xD0 - 0xDF */
 	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 	/* 0xE0 - 0xEF */
@@ -1686,6 +1687,11 @@ twobyte_insn:
 		c->dst.val = (c->d & ByteOp) ? (s8) c->src.val :
 							(s16) c->src.val;
 		break;
+	case 0xc3:		/* movnti */
+		c->dst.bytes = c->op_bytes;
+		c->dst.val = (c->op_bytes == 4) ? (u32) c->src.val :
+							(u64) c->src.val;
+		break;
 	}
 	goto writeback;
 
-- 
1.5.2


[-- Attachment #3: Type: text/plain, Size: 314 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 #4: 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] 5+ messages in thread

* Re: [PATCH] KVM: x86 emulator: implement 'movnti mem, reg'
       [not found] ` <DB3BD37E3533EE46BED2FBA80995557F97021F-wq7ZOvIWXbM/UvCtAeCM4rfspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2007-10-15  9:38   ` Avi Kivity
       [not found]     ` <47133500.2000408-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Avi Kivity @ 2007-10-15  9:38 UTC (permalink / raw)
  To: Yang, Sheng; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Yang, Sheng wrote:
> >From 1b7892787f1b619a52e52275cf41248f1131d1b6 Mon Sep 17 00:00:00 2001
> From: Sheng Yang <sheng.yang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> Date: Mon, 15 Oct 2007 14:24:20 +0800
> Subject: [PATCH] KVM: x86 emulator: implement 'movnti mem, reg'
>
> Implement emulation of instruction:
>     movnti m32/m64, r32/r64
>     opcode: 0x0f 0xc3
>   

Applied, thanks.

I vaguely remember something about a guest hitting this...  which one is it?

I'll push this for 2.6.24 if it's a real life issue.

-- 
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] 5+ messages in thread

* Re: [PATCH] KVM: x86 emulator: implement 'movnti mem, reg'
       [not found]     ` <47133500.2000408-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
@ 2007-10-15  9:43       ` Yang, Sheng
       [not found]         ` <DB3BD37E3533EE46BED2FBA80995557F970230-wq7ZOvIWXbM/UvCtAeCM4rfspsVTdybXVpNB7YpNyf8@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Yang, Sheng @ 2007-10-15  9:43 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Yeah :)

Linux guest 2.6.16 x86_64 crashed when trying to get IP, for this
'movnti' haven't been implement yet. 

Avi Kivity wrote:
> Yang, Sheng wrote:
>>> From 1b7892787f1b619a52e52275cf41248f1131d1b6 Mon Sep 17 00:00:00
2001
>> From: Sheng Yang <sheng.yang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
>> Date: Mon, 15 Oct 2007 14:24:20 +0800
>> Subject: [PATCH] KVM: x86 emulator: implement 'movnti mem, reg'
>> 
>> Implement emulation of instruction:
>>     movnti m32/m64, r32/r64
>>     opcode: 0x0f 0xc3
>> 
> 
> Applied, thanks.
> 
> I vaguely remember something about a guest hitting this...  which one
is it?
> 
> I'll push this for 2.6.24 if it's a real life issue.

Thanks
Yang, Sheng

-------------------------------------------------------------------------
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] 5+ messages in thread

* Re: [PATCH] KVM: x86 emulator: implement 'movnti mem, reg'
       [not found]         ` <DB3BD37E3533EE46BED2FBA80995557F970230-wq7ZOvIWXbM/UvCtAeCM4rfspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2007-10-15  9:44           ` Avi Kivity
       [not found]             ` <47133685.20609-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Avi Kivity @ 2007-10-15  9:44 UTC (permalink / raw)
  To: Yang, Sheng; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Yang, Sheng wrote:
> Yeah :)
>
> Linux guest 2.6.16 x86_64 crashed when trying to get IP, for this
> 'movnti' haven't been implement yet. 
>
>   

So, it was using movnti for mmio into the nic registers?


> Avi Kivity wrote:
>   
>> Yang, Sheng wrote:
>>     
>>>> From 1b7892787f1b619a52e52275cf41248f1131d1b6 Mon Sep 17 00:00:00
>>>>         
> 2001
>   
>>> From: Sheng Yang <sheng.yang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
>>> Date: Mon, 15 Oct 2007 14:24:20 +0800
>>> Subject: [PATCH] KVM: x86 emulator: implement 'movnti mem, reg'
>>>
>>> Implement emulation of instruction:
>>>     movnti m32/m64, r32/r64
>>>     opcode: 0x0f 0xc3
>>>
>>>       
>> Applied, thanks.
>>
>> I vaguely remember something about a guest hitting this...  which one
>>     
> is it?
>   
>> I'll push this for 2.6.24 if it's a real life issue.
>>     
>
> Thanks
> Yang, Sheng
>
> -------------------------------------------------------------------------
> 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/
> _______________________________________________
> kvm-devel mailing list
> kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/kvm-devel
>   


-- 
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] 5+ messages in thread

* Re: [PATCH] KVM: x86 emulator: implement 'movnti mem, reg'
       [not found]             ` <47133685.20609-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
@ 2007-10-15  9:53               ` Yang, Sheng
  0 siblings, 0 replies; 5+ messages in thread
From: Yang, Sheng @ 2007-10-15  9:53 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Avi Kivity wrote:
> Yang, Sheng wrote:
>> Yeah :)
>> 
>> Linux guest 2.6.16 x86_64 crashed when trying to get IP, for this
>> 'movnti' haven't been implement yet.
>> 
>> 
> 
> So, it was using movnti for mmio into the nic registers?

Yeah, it's a mmio operation. 

> 
> 
>> Avi Kivity wrote:
>> 
>>> Yang, Sheng wrote:
>>> 
>>>>> From 1b7892787f1b619a52e52275cf41248f1131d1b6 Mon Sep 17 00:00:00
>>>>> 
>> 2001
>> 
>>>> From: Sheng Yang <sheng.yang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
>>>> Date: Mon, 15 Oct 2007 14:24:20 +0800
>>>> Subject: [PATCH] KVM: x86 emulator: implement 'movnti mem, reg'
>>>> 
>>>> Implement emulation of instruction:
>>>>     movnti m32/m64, r32/r64
>>>>     opcode: 0x0f 0xc3
>>>> 
>>>> 
>>> Applied, thanks.
>>> 
>>> I vaguely remember something about a guest hitting this...  which
one
>>> 
>> is it?
>> 
>>> I'll push this for 2.6.24 if it's a real life issue.
>>> 
>> 
>> Thanks
>> Yang, Sheng
>> 
>>
------------------------------------------------------------------------
-
>> 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/
>> _______________________________________________
>> kvm-devel mailing list
>> kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
>> https://lists.sourceforge.net/lists/listinfo/kvm-devel

Thanks
Yang, Sheng

-------------------------------------------------------------------------
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] 5+ messages in thread

end of thread, other threads:[~2007-10-15  9:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-15  9:20 [PATCH] KVM: x86 emulator: implement 'movnti mem, reg' Yang, Sheng
     [not found] ` <DB3BD37E3533EE46BED2FBA80995557F97021F-wq7ZOvIWXbM/UvCtAeCM4rfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2007-10-15  9:38   ` Avi Kivity
     [not found]     ` <47133500.2000408-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-10-15  9:43       ` Yang, Sheng
     [not found]         ` <DB3BD37E3533EE46BED2FBA80995557F970230-wq7ZOvIWXbM/UvCtAeCM4rfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2007-10-15  9:44           ` Avi Kivity
     [not found]             ` <47133685.20609-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-10-15  9:53               ` Yang, Sheng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox