Re: [PATCH 0/1] Defer skb allocation for both mergeable buffers and big packets in virtio_net

2009-11-23 Thread Mark McLoughlin
On Mon, 2009-11-23 at 11:23 +1030, Rusty Russell wrote: I'd like to drop big packet support from our driver, but I don't know how many kvm hosts will not offer mergable rx bufs yet. Anthony? Mergeable rx bufs were first added in kvm-80 and qemu-0.10.0 So e.g., it's in Fedora since Fedora 11

Re: [PATCH 1/1] Defer skb allocation for both mergeable buffers and big packets in virtio_net

2009-11-23 Thread Michael S. Tsirkin
On Fri, Nov 20, 2009 at 08:21:41AM -0800, Shirley Ma wrote: On Fri, 2009-11-20 at 07:19 +0100, Eric Dumazet wrote: Interesting use after free :) Thanks for catching the stupid mistake. This is the updated patch for review. Signed-off-by: Shirley Ma (x...@us.ibm.com) some style comments.

Question about shutting down Guest KVM during HOST OS shutdown

2009-11-23 Thread Arun Khan
Greetings, I have been working on a script (kvminit) that starts and shuts down Guest KVMs during HOST OS boot/shutdown. The setup is in a small network wherein HOST OS is openSUSE 11.1 and Guest KVMs is a bunch of openSUSE and CentOS servers installation doing dedicated tasks (e.g. openLDAP +

kvmmmu tracing

2009-11-23 Thread Johannes Berg
Commit f691fe1da7e2715137d21ae5a80bec64db4625db is really broken wrt. the userspace interface for tracing because of the weird KVM_MMU_PAGE_PRINTK macro. Maybe we should have a unsafe for export flag for events, if they do strange things like that? As it stands, I can't use trace-cmd on an x86

Re: Question about shutting down Guest KVM during HOST OS shutdown

2009-11-23 Thread Bernhard Held
Hi Arun! send_cmd() { QEMU_MONITOR_COMMAND=$1 echo ${QEMU_MONITOR_COMMAND} | socat - UNIX-CONNECT:${FILE_MONITOR} } which sends the exit command to the qemu process via a socket file. Just send system_powerdown, and your guest will receive an ACPI shutdown request. Bernhard

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

2009-11-23 Thread Gleb Natapov
KVM virtuaize 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

[PATCH v2 04/12] Add handle page fault PV helper.

2009-11-23 Thread Gleb Natapov
Allow paravirtualized guest to do special handling for some page faults. Ingo's concerns not yet addressed here. What was the conclusion of previous discussion? Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/include/asm/paravirt.h |7 +++

[PATCH v2 05/12] Handle asynchronous page fault in a PV guest.

2009-11-23 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.

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

2009-11-23 Thread Gleb Natapov
If async page fault is received by idle task or when preemp_count is not zero guest cannot reschedule, so do sti; hlt and wait for page to be ready. vcpu can still process interrupts while it waits for the page to be ready. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/kernel/kvm.c |

[PATCH v2 06/12] Export __get_user_pages_fast.

2009-11-23 Thread Gleb Natapov
KVM will use it to try and find a page without falling back to slow gup. That is why get_user_pages_fast() is not enough. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/mm/gup.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/x86/mm/gup.c

[PATCH v2 08/12] Inject asynchronous page fault into a guest if page is swapped out.

2009-11-23 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

[PATCH v2 09/12] Retry fault before vmentry

2009-11-23 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 g...@redhat.com ---

[PATCH v2 07/12] Add get_user_pages() variant that fails if major fault is required.

2009-11-23 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. Reviewed-by: Rik van Riel r...@redhat.com Signed-off-by: Gleb Natapov g...@redhat.com --- fs/ncpfs/mmap.c|2 ++ include/linux/mm.h |5 + mm/filemap.c |

[PATCH v2 02/12] Add PV MSR to enable asynchronous page faults delivery.

2009-11-23 Thread Gleb Natapov
Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/include/asm/kvm_host.h |3 ++ arch/x86/include/asm/kvm_para.h |2 + arch/x86/kvm/x86.c | 42 +- include/linux/kvm.h |1 + 4 files changed, 46 insertions(+), 2

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

2009-11-23 Thread Gleb Natapov
Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/kvm/mmu.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 1225c31..a538d82 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -2204,10 +2204,11 @@ int

[PATCH v2 01/12] Move kvm_smp_prepare_boot_cpu() from kvmclock.c to kvm.c.

2009-11-23 Thread Gleb Natapov
Async PF also needs to hook into smp_prepare_boot_cpu so move the hook into generic code. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/include/asm/kvm_para.h |1 + arch/x86/kernel/kvm.c | 11 +++ arch/x86/kernel/kvmclock.c | 13 + 3 files

[PATCH v2 10/12] Maintain preemptability count even for !CONFIG_PREEMPT kernels

2009-11-23 Thread Gleb Natapov
Do not preempt kernel. Just maintain counter to know if task can be rescheduled. Asynchronous page fault may be delivered while spinlock is held or current process can't be preempted for other reasons. KVM uses preempt_count() to check if preemptions is allowed and schedule other process if

[PATCH v2 03/12] Add async PF initialization to PV guest.

2009-11-23 Thread Gleb Natapov
Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/include/asm/kvm_para.h |5 arch/x86/kernel/kvm.c | 49 +++ arch/x86/kernel/smpboot.c |3 ++ include/linux/kvm_para.h|2 + 4 files changed, 59 insertions(+), 0

RE: Question about shutting down Guest KVM during HOST OS shutdown

2009-11-23 Thread Neil Aggarwal
Arun: I have been working on a script (kvminit) that starts and shuts down Guest KVMs during HOST OS boot/shutdown. The setup is in a small I asked the same question on the CentOS-virt mailing list about using the virsh command to shutdown all guest VMs. That command is supposed to do a

Re: kvmmmu tracing

2009-11-23 Thread Steven Rostedt
On Mon, 2009-11-23 at 12:06 +0100, Johannes Berg wrote: Commit f691fe1da7e2715137d21ae5a80bec64db4625db is really broken wrt. the userspace interface for tracing because of the weird KVM_MMU_PAGE_PRINTK macro. Maybe we should have a unsafe for export flag for events, if they do strange

Re: [PATCH v2 04/12] Add handle page fault PV helper.

2009-11-23 Thread Peter Zijlstra
On Mon, 2009-11-23 at 16:05 +0200, Gleb Natapov wrote: diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index f4cee90..14707dc 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c @@ -952,6 +952,9 @@ do_page_fault(struct pt_regs *regs, unsigned long error_code) int

Re: [PATCH v2 10/12] Maintain preemptability count even for !CONFIG_PREEMPT kernels

2009-11-23 Thread Peter Zijlstra
On Mon, 2009-11-23 at 16:06 +0200, Gleb Natapov wrote: Do not preempt kernel. Just maintain counter to know if task can be rescheduled. Asynchronous page fault may be delivered while spinlock is held or current process can't be preempted for other reasons. KVM uses preempt_count() to check

Re: kvmmmu tracing

2009-11-23 Thread Johannes Berg
On Mon, 2009-11-23 at 09:58 -0500, Steven Rostedt wrote: On Mon, 2009-11-23 at 12:06 +0100, Johannes Berg wrote: Commit f691fe1da7e2715137d21ae5a80bec64db4625db is really broken wrt. the userspace interface for tracing because of the weird KVM_MMU_PAGE_PRINTK macro. Maybe we should

Re: [PATCH v2 10/12] Maintain preemptability count even for !CONFIG_PREEMPT kernels

2009-11-23 Thread Gleb Natapov
On Mon, Nov 23, 2009 at 04:34:15PM +0100, Peter Zijlstra wrote: On Mon, 2009-11-23 at 16:06 +0200, Gleb Natapov wrote: Do not preempt kernel. Just maintain counter to know if task can be rescheduled. Asynchronous page fault may be delivered while spinlock is held or current process can't

Re: [PATCH 1/1] Defer skb allocation for both mergeable buffers and big packets in virtio_net

2009-11-23 Thread Shirley Ma
On Mon, 2009-11-23 at 11:38 +1030, Rusty Russell wrote: How about: struct page *end; /* Find end of list, sew whole thing into vi-pages. */ for (end = page; end-private; end = (struct page *)end-private); end-private = (unsigned long)vi-pages;

Re: [PATCH 1/1] Defer skb allocation for both mergeable buffers and big packets in virtio_net

2009-11-23 Thread Shirley Ma
On Mon, 2009-11-23 at 11:43 +0200, Michael S. Tsirkin wrote: should be !npage-private and nesting is too deep here: this is cleaner in a give_a_page subroutine as it was. This will be addressed with Rusty's comment. + /* use private to chain big packets */ packets? or pages?

Re: [PATCH v2 10/12] Maintain preemptability count even for !CONFIG_PREEMPT kernels

2009-11-23 Thread Christoph Lameter
This adds significant overhead for the !PREEMPT case adding lots of code in critical paths all over the place. -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [patch 0/2] Handle multiple exceptions (fixes Win2003 reboot by triple fault)

2009-11-23 Thread Marcelo Tosatti
On Thu, Nov 19, 2009 at 05:54:07PM +0200, Gleb Natapov wrote: It's actually less readable. I know 11 is between 10 and 13, but is NP_VECTOR between TS_VECTOR and GP_VECTOR? This is better as a switch, or even: u8 exception_class[] = { [PF_VECTOR] EXPT_PF, etc. OK what

Re: Breakage due to commit c1699988 (v3: don't call reset functions on cpu initialization)

2009-11-23 Thread Glauber Costa
On Sun, Nov 22, 2009 at 04:42:12PM +0200, Avi Kivity wrote: A qemu-kvm which merges this commit breaks badly (see qemu-kvm.git next branch). In the commit log for this commit, you write I tested it with qemu (with and without io-thread) and qemu-kvm, and it seems to be doing okay -

Re: [PATCH 1/1] Defer skb allocation for both mergeable buffers and big packets in virtio_net

2009-11-23 Thread Shirley Ma
Hello Rusty, On Mon, 2009-11-23 at 11:38 +1030, Rusty Russell wrote: Overall, the patch looks good. But it would have been nicer if it were split into several parts: cleanups, new infrastructure, then the actual allocation change. I have split the patch into a set: cleanups, new

Re: kvm hangs w/o nolapic

2009-11-23 Thread Marcelo Tosatti
On Fri, Nov 20, 2009 at 10:25:41PM +0100, Johannes Berg wrote: On Fri, 2009-11-20 at 21:18 +0300, Cyrill Gorcunov wrote: I've just booted a latest -tip with kvm without problems. Unfortunately, -tip is usually different enough that I it tends to not matter to me while I'm running a

Re: Breakage due to commit c1699988 (v3: don't call reset functions on cpu initialization)

2009-11-23 Thread Glauber Costa
On Mon, Nov 23, 2009 at 5:00 PM, Glauber Costa glom...@redhat.com wrote: On Sun, Nov 22, 2009 at 04:42:12PM +0200, Avi Kivity wrote: A qemu-kvm which merges this commit breaks badly (see qemu-kvm.git next branch).  In the commit log for this commit, you write     I tested it with qemu (with

Re: [PATCH 1/1] Defer skb allocation for both mergeable buffers and big packets in virtio_net

2009-11-23 Thread Rusty Russell
On Tue, 24 Nov 2009 02:37:01 am Shirley Ma wrote: + skb = (struct sk_buff *)buf; This cast is unnecessary, but a comment would be nice: Without this cast there is a compile warning. Hi Shirley, Looks like buf is a void *, so no cast should be necessary. But I could be

Re: [PATCH 1/1] Defer skb allocation for both mergeable buffers and big packets in virtio_net

2009-11-23 Thread Shirley Ma
On Tue, 2009-11-24 at 08:54 +1030, Rusty Russell wrote: #define BIG_PACKET_PAD (NET_SKB_PAD - sizeof(struct virtio_net_hdr) + NET_IP_ALIGN) struct big_packet_page { struct virtio_net_hdr hdr; char pad[BIG_PACKET_PAD]; /* Actual packet data starts here */

Re: kvm hangs w/o nolapic

2009-11-23 Thread Johannes Berg
On Mon, 2009-11-23 at 17:05 -0200, Marcelo Tosatti wrote: QEMU PC emulator version 0.10.50 (qemu-kvm-devel-88), Copyright (c) 2003-2008 Fabrice Bellard Can you please try git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git ? There have been a number of HPET emulation fixes. Indeed, that

A puzzle on the interrupt disposal of KVM?

2009-11-23 Thread Liang YANG
Does the vmx_inject_irq and vmx_inject_nmi inject all the interrupt from outer space ? Then when the interrrupt yielded from hardware is delieved to the QEMU or KVM ? Anyone can help me,, Thanks in advance!! -- BestRegards. YangLiang _ Master

Re: [Autotest] [PATCH 18/19] KVM test: kvm_tests.cfg.sample: get all Windows test utilities from a single ISO

2009-11-23 Thread sudhir kumar
On Thu, Sep 10, 2009 at 8:49 AM, Lucas Meneghel Rodrigues l...@redhat.com wrote: On Wed, Sep 9, 2009 at 3:12 PM, Michael Goldish mgold...@redhat.com wrote: Instead of rss.iso, vlc.iso and autoit.iso -- look for everything in winutils.iso by default. This make maintenance a little easier, and

Re: A puzzle on the interrupt disposal of KVM?

2009-11-23 Thread Gleb Natapov
On Tue, Nov 24, 2009 at 08:49:24AM +0800, Liang YANG wrote: Does the vmx_inject_irq and vmx_inject_nmi inject all the interrupt from outer space ? Then when the interrrupt yielded from hardware is delieved to the QEMU or KVM ? HW interrupts delivered to the host kernel. --

Re: [PATCH v2 10/12] Maintain preemptability count even for !CONFIG_PREEMPT kernels

2009-11-23 Thread Gleb Natapov
On Mon, Nov 23, 2009 at 11:30:02AM -0600, Christoph Lameter wrote: This adds significant overhead for the !PREEMPT case adding lots of code in critical paths all over the place. I want to measure it. Can you suggest benchmarks to try? -- Gleb. -- To unsubscribe from

[PATCH] PPC: Sync guest visible MMU state

2009-11-23 Thread Alexander Graf
Currently userspace has no chance to find out which virtual address space we're in and resolve addresses. While that is a big problem for migration, it's also unpleasent when debugging, as gdb and the monitor don't work on virtual addresses. This patch exports enough of the MMU segment state to