[COMMIT master] KVM: Adjust makefile for x86_emulate.c rename

2009-08-13 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/x86/kvm/Makefile b/arch/x86/kvm/Makefile index afaaa76..0e7fe78 100644 --- a/arch/x86/kvm/Makefile +++ b/arch/x86/kvm/Makefile @@ -9,7 +9,7 @@ kvm-y += $(addprefix ../../../virt/kvm/,

Re: [PATCH 0/3] qemu-kvm: vhost net support

2009-08-13 Thread Michael S. Tsirkin
On Wed, Aug 12, 2009 at 04:27:44PM -0400, Gregory Haskins wrote: Michael S. Tsirkin wrote: This adds support for vhost-net virtio kernel backend. This is RFC, but works without issues for me. Still needs to be split up, tested and benchmarked properly, but posting it here in case

Re: [PATCH 2/2] vhost_net: a kernel-level virtio server

2009-08-13 Thread Michael S. Tsirkin
On Wed, Aug 12, 2009 at 07:59:47PM +0200, Arnd Bergmann wrote: The trick is to swap the virtqueues instead. virtio-net is actually mostly symmetric in just the same way that the physical wires on a twisted pair ethernet are symmetric (I like how that analogy fits). You need to really squint

Re: [PATCH 2/2] vhost_net: a kernel-level virtio server

2009-08-13 Thread Michael S. Tsirkin
On Wed, Aug 12, 2009 at 02:27:31PM -0500, Anthony Liguori wrote: Arnd Bergmann wrote: As I pointed out earlier, most code in virtio net is asymmetrical: guest provides buffers, host consumes them. Possibly, one could use virtio rings in a symmetrical way, but support of existing guest virtio

[RFC] defer skb allocation in virtio_net -- mergable buff part

2009-08-13 Thread Shirley Ma
Guest virtio_net receives packets from its pre-allocated vring buffers, then it delivers these packets to upper layer protocols as skb buffs. So it's not necessary to pre-allocate skb for each mergable buffer, then frees it when it's useless. This patch has deferred skb allocation to when

Re: [PATCH 2/2] vhost_net: a kernel-level virtio server

2009-08-13 Thread Michael S. Tsirkin
On Wed, Aug 12, 2009 at 02:22:38PM -0500, Anthony Liguori wrote: Michael S. Tsirkin wrote: We discussed this before, and I still think this could be directly derived from struct virtqueue, in the same way that vring_virtqueue is derived from struct virtqueue. I prefer keeping it

[PATCHv2 0/3] qemu-kvm: vhost net support

2009-08-13 Thread Michael S. Tsirkin
This adds support for vhost-net virtio kernel backend. This is RFC, but works without issues for me. Still needs to be split up, tested and benchmarked properly, but posting it here in case people want to test drive the kernel bits I posted. Changes since v1: - rebased on top of

[PATCHv2 1/3] qemu-kvm: move virtio-pci.o to near pci.o

2009-08-13 Thread Michael S. Tsirkin
virtio-pci depends, and will always depend, on pci.c so it makes sense to keep it in the same makefile, (unlike the rest of virtio files which should eventually be moved out to Makefile.hw). Signed-off-by: Michael S. Tsirkin m...@redhat.com --- Makefile.hw |2 +- Makefile.target |2

[PATCHv2 2/3] virtio: move features to an inline function

2009-08-13 Thread Michael S. Tsirkin
devices should have the final say over which virtio features they support. E.g. indirect entries may or may not make sense in the context of virtio-console. Move the common bits from virtio-pci to an inline function and let each device call it. No functional changes. Signed-off-by: Michael S.

[PATCHv2 3/3] qemu-kvm: vhost-net implementation

2009-08-13 Thread Michael S. Tsirkin
This adds support for vhost-net virtio kernel backend. To enable (assuming device eth2): 1. enable promisc mode or program guest mac in device eth2 2. disable tso, gso, lro on the card 3. add vhost=eth0 to -net flag 4. run with CAP_NET_ADMIN priviledge (e.g. root) This patch is RFC, but works

Re: [PATCH v3 1/8] Do not call ack notifiers on PIC reset.

2009-08-13 Thread Marcelo Tosatti
On Wed, Aug 12, 2009 at 03:17:15PM +0300, Gleb Natapov wrote: For device assigned it may cause host hang since ack notifier callback enables host interrupt and guest not necessary cleared interrupt condition in an assigned device. For PIT we should not call ack notifier here since interrupt

Re: [PATCH v3 1/8] Do not call ack notifiers on PIC reset.

2009-08-13 Thread Gleb Natapov
On Thu, Aug 13, 2009 at 06:11:05AM -0300, Marcelo Tosatti wrote: On Wed, Aug 12, 2009 at 03:17:15PM +0300, Gleb Natapov wrote: For device assigned it may cause host hang since ack notifier callback enables host interrupt and guest not necessary cleared interrupt condition in an assigned

Re: [PATCH v3 7/8] Move IO APIC to its own lock.

2009-08-13 Thread Gleb Natapov
On Thu, Aug 13, 2009 at 06:13:30AM -0300, Marcelo Tosatti wrote: +++ b/virt/kvm/ioapic.c @@ -182,6 +182,7 @@ int kvm_ioapic_set_irq(struct kvm_ioapic *ioapic, int irq, int level) union kvm_ioapic_redirect_entry entry; int ret = 1; + mutex_lock(ioapic-lock); if (irq

Re: [PATCH v3 7/8] Move IO APIC to its own lock.

2009-08-13 Thread Avi Kivity
On 08/13/2009 12:48 PM, Gleb Natapov wrote: On Thu, Aug 13, 2009 at 06:13:30AM -0300, Marcelo Tosatti wrote: +++ b/virt/kvm/ioapic.c @@ -182,6 +182,7 @@ int kvm_ioapic_set_irq(struct kvm_ioapic *ioapic, int irq, int level) union kvm_ioapic_redirect_entry entry; int ret = 1;

Re: [PATCH v3 7/8] Move IO APIC to its own lock.

2009-08-13 Thread Gleb Natapov
On Thu, Aug 13, 2009 at 12:49:45PM +0300, Avi Kivity wrote: On 08/13/2009 12:48 PM, Gleb Natapov wrote: On Thu, Aug 13, 2009 at 06:13:30AM -0300, Marcelo Tosatti wrote: +++ b/virt/kvm/ioapic.c @@ -182,6 +182,7 @@ int kvm_ioapic_set_irq(struct kvm_ioapic *ioapic, int irq, int level) union

Re: [PATCH v3 7/8] Move IO APIC to its own lock.

2009-08-13 Thread Avi Kivity
On 08/13/2009 01:09 PM, Gleb Natapov wrote: There's also srcu. What are the disadvantages? There should be some, otherwise why not use it all the time. I think it incurs an atomic op in the read path, but not much overhead otherwise. Paul? -- error compiling committee.c: too

Re: [PATCH] Fix Makefile rule for compiling emulate.c

2009-08-13 Thread Avi Kivity
On 08/13/2009 12:42 AM, Mohammed Gamal wrote: Signed-off-by: Mohammed Gamalm.gamal...@gmail.com --- arch/x86/kvm/Makefile |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/Makefile b/arch/x86/kvm/Makefile index afaaa76..0e7fe78 100644 ---

Re: [PATCH 0/3] qemu-kvm: vhost net support

2009-08-13 Thread Gregory Haskins
Michael S. Tsirkin wrote: On Wed, Aug 12, 2009 at 04:27:44PM -0400, Gregory Haskins wrote: Michael S. Tsirkin wrote: This adds support for vhost-net virtio kernel backend. This is RFC, but works without issues for me. Still needs to be split up, tested and benchmarked properly, but posting

Re: [PATCH 0/3] qemu-kvm: vhost net support

2009-08-13 Thread Michael S. Tsirkin
On Thu, Aug 13, 2009 at 07:35:52AM -0400, Gregory Haskins wrote: Michael S. Tsirkin wrote: On Wed, Aug 12, 2009 at 04:27:44PM -0400, Gregory Haskins wrote: Michael S. Tsirkin wrote: This adds support for vhost-net virtio kernel backend. This is RFC, but works without issues for me.

Re: qemu-kvm segfaults in qemu_del_timer (0.10.5 and 0.10.6)

2009-08-13 Thread Chris Webb
Chris Webb ch...@arachsys.com writes: Avi Kivity a...@redhat.com writes: I understand it's hard, but it's nearly impossible to work out the problem from so little data, so please do make the effort to obtain dumps. We're trying for this at the moment, but since we can't change the

Re: qemu-kvm segfaults in qemu_del_timer (0.10.5 and 0.10.6)

2009-08-13 Thread Chris Webb
Chris Webb ch...@arachsys.com writes: The segfault appears to be a null pointer dereference. ts-clock is NULL and line 1161 uses ts-clock-type: (gdb) p ts $4 = (QEMUTimer *) 0x30d1f30 (gdb) p ts-clock $5 = (QEMUClock *) 0x0 Sorry, meant to paste this too: (gdb) p *ts $1 =

Re: qemu-kvm segfaults in qemu_del_timer (0.10.5 and 0.10.6)

2009-08-13 Thread Avi Kivity
On 08/13/2009 03:23 PM, Chris Webb wrote: We've been lucky and relatively quickly got a core dump from one of the new qemu-kvms with the non-zero core file rlimit. A backtrace looks like this: (gdb) bt #0 0x004068f7 in qemu_mod_timer (ts=0x30d1f30, expire_time=430489) at

Re: qemu-kvm segfaults in qemu_del_timer (0.10.5 and 0.10.6)

2009-08-13 Thread Chris Webb
Avi Kivity a...@redhat.com writes: csock looks corrupted, should be -1 or an fd. Was a vnc client connected? Was the guest playing with the display resolution? Yes, I think in this case there was a vncviewer connected, and the guest had started booting up into windows, which changes the

Re: qemu-kvm segfaults in qemu_del_timer (0.10.5 and 0.10.6)

2009-08-13 Thread Chris Webb
Chris Webb ch...@arachsys.com writes: Avi Kivity a...@redhat.com writes: csock looks corrupted, should be -1 or an fd. Was a vnc client connected? Was the guest playing with the display resolution? Yes, I think in this case there was a vncviewer connected, and the guest had started

Re: qemu-kvm segfaults in qemu_del_timer (0.10.5 and 0.10.6)

2009-08-13 Thread Avi Kivity
On 08/13/2009 03:45 PM, Chris Webb wrote: Chris Webbch...@arachsys.com writes: Avi Kivitya...@redhat.com writes: csock looks corrupted, should be -1 or an fd. Was a vnc client connected? Was the guest playing with the display resolution? Yes, I think in this case there

Re: [PATCH 2/2] vhost_net: a kernel-level virtio server

2009-08-13 Thread Arnd Bergmann
On Wednesday 12 August 2009, Anthony Liguori wrote: At any rate, I'd like to see performance results before we consider trying to reuse virtio code. Yes, I agree. I'd also like to do more work on the macvlan extensions to see if it works out without involving a socket. Passing the socket into

Re: [PATCH 2/2] vhost_net: a kernel-level virtio server

2009-08-13 Thread Arnd Bergmann
On Thursday 13 August 2009, Arnd Bergmann wrote: Unfortunately, this also implies that you could no longer simply use the packet socket interface as you do currently, as I realized only now. This obviously has a significant impact on your user space interface. Also, if we do the copy in the

Re: [PATCH 2/2] vhost_net: a kernel-level virtio server

2009-08-13 Thread Arnd Bergmann
On Thursday 13 August 2009, Michael S. Tsirkin wrote: On Wed, Aug 12, 2009 at 07:59:47PM +0200, Arnd Bergmann wrote: The trick is to swap the virtqueues instead. virtio-net is actually mostly symmetric in just the same way that the physical wires on a twisted pair ethernet are symmetric (I

[PATCH] Documentation: Update KVM list email address

2009-08-13 Thread Amit Shah
The KVM list moved to vger.kernel.org last year Signed-off-by: Amit Shah amit.s...@redhat.com --- Documentation/ioctl/ioctl-number.txt |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Documentation/ioctl/ioctl-number.txt b/Documentation/ioctl/ioctl-number.txt index

Re: [PATCH 2/2] vhost_net: a kernel-level virtio server

2009-08-13 Thread Michael S. Tsirkin
On Thu, Aug 13, 2009 at 03:38:43PM +0200, Arnd Bergmann wrote: On Thursday 13 August 2009, Michael S. Tsirkin wrote: On Wed, Aug 12, 2009 at 07:59:47PM +0200, Arnd Bergmann wrote: The trick is to swap the virtqueues instead. virtio-net is actually mostly symmetric in just the same way

Re: [PATCH 2/2] vhost_net: a kernel-level virtio server

2009-08-13 Thread Michael S. Tsirkin
On Thu, Aug 13, 2009 at 03:48:35PM +0200, Arnd Bergmann wrote: On Thursday 13 August 2009, Arnd Bergmann wrote: Unfortunately, this also implies that you could no longer simply use the packet socket interface as you do currently, as I realized only now. This obviously has a significant

Re: [PATCH 2/2] vhost_net: a kernel-level virtio server

2009-08-13 Thread Arnd Bergmann
On Thursday 13 August 2009, Michael S. Tsirkin wrote: The best way to do this IMO would be to add zero copy support to raw sockets, vhost will then get it basically for free. Yes, that would be nice. I wonder if that could lead to security problems on TX though. I guess It will only bring

Re: [PATCH 2/2] vhost_net: a kernel-level virtio server

2009-08-13 Thread Arnd Bergmann
On Thursday 13 August 2009, Michael S. Tsirkin wrote: Right now, the number of copy operations in your code is the same. You are doing the copy a little bit later in skb_copy_datagram_iovec(), which is indeed a very nice hack. Changing to a virtqueue based method would imply that the host

Re: [PATCH 2/2] vhost_net: a kernel-level virtio server

2009-08-13 Thread Michael S. Tsirkin
On Thu, Aug 13, 2009 at 04:58:06PM +0200, Arnd Bergmann wrote: On Thursday 13 August 2009, Michael S. Tsirkin wrote: Right now, the number of copy operations in your code is the same. You are doing the copy a little bit later in skb_copy_datagram_iovec(), which is indeed a very nice

Re: [PATCH v3 7/8] Move IO APIC to its own lock.

2009-08-13 Thread Paul E. McKenney
On Thu, Aug 13, 2009 at 01:44:06PM +0300, Avi Kivity wrote: On 08/13/2009 01:09 PM, Gleb Natapov wrote: There's also srcu. What are the disadvantages? There should be some, otherwise why not use it all the time. I think it incurs an atomic op in the read path, but not much overhead

Re: [PATCH 2/2] vhost_net: a kernel-level virtio server

2009-08-13 Thread Avi Kivity
On 08/13/2009 05:53 PM, Arnd Bergmann wrote: On Thursday 13 August 2009, Michael S. Tsirkin wrote: The best way to do this IMO would be to add zero copy support to raw sockets, vhost will then get it basically for free. Yes, that would be nice. I wonder if that could lead to

[PATCH] Move irq sharing information to irqchip level.

2009-08-13 Thread Gleb Natapov
This removes assumptions that max GSIs is smaller than number of pins. Sharing is tracked on pin level not GSI level. Signed-off-by: Gleb Natapov g...@redhat.com diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index b17d845..4c15bdd 100644 ---

[PATCHv3 0/2] vhost: a kernel-level virtio server

2009-08-13 Thread Michael S. Tsirkin
This implements vhost: a kernel-level backend for virtio, The main motivation for this work is to reduce virtualization overhead for virtio by removing system calls on data path, without guest changes. For virtio-net, this removes up to 4 system calls per packet: vm exit for kick, reentry for

[PATCHv3 1/2] mm: export use_mm/unuse_mm to modules

2009-08-13 Thread Michael S. Tsirkin
vhost net module wants to do copy to/from user from a kernel thread, which needs use_mm (like what fs/aio has). Move that into mm/ and export to modules. Acked-by: Andrew Morton a...@linux-foundation.org Signed-off-by: Michael S. Tsirkin m...@redhat.com --- fs/aio.c| 47

[PATCHv3 2/2] vhost_net: a kernel-level virtio server

2009-08-13 Thread Michael S. Tsirkin
What it is: vhost net is a character device that can be used to reduce the number of system calls involved in virtio networking. Existing virtio net code is used in the guest without modification. There's similarity with vringfd, with some differences and reduced scope - uses eventfd for

[ kvm-Bugs-2837083 ] Wrong disk size on exported nbd device

2009-08-13 Thread SourceForge.net
Bugs item #2837083, was opened at 2009-08-13 16:27 Message generated for change (Tracker Item Submitted) made by atilaromero You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=893831aid=2837083group_id=180599 Please note that this message will contain a full copy of

Re: Page allocation failures in guest

2009-08-13 Thread Pierre Ossman
On Wed, 12 Aug 2009 15:01:52 +0930 Rusty Russell ru...@rustcorp.com.au wrote: On Wed, 12 Aug 2009 12:49:51 pm Rusty Russell wrote: On Tue, 11 Aug 2009 04:22:53 pm Avi Kivity wrote: On 08/11/2009 09:32 AM, Pierre Ossman wrote: I doesn't get out of it though, or at least the virtio net

[PATCH -tip v14 02/12] x86: x86 instruction decoder build-time selftest

2009-08-13 Thread Masami Hiramatsu
Add a user-space selftest of x86 instruction decoder at kernel build time. When CONFIG_X86_DECODER_SELFTEST=y, Kbuild builds a test harness of x86 instruction decoder and performs it after building vmlinux. The test compares the results of objdump and x86 instruction decoder code and check there

[PATCH -tip v14 01/12] x86: instruction decoder API

2009-08-13 Thread Masami Hiramatsu
Add x86 instruction decoder to arch-specific libraries. This decoder can decode x86 instructions used in kernel into prefix, opcode, modrm, sib, displacement and immediates. This can also show the length of instructions. This version introduces instruction attributes for decoding instructions.

[PATCH -tip v14 00/12] tracing: kprobe-based event tracer and x86 instruction decoder

2009-08-13 Thread Masami Hiramatsu
Hi, Here are the patches of kprobe-based event tracer for x86, version 14, which allows you to probe various kernel events through ftrace interface. The tracer supports per-probe filtering which allows you to set filters on each probe and shows formats of each probe. This version includes below

[PATCH -tip v14 04/12] kprobes: cleanup fix_riprel() using insn decoder on x86

2009-08-13 Thread Masami Hiramatsu
Cleanup fix_riprel() in arch/x86/kernel/kprobes.c by using x86 instruction decoder. Signed-off-by: Masami Hiramatsu mhira...@redhat.com Cc: Ananth N Mavinakayanahalli ana...@in.ibm.com Cc: Avi Kivity a...@redhat.com Cc: Andi Kleen a...@linux.intel.com Cc: Christoph Hellwig h...@infradead.org Cc:

[PATCH -tip v14 06/12] tracing: ftrace dynamic ftrace_event_call support

2009-08-13 Thread Masami Hiramatsu
Add dynamic ftrace_event_call support to ftrace. Trace engines can adds new ftrace_event_call to ftrace on the fly. Each operator functions of the call takes a ftrace_event_call data structure as an argument, because these functions may be shared among several ftrace_event_calls. Changes from

[PATCH -tip v14 07/12] tracing: Introduce TRACE_FIELD_ZERO() macro

2009-08-13 Thread Masami Hiramatsu
Use TRACE_FIELD_ZERO(type, item) instead of TRACE_FIELD_ZERO_CHAR(item). This also includes a fix of TRACE_ZERO_CHAR() macro. Signed-off-by: Masami Hiramatsu mhira...@redhat.com Cc: Ananth N Mavinakayanahalli ana...@in.ibm.com Cc: Avi Kivity a...@redhat.com Cc: Andi Kleen a...@linux.intel.com Cc:

[PATCH -tip v14 10/12] tracing: Generate names for each kprobe event automatically

2009-08-13 Thread Masami Hiramatsu
Generate names for each kprobe event based on the probe point, and remove generic k*probe event types because there is no user of those types. Signed-off-by: Masami Hiramatsu mhira...@redhat.com Cc: Ananth N Mavinakayanahalli ana...@in.ibm.com Cc: Avi Kivity a...@redhat.com Cc: Andi Kleen

[PATCH -tip v14 12/12] tracing: Add kprobes event profiling interface

2009-08-13 Thread Masami Hiramatsu
Add profiling interaces for each kprobes event. This interface provides how many times each probe hit or missed. Signed-off-by: Masami Hiramatsu mhira...@redhat.com Cc: Ananth N Mavinakayanahalli ana...@in.ibm.com Cc: Avi Kivity a...@redhat.com Cc: Andi Kleen a...@linux.intel.com Cc: Christoph

[PATCH -tip v14 08/12] tracing: add kprobe-based event tracer

2009-08-13 Thread Masami Hiramatsu
Add kprobes-based event tracer on ftrace. This tracer is similar to the events tracer which is based on Tracepoint infrastructure. Instead of Tracepoint, this tracer is based on kprobes (kprobe and kretprobe). It probes anywhere where kprobes can probe(this means, all functions body except for

[PATCH -tip v14 09/12] tracing: Kprobe-tracer supports more than 6 arguments

2009-08-13 Thread Masami Hiramatsu
Support up to 128 arguments for each kprobes event. Signed-off-by: Masami Hiramatsu mhira...@redhat.com Cc: Ananth N Mavinakayanahalli ana...@in.ibm.com Cc: Avi Kivity a...@redhat.com Cc: Andi Kleen a...@linux.intel.com Cc: Christoph Hellwig h...@infradead.org Cc: Frank Ch. Eigler f...@redhat.com

[PATCH -tip v14 11/12] tracing: Kprobe tracer assigns new event ids for each event

2009-08-13 Thread Masami Hiramatsu
Assigns new event ids for each kprobes event. This doesn't clear ring_buffer when unregistering each kprobe event. Thus, if you mind 'Unknown event' messages, clear the buffer manually after changing kprobe events. Signed-off-by: Masami Hiramatsu mhira...@redhat.com Cc: Ananth N Mavinakayanahalli

[PATCH -tip v14 03/12] kprobes: checks probe address is instruction boudary on x86

2009-08-13 Thread Masami Hiramatsu
Ensure safeness of inserting kprobes by checking whether the specified address is at the first byte of a instruction on x86. This is done by decoding probed function from its head to the probe point. Signed-off-by: Masami Hiramatsu mhira...@redhat.com Acked-by: Ananth N Mavinakayanahalli

[TOOL] kprobestest : Kprobe stress test tool

2009-08-13 Thread Masami Hiramatsu
This script tests kprobes to probe on all symbols in the kernel and finds symbols which must be blacklisted. Usage - kprobestest [-s SYMLIST] [-b BLACKLIST] [-w WHITELIST] Run stress test. If SYMLIST file is specified, use it as an initial symbol list (This is useful for

[TOOL] c2kpe: C expression to kprobe event format converter

2009-08-13 Thread Masami Hiramatsu
This program converts probe point in C expression to kprobe event format for kprobe-based event tracer. This helps to define kprobes events by C source line number or function name, and local variable name. Currently, this supports only x86(32/64) kernels. Compile Before compilation,

Re: [TOOL] c2kpe: C expression to kprobe event format converter

2009-08-13 Thread Christoph Hellwig
You rock, this is awesome! I'm a bit busy right now, but I'll play around with it ASAP and will see how well it works for me. -- 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

Guest OpenGL Acceleration

2009-08-13 Thread Gordan Bobic
Is OpenGL Acceleration based on the host's OpenGL capability available in KVM? Thanks. Gordan -- 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

Disk Emulation and Trim Instruction

2009-08-13 Thread Gordan Bobic
With the recent talk of the trim SATA instruction becoming supported in the upcoming versions of Windows and claims from Intel that support for it in their SSDs is imminent, it occurs to me that this would be equally useful in virtual disk emulation. Since the disk image is a sparse file, it