public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] wrong tlb flush order
@ 2007-06-20  9:13 Shaohua Li
       [not found] ` <1182330806.31486.3.camel-yAZKuqJtXNMXR+D7ky4Foa2pdiUAq4bhAL8bYrjMMd8@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Shaohua Li @ 2007-06-20  9:13 UTC (permalink / raw)
  To: kvm-devel

Sounds like a obvious bug to me. Other places doing tlb flush do the right thing.

Signed-off-by: Shaohua Li <shaohua.li-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

Index: kvm-28/kernel/mmu.c
===================================================================
--- kvm-28.orig/kernel/mmu.c	2007-06-20 16:52:46.000000000 +0800
+++ kvm-28/kernel/mmu.c	2007-06-20 17:10:02.000000000 +0800
@@ -441,8 +441,8 @@
 		BUG_ON(!(*spte & PT_WRITABLE_MASK));
 		rmap_printk("rmap_write_protect: spte %p %llx\n", spte, *spte);
 		rmap_remove(vcpu, spte);
-		kvm_flush_remote_tlbs(vcpu->kvm);
 		set_shadow_pte(spte, *spte & ~PT_WRITABLE_MASK);
+		kvm_flush_remote_tlbs(vcpu->kvm);
 	}
 }
 

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch] wrong tlb flush order
       [not found] ` <1182330806.31486.3.camel-yAZKuqJtXNMXR+D7ky4Foa2pdiUAq4bhAL8bYrjMMd8@public.gmane.org>
@ 2007-06-20  9:39   ` Avi Kivity
       [not found]     ` <4678F5E7.7070908-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Avi Kivity @ 2007-06-20  9:39 UTC (permalink / raw)
  To: Shaohua Li; +Cc: kvm-devel

Shaohua Li wrote:
> Sounds like a obvious bug to me. Other places doing tlb flush do the right thing.
>   

Right.  Applied, thanks.

-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch] wrong tlb flush order
       [not found]     ` <4678F5E7.7070908-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
@ 2007-06-20 19:07       ` Nakajima, Jun
       [not found]         ` <97D612E30E1F88419025B06CB4CF1BE102862D5D-1a9uaKK1+wJcIJlls4ac1rfspsVTdybXVpNB7YpNyf8@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Nakajima, Jun @ 2007-06-20 19:07 UTC (permalink / raw)
  To: Avi Kivity, Li, Shaohua; +Cc: kvm-devel

Avi Kivity wrote:
> Shaohua Li wrote:
> > Sounds like a obvious bug to me. Other places doing tlb flush do the
right
> > thing. 
> > 
> 
> Right.  Applied, thanks.

BTW,

The current VMX code does not make sense to me:

static void vmx_flush_tlb(struct kvm_vcpu *vcpu)
{
	vmcs_writel(GUEST_CR3, vmcs_readl(GUEST_CR3));
}

Jun
---
Intel Open Source Technology Center

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch] wrong tlb flush order
       [not found]         ` <97D612E30E1F88419025B06CB4CF1BE102862D5D-1a9uaKK1+wJcIJlls4ac1rfspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2007-06-21  2:05           ` Li, Xin B
       [not found]             ` <B30DA1341B0CFA4893EF8A36B40B5C5D014859EA-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Li, Xin B @ 2007-06-21  2:05 UTC (permalink / raw)
  To: Nakajima, Jun, Avi Kivity, Li, Shaohua; +Cc: kvm-devel

>
>BTW,
>
>The current VMX code does not make sense to me:
>
>static void vmx_flush_tlb(struct kvm_vcpu *vcpu)
>{
>	vmcs_writel(GUEST_CR3, vmcs_readl(GUEST_CR3));
>}
>

The point is, vmexits will invalidate all TLB entries on Intel VT
processor today.
-Xin 

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch] wrong tlb flush order
       [not found]             ` <B30DA1341B0CFA4893EF8A36B40B5C5D014859EA-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2007-06-21  8:50               ` Avi Kivity
  0 siblings, 0 replies; 5+ messages in thread
From: Avi Kivity @ 2007-06-21  8:50 UTC (permalink / raw)
  To: Li, Xin B; +Cc: kvm-devel

Li, Xin B wrote:
>> BTW,
>>
>> The current VMX code does not make sense to me:
>>
>> static void vmx_flush_tlb(struct kvm_vcpu *vcpu)
>> {
>> 	vmcs_writel(GUEST_CR3, vmcs_readl(GUEST_CR3));
>> }
>>
>>     
>
> The point is, vmexits will invalidate all TLB entries on Intel VT
> processor today.
>   

Yes.  This was based on some text in the manual that I can't find 
anymore.  I long suspected that it is unnecessary.

-- 
error compiling committee.c: too many arguments to function


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-06-21  8:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-20  9:13 [patch] wrong tlb flush order Shaohua Li
     [not found] ` <1182330806.31486.3.camel-yAZKuqJtXNMXR+D7ky4Foa2pdiUAq4bhAL8bYrjMMd8@public.gmane.org>
2007-06-20  9:39   ` Avi Kivity
     [not found]     ` <4678F5E7.7070908-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-06-20 19:07       ` Nakajima, Jun
     [not found]         ` <97D612E30E1F88419025B06CB4CF1BE102862D5D-1a9uaKK1+wJcIJlls4ac1rfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2007-06-21  2:05           ` Li, Xin B
     [not found]             ` <B30DA1341B0CFA4893EF8A36B40B5C5D014859EA-wq7ZOvIWXbNpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2007-06-21  8:50               ` Avi Kivity

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