Re: kvm network latency, higher with virtio ?

2009-09-16 Thread Michael S. Tsirkin
On Tue, Sep 15, 2009 at 05:15:09PM +0200, Luca Bigliardi wrote: Hi, I'm running some tests between two linux instances bridged together. If I try to ping 10 times I obtain the following results: -net nic,model=virtio -net tap : rtt min/avg/max/mdev = 0.756/0.967/2.115/0.389 ms -net

Re: [PATCH -v2] QEMU-KVM: MCE: Relay UCR MCE to guest

2009-09-16 Thread Avi Kivity
On 09/16/2009 04:09 AM, Huang Ying wrote: On Mon, 2009-09-14 at 13:10 +0800, Avi Kivity wrote: On 09/14/2009 05:55 AM, Huang Ying wrote: Hi, Avi, On Thu, 2009-09-10 at 17:35 +0800, Andi Kleen wrote: (also, I if we can't handle guest-mode SIGBUS I think it would be nice to

Re: [PATCHv5 3/3] vhost_net: a kernel-level virtio server

2009-09-16 Thread Avi Kivity
On 09/15/2009 11:08 PM, Gregory Haskins wrote: There's virtio-console, virtio-blk etc. None of these have kernel-mode servers, but these could be implemented if/when needed. IIUC, Ira already needs at least ethernet and console capability. He's welcome to pick up the necessary

Re: kvm network latency, higher with virtio ?

2009-09-16 Thread Dor Laor
On 09/16/2009 10:27 AM, Michael S. Tsirkin wrote: On Tue, Sep 15, 2009 at 05:15:09PM +0200, Luca Bigliardi wrote: Hi, I'm running some tests between two linux instances bridged together. If I try to ping 10 times I obtain the following results: -net nic,model=virtio -net tap : rtt

Re: [KVM-AUTOTEST PATCH 1/2] Add KSM test

2009-09-16 Thread Dor Laor
On 09/15/2009 09:58 PM, Jiri Zupka wrote: After a quick review I have the following questions: 1. Why did you implement the guest tool in 'c' and not in python? Python is much simpler and you can share some code with the server. This 'test protocol' would also be easier to understand this

Re: Running kvm/use/kvmctl just segfault

2009-09-16 Thread shawn du
After debugging with gdb, I find out the mistake is me. It turns out that there should be three configures to do: in qemu-kvm root, in kvm, and in kvm/user, sadly, I missed the one in the middle. So, the consequence is that the definition of the type struct kvm_callbacks is different between

[PATCH QEMU-KVM 01/34] Add test device

2009-09-16 Thread Avi Kivity
From: Gerd Hoffmann kra...@redhat.com Add a test device which supports the kvmctl ioports, for running the test suite. Usage: qemu -chardev file,path=/log/file/some/where,id=testlog -device testdev,chardev=testlog Signed-off-by: Gerd Hoffmann kra...@redhat.com Signed-off-by: Avi

[PATCH QEMU-KVM 02/34] test: load image immediately after program headers

2009-09-16 Thread Avi Kivity
Otherwise, ld places the image somewhere where multiboot can't find the multiboot headers. Signed-off-by: Avi Kivity a...@redhat.com --- kvm/user/flat.lds |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/kvm/user/flat.lds b/kvm/user/flat.lds index 61f1057..d61bec3 100644

[PATCH QEMU-KVM 03/34] test: Set up a default stack

2009-09-16 Thread Avi Kivity
multiboot doesn't give us any stack, so we need to set one up. Signed-off-by: Avi Kivity a...@redhat.com --- kvm/user/test/x86/cstart64.S |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/kvm/user/test/x86/cstart64.S b/kvm/user/test/x86/cstart64.S index 432a3dc..4f116f9

[PATCH QEMU-KVM 05/34] test: Map 4GB of memory

2009-09-16 Thread Avi Kivity
Needed so the APIC can be accessed at address 0xfee0. Signed-off-by: Avi Kivity a...@redhat.com --- kvm/user/test/x86/cstart64.S |7 +-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/kvm/user/test/x86/cstart64.S b/kvm/user/test/x86/cstart64.S index 805938b..3f193a3

[PATCH QEMU-KVM 04/34] test: add multiboot headers to startup files

2009-09-16 Thread Avi Kivity
With these headers, multiboot can launch us directly in protected mode. Signed-off-by: Avi Kivity a...@redhat.com --- kvm/user/test/x86/cstart.S |9 + kvm/user/test/x86/cstart64.S |9 + 2 files changed, 18 insertions(+), 0 deletions(-) diff --git

[PATCH QEMU-KVM 09/34] test: fix realmode test print_serial() direction flag

2009-09-16 Thread Avi Kivity
Clear the direction flag to get the correct output. Signed-off-by: Avi Kivity a...@redhat.com --- kvm/user/test/x86/realmode.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/kvm/user/test/x86/realmode.c b/kvm/user/test/x86/realmode.c index 0db09b8..f9e303f 100644 ---

[PATCH QEMU-KVM 13/34] test: add cr8 latency tests

2009-09-16 Thread Avi Kivity
In light of the recent cr8/ept problem. Signed-off-by: Avi Kivity a...@redhat.com --- kvm/user/test/x86/vmexit.c | 16 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/kvm/user/test/x86/vmexit.c b/kvm/user/test/x86/vmexit.c index bd1895f..cce26d9 100644 ---

[PATCH QEMU-KVM 08/34] test: Remove smp support from access.c

2009-09-16 Thread Avi Kivity
Doesn't do anthing anyway. Signed-off-by: Avi Kivity a...@redhat.com --- kvm/user/test/x86/access.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kvm/user/test/x86/access.c b/kvm/user/test/x86/access.c index 272a4ef..5eadff8 100644 --- a/kvm/user/test/x86/access.c

[PATCH QEMU-KVM 06/34] test: use real APIC instead of fake APIC

2009-09-16 Thread Avi Kivity
smp temporarily disabled Signed-off-by: Avi Kivity a...@redhat.com --- kvm/user/test/x86/cstart64.S |9 ++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/kvm/user/test/x86/cstart64.S b/kvm/user/test/x86/cstart64.S index 3f193a3..912bcf8 100644 ---

[PATCH QEMU-KVM 15/34] test-device: add support for irq injection

2009-09-16 Thread Avi Kivity
This allows apic.flat to pass. Direct access to the ioapic is required, which is not supported by qdev at this time, so we pass the isa_irq array using a hack. Signed-off-by: Avi Kivity a...@redhat.com --- hw/pc.c |3 +++ hw/testdev.c |8 2 files changed, 11 insertions(+),

[PATCH QEMU-KVM 18/34] test: add x2apic test

2009-09-16 Thread Avi Kivity
Signed-off-by: Avi Kivity a...@redhat.com --- kvm/user/test/x86/apic.c | 46 ++ 1 files changed, 46 insertions(+), 0 deletions(-) diff --git a/kvm/user/test/x86/apic.c b/kvm/user/test/x86/apic.c index fdeec4c..504def2 100644 ---

[PATCH QEMU-KVM 11/34] test: Allow adding mode vmexit latency tests

2009-09-16 Thread Avi Kivity
Make the latency test run on an array of function pointers, which can be expanded with more tests. Signed-off-by: Avi Kivity a...@redhat.com --- kvm/user/test/x86/vmexit.c | 32 1 files changed, 28 insertions(+), 4 deletions(-) diff --git

[PATCH QEMU-KVM 27/34] test: initialize idt on all processors

2009-09-16 Thread Avi Kivity
Signed-off-by: Avi Kivity a...@redhat.com --- kvm/user/test/x86/cstart64.S |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/kvm/user/test/x86/cstart64.S b/kvm/user/test/x86/cstart64.S index 278465b..a55ad50 100644 --- a/kvm/user/test/x86/cstart64.S +++

[PATCH QEMU-KVM 16/34] test: Use function table for APIC access

2009-09-16 Thread Avi Kivity
Prepare for x2apic. Signed-off-by: Avi Kivity a...@redhat.com --- kvm/user/test/x86/apic.c | 41 +++-- 1 files changed, 39 insertions(+), 2 deletions(-) diff --git a/kvm/user/test/x86/apic.c b/kvm/user/test/x86/apic.c index b712ef8..72dd963 100644 ---

[PATCH QEMU-KVM 20/34] test: Add fwcfg interface for getting the cpu count

2009-09-16 Thread Avi Kivity
Signed-off-by: Avi Kivity a...@redhat.com --- kvm/user/test/lib/x86/fwcfg.c |5 + kvm/user/test/lib/x86/fwcfg.h |2 ++ 2 files changed, 7 insertions(+), 0 deletions(-) diff --git a/kvm/user/test/lib/x86/fwcfg.c b/kvm/user/test/lib/x86/fwcfg.c index a9a2ce2..2cf7cec 100644 ---

[PATCH QEMU-KVM 14/34] test: Mask PIC interrupts before APIC test

2009-09-16 Thread Avi Kivity
We aren't ready to handle PIC interrupts, so mask them. Signed-off-by: Avi Kivity a...@redhat.com --- kvm/user/test/x86/apic.c | 13 + 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/kvm/user/test/x86/apic.c b/kvm/user/test/x86/apic.c index 7794615..b712ef8 100644

[PATCH QEMU-KVM 10/34] test: port readmode tests to multiboot

2009-09-16 Thread Avi Kivity
Signed-off-by: Avi Kivity a...@redhat.com --- kvm/user/test/x86/realmode.c | 52 --- kvm/user/test/x86/realmode.lds |6 + 2 files changed, 43 insertions(+), 15 deletions(-) diff --git a/kvm/user/test/x86/realmode.c b/kvm/user/test/x86/realmode.c

[PATCH QEMU-KVM 24/34] test: switch 64-bit smp startup to real APIC

2009-09-16 Thread Avi Kivity
Signed-off-by: Avi Kivity a...@redhat.com --- kvm/user/test/x86/cstart64.S | 74 - 1 files changed, 43 insertions(+), 31 deletions(-) diff --git a/kvm/user/test/x86/cstart64.S b/kvm/user/test/x86/cstart64.S index 14bb98c..278465b 100644 ---

[PATCH QEMU-KVM 17/34] test: use new apic_icr_write() to issue IPI

2009-09-16 Thread Avi Kivity
Signed-off-by: Avi Kivity a...@redhat.com --- kvm/user/test/x86/apic.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kvm/user/test/x86/apic.c b/kvm/user/test/x86/apic.c index 72dd963..fdeec4c 100644 --- a/kvm/user/test/x86/apic.c +++ b/kvm/user/test/x86/apic.c @@

[PATCH QEMU-KVM 31/34] test: drop irq.flat

2009-09-16 Thread Avi Kivity
Obsolete. Signed-off-by: Avi Kivity a...@redhat.com --- kvm/user/config-x86-common.mak |2 - kvm/user/config-x86_64.mak |2 +- kvm/user/test/x86/irq.S| 118 3 files changed, 1 insertions(+), 121 deletions(-) delete mode 100644

[PATCH QEMU-KVM 33/34] test: Fix compilation rule for assembly files wrt autodependencies

2009-09-16 Thread Avi Kivity
Only compile the first dependency (the source file), not the rest (headers). Signed-off-by: Avi Kivity a...@redhat.com --- kvm/user/Makefile |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/kvm/user/Makefile b/kvm/user/Makefile index d9fbf17..ed462bb 100644 ---

[PATCH QEMU-KVM 26/34] test: Use xapic_write() to enable xapic()

2009-09-16 Thread Avi Kivity
apic_write() depends on apic_ops, which is shared among cpus and can be modified if another cpu enabled x2apic. Use xapic_write() which is race-proof. Signed-off-by: Avi Kivity a...@redhat.com --- kvm/user/test/lib/x86/apic.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff

[PATCH QEMU-KVM 19/34] test: add support for the firmware configuration interface

2009-09-16 Thread Avi Kivity
Signed-off-by: Avi Kivity a...@redhat.com --- kvm/user/config-x86-common.mak |2 + kvm/user/test/lib/x86/fwcfg.c | 35 + kvm/user/test/lib/x86/fwcfg.h | 42 3 files changed, 79 insertions(+), 0 deletions(-) create

[PATCH QEMU-KVM 25/34] test: add apic_id() accessor

2009-09-16 Thread Avi Kivity
apic and x2apic have different formats for the ID register, so we need an accessor for it. Signed-off-by: Avi Kivity a...@redhat.com --- kvm/user/test/lib/x86/apic.c | 18 ++ kvm/user/test/lib/x86/apic.h |1 + 2 files changed, 19 insertions(+), 0 deletions(-) diff --git

[PATCH QEMU-KVM 32/34] test: fix autodependencies

2009-09-16 Thread Avi Kivity
The autodependencies files were generated, but not included. Signed-off-by: Avi Kivity a...@redhat.com --- kvm/user/config-x86-common.mak |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/kvm/user/config-x86-common.mak b/kvm/user/config-x86-common.mak index

[PATCH QEMU-KVM 34/34] test: avoid deleting intermediate .o files

2009-09-16 Thread Avi Kivity
If make doesn't see an intermediate file mentioned explicitly, it deletes it after making the target. This silly behaviour causes needless rebuilds. Add all intermediates as explicit dependncies to prevent this behaviour. Signed-off-by: Avi Kivity a...@redhat.com ---

Writting iptables rules to accept inbound connections to kvm guests

2009-09-16 Thread carlopmart
Hi all, I have installed a CentOS 5.3 x86_64 server with kvm and libvirt to do some tests for future virtualized deployments. My environment: eth0 -- 172.25.50.1/24 (public host ip) virbr0 --- 192.168.122.1/24 (natted interface installed by libvirt) virbr1 --- 172.26.50.0/24 (isolated

Re: [PATCHv5 3/3] vhost_net: a kernel-level virtio server

2009-09-16 Thread Gregory Haskins
Avi Kivity wrote: On 09/15/2009 11:08 PM, Gregory Haskins wrote: There's virtio-console, virtio-blk etc. None of these have kernel-mode servers, but these could be implemented if/when needed. IIUC, Ira already needs at least ethernet and console capability. He's welcome to

[PATCH 4/4] KVM: VMX: Use shared msr infrastructure

2009-09-16 Thread Avi Kivity
Instead of reloading syscall MSRs on every preemption, use the new shared msr infrastructure to reload them at the last possible minute (just before exit to userspace). Improves vcpu/idle/vcpu switches by about 2000 cycles (when EFER needs to be reloaded as well). Signed-off-by: Avi Kivity

[PATCH 3/4] KVM: x86 shared msr infrastructure

2009-09-16 Thread Avi Kivity
The various syscall-related MSRs are fairly expensive to switch. Currently we switch them on every vcpu preemption, which is far too often: - if we're switching to a kernel thread (idle task, threaded interrupt, kernel-mode virtio server (vhost-net), for example) and back, then there's no

[PATCH 2/4] KVM: VMX: Move MSR_KERNEL_GS_BASE out of the vmx autoload msr area

2009-09-16 Thread Avi Kivity
Currently MSR_KERNEL_GS_BASE is saved and restored as part of the guest/host msr reloading. Since we wish to lazy-restore all the other msrs, save and reload MSR_KERNEL_GS_BASE explicitly instead of using the common code. Signed-off-by: Avi Kivity a...@redhat.com --- arch/x86/kvm/vmx.c | 34

[PATCH 0/4] User return notifiers / just-in-time MSR switching for KVM

2009-09-16 Thread Avi Kivity
The various x86 syscall related MSRs (MSR_LSTAR and friends, EFER when SCE needs to be updated) are fairly expensive to read or write. Since different operating systems can set different values for these MSRs, KVM needs to reload them when switching to a different guest or to the host. Switching

[PATCH 1/4] core, x86: Add user return notifiers

2009-09-16 Thread Avi Kivity
Add a general per-cpu notifier that is called whenever the kernel is about to return to userspace. The notifier uses a thread_info flag and existing checks, so there is no impact on user return or context switch fast paths. Signed-off-by: Avi Kivity a...@redhat.com --- arch/Kconfig

Re: [PATCHv5 3/3] vhost_net: a kernel-level virtio server

2009-09-16 Thread Avi Kivity
On 09/16/2009 02:44 PM, Gregory Haskins wrote: The problem isn't where to find the models...the problem is how to aggregate multiple models to the guest. You mean configuration? You instantiate multiple vhost-nets. Multiple ethernet NICs is a supported configuration for kvm. But

Re: [KVM-AUTOTEST PATCH 1/2] Add KSM test

2009-09-16 Thread Jiri Zupka
- Dor Laor dl...@redhat.com wrote: On 09/15/2009 09:58 PM, Jiri Zupka wrote: After a quick review I have the following questions: 1. Why did you implement the guest tool in 'c' and not in python? Python is much simpler and you can share some code with the server. This 'test

[PATCH 9/9] KVM: remove duplicated #include

2009-09-16 Thread Huang Weiyi
Remove duplicated #include('s) in arch/x86/kvm/lapic.c Signed-off-by: Huang Weiyi weiyi.hu...@gmail.com --- arch/x86/kvm/lapic.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c index 1ae5ceb..1fa20c4 100644 ---

Re: [KVM-AUTOTEST PATCH 1/2] Add KSM test

2009-09-16 Thread Dor Laor
On 09/16/2009 04:09 PM, Jiri Zupka wrote: - Dor Laordl...@redhat.com wrote: On 09/15/2009 09:58 PM, Jiri Zupka wrote: After a quick review I have the following questions: 1. Why did you implement the guest tool in 'c' and not in python? Python is much simpler and you can share some

[PATCH 5/5] KVM: SVM: Remove remaining occurences of rdtscll

2009-09-16 Thread Joerg Roedel
This patch replaces them with native_read_tsc() which can also be used in expressions and saves a variable on the stack in this case. Signed-off-by: Joerg Roedel joerg.roe...@amd.com --- arch/x86/kvm/svm.c |7 +++ 1 files changed, 3 insertions(+), 4 deletions(-) diff --git

[PATCH 3/5] KVM: SVM: Fix tsc offset adjustment when running nested

2009-09-16 Thread Joerg Roedel
When svm_vcpu_load is called while the vcpu is running in guest mode the tsc adjustment made there is lost on the next emulated #vmexit. This causes the tsc running backwards in the guest. This patch fixes the issue by also adjusting the tsc_offset in the emulated hsave area so that it will not

[PATCH 1/5] KVM: SVM: reorganize svm_interrupt_allowed

2009-09-16 Thread Joerg Roedel
This patch reorganizes the logic in svm_interrupt_allowed to make it better to read. This is important because the logic is a lot more complicated with Nested SVM. Signed-off-by: Joerg Roedel joerg.roe...@amd.com --- arch/x86/kvm/svm.c | 16 1 files changed, 12 insertions(+),

[PATCH 0/5] Another set of Nested SVM fixes and cleanups

2009-09-16 Thread Joerg Roedel
Hi, this series of patches contain another set of cleanups and an important fix to the Nested SVM code. These patches make the TSC handling code for SVM aware of a nested guest. This fixes the TSC running backwards on guest and nested guest. The backwards running TSC resulted in stalled guests

[PATCH 2/5] KVM: SVM: don't copy exit_int_info on nested vmrun

2009-09-16 Thread Joerg Roedel
The exit_int_info field is only written by the hardware and never read. So it does not need to be copied on a vmrun emulation. Signed-off-by: Joerg Roedel joerg.roe...@amd.com --- arch/x86/kvm/svm.c |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/svm.c

[PATCH 4/5] KVM: SVM: Handle tsc in svm_get_msr/svm_set_msr correctly

2009-09-16 Thread Joerg Roedel
When running nested we need to touch the l1 guests tsc_offset. Otherwise changes will be lost or a wrong value be read. Signed-off-by: Joerg Roedel joerg.roe...@amd.com --- arch/x86/kvm/svm.c | 23 +-- 1 files changed, 17 insertions(+), 6 deletions(-) diff --git

Re: [PATCH 0/5] Another set of Nested SVM fixes and cleanups

2009-09-16 Thread Avi Kivity
On 09/16/2009 04:24 PM, Joerg Roedel wrote: Hi, this series of patches contain another set of cleanups and an important fix to the Nested SVM code. These patches make the TSC handling code for SVM aware of a nested guest. This fixes the TSC running backwards on guest and nested guest. The

Re: [PATCHv5 3/3] vhost_net: a kernel-level virtio server

2009-09-16 Thread Gregory Haskins
Avi Kivity wrote: On 09/16/2009 02:44 PM, Gregory Haskins wrote: The problem isn't where to find the models...the problem is how to aggregate multiple models to the guest. You mean configuration? You instantiate multiple vhost-nets. Multiple ethernet NICs is a supported

Re: [PATCH 0/5] Another set of Nested SVM fixes and cleanups

2009-09-16 Thread Joerg Roedel
On Wed, Sep 16, 2009 at 05:02:59PM +0300, Avi Kivity wrote: On 09/16/2009 04:24 PM, Joerg Roedel wrote: Hi, this series of patches contain another set of cleanups and an important fix to the Nested SVM code. These patches make the TSC handling code for SVM aware of a nested guest. This

Re: vhost-net todo list

2009-09-16 Thread Arnd Bergmann
On Wednesday 16 September 2009, Michael S. Tsirkin wrote: vhost-net driver projects I still think that list should include - UDP multicast socket support - TCP socket support - raw packet socket support for qemu (from Or Gerlitz) if we have those, plus the tap support that is already on your

Re: [PATCHv5 3/3] vhost_net: a kernel-level virtio server

2009-09-16 Thread Arnd Bergmann
On Tuesday 15 September 2009, Michael S. Tsirkin wrote: Userspace in x86 maps a PCI region, uses it for communication with ppc? This might have portability issues. On x86 it should work, but if the host is powerpc or similar, you cannot reliably access PCI I/O memory through copy_tofrom_user but

Re: vhost-net todo list

2009-09-16 Thread Michael S. Tsirkin
On Wed, Sep 16, 2009 at 04:52:40PM +0200, Arnd Bergmann wrote: On Wednesday 16 September 2009, Michael S. Tsirkin wrote: vhost-net driver projects I still think that list should include Yea, why not. Go wild. - UDP multicast socket support - TCP socket support Switch to UDP unicast

Re: vhost-net todo list

2009-09-16 Thread Arnd Bergmann
On Wednesday 16 September 2009, Michael S. Tsirkin wrote: On Wed, Sep 16, 2009 at 04:52:40PM +0200, Arnd Bergmann wrote: On Wednesday 16 September 2009, Michael S. Tsirkin wrote: vhost-net driver projects I still think that list should include Yea, why not. Go wild. - UDP

Re: [PATCHv5 3/3] vhost_net: a kernel-level virtio server

2009-09-16 Thread Michael S. Tsirkin
On Wed, Sep 16, 2009 at 04:57:42PM +0200, Arnd Bergmann wrote: On Tuesday 15 September 2009, Michael S. Tsirkin wrote: Userspace in x86 maps a PCI region, uses it for communication with ppc? This might have portability issues. On x86 it should work, but if the host is powerpc or similar,

Re: vhost-net todo list

2009-09-16 Thread Michael S. Tsirkin
On Wed, Sep 16, 2009 at 05:08:46PM +0200, Arnd Bergmann wrote: On Wednesday 16 September 2009, Michael S. Tsirkin wrote: On Wed, Sep 16, 2009 at 04:52:40PM +0200, Arnd Bergmann wrote: On Wednesday 16 September 2009, Michael S. Tsirkin wrote: vhost-net driver projects I still think

Re: [PATCHv5 3/3] vhost_net: a kernel-level virtio server

2009-09-16 Thread Arnd Bergmann
On Wednesday 16 September 2009, Michael S. Tsirkin wrote: On Wed, Sep 16, 2009 at 04:57:42PM +0200, Arnd Bergmann wrote: On Tuesday 15 September 2009, Michael S. Tsirkin wrote: Userspace in x86 maps a PCI region, uses it for communication with ppc? This might have portability issues. On

Re: vhost-net todo list

2009-09-16 Thread Arnd Bergmann
On Wednesday 16 September 2009, Michael S. Tsirkin wrote: No, I think this is less important, because the bridge code also doesn't do this. True, but the reason might be that it is much harder in bridge (you have to snoop multicast registrations). With macvlan you know which multicasts

GDB + KVM Debug

2009-09-16 Thread Saksena, Abhishek
Hi All, I see Qemu support GDB server that allows debugging kernels, boot loaders and others. Is this kind of support is available when KVM is enabled. For some reason the single stepping of instructions doesn't seem to work when KVM is in use. So what debug capabilities (for Guest SW) KVM

Re: [PATCHv5 3/3] vhost_net: a kernel-level virtio server

2009-09-16 Thread Avi Kivity
On 09/16/2009 05:10 PM, Gregory Haskins wrote: If kvm can do it, others can. The problem is that you seem to either hand-wave over details like this, or you give details that are pretty much exactly what vbus does already. My point is that I've already sat down and thought about these

Re: GDB + KVM Debug

2009-09-16 Thread Jan Kiszka
Saksena, Abhishek wrote: Hi All, I see Qemu support GDB server that allows debugging kernels, boot loaders and others. Is this kind of support is available when KVM is enabled. Yes. For some reason the single stepping of instructions doesn't seem to work when KVM is in use. So what

Re: [PATCHv5 3/3] vhost_net: a kernel-level virtio server

2009-09-16 Thread Michael S. Tsirkin
On Wed, Sep 16, 2009 at 05:22:37PM +0200, Arnd Bergmann wrote: On Wednesday 16 September 2009, Michael S. Tsirkin wrote: On Wed, Sep 16, 2009 at 04:57:42PM +0200, Arnd Bergmann wrote: On Tuesday 15 September 2009, Michael S. Tsirkin wrote: Userspace in x86 maps a PCI region, uses it for

Re: GDB + KVM Debug

2009-09-16 Thread Jan Kiszka
Saksena, Abhishek wrote: Thanks for the quick reply. What versions (kernel/kvm-kmod and qemu-kvm) are you using? What is your host, what your target architecture/operating mode (real mode, 32 bit prot. mode, 64 bit mode)? I am using KVM-74? Do I need to upgrade then? Yes, definitely.

Re: vhost-net todo list

2009-09-16 Thread Michael S. Tsirkin
On Wed, Sep 16, 2009 at 05:27:25PM +0200, Arnd Bergmann wrote: On Wednesday 16 September 2009, Michael S. Tsirkin wrote: No, I think this is less important, because the bridge code also doesn't do this. True, but the reason might be that it is much harder in bridge (you have to

Re: vhost-net todo list

2009-09-16 Thread Avi Kivity
On 09/16/2009 06:27 PM, Arnd Bergmann wrote: That scenario is probably not so relevant for KVM, unless you consider the guest taking over the qemu host process a valid security threat. It is. We address it by using SCM_RIGHTS for all sensitive operations and selinuxing qemu as tightly as

Re: GDB + KVM Debug

2009-09-16 Thread Avi Kivity
On 09/16/2009 07:37 PM, Jan Kiszka wrote: My target is x86 and we want to debug all real, prot. and 64 bit mode. If your host is running 64 bit mode but your target uses less, you need an extra patch [1] to deal with gdb limitations and a lacking workaround in qemu(-kvm). Can you

KVM module build problem on today's git testing

2009-09-16 Thread Lucas Meneghel Rodrigues
Hi folks, I've got a build problem on today's git testing, the relevant bits of the failure can be seen here: 09/16 13:17:22 INFO |kvm_instal:0279| Building KVM modules 09/16 13:17:22 DEBUG| utils:0053| Running './configure' 09/16 13:17:22 DEBUG| utils:0053| Running 'make clean' 09/16

Re: GDB + KVM Debug

2009-09-16 Thread Jan Kiszka
Avi Kivity wrote: On 09/16/2009 07:37 PM, Jan Kiszka wrote: My target is x86 and we want to debug all real, prot. and 64 bit mode. If your host is running 64 bit mode but your target uses less, you need an extra patch [1] to deal with gdb limitations and a lacking workaround in

Re: [PATCH -v2] QEMU-KVM: MCE: Relay UCR MCE to guest

2009-09-16 Thread Marcelo Tosatti
On Wed, Sep 09, 2009 at 10:28:02AM +0800, Huang Ying wrote: UCR (uncorrected recovery) MCE is supported in recent Intel CPUs, where some hardware error such as some memory error can be reported without PCC (processor context corrupted). To recover from such MCE, the corresponding memory will

Re: GDB + KVM Debug

2009-09-16 Thread Avi Kivity
On 09/16/2009 08:56 PM, Jan Kiszka wrote: Can you post this against qemu-kvm, with a switch to disable it in case it interferes with a theoretical fixed gdb? Any fix for gdb will require some work on the qemu side as well to actually use it (we will have to transfer additional system

[PATCH] Autotest 0.11.1: KVM test: Unbreaking release tag detection

2009-09-16 Thread Lucas Meneghel Rodrigues
This makes the KVM release tag detection fix available for autotest 0.11.1. Signed-off-by: Lucas Meneghel Rodrigues l...@redhat.com --- Index: 0.11.1/client/tests/kvm/control === --- 0.11.1/client/tests/kvm/control (revision

Autotest 0.11.1: KVM test: Fixing shutdown test

2009-09-16 Thread Lucas Meneghel Rodrigues
Only close session after we are sure the guest is down on shutdown test. Backport of a fix present on trunk. Signed-off-by: Lucas Meneghel Rodrigues l...@redhat.com --- Index: 0.11.1/client/tests/kvm/kvm_tests.py === ---

RE: GDB + KVM Debug

2009-09-16 Thread Saksena, Abhishek
I am using KVM-88. However I can't get gdb still working. I stared qemu with -s -S option and when I try to connect gdb to it I get following error:- (gdb) target remote lochost:1234 lochost: unknown host lochost:1234: No such file or directory. (gdb) target remote locahost:1234 locahost:

Re: [PATCHv5 3/3] vhost_net: a kernel-level virtio server

2009-09-16 Thread Gregory Haskins
Avi Kivity wrote: On 09/16/2009 05:10 PM, Gregory Haskins wrote: If kvm can do it, others can. The problem is that you seem to either hand-wave over details like this, or you give details that are pretty much exactly what vbus does already. My point is that I've already sat down and

Re: KVM module build problem on today's git testing

2009-09-16 Thread Lucas Meneghel Rodrigues
Ok, Marcelo promptly fixed kvm-kmod e9f6d366fa77a0988bcba2554a63a539ff1b2358 Date: Wed Sep 16 15:44:20 2009 -0300 Add printk_once definition And now build works fine. Thank you very much Marcelo! On Wed, Sep 16, 2009 at 2:48 PM, Lucas Meneghel Rodrigues l...@redhat.com wrote: Hi

Re: [PATCHv5 3/3] vhost_net: a kernel-level virtio server

2009-09-16 Thread Avi Kivity
On 09/16/2009 10:22 PM, Gregory Haskins wrote: Avi Kivity wrote: On 09/16/2009 05:10 PM, Gregory Haskins wrote: If kvm can do it, others can. The problem is that you seem to either hand-wave over details like this, or you give details that are pretty much exactly what

Re: KVM module build problem on today's git testing

2009-09-16 Thread Avi Kivity
On 09/16/2009 10:18 PM, Lucas Meneghel Rodrigues wrote: Ok, Marcelo promptly fixed kvm-kmod e9f6d366fa77a0988bcba2554a63a539ff1b2358 Date: Wed Sep 16 15:44:20 2009 -0300 Add printk_once definition And now build works fine. Thank you very much Marcelo! Regardless, kvm-kmod is

Re: [PATCH 3/4] KVM: x86 shared msr infrastructure

2009-09-16 Thread Marcelo Tosatti
On Wed, Sep 16, 2009 at 03:45:33PM +0300, Avi Kivity wrote: The various syscall-related MSRs are fairly expensive to switch. Currently we switch them on every vcpu preemption, which is far too often: - if we're switching to a kernel thread (idle task, threaded interrupt, kernel-mode

Re: [PATCH 3/4] KVM: x86 shared msr infrastructure

2009-09-16 Thread Avi Kivity
On 09/17/2009 12:21 AM, Marcelo Tosatti wrote: +static struct kvm_shared_msrs_global __read_mostly shared_msrs_global; Does this assume the MSRs in question are consistent across CPUs? Yes. And they are. I guess that is not true with arch_prctl(ARCH_SET_GS/ARCH_GET_GS) ?

Re: [PATCH -v2] QEMU-KVM: MCE: Relay UCR MCE to guest

2009-09-16 Thread Huang Ying
On Thu, 2009-09-17 at 01:59 +0800, Marcelo Tosatti wrote: On Wed, Sep 09, 2009 at 10:28:02AM +0800, Huang Ying wrote: UCR (uncorrected recovery) MCE is supported in recent Intel CPUs, where some hardware error such as some memory error can be reported without PCC (processor context

Re: [PATCHv5 3/3] vhost_net: a kernel-level virtio server

2009-09-16 Thread Gregory Haskins
Avi Kivity wrote: On 09/16/2009 10:22 PM, Gregory Haskins wrote: Avi Kivity wrote: On 09/16/2009 05:10 PM, Gregory Haskins wrote: If kvm can do it, others can. The problem is that you seem to either hand-wave over details like this, or you give details that are pretty

[PATCH] KVM test: Verify configure script capabilities before assuming --disable-strip

2009-09-16 Thread Lucas Meneghel Rodrigues
Instead of just assuming we can use --disable-strip, keep a record of the supported configure options and only use that particular option if it's supported. Signed-off-by: Lucas Meneghel Rodrigues l...@redhat.com --- diff --git a/client/tests/kvm/tests/build.py b/client/tests/kvm/tests/build.py

Re: [PATCHv5 3/3] vhost_net: a kernel-level virtio server

2009-09-16 Thread Michael S. Tsirkin
On Wed, Sep 16, 2009 at 10:10:55AM -0400, Gregory Haskins wrote: There is no role reversal. So if I have virtio-blk driver running on the x86 and vhost-blk device running on the ppc board, I can use the ppc board as a block-device. What if I really wanted to go the other way? It seems ppc

Re: [PATCHv5 3/3] vhost_net: a kernel-level virtio server

2009-09-16 Thread Gregory Haskins
Michael S. Tsirkin wrote: On Wed, Sep 16, 2009 at 10:10:55AM -0400, Gregory Haskins wrote: There is no role reversal. So if I have virtio-blk driver running on the x86 and vhost-blk device running on the ppc board, I can use the ppc board as a block-device. What if I really wanted to go the

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

2009-09-16 Thread Michael S. Tsirkin
Hi Andrew, On Tue, Aug 11, 2009 at 03:10:10PM -0700, Andrew Morton wrote: On Wed, 12 Aug 2009 00:27:52 +0300 Michael S. Tsirkin m...@redhat.com wrote: 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

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

2009-09-16 Thread Andrew Morton
On Thu, 17 Sep 2009 08:38:18 +0300 Michael S. Tsirkin m...@redhat.com wrote: Hi Andrew, On Tue, Aug 11, 2009 at 03:10:10PM -0700, Andrew Morton wrote: On Wed, 12 Aug 2009 00:27:52 +0300 Michael S. Tsirkin m...@redhat.com wrote: vhost net module wants to do copy to/from user from a