[PATCH 08/12] KVM: MMU: introduce nulls desc

2013-07-30 Thread Xiao Guangrong
It likes nulls list and we use the pte-list as the nulls which can help us to detect whether the "desc" is moved to anther rmap then we can re-walk the rmap if that happened Signed-off-by: Xiao Guangrong --- arch/x86/kvm/mmu.c | 35 --- 1 file c

[PATCH 11/12] KVM: MMU: locklessly write-protect the page

2013-07-30 Thread Xiao Guangrong
-off-by: Xiao Guangrong --- arch/x86/include/asm/kvm_host.h | 4 --- arch/x86/kvm/mmu.c | 62 - arch/x86/kvm/mmu.h | 6 arch/x86/kvm/x86.c | 19 + 4 files changed, 62 insertions(+), 29 deletions(-) diff

[PATCH 12/12] KVM: MMU: clean up spte_write_protect

2013-07-30 Thread Xiao Guangrong
Now, the only user of spte_write_protect is rmap_write_protect which always calls spte_write_protect with pt_protect = true, so drop it and the unused parameter @kvm Signed-off-by: Xiao Guangrong --- arch/x86/kvm/mmu.c | 19 --- 1 file changed, 8 insertions(+), 11 deletions

[PATCH 06/12] KVM: MMU: flush tlb if the spte can be locklessly modified

2013-07-30 Thread Xiao Guangrong
, see spte.w = 0, then without flush tlb unlock mmu-lock !!! At this point, the shadow page can still be writable due to the corrupt tlb entry Flush all TLB Signed-off-by: Xiao Guangrong

[PATCH 09/12] KVM: MMU: introduce pte-list lockless walker

2013-07-30 Thread Xiao Guangrong
The basic idea is from nulls list which uses a nulls to indicate whether the desc is moved to different pte-list Thanks to SLAB_DESTROY_BY_RCU, the desc can be quickly reused Signed-off-by: Xiao Guangrong --- arch/x86/kvm/mmu.c | 51 ++- 1 file

[PATCH 07/12] KVM: MMU: redesign the algorithm of pte_list

2013-07-30 Thread Xiao Guangrong
che miss Signed-off-by: Xiao Guangrong --- arch/x86/kvm/mmu.c | 182 - 1 file changed, 125 insertions(+), 57 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 5a40564..3013bb1 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu

[RFC PATCH 00/12] KVM: MMU: locklessly wirte-protect

2013-07-30 Thread Xiao Guangrong
k spte from nonpresent to present. Other writes cost lots of time to trigger the page fault due to write-protection which are fixed by fast page fault which need not take mmu-lock. Xiao Guangrong (12): KVM: MMU: remove unused parameter KVM: MMU: properly check last spte in fast_page_fault()

[PATCH 05/12] KVM: MMU: add spte into rmap before logging dirty page

2013-07-30 Thread Xiao Guangrong
-of-order that will be added in the later patch Signed-off-by: Xiao Guangrong --- arch/x86/kvm/mmu.c | 25 ++--- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 0fe56ad..58283bf 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch

[PATCH 01/12] KVM: MMU: remove unused parameter

2013-07-30 Thread Xiao Guangrong
@vcpu in page_fault_can_be_fast() is not used so remove it Signed-off-by: Xiao Guangrong --- arch/x86/kvm/mmu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 3a9493a..a731c0b 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86

[PATCH 02/12] KVM: MMU: properly check last spte in fast_page_fault()

2013-07-30 Thread Xiao Guangrong
ble and avoid potential issue in the further development Signed-off-by: Xiao Guangrong --- arch/x86/kvm/mmu.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index a731c0b..cf163ca 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/

[PATCH 04/12] KVM: MMU: log dirty page after marking spte writable

2013-07-30 Thread Xiao Guangrong
bitmap and failed to write-protect the page Signed-off-by: Xiao Guangrong --- arch/x86/kvm/mmu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 35d4b50..0fe56ad 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c

[PATCH 03/12] KVM: MMU: lazily drop large spte

2013-07-30 Thread Xiao Guangrong
-protecting a large spte is a good idea, | since it moves some work from protect-time to fault-time, so it reduces | jitter. This removes the need for the return value. [ It has fixed the issue reported in 6b73a9606 by stopping fast page fault marking the large spte to writable ] Signed-off-by: Xiao

[PATCH 03/12] KVM: MMU: lazily drop large spte

2013-07-30 Thread Xiao Guangrong
-protecting a large spte is a good idea, | since it moves some work from protect-time to fault-time, so it reduces | jitter. This removes the need for the return value. [ It has fixed the issue reported in 6b73a9606 by stopping fast page fault marking the large spte to writable ] Signed-off-by: Xiao

[PATCH 04/12] KVM: MMU: log dirty page after marking spte writable

2013-07-30 Thread Xiao Guangrong
bitmap and failed to write-protect the page Signed-off-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com --- arch/x86/kvm/mmu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 35d4b50..0fe56ad 100644 --- a/arch/x86/kvm/mmu.c

[PATCH 01/12] KVM: MMU: remove unused parameter

2013-07-30 Thread Xiao Guangrong
@vcpu in page_fault_can_be_fast() is not used so remove it Signed-off-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com --- arch/x86/kvm/mmu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 3a9493a..a731c0b 100644

[PATCH 02/12] KVM: MMU: properly check last spte in fast_page_fault()

2013-07-30 Thread Xiao Guangrong
and avoid potential issue in the further development Signed-off-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com --- arch/x86/kvm/mmu.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index a731c0b..cf163ca 100644 --- a/arch/x86

[PATCH 05/12] KVM: MMU: add spte into rmap before logging dirty page

2013-07-30 Thread Xiao Guangrong
-of-order that will be added in the later patch Signed-off-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com --- arch/x86/kvm/mmu.c | 25 ++--- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 0fe56ad..58283bf 100644

[RFC PATCH 00/12] KVM: MMU: locklessly wirte-protect

2013-07-30 Thread Xiao Guangrong
need not take mmu-lock. Xiao Guangrong (12): KVM: MMU: remove unused parameter KVM: MMU: properly check last spte in fast_page_fault() KVM: MMU: lazily drop large spte KVM: MMU: log dirty page after marking spte writable KVM: MMU: add spte into rmap before logging dirty page KVM: MMU

[PATCH 07/12] KVM: MMU: redesign the algorithm of pte_list

2013-07-30 Thread Xiao Guangrong
one, the replaced one is missed when we do lockless walk. To fix this case, we do not backward move the spte, instead, we forward move the entry: when a spte is deleted, we move the entry in the first desc to that position Both of these also can reduce cache miss Signed-off-by: Xiao

[PATCH 06/12] KVM: MMU: flush tlb if the spte can be locklessly modified

2013-07-30 Thread Xiao Guangrong
, see spte.w = 0, then without flush tlb unlock mmu-lock !!! At this point, the shadow page can still be writable due to the corrupt tlb entry Flush all TLB Signed-off-by: Xiao Guangrong

[PATCH 12/12] KVM: MMU: clean up spte_write_protect

2013-07-30 Thread Xiao Guangrong
Now, the only user of spte_write_protect is rmap_write_protect which always calls spte_write_protect with pt_protect = true, so drop it and the unused parameter @kvm Signed-off-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com --- arch/x86/kvm/mmu.c | 19 --- 1 file changed, 8

[PATCH 09/12] KVM: MMU: introduce pte-list lockless walker

2013-07-30 Thread Xiao Guangrong
The basic idea is from nulls list which uses a nulls to indicate whether the desc is moved to different pte-list Thanks to SLAB_DESTROY_BY_RCU, the desc can be quickly reused Signed-off-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com --- arch/x86/kvm/mmu.c | 51

[PATCH 11/12] KVM: MMU: locklessly write-protect the page

2013-07-30 Thread Xiao Guangrong
-off-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com --- arch/x86/include/asm/kvm_host.h | 4 --- arch/x86/kvm/mmu.c | 62 - arch/x86/kvm/mmu.h | 6 arch/x86/kvm/x86.c | 19 + 4 files changed, 62

[PATCH 10/12] KVM: MMU: allow locklessly access shadow page table out of vcpu thread

2013-07-30 Thread Xiao Guangrong
and the scalability Signed-off-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com --- arch/x86/include/asm/kvm_host.h | 6 +- arch/x86/kvm/mmu.c | 23 +++ arch/x86/kvm/mmu.h | 22 ++ 3 files changed, 50 insertions(+), 1 deletion

[PATCH 08/12] KVM: MMU: introduce nulls desc

2013-07-30 Thread Xiao Guangrong
It likes nulls list and we use the pte-list as the nulls which can help us to detect whether the desc is moved to anther rmap then we can re-walk the rmap if that happened Signed-off-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com --- arch/x86/kvm/mmu.c | 35

Re: [PATCH] KVM: MMU: avoid fast page fault fixing mmio page fault

2013-07-18 Thread Xiao Guangrong
On 07/18/2013 02:06 PM, Gleb Natapov wrote: > On Thu, Jul 18, 2013 at 02:01:47PM +0800, Xiao Guangrong wrote: >> On 07/18/2013 01:31 PM, Gleb Natapov wrote: >>> On Thu, Jul 18, 2013 at 12:52:37PM +0800, Xiao Guangrong wrote: >>>> Currently, fast page fault tri

Re: [PATCH] KVM: MMU: avoid fast page fault fixing mmio page fault

2013-07-18 Thread Xiao Guangrong
On 07/18/2013 01:31 PM, Gleb Natapov wrote: > On Thu, Jul 18, 2013 at 12:52:37PM +0800, Xiao Guangrong wrote: >> Currently, fast page fault tries to fix mmio page fault when the >> generation number is invalid (spte.gen != kvm.gen) and returns to >> guest to retry the fault s

Re: [PATCH] KVM: MMU: avoid fast page fault fixing mmio page fault

2013-07-18 Thread Xiao Guangrong
On 07/18/2013 01:31 PM, Gleb Natapov wrote: On Thu, Jul 18, 2013 at 12:52:37PM +0800, Xiao Guangrong wrote: Currently, fast page fault tries to fix mmio page fault when the generation number is invalid (spte.gen != kvm.gen) and returns to guest to retry the fault since it sees the last spte

Re: [PATCH] KVM: MMU: avoid fast page fault fixing mmio page fault

2013-07-18 Thread Xiao Guangrong
On 07/18/2013 02:06 PM, Gleb Natapov wrote: On Thu, Jul 18, 2013 at 02:01:47PM +0800, Xiao Guangrong wrote: On 07/18/2013 01:31 PM, Gleb Natapov wrote: On Thu, Jul 18, 2013 at 12:52:37PM +0800, Xiao Guangrong wrote: Currently, fast page fault tries to fix mmio page fault when the generation

Re: [PATCH] KVM: MMU: avoid fast page fault fixing mmio page fault

2013-07-17 Thread Xiao Guangrong
On 07/18/2013 12:52 PM, Xiao Guangrong wrote: > Currently, fast page fault tries to fix mmio page fault when the > generation number is invalid (spte.gen != kvm.gen) and returns to > guest to retry the fault since it sees the last spte is nonpresent > which causes infinity loop

[PATCH] KVM: MMU: avoid fast page fault fixing mmio page fault

2013-07-17 Thread Xiao Guangrong
is recognized as ept-misconfig Fix it by filtering the mmio page fault out in page_fault_can_be_fast Reported-by: Markus Trippelsdorf Tested-by: Markus Trippelsdorf Signed-off-by: Xiao Guangrong --- arch/x86/kvm/mmu.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/arch/x86/kvm/mmu.c b/arch

Re: commit f8f559422b (KVM: MMU: fast invalidate all mmio sptes) causes hang

2013-07-17 Thread Xiao Guangrong
On Jul 18, 2013, at 3:31 AM, Gleb Natapov wrote: > On Thu, Jul 18, 2013 at 03:07:11AM +0800, Xiao Guangrong wrote: >> Ouch! >> >> The guest is hang when boot from ubuntu iso, i bisected the code and found >> it is caused by: >> >> cad55f1aed000db46d

Re: commit f8f559422b (KVM: MMU: fast invalidate all mmio sptes) causes hang

2013-07-17 Thread Xiao Guangrong
code & PFERR_RSVD_MASK) + return false; + return true; } On Jul 18, 2013, at 2:42 AM, Markus Trippelsdorf wrote: > On 2013.07.18 at 01:25 +0800, Xiao Guangrong wrote: >> Hi Markus, >> >> Thanks for your report! I am downloading the ubuntu iso and

Re: commit f8f559422b (KVM: MMU: fast invalidate all mmio sptes) causes hang

2013-07-17 Thread Xiao Guangrong
commit: >>> commit f8f559422b6c6a05469dfde614b67789b6142cb5 >>> Author: Xiao Guangrong >>> Date: Fri Jun 7 16:51:26 2013 +0800 >>> >>>KVM: MMU: fast invalidate all mmio sptes >>> >>> causes my kvm qemu qcow2 images to hang when they switch from the boot

Re: commit f8f559422b (KVM: MMU: fast invalidate all mmio sptes) causes hang

2013-07-17 Thread Xiao Guangrong
commit: >>> commit f8f559422b6c6a05469dfde614b67789b6142cb5 >>> Author: Xiao Guangrong >>> Date: Fri Jun 7 16:51:26 2013 +0800 >>> >>>KVM: MMU: fast invalidate all mmio sptes >>> >>> causes my kvm qemu qcow2 images to hang when they switch from

Re: commit f8f559422b (KVM: MMU: fast invalidate all mmio sptes) causes hang

2013-07-17 Thread Xiao Guangrong
f8f559422b6c6a05469dfde614b67789b6142cb5 Author: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com Date: Fri Jun 7 16:51:26 2013 +0800 KVM: MMU: fast invalidate all mmio sptes causes my kvm qemu qcow2 images to hang when they switch from the boot console to the desktop. For example: qemu

Re: commit f8f559422b (KVM: MMU: fast invalidate all mmio sptes) causes hang

2013-07-17 Thread Xiao Guangrong
, Markus Trippelsdorf wrote: The following commit: commit f8f559422b6c6a05469dfde614b67789b6142cb5 Author: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com Date: Fri Jun 7 16:51:26 2013 +0800 KVM: MMU: fast invalidate all mmio sptes causes my kvm qemu qcow2 images to hang when they switch

Re: commit f8f559422b (KVM: MMU: fast invalidate all mmio sptes) causes hang

2013-07-17 Thread Xiao Guangrong
PFERR_RSVD_MASK) + return false; + return true; } On Jul 18, 2013, at 2:42 AM, Markus Trippelsdorf mar...@trippelsdorf.de wrote: On 2013.07.18 at 01:25 +0800, Xiao Guangrong wrote: Hi Markus, Thanks for your report! I am downloading the ubuntu iso and will try to reproducible

Re: commit f8f559422b (KVM: MMU: fast invalidate all mmio sptes) causes hang

2013-07-17 Thread Xiao Guangrong
On Jul 18, 2013, at 3:31 AM, Gleb Natapov g...@redhat.com wrote: On Thu, Jul 18, 2013 at 03:07:11AM +0800, Xiao Guangrong wrote: Ouch! The guest is hang when boot from ubuntu iso, i bisected the code and found it is caused by: cad55f1aed000db46dfd1b5706707f33624d8604 is the first bad

[PATCH] KVM: MMU: avoid fast page fault fixing mmio page fault

2013-07-17 Thread Xiao Guangrong
is recognized as ept-misconfig Fix it by filtering the mmio page fault out in page_fault_can_be_fast Reported-by: Markus Trippelsdorf mar...@trippelsdorf.de Tested-by: Markus Trippelsdorf mar...@trippelsdorf.de Signed-off-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com --- arch/x86/kvm/mmu.c | 7

Re: [PATCH] KVM: MMU: avoid fast page fault fixing mmio page fault

2013-07-17 Thread Xiao Guangrong
On 07/18/2013 12:52 PM, Xiao Guangrong wrote: Currently, fast page fault tries to fix mmio page fault when the generation number is invalid (spte.gen != kvm.gen) and returns to guest to retry the fault since it sees the last spte is nonpresent which causes infinity loop It can be triggered

Re: [PATCH v3 4/6] KVM: MMU: fast invalidate all mmio sptes

2013-06-27 Thread Xiao Guangrong
On 06/27/2013 06:19 PM, Gleb Natapov wrote: > On Thu, Jun 27, 2013 at 05:50:08PM +0800, Xiao Guangrong wrote: >> On 06/27/2013 05:21 PM, Gleb Natapov wrote: >>> On Thu, Jun 27, 2013 at 12:14:24PM +0300, Gleb Natapov wrote: >>>> On Thu, Jun 27, 2013 at 12:01:

Re: [PATCH v3 4/6] KVM: MMU: fast invalidate all mmio sptes

2013-06-27 Thread Xiao Guangrong
On 06/27/2013 05:21 PM, Gleb Natapov wrote: > On Thu, Jun 27, 2013 at 12:14:24PM +0300, Gleb Natapov wrote: >> On Thu, Jun 27, 2013 at 12:01:10PM +0300, Gleb Natapov wrote: >>> On Thu, Jun 27, 2013 at 11:29:00AM +0300, Gleb Natapov wrote: >>>> On Fri, Jun 07,

Re: [PATCH v3 4/6] KVM: MMU: fast invalidate all mmio sptes

2013-06-27 Thread Xiao Guangrong
On 06/27/2013 05:21 PM, Gleb Natapov wrote: On Thu, Jun 27, 2013 at 12:14:24PM +0300, Gleb Natapov wrote: On Thu, Jun 27, 2013 at 12:01:10PM +0300, Gleb Natapov wrote: On Thu, Jun 27, 2013 at 11:29:00AM +0300, Gleb Natapov wrote: On Fri, Jun 07, 2013 at 04:51:26PM +0800, Xiao Guangrong wrote

Re: [PATCH v3 4/6] KVM: MMU: fast invalidate all mmio sptes

2013-06-27 Thread Xiao Guangrong
On 06/27/2013 06:19 PM, Gleb Natapov wrote: On Thu, Jun 27, 2013 at 05:50:08PM +0800, Xiao Guangrong wrote: On 06/27/2013 05:21 PM, Gleb Natapov wrote: On Thu, Jun 27, 2013 at 12:14:24PM +0300, Gleb Natapov wrote: On Thu, Jun 27, 2013 at 12:01:10PM +0300, Gleb Natapov wrote: On Thu, Jun 27

Re: [PATCH 2/7] KVM: MMU: document clear_spte_count

2013-06-19 Thread Xiao Guangrong
On 06/19/2013 08:41 PM, Paolo Bonzini wrote: > Il 19/06/2013 14:25, Xiao Guangrong ha scritto: >> On 06/19/2013 07:55 PM, Paolo Bonzini wrote: >>> Il 19/06/2013 13:53, Xiao Guangrong ha scritto: >>>> On 06/19/2013 07:32 PM, Paolo Bonzini wrote: >>>>> I

Re: [PATCH 7/7] KVM: MMU: document fast invalidate all mmio sptes

2013-06-19 Thread Xiao Guangrong
On 06/19/2013 08:35 PM, Paolo Bonzini wrote: > Il 19/06/2013 11:09, Xiao Guangrong ha scritto: >> Document it to Documentation/virtual/kvm/mmu.txt >> >> Signed-off-by: Xiao Guangrong >> --- >> Documentation/virtual/kvm/mmu.txt | 25 +

Re: [PATCH 6/7] KVM: MMU: document fast invalidate all pages

2013-06-19 Thread Xiao Guangrong
On 06/19/2013 08:25 PM, Paolo Bonzini wrote: > Il 19/06/2013 11:09, Xiao Guangrong ha scritto: >> Document it to Documentation/virtual/kvm/mmu.txt >> >> Signed-off-by: Xiao Guangrong >> --- >> Documentation/virtual/kvm/mmu.txt | 23 +++ &g

Re: [PATCH 5/7] KVM: MMU: document fast page fault in

2013-06-19 Thread Xiao Guangrong
On 06/19/2013 08:13 PM, Paolo Bonzini wrote: > Il 19/06/2013 11:09, Xiao Guangrong ha scritto: >> Document fast page fault to Documentation/virtual/kvm/mmu.txt >> >> Signed-off-by: Xiao Guangrong >> --- >> Documentation/virtual/kvm/mmu.txt | 3 +++ >> 1 f

Re: [PATCH 4/7] KVM: MMU: document mmio page fault

2013-06-19 Thread Xiao Guangrong
On 06/19/2013 08:10 PM, Paolo Bonzini wrote: > Il 19/06/2013 11:09, Xiao Guangrong ha scritto: >> Document it to Documentation/virtual/kvm/mmu.txt >> >> Signed-off-by: Xiao Guangrong >> --- >> Documentation/virtual/kvm/mmu.txt | 11 +-- >> 1 fil

Re: [PATCH 3/7] KVM: MMU: document write_flooding_count

2013-06-19 Thread Xiao Guangrong
On 06/19/2013 07:58 PM, Paolo Bonzini wrote: > Il 19/06/2013 11:09, Xiao Guangrong ha scritto: >> Document write_flooding_count to Documentation/virtual/kvm/mmu.txt >> >> Signed-off-by: Xiao Guangrong >> --- >> Documentation/virtual/kvm/mmu.txt | 8 &g

Re: [PATCH 2/7] KVM: MMU: document clear_spte_count

2013-06-19 Thread Xiao Guangrong
On 06/19/2013 07:40 PM, Paolo Bonzini wrote: > Il 19/06/2013 11:09, Xiao Guangrong ha scritto: >> Document it to Documentation/virtual/kvm/mmu.txt > > Edits inline, please ack. Good to me. Thank you very much for bearing my poor English. -- To unsubscribe from this list

Re: [PATCH 2/7] KVM: MMU: document clear_spte_count

2013-06-19 Thread Xiao Guangrong
On 06/19/2013 07:55 PM, Paolo Bonzini wrote: > Il 19/06/2013 13:53, Xiao Guangrong ha scritto: >> On 06/19/2013 07:32 PM, Paolo Bonzini wrote: >>> Il 19/06/2013 11:09, Xiao Guangrong ha scritto: >>>> Document it to Documentation/virtual/kvm/mmu.txt >>>

Re: [PATCH 2/7] KVM: MMU: document clear_spte_count

2013-06-19 Thread Xiao Guangrong
On 06/19/2013 07:32 PM, Paolo Bonzini wrote: > Il 19/06/2013 11:09, Xiao Guangrong ha scritto: >> Document it to Documentation/virtual/kvm/mmu.txt > > While reviewing the docs, I looked at the code. > > Why can't this happen? > > CPU 1: __get_s

Re: [PATCH v3 0/6] KVM: MMU: fast invalidate all mmio sptes

2013-06-19 Thread Xiao Guangrong
On 06/19/2013 07:08 PM, Paolo Bonzini wrote: > Il 10/06/2013 19:03, Gleb Natapov ha scritto: >> On Mon, Jun 10, 2013 at 10:43:52PM +0900, Takuya Yoshikawa wrote: >>> On Mon, 10 Jun 2013 16:39:37 +0800 >>> Xiao Guangrong wrote: >>> >>>> On 06/10/2013

[PATCH 2/7] KVM: MMU: document clear_spte_count

2013-06-19 Thread Xiao Guangrong
Document it to Documentation/virtual/kvm/mmu.txt Signed-off-by: Xiao Guangrong --- Documentation/virtual/kvm/mmu.txt | 4 arch/x86/include/asm/kvm_host.h | 5 + arch/x86/kvm/mmu.c| 7 --- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git

[PATCH 4/7] KVM: MMU: document mmio page fault

2013-06-19 Thread Xiao Guangrong
Document it to Documentation/virtual/kvm/mmu.txt Signed-off-by: Xiao Guangrong --- Documentation/virtual/kvm/mmu.txt | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Documentation/virtual/kvm/mmu.txt b/Documentation/virtual/kvm/mmu.txt index 5a6b2e2..4fb442b

[PATCH 5/7] KVM: MMU: document fast page fault in

2013-06-19 Thread Xiao Guangrong
Document fast page fault to Documentation/virtual/kvm/mmu.txt Signed-off-by: Xiao Guangrong --- Documentation/virtual/kvm/mmu.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/virtual/kvm/mmu.txt b/Documentation/virtual/kvm/mmu.txt index 4fb442b..b5ce7dd 100644

[PATCH 3/7] KVM: MMU: document write_flooding_count

2013-06-19 Thread Xiao Guangrong
Document write_flooding_count to Documentation/virtual/kvm/mmu.txt Signed-off-by: Xiao Guangrong --- Documentation/virtual/kvm/mmu.txt | 8 arch/x86/include/asm/kvm_host.h | 5 + 2 files changed, 13 insertions(+) diff --git a/Documentation/virtual/kvm/mmu.txt b/Documentation

[PATCH 1/7] KVM: MMU: update the documentation for reverse mapping of parent_pte

2013-06-19 Thread Xiao Guangrong
Update the document to match the current reverse mapping of parent_pte Signed-off-by: Xiao Guangrong --- Documentation/virtual/kvm/mmu.txt | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Documentation/virtual/kvm/mmu.txt b/Documentation/virtual/kvm/mmu.txt

[PATCH 0/7] KVM: MMU: update mmu documentation

2013-06-19 Thread Xiao Guangrong
As Paolo pointed out that this is the time to update the documentation, this patchest does it to let mmu.txt matches with the current mmu implementation Xiao Guangrong (7): KVM: MMU: update the documentation for reverse mapping of parent_pte KVM: MMU: document clear_spte_count KVM: MMU

[PATCH 7/7] KVM: MMU: document fast invalidate all mmio sptes

2013-06-19 Thread Xiao Guangrong
Document it to Documentation/virtual/kvm/mmu.txt Signed-off-by: Xiao Guangrong --- Documentation/virtual/kvm/mmu.txt | 25 + 1 file changed, 25 insertions(+) diff --git a/Documentation/virtual/kvm/mmu.txt b/Documentation/virtual/kvm/mmu.txt index f5c4de9..9b7cfb3

[PATCH 6/7] KVM: MMU: document fast invalidate all pages

2013-06-19 Thread Xiao Guangrong
Document it to Documentation/virtual/kvm/mmu.txt Signed-off-by: Xiao Guangrong --- Documentation/virtual/kvm/mmu.txt | 23 +++ arch/x86/include/asm/kvm_host.h | 5 + 2 files changed, 28 insertions(+) diff --git a/Documentation/virtual/kvm/mmu.txt b/Documentation

[PATCH 6/7] KVM: MMU: document fast invalidate all pages

2013-06-19 Thread Xiao Guangrong
Document it to Documentation/virtual/kvm/mmu.txt Signed-off-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com --- Documentation/virtual/kvm/mmu.txt | 23 +++ arch/x86/include/asm/kvm_host.h | 5 + 2 files changed, 28 insertions(+) diff --git a/Documentation/virtual

[PATCH 7/7] KVM: MMU: document fast invalidate all mmio sptes

2013-06-19 Thread Xiao Guangrong
Document it to Documentation/virtual/kvm/mmu.txt Signed-off-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com --- Documentation/virtual/kvm/mmu.txt | 25 + 1 file changed, 25 insertions(+) diff --git a/Documentation/virtual/kvm/mmu.txt b/Documentation/virtual/kvm

[PATCH 1/7] KVM: MMU: update the documentation for reverse mapping of parent_pte

2013-06-19 Thread Xiao Guangrong
Update the document to match the current reverse mapping of parent_pte Signed-off-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com --- Documentation/virtual/kvm/mmu.txt | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Documentation/virtual/kvm/mmu.txt b

[PATCH 0/7] KVM: MMU: update mmu documentation

2013-06-19 Thread Xiao Guangrong
As Paolo pointed out that this is the time to update the documentation, this patchest does it to let mmu.txt matches with the current mmu implementation Xiao Guangrong (7): KVM: MMU: update the documentation for reverse mapping of parent_pte KVM: MMU: document clear_spte_count KVM: MMU

[PATCH 4/7] KVM: MMU: document mmio page fault

2013-06-19 Thread Xiao Guangrong
Document it to Documentation/virtual/kvm/mmu.txt Signed-off-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com --- Documentation/virtual/kvm/mmu.txt | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Documentation/virtual/kvm/mmu.txt b/Documentation/virtual/kvm

[PATCH 5/7] KVM: MMU: document fast page fault in

2013-06-19 Thread Xiao Guangrong
Document fast page fault to Documentation/virtual/kvm/mmu.txt Signed-off-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com --- Documentation/virtual/kvm/mmu.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/virtual/kvm/mmu.txt b/Documentation/virtual/kvm/mmu.txt index

[PATCH 3/7] KVM: MMU: document write_flooding_count

2013-06-19 Thread Xiao Guangrong
Document write_flooding_count to Documentation/virtual/kvm/mmu.txt Signed-off-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com --- Documentation/virtual/kvm/mmu.txt | 8 arch/x86/include/asm/kvm_host.h | 5 + 2 files changed, 13 insertions(+) diff --git a/Documentation/virtual

[PATCH 2/7] KVM: MMU: document clear_spte_count

2013-06-19 Thread Xiao Guangrong
Document it to Documentation/virtual/kvm/mmu.txt Signed-off-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com --- Documentation/virtual/kvm/mmu.txt | 4 arch/x86/include/asm/kvm_host.h | 5 + arch/x86/kvm/mmu.c| 7 --- 3 files changed, 13 insertions(+), 3

Re: [PATCH v3 0/6] KVM: MMU: fast invalidate all mmio sptes

2013-06-19 Thread Xiao Guangrong
On 06/19/2013 07:08 PM, Paolo Bonzini wrote: Il 10/06/2013 19:03, Gleb Natapov ha scritto: On Mon, Jun 10, 2013 at 10:43:52PM +0900, Takuya Yoshikawa wrote: On Mon, 10 Jun 2013 16:39:37 +0800 Xiao Guangrong xiaoguangrong.e...@gmail.com wrote: On 06/10/2013 03:56 PM, Gleb Natapov wrote

Re: [PATCH 2/7] KVM: MMU: document clear_spte_count

2013-06-19 Thread Xiao Guangrong
On 06/19/2013 07:32 PM, Paolo Bonzini wrote: Il 19/06/2013 11:09, Xiao Guangrong ha scritto: Document it to Documentation/virtual/kvm/mmu.txt While reviewing the docs, I looked at the code. Why can't this happen? CPU 1: __get_spte_lockless CPU 2: __update_clear_spte_slow

Re: [PATCH 2/7] KVM: MMU: document clear_spte_count

2013-06-19 Thread Xiao Guangrong
On 06/19/2013 07:55 PM, Paolo Bonzini wrote: Il 19/06/2013 13:53, Xiao Guangrong ha scritto: On 06/19/2013 07:32 PM, Paolo Bonzini wrote: Il 19/06/2013 11:09, Xiao Guangrong ha scritto: Document it to Documentation/virtual/kvm/mmu.txt While reviewing the docs, I looked at the code. Why

Re: [PATCH 2/7] KVM: MMU: document clear_spte_count

2013-06-19 Thread Xiao Guangrong
On 06/19/2013 07:40 PM, Paolo Bonzini wrote: Il 19/06/2013 11:09, Xiao Guangrong ha scritto: Document it to Documentation/virtual/kvm/mmu.txt Edits inline, please ack. Good to me. Thank you very much for bearing my poor English. -- To unsubscribe from this list: send the line unsubscribe

Re: [PATCH 3/7] KVM: MMU: document write_flooding_count

2013-06-19 Thread Xiao Guangrong
On 06/19/2013 07:58 PM, Paolo Bonzini wrote: Il 19/06/2013 11:09, Xiao Guangrong ha scritto: Document write_flooding_count to Documentation/virtual/kvm/mmu.txt Signed-off-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com --- Documentation/virtual/kvm/mmu.txt | 8 arch/x86

Re: [PATCH 4/7] KVM: MMU: document mmio page fault

2013-06-19 Thread Xiao Guangrong
On 06/19/2013 08:10 PM, Paolo Bonzini wrote: Il 19/06/2013 11:09, Xiao Guangrong ha scritto: Document it to Documentation/virtual/kvm/mmu.txt Signed-off-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com --- Documentation/virtual/kvm/mmu.txt | 11 +-- 1 file changed, 9 insertions

Re: [PATCH 5/7] KVM: MMU: document fast page fault in

2013-06-19 Thread Xiao Guangrong
On 06/19/2013 08:13 PM, Paolo Bonzini wrote: Il 19/06/2013 11:09, Xiao Guangrong ha scritto: Document fast page fault to Documentation/virtual/kvm/mmu.txt Signed-off-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com --- Documentation/virtual/kvm/mmu.txt | 3 +++ 1 file changed, 3

Re: [PATCH 6/7] KVM: MMU: document fast invalidate all pages

2013-06-19 Thread Xiao Guangrong
On 06/19/2013 08:25 PM, Paolo Bonzini wrote: Il 19/06/2013 11:09, Xiao Guangrong ha scritto: Document it to Documentation/virtual/kvm/mmu.txt Signed-off-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com --- Documentation/virtual/kvm/mmu.txt | 23 +++ arch/x86/include

Re: [PATCH 7/7] KVM: MMU: document fast invalidate all mmio sptes

2013-06-19 Thread Xiao Guangrong
On 06/19/2013 08:35 PM, Paolo Bonzini wrote: Il 19/06/2013 11:09, Xiao Guangrong ha scritto: Document it to Documentation/virtual/kvm/mmu.txt Signed-off-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com --- Documentation/virtual/kvm/mmu.txt | 25 + 1 file changed

Re: [PATCH 2/7] KVM: MMU: document clear_spte_count

2013-06-19 Thread Xiao Guangrong
On 06/19/2013 08:41 PM, Paolo Bonzini wrote: Il 19/06/2013 14:25, Xiao Guangrong ha scritto: On 06/19/2013 07:55 PM, Paolo Bonzini wrote: Il 19/06/2013 13:53, Xiao Guangrong ha scritto: On 06/19/2013 07:32 PM, Paolo Bonzini wrote: Il 19/06/2013 11:09, Xiao Guangrong ha scritto: Document

Re: [PATCH v3 0/6] KVM: MMU: fast invalidate all mmio sptes

2013-06-18 Thread Xiao Guangrong
On 06/18/2013 10:26 PM, Paolo Bonzini wrote: > Il 07/06/2013 10:51, Xiao Guangrong ha scritto: >> Changelog: >> V3: >> All of these changes are from Gleb's review: >> 1) rename RET_MMIO_PF_EMU to RET_MMIO_PF_EMULATE. >> 2) smartly adjust kvm generation num

Re: [PATCH v3 0/6] KVM: MMU: fast invalidate all mmio sptes

2013-06-18 Thread Xiao Guangrong
On 06/18/2013 10:26 PM, Paolo Bonzini wrote: Il 07/06/2013 10:51, Xiao Guangrong ha scritto: Changelog: V3: All of these changes are from Gleb's review: 1) rename RET_MMIO_PF_EMU to RET_MMIO_PF_EMULATE. 2) smartly adjust kvm generation number in kvm_current_mmio_generatio

Re: linux-next: manual merge of the akpm tree with the kvm tree

2013-06-17 Thread Xiao Guangrong
Hi Stephen, Thanks for your work! On 06/17/2013 04:07 PM, Stephen Rothwell wrote: > - prepare_zap_oldest_mmu_page(kvm, _list); > + freed += prepare_zap_oldest_mmu_page(kvm, _list); It seems this change is not needed? and "freed" is not defined in mmu_shrink(). Right?

Re: [PATCH v3 0/6] KVM: MMU: fast invalidate all mmio sptes

2013-06-17 Thread Xiao Guangrong
Sorry for the delay reply since i was on vacation. On 06/15/2013 10:22 AM, Takuya Yoshikawa wrote: > On Thu, 13 Jun 2013 21:08:21 -0300 > Marcelo Tosatti wrote: > >> On Fri, Jun 07, 2013 at 04:51:22PM +0800, Xiao Guangrong wrote: > >> - Where is the generation number in

Re: [PATCH v3 0/6] KVM: MMU: fast invalidate all mmio sptes

2013-06-17 Thread Xiao Guangrong
Sorry for the delay reply since i was on vacation. On 06/15/2013 10:22 AM, Takuya Yoshikawa wrote: On Thu, 13 Jun 2013 21:08:21 -0300 Marcelo Tosatti mtosa...@redhat.com wrote: On Fri, Jun 07, 2013 at 04:51:22PM +0800, Xiao Guangrong wrote: - Where is the generation number increased

Re: linux-next: manual merge of the akpm tree with the kvm tree

2013-06-17 Thread Xiao Guangrong
Hi Stephen, Thanks for your work! On 06/17/2013 04:07 PM, Stephen Rothwell wrote: - prepare_zap_oldest_mmu_page(kvm, invalid_list); + freed += prepare_zap_oldest_mmu_page(kvm, invalid_list); It seems this change is not needed? and freed is not defined in mmu_shrink().

Re: [PATCH v3 3/6] KVM: MMU: make return value of mmio page fault handler more readable

2013-06-10 Thread Xiao Guangrong
On 06/10/2013 03:57 PM, Gleb Natapov wrote: > On Fri, Jun 07, 2013 at 04:51:25PM +0800, Xiao Guangrong wrote: >> Define some meaningful names instead of raw code >> >> Signed-off-by: Xiao Guangrong >> --- >> arch/x86/kvm/mmu.c | 15 +-

Re: [PATCH v3 0/6] KVM: MMU: fast invalidate all mmio sptes

2013-06-10 Thread Xiao Guangrong
On 06/10/2013 03:56 PM, Gleb Natapov wrote: > On Fri, Jun 07, 2013 at 04:51:22PM +0800, Xiao Guangrong wrote: >> Changelog: >> V3: >> All of these changes are from Gleb's review: >> 1) rename RET_MMIO_PF_EMU to RET_MMIO_PF_EMULATE. >> 2) sma

Re: [PATCH v3 0/6] KVM: MMU: fast invalidate all mmio sptes

2013-06-10 Thread Xiao Guangrong
On 06/10/2013 03:56 PM, Gleb Natapov wrote: On Fri, Jun 07, 2013 at 04:51:22PM +0800, Xiao Guangrong wrote: Changelog: V3: All of these changes are from Gleb's review: 1) rename RET_MMIO_PF_EMU to RET_MMIO_PF_EMULATE. 2) smartly adjust kvm generation number

Re: [PATCH v3 3/6] KVM: MMU: make return value of mmio page fault handler more readable

2013-06-10 Thread Xiao Guangrong
On 06/10/2013 03:57 PM, Gleb Natapov wrote: On Fri, Jun 07, 2013 at 04:51:25PM +0800, Xiao Guangrong wrote: Define some meaningful names instead of raw code Signed-off-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com --- arch/x86/kvm/mmu.c | 15 +-- arch/x86/kvm/mmu.h | 14

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-09 Thread Xiao Guangrong
On 06/09/2013 08:27 PM, Gleb Natapov wrote: > On Sun, Jun 09, 2013 at 08:17:19PM +0800, Xiao Guangrong wrote: >> On 06/09/2013 07:56 PM, Gleb Natapov wrote: >>> On Sun, Jun 09, 2013 at 07:44:03PM +0800, Xiao Guangrong wrote: >>>> On 06/09/2013 07:36 PM, Gleb Natap

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-09 Thread Xiao Guangrong
On 06/09/2013 07:56 PM, Gleb Natapov wrote: > On Sun, Jun 09, 2013 at 07:44:03PM +0800, Xiao Guangrong wrote: >> On 06/09/2013 07:36 PM, Gleb Natapov wrote: >>> On Sun, Jun 09, 2013 at 07:25:17PM +0800, Xiao Guangrong wrote: >>>> On 06/09/2013 06:19 PM, Gleb Natap

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-09 Thread Xiao Guangrong
On 06/09/2013 07:36 PM, Gleb Natapov wrote: > On Sun, Jun 09, 2013 at 07:25:17PM +0800, Xiao Guangrong wrote: >> On 06/09/2013 06:19 PM, Gleb Natapov wrote: >>> On Sun, Jun 09, 2013 at 06:01:45PM +0800, Xiao Guangrong wrote: >>>> On 06/09/2013 05:39 PM, Gleb Natap

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-09 Thread Xiao Guangrong
On 06/09/2013 06:19 PM, Gleb Natapov wrote: > On Sun, Jun 09, 2013 at 06:01:45PM +0800, Xiao Guangrong wrote: >> On 06/09/2013 05:39 PM, Gleb Natapov wrote: >>> On Sun, Jun 09, 2013 at 05:29:37PM +0800, Xiao Guangrong wrote: >>>> On 06/09/2013 04:45 PM, Gleb Natapov

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-09 Thread Xiao Guangrong
On 06/09/2013 05:39 PM, Gleb Natapov wrote: > On Sun, Jun 09, 2013 at 05:29:37PM +0800, Xiao Guangrong wrote: >> On 06/09/2013 04:45 PM, Gleb Natapov wrote: >> >>> +static int emulator_fix_hypercall(struct x86_emulate_ctxt *ctxt) >>> +{ >>> +

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-09 Thread Xiao Guangrong
On 06/09/2013 04:45 PM, Gleb Natapov wrote: > +static int emulator_fix_hypercall(struct x86_emulate_ctxt *ctxt) > +{ > + struct kvm_vcpu *vcpu = emul_to_vcpu(ctxt); > + return kvm_exec_with_stopped_vcpu(vcpu->kvm, > + emulator_fix_hypercall_cb, ctxt); > +} > + > + >

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-09 Thread Xiao Guangrong
On 06/09/2013 04:59 PM, Gleb Natapov wrote: > On Sun, Jun 09, 2013 at 04:56:42PM +0800, Xiao Guangrong wrote: >> On 06/09/2013 04:45 PM, Gleb Natapov wrote: >>> On Sat, Jun 08, 2013 at 11:15:37AM +0800, Xiao Guangrong wrote: >>>> From: Xiao Guangrong >>>&

Re: [PATCH v8 00/11] KVM: MMU: fast zap all shadow pages

2013-06-09 Thread Xiao Guangrong
On 06/09/2013 04:53 PM, Gleb Natapov wrote: > On Fri, May 31, 2013 at 08:36:19AM +0800, Xiao Guangrong wrote: >> Hi Gleb, Paolo, Marcelo, >> >> I have putted the potential controversial patches to the latter that are >> patch 8 ~ 10, patch 11 depends on patch 9. Other

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-09 Thread Xiao Guangrong
On 06/09/2013 04:45 PM, Gleb Natapov wrote: > On Sat, Jun 08, 2013 at 11:15:37AM +0800, Xiao Guangrong wrote: >> From: Xiao Guangrong >> >> Currently, memory synchronization is missed in emulator_fix_hypercall, >> please see the commit 758ccc89b83 >> (KVM:

<    6   7   8   9   10   11   12   13   14   15   >