Re: [kvm-devel] [RFC 7/8]KVM: swap out guest pages

2007-07-25 Thread Shaohua Li
2007/7/24, Avi Kivity [EMAIL PROTECTED]: Shaohua Li wrote: Make KVM guest pages be allocated dynamically and able to be swaped out. One issue: all inodes returned from anon_inode_getfd are shared, if one module changes field of the inode, other moduels might break. Should we introduce

Re: [kvm-devel] [RFC 4/8]KVM: move gfn_to_page out of kmap/unmap pars

2007-07-24 Thread Shaohua Li
2007/7/24, Avi Kivity [EMAIL PROTECTED]: Shaohua Li wrote: gfn_to_page might sleep with swap support. Move it out of the kmap calls. I'd like to apply this to the kvm.git master branch so we don't have to maintain it. Was this tested on a highmem machine? If not, I can do it. My test

Re: [kvm-devel] (no subject)

2007-07-24 Thread Shaohua Li
From: Avi Kivity [EMAIL PROTECTED] To: Li, Shaohua [EMAIL PROTECTED] Date: Tue, 24 Jul 2007 13:42:29 +0800 Subject: Re: [RFC 0/8]KVM: swap out guest pages Shaohua Li wrote: On Mon, 2007-07-23 at 18:27 +0800, Avi Kivity wrote: Shaohua Li wrote: This patch series make kvm guest

[kvm-devel] [RFC 0/8]KVM: swap out guest pages

2007-07-23 Thread Shaohua Li
This patch series make kvm guest pages be able to be swapped out and dynamically allocated. Without it, all guest memory is allocated at guest start time. patches are against latest git, and you need first patch Avi's kvm-sch integration patch

[kvm-devel] [RFC 1/8]KVM: fix bugs in kvm sched integration patch

2007-07-23 Thread Shaohua Li
fix some bugs in kvm-sch patch. 1. vmcs_readl/vmcs_writel are called with preempt enabled 2. preempt_count check doesn't make sense with preempt disabled 3. vmx_cpu_run doesn't handle error correctly and kvm_mmu_reload might sleep with mutex changes, so I move it above. Signed-off-by: Shaohua Li

[kvm-devel] [RFC 2/8]KVM: export several symbols kvm swap out needed

2007-07-23 Thread Shaohua Li
export symbols kvm swapout required Signed-off-by: Shaohua Li [EMAIL PROTECTED] Index: linux/mm/swap_state.c === --- linux.orig/mm/swap_state.c 2007-07-23 13:06:20.0 +0800 +++ linux/mm/swap_state.c 2007-07-23 13:29

[kvm-devel] [RFC 3/8]KVM: convert vm lock to a mutex

2007-07-23 Thread Shaohua Li
convert kvm lock to a mutex. TBD: after this change, a lot of logic in kvm can be simplified, eg, we don't need release lock and then do operation blocking. Signed-off-by: Shaohua Li [EMAIL PROTECTED] --- drivers/kvm/kvm.h |2 - drivers/kvm/kvm_main.c | 58

[kvm-devel] [RFC 4/8]KVM: move gfn_to_page out of kmap/unmap pars

2007-07-23 Thread Shaohua Li
gfn_to_page might sleep with swap support. Move it out of the kmap calls. Signed-off-by: Shaohua Li [EMAIL PROTECTED] --- drivers/kvm/kvm.h |2 - drivers/kvm/kvm_main.c|9 ++--- drivers/kvm/mmu.c |2 - drivers/kvm/paging_tmpl.h | 80

[kvm-devel] [RFC 5/8]KVM: rmap readonly pages

2007-07-23 Thread Shaohua Li
Make shadow page table rmap readonly pages. Signed-off-by: Shaohua Li [EMAIL PROTECTED] --- drivers/kvm/mmu.c | 66 ++ drivers/kvm/paging_tmpl.h |2 - 2 files changed, 39 insertions(+), 29 deletions(-) Index: linux/drivers/kvm/mmu.c

[kvm-devel] [RFC 6/8]KVM: introduce kvm_mmu_zap_pagetbl

2007-07-23 Thread Shaohua Li
add a routine to zap all shadow pgtble for a gfn. If kvm supports SMP, the API should zap pgtble for all vcpus, but kvm shadow page table really should be per-vm, instead of per-vcpu. Signed-off-by: Shaohua Li [EMAIL PROTECTED] --- drivers/kvm/kvm.h |1 + drivers/kvm/mmu.c | 28

[kvm-devel] [RFC 7/8]KVM: swap out guest pages

2007-07-23 Thread Shaohua Li
Make KVM guest pages be allocated dynamically and able to be swaped out. One issue: all inodes returned from anon_inode_getfd are shared, if one module changes field of the inode, other moduels might break. Should we introduce a new API to not share inode? Signed-off-by: Shaohua Li [EMAIL

[kvm-devel] [RFC 8/8]KVM: cache pages

2007-07-23 Thread Shaohua Li
KVM use gfn_to_page very frequestly, which makes find_get_page a bottleneck, so cache pages found to speed up. Signed-off-by: Shaohua Li [EMAIL PROTECTED] --- drivers/kvm/kvm.h |1 + drivers/kvm/kvm_main.c |9 + 2 files changed, 10 insertions(+) Index: linux/drivers/kvm

Re: [kvm-devel] [RFC 0/8]KVM: swap out guest pages

2007-07-23 Thread Shaohua Li
On Mon, 2007-07-23 at 18:27 +0800, Avi Kivity wrote: Shaohua Li wrote: This patch series make kvm guest pages be able to be swapped out and dynamically allocated. Without it, all guest memory is allocated at guest start time. patches are against latest git, and you need first patch

Re: [kvm-devel] [RFC 1/8]KVM: fix bugs in kvm sched integration patch

2007-07-23 Thread Shaohua Li
On Mon, 2007-07-23 at 18:46 +0800, Avi Kivity wrote: Shaohua Li wrote: fix some bugs in kvm-sch patch. There is now a 'preempt-hooks' branch on kvm.git with the preempt-hooks work. I'll continually update and rebase it against master. 1. vmcs_readl/vmcs_writel are called

Re: [kvm-devel] [RFC 6/8]KVM: introduce kvm_mmu_zap_pagetbl

2007-07-23 Thread Shaohua Li
On Mon, 2007-07-23 at 19:16 +0800, Avi Kivity wrote: Shaohua Li wrote: add a routine to zap all shadow pgtble for a gfn. If kvm supports SMP, the API should zap pgtble for all vcpus, but kvm shadow page table really should be per-vm, instead of per-vcpu. kvm shadow page tables

Re: [kvm-devel] [RFC 0/8]KVM: swap out guest pages

2007-07-23 Thread Shaohua Li
On Mon, 2007-07-23 at 20:34 +0800, Christoph Hellwig wrote: On Mon, Jul 23, 2007 at 03:29:36PM +0300, Avi Kivity wrote: Actually it requires lots of deep down VM internals symbols that'll never get exported. What's it here? kvm-specific address space or generic vmas. The

Re: [kvm-devel] [PATCH][RFC] kvm-scheduler integration

2007-07-09 Thread Shaohua Li
On Sun, 2007-07-08 at 20:58 +0800, Avi Kivity wrote: The only fly in the ointment is that it crashes quite soon. Haven't figured out why yet, but comments on the general direction would be welcome. Attached patch seems help in my test. prepare_task_switch is called with irq disabled.

[kvm-devel] [patch] wrong tlb flush order

2007-06-20 Thread Shaohua Li
Sounds like a obvious bug to me. Other places doing tlb flush do the right thing. Signed-off-by: Shaohua Li [EMAIL PROTECTED] Index: kvm-28/kernel/mmu.c === --- kvm-28.orig/kernel/mmu.c2007-06-20 16:52:46.0 +0800

Re: [kvm-devel] [RFC] KVM guest page swap out support - take2

2007-06-12 Thread Shaohua Li
On Thu, 2007-06-07 at 17:10 +0800, Shaohua Li wrote: On Wed, 2007-06-06 at 09:18 +0800, Shaohua Li wrote: On Tue, 2007-06-05 at 22:17 +0800, Avi Kivity wrote: Shaohua Li wrote: Hi, This is a updated patch set of swap out kvm guest pages.Changes are: 1. refresh against to kvm-26

Re: [kvm-devel] [RFC] KVM guest page swap out support - take2

2007-06-07 Thread Shaohua Li
On Wed, 2007-06-06 at 09:18 +0800, Shaohua Li wrote: On Tue, 2007-06-05 at 22:17 +0800, Avi Kivity wrote: Shaohua Li wrote: Hi, This is a updated patch set of swap out kvm guest pages.Changes are: 1. refresh against to kvm-26 2. clean up shadow page handling to make gfn_to_page

Re: [kvm-devel] [RFC] KVM guest page swap out support - take2

2007-06-05 Thread Shaohua Li
On Tue, 2007-06-05 at 22:17 +0800, Avi Kivity wrote: Shaohua Li wrote: Hi, This is a updated patch set of swap out kvm guest pages.Changes are: 1. refresh against to kvm-26 2. clean up shadow page handling to make gfn_to_page not be called within kmap_atomic/kunamp_atomic. 3. variant

[kvm-devel] [RFC] KVM guest page swap out support - take2

2007-06-03 Thread Shaohua Li
Hi, This is a updated patch set of swap out kvm guest pages.Changes are: 1. refresh against to kvm-26 2. clean up shadow page handling to make gfn_to_page not be called within kmap_atomic/kunamp_atomic. 3. variant bug fixing. Now the patch is quite stable in my test. 4. make swap out optional. A

Re: [kvm-devel] [PATCH 0/7] KVM: Suspend and cpu hotplug fixes

2007-05-24 Thread Shaohua Li
On Thu, 2007-05-24 at 20:10 +0800, Avi Kivity wrote: The following patchset makes kvm more robust wrt cpu hotunplug, and makes suspend-to-ram actually work. Suspend-to-disk benefits from the cpu hotunplug improvements as well. The major issue is that KVM wants to disable the virtualization

[kvm-devel] [RFC]kvm: swapout guest page

2007-05-21 Thread Shaohua Li
Hi, I saw some discussions on the topic but no progress. I did an experiment to make guest page be allocated dynamically and swap out. please see attachment patches. It's not yet for merge but I'd like get some suggestions and help. Patches (against kvm-19) work here but maybe not very stable as

[kvm-devel] [PATCH] KVM breaks CPU hotplug

2007-03-26 Thread Shaohua Li
When testing CPU hotplug, I found cpu can't be onlined with kvm enabled sometimes. The reason is smp_call_function_single is a nop if the thread is running on the target cpu. I think CPU_ONLINE case doesn't require the fix as the online CPU isn't plugged into sheduler yet. Signed-off-by: Shaohua