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 nee

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 o

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 par

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 par

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

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, kvm_mmu_notifie

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 sc

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 (_dirt

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; +BUG_ON(!(

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 eve

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); > >> +

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, NU

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, an

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: git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.

[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 --- 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 9c629b5..f474e93 100644 --- a

[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 --- 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 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kv

[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 --- arch/x86/kvm/x86.c | 41 ++

[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 --- arch/x86/kvm/x86.c | 38 +- 1 files changed, 29 insertions(+), 9 deletions(-) diff --git a/

[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 --- arch/x86/kvm/x86.c | 72 1 files changed,

[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 --- arch/x86/kvm/x86.c | 149 --- 1 files changed, 47 insertions(+), 102 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 887714f..baa5a11

[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 --- arch/x86/include/asm/kvm_host.h |5 + arch/x86/kvm/mmu.c

[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 --- arch/x86/kvm/mmu.c | 13 +-- arch/x86/kvm/paging_tmpl.h | 46 ++- 2 files changed, 25 insertions(+), 3

[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 --- arch/x86/kvm/paging_tmpl.h |4 ++-- 1 file

[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 --- arch/x86/kvm/mmu.c | 10 +- arch/x86/kvm/paging_tmpl.h | 16 +

[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 --- arch/x86/kvm/mmu.c | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 580ecf0..82

[PATCH v2 12/22] KVM: MMU: split kvm_mmu_free_page

2011-06-22 Thread Xiao Guangrong
Split kvm_mmu_free_page to kvm_mmu_isolate_page and kvm_mmu_free_page One is used to remove the page from cache under mmu lock and the other is used to free page table out of mmu lock Signed-off-by: Xiao Guangrong --- arch/x86/kvm/mmu.c | 21 ++--- 1 files changed, 18 insertio

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

[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 --- 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 --- arch/x86/kvm/mmu.c | 75 +++- 1 files changed, 39 insertions(+), 36 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 5ceb64a.

[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 --- arch/x86/kvm/mmu.c | 82 +++ 1 files changed, 69 insertions(+)

[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 --- arch/x86/include/asm/kvm_host.h |8 +++ arch/x86/kvm/mmu.c | 132 --- 2 files

[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 --- 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 +++ b/arch/x86/kvm/mmu.c @@ -172,8

[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. | (https://

[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 --- arch/x86/kvm/mmu.c |5 arch/x86/kvm/mmutrace.h | 48 +++ arch/x86/kvm/trace.h| 23 ++ arch/x86/kvm/x86.c |5 +++- 4 files chan

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,

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 ve

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 f

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 > > 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 write/user/fetch_fault > do not

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 t

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_MAS

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 > --- > arch/x86/kvm/mmu.c |9 + > 1 files changed, 5 insertions(+), 4 deletions(-) > > dif

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 fo

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. >> >> Co

[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 --- client/tests/kvm/get_started.py |7 -

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

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 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 @@ static int

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

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

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 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 anyway, inste

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 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 @@ static int

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 nic

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 alre

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 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 call another >

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 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 many 2MB 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 Thu, Jun 23, 2011 at 8:00 AM, Rik van Riel 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 that cause

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

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 wrote: > On 06/22/2011 07:13 PM, Nai Xia wrote: >> >> On Wed, Jun 22, 2011 at 11:39 PM, 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 t

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 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 actually t

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

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 >> --- >> arch/x86/kvm/mmu.c |9 + >> 1

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, p

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 : > On Wed, Feb 16, 2011 at 04:00:15PM +0800, lidong chen

[PATCH] kVM Test: physical_resources_check: Update case and fix error

2011-06-22 Thread Qingtang Zhou
- update this case, make it easy to get failure from result. - fix some error in log message. - close session before exception raised. - update code style. Signed-off-by: Qingtang Zhou --- client/tests/kvm/tests/physical_resources_check.py | 178 +++- 1 files changed, 96 inserti

RE: Time sync in KVM Guest

2011-06-22 Thread Chaitra Gorantla
Thanks for the information. Is there any way to calculate the delta between host and the guest? 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 s

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

2011-06-22 Thread Xiao Guangrong
On 06/23/2011 11:19 AM, Xiao Guangrong wrote: >> Otherwise you can move the mmio info from an mmio spte back to >> mmio_gva/mmio_gfn after a TLB flush, without rereading the guest >> pagetable. >> > > We do not read the guest page table when mmio page fault occurred, > we just do it as you say: >