Re: [PATCH] mmu_notifier, kvm: Introduce dirty bit tracking in spte and mmu notifier to help KSM dirty bit tracking

2011-06-22 Thread Izik Eidus
On 6/22/2011 3:21 AM, Chris Wright wrote: * Nai Xia (nai@gmail.com) wrote: Introduced kvm_mmu_notifier_test_and_clear_dirty(), kvm_mmu_notifier_dirty_update() and their mmu_notifier interfaces to support KSM dirty bit tracking, which brings significant performance gain in volatile pages

Re: [PATCH] mmu_notifier, kvm: Introduce dirty bit tracking in spte and mmu notifier to help KSM dirty bit tracking

2011-06-22 Thread Nai Xia
On Wednesday 22 June 2011 14:15:51 Izik Eidus wrote: On 6/22/2011 3:21 AM, Chris Wright wrote: * Nai Xia (nai@gmail.com) wrote: Introduced kvm_mmu_notifier_test_and_clear_dirty(), kvm_mmu_notifier_dirty_update() and their mmu_notifier interfaces to support KSM dirty bit tracking,

Re: restricting users to only power control of VMs

2011-06-22 Thread Avi Kivity
On 06/22/2011 12:45 AM, Iordan Iordanov wrote: It's a job for the management layer; I think it should be easy to script libvirt to do this. I read the documentation of libvirt, and out of the box, I don't see how this can be configured. So, I understand your reply as meaning that we need

Re: Time sync in KVM Guest

2011-06-22 Thread Dor Laor
On 06/22/2011 06:17 AM, Chaitra Gorantla wrote: Hi all, We are working on Fedora 15 Host. And the KVM is used to create Fedora 14 guest. The clock-source details are as below. Our Host supports constant_tsc. on HOST OS cat /sys/devices/system/clocksource/clocksource0/current_clocksource tsc

Re: [PATCH x86 kvm] Fix register corruption in pvclock_scale_delta

2011-06-22 Thread Ian Campbell
On Sun, 2011-06-19 at 15:44 +0300, Avi Kivity wrote: On 06/16/2011 06:50 AM, Zachary Amsden wrote: The 128-bit multiply in pvclock.h was missing an output constraint for EDX which caused a register corruption to appear. Was there any particular symptom associated with corruption at that

Re: [PATCH x86 kvm] Fix register corruption in pvclock_scale_delta

2011-06-22 Thread Avi Kivity
On 06/22/2011 12:35 PM, Ian Campbell wrote: On Sun, 2011-06-19 at 15:44 +0300, Avi Kivity wrote: On 06/16/2011 06:50 AM, Zachary Amsden wrote: The 128-bit multiply in pvclock.h was missing an output constraint for EDX which caused a register corruption to appear. Was there any

Re: [PATCH x86 kvm] Fix register corruption in pvclock_scale_delta

2011-06-22 Thread Avi Kivity
On 06/22/2011 12:35 PM, Ian Campbell wrote: On Sun, 2011-06-19 at 15:44 +0300, Avi Kivity wrote: On 06/16/2011 06:50 AM, Zachary Amsden wrote: The 128-bit multiply in pvclock.h was missing an output constraint for EDX which caused a register corruption to appear. Was there any

Re: [PATCH x86 kvm] Fix register corruption in pvclock_scale_delta

2011-06-22 Thread Ian Campbell
On Wed, 2011-06-22 at 10:40 +0100, Avi Kivity wrote: On 06/22/2011 12:35 PM, Ian Campbell wrote: On Sun, 2011-06-19 at 15:44 +0300, Avi Kivity wrote: On 06/16/2011 06:50 AM, Zachary Amsden wrote: The 128-bit multiply in pvclock.h was missing an output constraint for EDX which

Re: [PATCH] mmu_notifier, kvm: Introduce dirty bit tracking in spte and mmu notifier to help KSM dirty bit tracking

2011-06-22 Thread Avi Kivity
On 06/21/2011 04:32 PM, Nai Xia wrote: Introduced kvm_mmu_notifier_test_and_clear_dirty(), kvm_mmu_notifier_dirty_update() and their mmu_notifier interfaces to support KSM dirty bit tracking, which brings significant performance gain in volatile pages scanning in KSM. Currently,

Re: [PATCH] mmu_notifier, kvm: Introduce dirty bit tracking in spte and mmu notifier to help KSM dirty bit tracking

2011-06-22 Thread Izik Eidus
On 6/22/2011 1:43 PM, Avi Kivity wrote: On 06/21/2011 04:32 PM, Nai Xia wrote: Introduced kvm_mmu_notifier_test_and_clear_dirty(), kvm_mmu_notifier_dirty_update() and their mmu_notifier interfaces to support KSM dirty bit tracking, which brings significant performance gain in volatile pages

Re: [PATCH] mmu_notifier, kvm: Introduce dirty bit tracking in spte and mmu notifier to help KSM dirty bit tracking

2011-06-22 Thread Avi Kivity
On 06/22/2011 02:05 PM, Izik Eidus wrote: +spte = rmap_next(kvm, rmapp, NULL); +while (spte) { +int _dirty; +u64 _spte = *spte; +BUG_ON(!(_spte PT_PRESENT_MASK)); +_dirty = _spte PT_DIRTY_MASK; +if (_dirty) { +dirty = 1; +

Re: [PATCH] mmu_notifier, kvm: Introduce dirty bit tracking in spte and mmu notifier to help KSM dirty bit tracking

2011-06-22 Thread Izik Eidus
On 6/22/2011 2:10 PM, Avi Kivity wrote: On 06/22/2011 02:05 PM, Izik Eidus wrote: +spte = rmap_next(kvm, rmapp, NULL); +while (spte) { +int _dirty; +u64 _spte = *spte; +BUG_ON(!(_spte PT_PRESENT_MASK)); +_dirty = _spte PT_DIRTY_MASK; +if

Re: [PATCH] mmu_notifier, kvm: Introduce dirty bit tracking in spte and mmu notifier to help KSM dirty bit tracking

2011-06-22 Thread Avi Kivity
On 06/22/2011 02:19 PM, Izik Eidus wrote: On 6/22/2011 2:10 PM, Avi Kivity wrote: On 06/22/2011 02:05 PM, Izik Eidus wrote: +spte = rmap_next(kvm, rmapp, NULL); +while (spte) { +int _dirty; +u64 _spte = *spte; +BUG_ON(!(_spte PT_PRESENT_MASK)); +_dirty

Re: [PATCH] mmu_notifier, kvm: Introduce dirty bit tracking in spte and mmu notifier to help KSM dirty bit tracking

2011-06-22 Thread Avi Kivity
On 06/22/2011 02:24 PM, Avi Kivity wrote: On 06/22/2011 02:19 PM, Izik Eidus wrote: On 6/22/2011 2:10 PM, Avi Kivity wrote: On 06/22/2011 02:05 PM, Izik Eidus wrote: +spte = rmap_next(kvm, rmapp, NULL); +while (spte) { +int _dirty; +u64 _spte = *spte; +

Re: [PATCH] mmu_notifier, kvm: Introduce dirty bit tracking in spte and mmu notifier to help KSM dirty bit tracking

2011-06-22 Thread Avi Kivity
On 06/22/2011 02:28 PM, Avi Kivity wrote: Actually, this is dangerous. If we use the dirty bit for other things, we will get data corruption. For example we might want to map clean host pages as writeable-clean in the spte on a read fault so that we don't get a page fault when they get

Re: [PATCH] mmu_notifier, kvm: Introduce dirty bit tracking in spte and mmu notifier to help KSM dirty bit tracking

2011-06-22 Thread Nai Xia
On Wednesday 22 June 2011 19:28:08 Avi Kivity wrote: On 06/22/2011 02:24 PM, Avi Kivity wrote: On 06/22/2011 02:19 PM, Izik Eidus wrote: On 6/22/2011 2:10 PM, Avi Kivity wrote: On 06/22/2011 02:05 PM, Izik Eidus wrote: +spte = rmap_next(kvm, rmapp, NULL); +while (spte) { +

Re: [PATCH] mmu_notifier, kvm: Introduce dirty bit tracking in spte and mmu notifier to help KSM dirty bit tracking

2011-06-22 Thread Izik Eidus
On 6/22/2011 2:33 PM, Nai Xia wrote: On Wednesday 22 June 2011 19:28:08 Avi Kivity wrote: On 06/22/2011 02:24 PM, Avi Kivity wrote: On 06/22/2011 02:19 PM, Izik Eidus wrote: On 6/22/2011 2:10 PM, Avi Kivity wrote: On 06/22/2011 02:05 PM, Izik Eidus wrote: +spte = rmap_next(kvm, rmapp,

collect some information when qemu-kvm exit

2011-06-22 Thread lidong chen
I find qemu-kvm only output a little information when abnormally exit. For example, if qemu-kvm exit by segmentation fault, there are no information in /var/log/libvirt/qemu/xx.log. so i want to solve this by collect some information when qemu-kvm exit. my idea is register some signal handler,

Re: [Qemu-devel] [PATCH 00/15] [PULL] qemu-kvm.git uq/master queue

2011-06-22 Thread Anthony Liguori
On 06/21/2011 12:07 PM, Marcelo Tosatti wrote: The following changes since commit eb47d7c5d96060040931c42773ee07e61e547af9: hw/9118.c: Implement active-low interrupt support (2011-06-15 13:23:37 +0200) are available in the git repository at:

[PATCH v2 01/22] KVM: MMU: fix walking shadow page table

2011-06-22 Thread Xiao Guangrong
Properly check the last mapping, and do not walk to the next level if last spte is met Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/mmu.c |9 + 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index

[PATCH v2 02/22] KVM: MMU: do not update slot bitmap if spte is nonpresent

2011-06-22 Thread Xiao Guangrong
Set slot bitmap only if the spte is present Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/mmu.c | 15 +++ 1 files changed, 7 insertions(+), 8 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index f474e93..8316c2d 100644 ---

[PATCH v2 03/22] KVM: x86: fix broken read emulation spans a page boundary

2011-06-22 Thread Xiao Guangrong
If the range spans a boundary, the mmio access can be broke, fix it as write emulation. And we already get the guest physical address, so use it to read guest data directly to avoid walking guest page table again Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/x86.c

[PATCH v2 04/22] KVM: x86: introduce vcpu_gva_to_gpa to cleanup the code

2011-06-22 Thread Xiao Guangrong
Introduce vcpu_gva_to_gpa to translate the gva to gpa, we can use it to cleanup the code between read emulation and write emulation Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/x86.c | 38 +- 1 files changed, 29 insertions(+),

[PATCH v2 05/22] KVM: x86: abstract the operation for read/write emulation

2011-06-22 Thread Xiao Guangrong
The operations of read emulation and write emulation are very similar, so we can abstract the operation of them, in larter patch, it is used to cleanup the same code Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/x86.c | 72

[PATCH v2 06/22] KVM: x86: cleanup the code of read/write emulation

2011-06-22 Thread Xiao Guangrong
Using the read/write operation to remove the same code Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/x86.c | 149 --- 1 files changed, 47 insertions(+), 102 deletions(-) diff --git a/arch/x86/kvm/x86.c

[PATCH v2 07/22] KVM: MMU: cache mmio info on page fault path

2011-06-22 Thread Xiao Guangrong
If the page fault is caused by mmio, we can cache the mmio info, later, we do not need to walk guest page table and quickly know it is a mmio fault while we emulate the mmio instruction Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/include/asm/kvm_host.h |5 +

[PATCH v2 08/22] KVM: MMU: optimize to handle dirty bit

2011-06-22 Thread Xiao Guangrong
If dirty bit is not set, we can make the pte access read-only to avoid handing dirty bit everywhere Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/mmu.c | 13 +-- arch/x86/kvm/paging_tmpl.h | 46 ++- 2 files

[PATCH v2 09/22] KVM: MMU: cleanup for FNAME(fetch)

2011-06-22 Thread Xiao Guangrong
gw-pte_access is the final access permission, since it is unified with gw-pt_access when we walked guest page table: FNAME(walk_addr_generic): pte_access = pt_access FNAME(gpte_access)(vcpu, pte, true); Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com ---

[PATCH v2 10/22] KVM: MMU: rename 'pt_write' to 'emulate'

2011-06-22 Thread Xiao Guangrong
If 'pt_write' is true, we need to emulate the fault. And in later patch, we need to emulate the fault even though it is not a pt_write event, so rename it to better fit the meaning Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/mmu.c | 10 +-

[PATCH v2 11/22] KVM: MMU: count used shadow pages on prepareing path

2011-06-22 Thread Xiao Guangrong
Move counting used shadow pages from commiting path to preparing path to reduce tlb flush on some paths Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/mmu.c | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/x86/kvm/mmu.c

[PATCH v2 13/22] KVM: MMU: remove bypass_guest_pf

2011-06-22 Thread Xiao Guangrong
The idea is from Avi: | Maybe it's time to kill off bypass_guest_pf=1. It's not as effective as | it used to be, since unsync pages always use shadow_trap_nonpresent_pte, | and since we convert between the two nonpresent_ptes during sync and unsync. Signed-off-by: Xiao Guangrong

[PATCH v2 14/22] KVM: MMU: filter out the mmio pfn from the fault pfn

2011-06-22 Thread Xiao Guangrong
If the page fault is caused by mmio, the gfn can not be found in memslots, and 'bad_pfn' is returned on gfn_to_hva path, so we can use 'bad_pfn' to identify the mmio page fault. And, to clarify the meaning of mmio pfn, we return fault page instead of bad page when the gfn is not allowd to prefetch

[PATCH v2 15/22] KVM: MMU: abstract some functions to handle fault pfn

2011-06-22 Thread Xiao Guangrong
Introduce handle_abnormal_pfn to handle fault pfn on page fault path, introduce mmu_invalid_pfn to handle fault pfn on prefetch path It is the preparing work for mmio page fault support Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/mmu.c | 47

[PATCH v2 16/22] KVM: MMU: introduce the rules to modify shadow page table

2011-06-22 Thread Xiao Guangrong
Introduce some interfaces to modify spte as linux kernel does: - mmu_spte_clear_track_bits, it set the spte from present to nonpresent, and track the stat bits(accessed/dirty) of spte - mmu_spte_clear_no_track, the same as mmu_spte_clear_track_bits except tracking the stat bits - mmu_spte_set,

[PATCH v2 17/22] KVM: MMU: clean up spte updating and clearing

2011-06-22 Thread Xiao Guangrong
Clean up the code between mmu_spte_clear_* and mmu_spte_update Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/mmu.c | 75 +++- 1 files changed, 39 insertions(+), 36 deletions(-) diff --git a/arch/x86/kvm/mmu.c

[PATCH 18/22] KVM: MMU: do not need atomicly to set/clear spte

2011-06-22 Thread Xiao Guangrong
Now, the spte is just from nonprsent to present or present to nonprsent, so we can use some trick to set/clear spte non-atomicly as linux kernel does Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/mmu.c | 82 +++ 1

[PATCH v2 19/22] KVM: MMU: lockless walking shadow page table

2011-06-22 Thread Xiao Guangrong
Use rcu to protect shadow pages table to be freed, so we can safely walk it, it should run fastly and is needed by mmio page fault Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/include/asm/kvm_host.h |8 +++ arch/x86/kvm/mmu.c | 132

[PATCH v2 20/22] KVM: MMU: reorganize struct kvm_shadow_walk_iterator

2011-06-22 Thread Xiao Guangrong
Reorganize it for good using the cache Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/mmu.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index dad7ad9..1319050 100644 --- a/arch/x86/kvm/mmu.c +++

[PATCH v2 21/22] KVM: MMU: mmio page fault support

2011-06-22 Thread Xiao Guangrong
The idea is from Avi: | We could cache the result of a miss in an spte by using a reserved bit, and | checking the page fault error code (or seeing if we get an ept violation or | ept misconfiguration), so if we get repeated mmio on a page, we don't need to | search the slot list/tree. |

[PATCH v2 22/22] KVM: MMU: trace mmio page fault

2011-06-22 Thread Xiao Guangrong
Add tracepoints to trace mmio page fault Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/mmu.c |5 arch/x86/kvm/mmutrace.h | 48 +++ arch/x86/kvm/trace.h| 23 ++ arch/x86/kvm/x86.c

Re: [PATCH] mmu_notifier, kvm: Introduce dirty bit tracking in spte and mmu notifier to help KSM dirty bit tracking

2011-06-22 Thread Andrea Arcangeli
On Tue, Jun 21, 2011 at 09:32:39PM +0800, Nai Xia wrote: diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index d48ec60..b407a69 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -4674,6 +4674,7 @@ static int __init vmx_init(void) kvm_mmu_set_mask_ptes(0ull, 0ull,

Re: [PATCH] mmu_notifier, kvm: Introduce dirty bit tracking in spte and mmu notifier to help KSM dirty bit tracking

2011-06-22 Thread Izik Eidus
If we don't flush the smp tlb don't we risk that we'll insert pages in the unstable tree that are volatile just because the dirty bit didn't get set again on the spte? Yes, this is the trade off we take, the unstable tree will be flushed anyway - so this is nothing that won`t be recovered

Re: [PATCH] mmu_notifier, kvm: Introduce dirty bit tracking in spte and mmu notifier to help KSM dirty bit tracking

2011-06-22 Thread Rik van Riel
On 06/22/2011 07:19 AM, Izik Eidus wrote: So what we say here is: it is better to have little junk in the unstable tree that get flushed eventualy anyway, instead of make the guest slower this race is something that does not reflect accurate of ksm anyway due to the full memcmp that we will

Re: [PATCH] mmu_notifier, kvm: Introduce dirty bit tracking in spte and mmu notifier to help KSM dirty bit tracking

2011-06-22 Thread Chris Wright
* Izik Eidus (izik.ei...@ravellosystems.com) wrote: On 6/22/2011 3:21 AM, Chris Wright wrote: * Nai Xia (nai@gmail.com) wrote: + if (!shadow_dirty_mask) { + WARN(1, KVM: do NOT try to test dirty bit in EPT\n); + goto out; + } This should never fire with the

Re: [PATCH v3 1/3] KVM: MMU: Clean up the error handling of walk_addr_generic()

2011-06-22 Thread Marcelo Tosatti
On Mon, Jun 20, 2011 at 11:29:47PM +0900, Takuya Yoshikawa wrote: From: Takuya Yoshikawa yoshikawa.tak...@oss.ntt.co.jp Avoid two step jump to the error handling part. This eliminates the use of the variables present and rsvd_fault. We also use the const type qualifier to show that

Re: [PATCH] mmu_notifier, kvm: Introduce dirty bit tracking in spte and mmu notifier to help KSM dirty bit tracking

2011-06-22 Thread Andrea Arcangeli
On Wed, Jun 22, 2011 at 11:39:40AM -0400, Rik van Riel wrote: On 06/22/2011 07:19 AM, Izik Eidus wrote: So what we say here is: it is better to have little junk in the unstable tree that get flushed eventualy anyway, instead of make the guest slower this race is something that does

Re: [PATCH v3 1/3] KVM: MMU: Clean up the error handling of walk_addr_generic()

2011-06-22 Thread Avi Kivity
On 06/22/2011 07:46 PM, Marcelo Tosatti wrote: if (unlikely(!is_present_gpte(pte))) { - present = false; - break; + errcode |= PFERR_PRESENT_MASK; + goto error; } Assignment of PFERR_PRESENT_MASK is

Re: [PATCH v2 01/22] KVM: MMU: fix walking shadow page table

2011-06-22 Thread Marcelo Tosatti
On Wed, Jun 22, 2011 at 10:28:04PM +0800, Xiao Guangrong wrote: Properly check the last mapping, and do not walk to the next level if last spte is met Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/mmu.c |9 + 1 files changed, 5 insertions(+), 4

Re: [Qemu-devel] [PATCH 03/12] Switch build system to accompanied kernel headers

2011-06-22 Thread Stefan Weil
Am 08.06.2011 16:10, schrieb Jan Kiszka: This helps reducing our build-time checks for feature support in the available Linux kernel headers. And it helps users that do not have sufficiently recent headers installed on their build machine. Consequently, the patch removes and build-time checks

Re: [PATCH 03/12] Switch build system to accompanied kernel headers

2011-06-22 Thread Jan Kiszka
On 2011-06-22 22:51, Stefan Weil wrote: Am 08.06.2011 16:10, schrieb Jan Kiszka: This helps reducing our build-time checks for feature support in the available Linux kernel headers. And it helps users that do not have sufficiently recent headers installed on their build machine.

[PATCH] KVM test: get_started.py: Remove confusing question

2011-06-22 Thread Lucas Meneghel Rodrigues
After receiving some feedback on get_started.py, resolved to remove a question regarding NFS shares. Since the script prints the directories clearly, if one wants to setup NFS or symlinks, he/she will do it. Signed-off-by: Lucas Meneghel Rodrigues l...@redhat.com ---

Re: [PATCH v2 21/22] KVM: MMU: mmio page fault support

2011-06-22 Thread Marcelo Tosatti
Xiao, On Wed, Jun 22, 2011 at 10:36:16PM +0800, Xiao Guangrong wrote: The idea is from Avi: | We could cache the result of a miss in an spte by using a reserved bit, and | checking the page fault error code (or seeing if we get an ept violation or | ept misconfiguration), so if we get

Re: [PATCH] mmu_notifier, kvm: Introduce dirty bit tracking in spte and mmu notifier to help KSM dirty bit tracking

2011-06-22 Thread Nai Xia
On Wed, Jun 22, 2011 at 11:39 PM, Rik van Riel r...@redhat.com wrote: On 06/22/2011 07:19 AM, Izik Eidus wrote: So what we say here is: it is better to have little junk in the unstable tree that get flushed eventualy anyway, instead of make the guest slower this race is something that

Re: [PATCH] mmu_notifier, kvm: Introduce dirty bit tracking in spte and mmu notifier to help KSM dirty bit tracking

2011-06-22 Thread Nai Xia
On Wed, Jun 22, 2011 at 11:03 PM, Andrea Arcangeli aarca...@redhat.com wrote: On Tue, Jun 21, 2011 at 09:32:39PM +0800, Nai Xia wrote: diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index d48ec60..b407a69 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -4674,6 +4674,7 @@

Re: [PATCH] mmu_notifier, kvm: Introduce dirty bit tracking in spte and mmu notifier to help KSM dirty bit tracking

2011-06-22 Thread Andrea Arcangeli
On Thu, Jun 23, 2011 at 07:13:54AM +0800, Nai Xia wrote: I agree on this point. Dirty bit , young bit, is by no means accurate. Even on 4kB pages, there is always a chance that the pte are dirty but the contents are actually the same. Yeah, the whole optimization contains trade-offs and Just a

Re: [PATCH] mmu_notifier, kvm: Introduce dirty bit tracking in spte and mmu notifier to help KSM dirty bit tracking

2011-06-22 Thread Rik van Riel
On 06/22/2011 07:13 PM, Nai Xia wrote: On Wed, Jun 22, 2011 at 11:39 PM, Rik van Rielr...@redhat.com wrote: On 06/22/2011 07:19 AM, Izik Eidus wrote: So what we say here is: it is better to have little junk in the unstable tree that get flushed eventualy anyway, instead of make the guest

Re: [PATCH] mmu_notifier, kvm: Introduce dirty bit tracking in spte and mmu notifier to help KSM dirty bit tracking

2011-06-22 Thread Nai Xia
On Thu, Jun 23, 2011 at 12:55 AM, Andrea Arcangeli aarca...@redhat.com wrote: On Wed, Jun 22, 2011 at 11:39:40AM -0400, Rik van Riel wrote: On 06/22/2011 07:19 AM, Izik Eidus wrote: So what we say here is: it is better to have little junk in the unstable tree that get flushed eventualy

Re: [PATCH] mmu_notifier, kvm: Introduce dirty bit tracking in spte and mmu notifier to help KSM dirty bit tracking

2011-06-22 Thread Nai Xia
On Wed, Jun 22, 2011 at 11:03 PM, Andrea Arcangeli aarca...@redhat.com wrote: On Tue, Jun 21, 2011 at 09:32:39PM +0800, Nai Xia wrote: diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index d48ec60..b407a69 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -4674,6 +4674,7 @@

Re: [PATCH] mmu_notifier, kvm: Introduce dirty bit tracking in spte and mmu notifier to help KSM dirty bit tracking

2011-06-22 Thread Andrea Arcangeli
On Thu, Jun 23, 2011 at 07:19:06AM +0800, Nai Xia wrote: OK, I'll have a try over other workarounds. I am not feeling good about need_pte_unmap myself. :-) The usual way is to check VM_HUGETLB in the caller and to call another function that doesn't kmap. Casting pmd_t to pte_t isn't really nice

Re: [PATCH] mmu_notifier, kvm: Introduce dirty bit tracking in spte and mmu notifier to help KSM dirty bit tracking

2011-06-22 Thread Andrea Arcangeli
On Thu, Jun 23, 2011 at 07:37:47AM +0800, Nai Xia wrote: On 2MB pages, I'd like to remind you and Rik that ksmd currently splits huge pages before their sub pages gets really merged to stable tree. So when there are many 2MB pages each having a 4kB subpage changed for all time, this is already

Re: [PATCH] mmu_notifier, kvm: Introduce dirty bit tracking in spte and mmu notifier to help KSM dirty bit tracking

2011-06-22 Thread Rik van Riel
On 06/22/2011 07:37 PM, Nai Xia wrote: On 2MB pages, I'd like to remind you and Rik that ksmd currently splits huge pages before their sub pages gets really merged to stable tree. Your proposal appears to add a condition that causes ksmd to skip doing that, which can cause the system to start

Re: [PATCH] mmu_notifier, kvm: Introduce dirty bit tracking in spte and mmu notifier to help KSM dirty bit tracking

2011-06-22 Thread Nai Xia
On Thu, Jun 23, 2011 at 7:44 AM, Andrea Arcangeli aarca...@redhat.com wrote: On Thu, Jun 23, 2011 at 07:19:06AM +0800, Nai Xia wrote: OK, I'll have a try over other workarounds. I am not feeling good about need_pte_unmap myself. :-) The usual way is to check VM_HUGETLB in the caller and to

Re: [PATCH] mmu_notifier, kvm: Introduce dirty bit tracking in spte and mmu notifier to help KSM dirty bit tracking

2011-06-22 Thread Nai Xia
On Thu, Jun 23, 2011 at 7:59 AM, Andrea Arcangeli aarca...@redhat.com wrote: On Thu, Jun 23, 2011 at 07:37:47AM +0800, Nai Xia wrote: On 2MB pages, I'd like to remind you and Rik that ksmd currently splits huge pages before their sub pages gets really merged to stable tree. So when there are

Re: [PATCH] mmu_notifier, kvm: Introduce dirty bit tracking in spte and mmu notifier to help KSM dirty bit tracking

2011-06-22 Thread Nai Xia
On Thu, Jun 23, 2011 at 8:00 AM, Rik van Riel r...@redhat.com wrote: On 06/22/2011 07:37 PM, Nai Xia wrote: On 2MB pages, I'd like to remind you and Rik that ksmd currently splits huge pages before their sub pages gets really merged to stable tree. Your proposal appears to add a condition

Re: [PATCH] mmu_notifier, kvm: Introduce dirty bit tracking in spte and mmu notifier to help KSM dirty bit tracking

2011-06-22 Thread Andrea Arcangeli
On Thu, Jun 23, 2011 at 08:31:56AM +0800, Nai Xia wrote: On Thu, Jun 23, 2011 at 7:59 AM, Andrea Arcangeli aarca...@redhat.com wrote: On Thu, Jun 23, 2011 at 07:37:47AM +0800, Nai Xia wrote: On 2MB pages, I'd like to remind you and Rik that ksmd currently splits huge pages before their sub

Re: [PATCH] mmu_notifier, kvm: Introduce dirty bit tracking in spte and mmu notifier to help KSM dirty bit tracking

2011-06-22 Thread Nai Xia
On Thu, Jun 23, 2011 at 7:28 AM, Rik van Riel r...@redhat.com wrote: On 06/22/2011 07:13 PM, Nai Xia wrote: On Wed, Jun 22, 2011 at 11:39 PM, Rik van Rielr...@redhat.com  wrote: On 06/22/2011 07:19 AM, Izik Eidus wrote: So what we say here is: it is better to have little junk in the

Re: [PATCH] mmu_notifier, kvm: Introduce dirty bit tracking in spte and mmu notifier to help KSM dirty bit tracking

2011-06-22 Thread Nai Xia
On Thu, Jun 23, 2011 at 7:25 AM, Andrea Arcangeli aarca...@redhat.com wrote: On Thu, Jun 23, 2011 at 07:13:54AM +0800, Nai Xia wrote: I agree on this point. Dirty bit , young bit, is by no means accurate. Even on 4kB pages, there is always a chance that the pte are dirty but the contents are

Re: [PATCH] mmu_notifier, kvm: Introduce dirty bit tracking in spte and mmu notifier to help KSM dirty bit tracking

2011-06-22 Thread Nai Xia
On Thu, Jun 23, 2011 at 8:44 AM, Andrea Arcangeli aarca...@redhat.com wrote: On Thu, Jun 23, 2011 at 08:31:56AM +0800, Nai Xia wrote: On Thu, Jun 23, 2011 at 7:59 AM, Andrea Arcangeli aarca...@redhat.com wrote: On Thu, Jun 23, 2011 at 07:37:47AM +0800, Nai Xia wrote: On 2MB pages, I'd like

Re: [PATCH v2 01/22] KVM: MMU: fix walking shadow page table

2011-06-22 Thread Xiao Guangrong
On 06/23/2011 01:13 AM, Marcelo Tosatti wrote: On Wed, Jun 22, 2011 at 10:28:04PM +0800, Xiao Guangrong wrote: Properly check the last mapping, and do not walk to the next level if last spte is met Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/mmu.c |9

Re: [PATCH v2 21/22] KVM: MMU: mmio page fault support

2011-06-22 Thread Xiao Guangrong
Marcelo, Thanks for your review! On 06/23/2011 05:59 AM, Marcelo Tosatti wrote: static int is_large_pte(u64 pte) @@ -2123,6 +2158,9 @@ static int set_spte(struct kvm_vcpu *vcpu, u64 *sptep, u64 spte, entry = *sptep; int ret = 0; +if (set_mmio_spte(sptep, gfn, pfn,

Re: [PATCH 03/12] Switch build system to accompanied kernel headers

2011-06-22 Thread Stefan Weil
Am 22.06.2011 23:37, schrieb Jan Kiszka: On 2011-06-22 22:51, Stefan Weil wrote: If not, kvm=yes should be restricted to platforms with kvm support. Otherwise, QEMU builds will fail very early: ERROR: Host kernel lacks signalfd() support, but KVM depends on it when the IO thread is disabled.

Re: virtio_net sometimes didn't work

2011-06-22 Thread lidong chen
I find this problem have already solved by this patch:) Subject: [PATCH] [virtio] Replace virtio-net with native gPXE driver http://git.etherboot.org/gpxe.git/commitdiff/180dcf4363bf1d8889a2398a4944e94ca150b311 2011/2/16 Michael S. Tsirkin m...@redhat.com: On Wed, Feb 16, 2011 at 04:00:15PM