Re: [PATCH 01/11] Add shared memory hypercall to PV Linux guest.

2009-11-01 Thread Gleb Natapov
On Sun, Nov 01, 2009 at 11:27:15PM -0500, Rik van Riel wrote: > On 11/01/2009 06:56 AM, Gleb Natapov wrote: > >Add hypercall that allows guest and host to setup per cpu shared > >memory. > > While it is pretty obvious that we should implement > the asynchronous pagefaults for KVM, so a swap-in > o

Re: CPU change causes hanging of .NET apps

2009-11-01 Thread Avi Kivity
On 11/02/2009 01:45 AM, Erik Rull wrote: Hi Avi, Please don't top-post. the Host CPU is a Intel Core2Duo - VT capable and enabled! The problem is that one of the flags that -cpu core2duo enables is implemented incorrectly, so it leads to .net breakage. These flags are pni, lm, nx, ssse3

Re: [PATCH 01/11] Add shared memory hypercall to PV Linux guest.

2009-11-01 Thread Rik van Riel
On 11/01/2009 06:56 AM, Gleb Natapov wrote: Add hypercall that allows guest and host to setup per cpu shared memory. While it is pretty obvious that we should implement the asynchronous pagefaults for KVM, so a swap-in of a page the host swapped out does not stall the entire virtual CPU, I beli

Re: CPU change causes hanging of .NET apps

2009-11-01 Thread Erik Rull
Hi Avi, the Host CPU is a Intel Core2Duo - VT capable and enabled! Best regards, Erik Avi Kivity wrote: On 10/28/2009 11:13 PM, Erik Rull wrote: Hi all, when changing the CPU from the default QEMU32 one to e.g. the n270 or the core2duo no .NET apps will work under Windows XP as guest. Sw

Re: [PATCH 11/27] Add book3s_64 Host MMU handling

2009-11-01 Thread Michael Neuling
> +static void invalidate_pte(struct hpte_cache *pte) > +{ > + dprintk_mmu("KVM: Flushing SPT %d: 0x%llx (0x%llx) -> 0x%llx\n", > + i, pte->pte.eaddr, pte->pte.vpage, pte->host_va); > + > + ppc_md.hpte_invalidate(pte->slot, pte->host_va, > +MMU_P

Re: [PATCH 08/27] Add SLB switching code for entry/exit

2009-11-01 Thread Michael Neuling
> This is the really low level of guest entry/exit code. > > Book3s_64 has an SLB, which stores all ESID -> VSID mappings we're > currently aware of. > > The segments in the guest differ from the ones on the host, so we need > to switch the SLB to tell the MMU that we're in a new context. > > So

PCI Passthrough and graphic cards ...

2009-11-01 Thread Michael McStarfighter
Hi, I've got a Kubuntu host and two dedicated graphic cards. Now I want to create a Windows Seven guest for KVM and give the guest one of the graphic cards (it isn't "in business" on my host). The informations I got is only that PCI passthrough is possible, but I've got no more details about it (o

vga_arb warning [was: mmotm 2009-11-01-10-01 uploaded]

2009-11-01 Thread Jiri Slaby
On 11/01/2009 07:07 PM, a...@linux-foundation.org wrote: > The mm-of-the-moment snapshot 2009-11-01-10-01 has been uploaded to Hi, I got the following warning while booting an image in qemu-kvm: WARNING: at fs/attr.c:158 notify_change+0x2da/0x310() Hardware name: Modules linked in: Pid: 1, comm:

buildbot failure in qemu-kvm on default_i386_out_of_tree

2009-11-01 Thread qemu-kvm
The Buildbot has detected a new failure of default_i386_out_of_tree on qemu-kvm. Full details are available at: http://buildbot.b1-systems.de/qemu-kvm/builders/default_i386_out_of_tree/builds/73 Buildbot URL: http://buildbot.b1-systems.de/qemu-kvm/ Buildslave for this Build: b1_qemu_kvm_2 Buil

buildbot failure in qemu-kvm on default_x86_64_out_of_tree

2009-11-01 Thread qemu-kvm
The Buildbot has detected a new failure of default_x86_64_out_of_tree on qemu-kvm. Full details are available at: http://buildbot.b1-systems.de/qemu-kvm/builders/default_x86_64_out_of_tree/builds/74 Buildbot URL: http://buildbot.b1-systems.de/qemu-kvm/ Buildslave for this Build: b1_qemu_kvm_1

Re: CPU change causes hanging of .NET apps

2009-11-01 Thread Avi Kivity
On 10/28/2009 11:13 PM, Erik Rull wrote: Hi all, when changing the CPU from the default QEMU32 one to e.g. the n270 or the core2duo no .NET apps will work under Windows XP as guest. Switching back and everything is fine. The Pentium Emulation on the other side works fine! The Application lo

Re: Interrupt Assignment on host

2009-11-01 Thread Avi Kivity
On 10/28/2009 11:16 PM, Erik Rull wrote: Hi all, after several tests it seems that the interrupt assignment on the host systems influences the kvm performance drastically. If eth0, video and usb are on seperate interrupts the perfomance is way better than if they are shared (that means on the

Re: [PATCH v2] fix qemu-kvm sigsegv at exit

2009-11-01 Thread Avi Kivity
On 10/29/2009 12:38 AM, Marcelo Tosatti wrote: This will miss an event at the very beginning of the loop (powerdown requested before we had a chance to spin up?). I think it should be fine since there will be a pending signal which will break us out of kvm_cpu_exec() before it has a chance to

Re: CPU troubles with kvm 83 redhat 5.4 windows 2008 server 64 bits

2009-11-01 Thread Avi Kivity
On 10/29/2009 05:11 PM, Arnaud Maillet wrote: Hello world, I used to use Xen on my server but due to a non-patched cygwin problem I installed kvm 83 on my redhat 5.4 with the red hat rpm. I found some troubles with a windows 2008 server 64 bits guest. When I install a software like an anti-viru

Re: [PATCH 5/5] Fix kdump under KVM.

2009-11-01 Thread Avi Kivity
On 10/30/2009 02:23 PM, Chris Lalancette wrote: In the meantime, I've gotten the "set_irq from IRQ context" that Avi suggested working, and the fixing up of this IOAPIC check is the last bit to actually get kdump working. There are two problems with that: - kvm_set_irq() calls some notifi

RE: [PATCH] viostor driver.Add memory barrier - synch with fix for Linux guests by Michael S. Tsirkin

2009-11-01 Thread Yan Vugenfirer
Committed. Thanks. > -Original Message- > From: kvm-ow...@vger.kernel.org [mailto:kvm-ow...@vger.kernel.org] On > Behalf Of Vadim Rozenfeld > Sent: Sunday, November 01, 2009 12:41 PM > To: kvm@vger.kernel.org > Subject: [PATCH] viostor driver.Add memory barrier - synch with fix for > Linu

[PATCH 02/11] Add "handle page fault" PV helper.

2009-11-01 Thread Gleb Natapov
Allow paravirtualized guest to do special handling for some page faults. Signed-off-by: Gleb Natapov --- arch/x86/include/asm/paravirt.h |7 +++ arch/x86/include/asm/paravirt_types.h |4 arch/x86/kernel/paravirt.c|8 arch/x86/kernel/paravirt_patch_

[PATCH 05/11] Add get_user_pages() variant that fails if major fault is required.

2009-11-01 Thread Gleb Natapov
This patch add get_user_pages() variant that only succeeds if getting a reference to a page doesn't require major fault. Signed-off-by: Gleb Natapov --- fs/ncpfs/mmap.c|2 ++ include/linux/mm.h |5 + mm/filemap.c |3 +++ mm/memory.c| 31 +++

[PATCH 08/11] Add "wait for page" hypercall.

2009-11-01 Thread Gleb Natapov
We want to be able to inject async pagefault into guest event if a guest is not executing userspace code. But in this case guest may receive async page fault in non-sleepable context. In this case it will be able to make "wait for page" hypercall vcpu will be put to sleep until page is swapped in a

[PATCH 06/11] Inject asynchronous page fault into a guest if page is swapped out.

2009-11-01 Thread Gleb Natapov
If guest access swapped out memory do not swap it in from vcpu thread context. Setup slow work to do swapping and send async page fault to a guest. Allow async page fault injection only when guest is in user mode since otherwise guest may be in non-sleepable context and will not be able to resched

[PATCH 11/11] Send async PF when guest is not in userspace too.

2009-11-01 Thread Gleb Natapov
Signed-off-by: Gleb Natapov --- arch/x86/kvm/mmu.c | 16 ++-- 1 files changed, 6 insertions(+), 10 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 3d33994..21ec65a 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -2358,7 +2358,7 @@ static bool kv

[PATCH 09/11] Maintain preemptability count even for !CONFIG_PREEMPT kernels

2009-11-01 Thread Gleb Natapov
Do not preempt kernel. Just maintain counter to know if task can sleep. Signed-off-by: Gleb Natapov --- include/linux/hardirq.h |6 ++ include/linux/preempt.h | 22 -- kernel/sched.c |6 -- lib/kernel_lock.c |1 + 4 files changed, 19 inser

[PATCH 01/11] Add shared memory hypercall to PV Linux guest.

2009-11-01 Thread Gleb Natapov
Add hypercall that allows guest and host to setup per cpu shared memory. Signed-off-by: Gleb Natapov --- arch/x86/include/asm/kvm_host.h |3 + arch/x86/include/asm/kvm_para.h | 11 + arch/x86/kernel/kvm.c | 82 +++ arch/x86/kernel/setup.c

[PATCH 03/11] Handle asynchronous page fault in a PV guest.

2009-11-01 Thread Gleb Natapov
Asynchronous page fault notifies vcpu that page it is trying to access is swapped out by a host. In response guest puts a task that caused the fault to sleep until page is swapped in again. When missing page is brought back into the memory guest is notified and task resumes execution. Signed-off-b

[PATCH 10/11] Handle async PF in non preemptable context.

2009-11-01 Thread Gleb Natapov
If async page fault is received by idle task or when preemp_count is not zero guest cannot reschedule, so make "wait for page" hypercall and comtinue only after a page is ready. Signed-off-by: Gleb Natapov --- arch/x86/kernel/kvm.c | 16 +++- 1 files changed, 15 insertions(+), 1 de

[PATCH 07/11] Retry fault before vmentry

2009-11-01 Thread Gleb Natapov
When page is swapped in it is mapped into guest memory only after guest tries to access it again and generate another fault. To save this fault we can map it immediately since we know that guest is going to access the page. Signed-off-by: Gleb Natapov --- arch/x86/include/asm/kvm_host.h |4 +

[PATCH 00/11] KVM: Add asynchronous page fault for PV guest.

2009-11-01 Thread Gleb Natapov
KVM virtualize guest memory by means of shadow pages or HW assistance like NPT/EPT. Not all memory used by a guest is mapped into the guest address space or even present in a host memory at any given time. When vcpu tries to access memory page that is not mapped into guest address space KVM is noti

[PATCH 04/11] Export __get_user_pages_fast.

2009-11-01 Thread Gleb Natapov
Signed-off-by: Gleb Natapov --- arch/x86/mm/gup.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/x86/mm/gup.c b/arch/x86/mm/gup.c index 71da1bc..cea0dfe 100644 --- a/arch/x86/mm/gup.c +++ b/arch/x86/mm/gup.c @@ -8,6 +8,7 @@ #include #include #include +#inclu

Re: kernel bug in kvm_intel

2009-11-01 Thread Avi Kivity
On 11/01/2009 12:45 PM, Tejun Heo wrote: Hello, Avi Kivity wrote: We get a page fault immediately (next instruction) after returning from the guest when running with oprofile. The page fault address does not match anything the instruction does, so presumably it is one of the accesses the p

Re: block virtio excessive VIRTIO_PCI_ISR reads

2009-11-01 Thread Saul Tamari
You are right. After enabling MSI-x for the virtio block device I now only see VIRTIO_PCI_QUEUE_NOTIFY writes and there aren't any VIRTIO_PCI_ISR reads anymore. Thanks, Saul On Sun, Nov 1, 2009 at 11:23 AM, Avi Kivity wrote: > On 10/29/2009 05:47 PM, Saul Tamari wrote: >> >> Hi, >> >> The cur

Re: kernel bug in kvm_intel

2009-11-01 Thread Tejun Heo
Hello, Avi Kivity wrote: > We get a page fault immediately (next instruction) after returning from > the guest when running with oprofile. The page fault address does not > match anything the instruction does, so presumably it is one of the > accesses the processor performs in order to service an

[PATCH] viostor driver.Add memory barrier - synch with fix for Linux guests by Michael S. Tsirkin

2009-11-01 Thread Vadim Rozenfeld
repository: /home/vadimr/shares/kvm-guest-drivers-windows branch: XP commit 6906acfc2d5f58df43ebc9c190e1447ff6e63a01 Author: Vadim Rozenfeld Date: Sun Nov 1 11:54:03 2009 +0200 [PATCH] viostor driver.Add memory read barrier - synch with fix for Linux guests by Michael S. Tsirkin Sign

Re: kernel bug in kvm_intel

2009-11-01 Thread Avi Kivity
On 11/01/2009 12:00 PM, Tejun Heo wrote: Hello, Avi Kivity wrote: Only, that merge doesn't change virt/kvm or arch/x86/kvm. Tejun, anything known bad about that merge? ada3fa15 kills kvm. Nothing rings a bell at the moment. How does it kill kvm? One big difference caused by that

Re: kernel bug in kvm_intel

2009-11-01 Thread Tejun Heo
Hello, Avi Kivity wrote: > Only, that merge doesn't change virt/kvm or arch/x86/kvm. > > Tejun, anything known bad about that merge? ada3fa15 kills kvm. Nothing rings a bell at the moment. How does it kill kvm? One big difference caused by that merge is use of sparse areas near the top of vma

Re: block virtio excessive VIRTIO_PCI_ISR reads

2009-11-01 Thread Avi Kivity
On 10/29/2009 05:47 PM, Saul Tamari wrote: Hi, The current qemu-kvm from the git indeed adds the MSI-x capability to the virtio block device. With MSI-x enabled on the virtio block device, there aren't VIRTIO_PCI_ISR reads on the unused device. There shouldn't be VIRTIO_PCI_ISR reads on an

Re: [PATCH] KVM: VMX: Use proper slot index for kvm_set_shared_msr

2009-11-01 Thread Avi Kivity
On 10/29/2009 07:13 PM, Avi Kivity wrote: On 10/29/2009 06:53 PM, Jan Kiszka wrote: We were missing one indirection here to translate from vmx-local to x86 slot indices, and this caused subtle host crashes. Ahh, good catch. How did it work? And, of course, applied. Thanks. -- error compi