Re: [PATCH 01/10] Add test device for use with the test suite

2009-09-14 Thread Avi Kivity
On 09/14/2009 11:01 AM, Avi Kivity wrote: On 09/14/2009 10:52 AM, Gerd Hoffmann wrote: This is lame, isn't it? We have qdev now! Yes. But who knows how to use it? Didn't notice you had a patch there. Thanks. Will repost with your patch. -- error compiling committee.c: too many arguments

Re: Running kvm/use/kvmctl just segfault

2009-09-14 Thread Avi Kivity
On 09/14/2009 06:38 PM, shawn du wrote: Well, in fact not only the smp test failed, all tests failed. I don't know it is just me or not. But after debugging the kvmctl main.c and libkvm.c code, I found out that it is the invocation to pre_kvm_run() and post_kvm_run() caused the segfault, it is

[GIT PULL][RESEND]KVM updates for 2.6.32-rc1

2009-09-14 Thread Avi Kivity
to a vm8086 task, load segments as 16-bit Avi Kivity (37): KVM: x86 emulator: Implement zero-extended immediate decoding KVM: x86 emulator: fix jmp far decoding (opcode 0xea) KVM: Move common KVM Kconfig items to new file virt/kvm/Kconfig KVM: SVM: Fold kvm_svm.h info svm.c

Re: Running kvm/use/kvmctl just segfault

2009-09-15 Thread Avi Kivity
On 09/15/2009 05:33 AM, shawn du wrote: Yes, I am running the latest qemu-kvm.git against the not so latest 2.6.27.18 kernel in Ubuntu 8.10. Normal VMs just run smoothly. Is there a problem? It should work. If it doesn't, well, debug it with gdb. -- error compiling committee.c: too many

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

2009-09-15 Thread Avi Kivity
On 09/14/2009 07:47 PM, Michael S. Tsirkin wrote: On Mon, Sep 14, 2009 at 12:08:55PM -0400, Gregory Haskins wrote: For Ira's example, the addresses would represent a physical address on the PCI boards, and would follow any kind of relevant rules for converting a GPA to a host accessible

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

2009-09-15 Thread Avi Kivity
On 09/14/2009 10:14 PM, Gregory Haskins wrote: To reiterate, as long as the model is such that the ppc boards are considered the owner (direct access, no translation needed) I believe it will work. If the pointers are expected to be owned by the host, then my model doesn't work well either.

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

2009-09-15 Thread Avi Kivity
On 09/15/2009 04:03 PM, Gregory Haskins wrote: In this case the x86 is the owner and the ppc boards use translated access. Just switch drivers and device and it falls into place. You could switch vbus roles as well, I suppose. Right, there's not real difference in this regard.

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

2009-09-15 Thread Avi Kivity
On 09/15/2009 04:50 PM, Gregory Haskins wrote: Why? vhost will call get_user_pages() or copy_*_user() which ought to do the right thing. I was speaking generally, not specifically to Ira's architecture. What I mean is that vbus was designed to work without assuming that the memory is

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

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

[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 a/kvm/user/test/x86

[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 --- a/kvm/user/test/x86

[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 --- a/kvm/user/test/x86

[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 a/kvm/user/test/x86

[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 +++ b/kvm/user/test

[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 --- a/kvm

[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 --- a/kvm

[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 --- a/kvm/user

[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 kvm

[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 --- a/kvm

[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 41e8c8d

[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 --- kvm/user/config-x86

[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 MSRs will have identical values and reloading is unnecessary. This patch uses the new user return notifiers to implement last-minute switching, and checks the msr values to avoid unnecessary reloading. Signed-off-by: Avi Kivity a...@redhat.com --- arch/x86/include/asm/kvm_host.h |3 + arch/x86

[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
return to userspace. This has been written so that there is no code impact if KVM is not configured, and no runtime impact if KVM is not running. The patchset improves guest/idle/guest switches by about 2000 cycles. Avi Kivity (4): core, x86: Add user return notifiers KVM: VMX: Move

[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: [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 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: 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

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

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 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: [PATCHv5 3/3] vhost_net: a kernel-level virtio server

2009-09-17 Thread Avi Kivity
On 09/17/2009 06:11 AM, Gregory Haskins wrote: irqfd/eventfd is the abstraction layer, it doesn't need to be reabstracted. Not per se, but it needs to be interfaced. How do I register that eventfd with the fastpath in Ira's rig? How do I signal the eventfd (x86-ppc, and ppc-x86)?

[PATCH v2] core, x86: Add user return notifiers

2009-09-19 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 --- v2: include new files

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

2009-09-19 Thread Avi Kivity
On 09/18/2009 09:14 PM, H. Peter Anvin wrote: On 09/16/2009 05:45 AM, Avi Kivity wrote: 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

Re: [PATCH 01/24] Don't disable werror unconditionally

2009-09-19 Thread Avi Kivity
On 09/18/2009 10:02 PM, Marcelo Tosatti wrote: On Fri, Sep 18, 2009 at 01:41:10PM +0200, Juan Quintela wrote: Signed-off-by: Juan Quintelaquint...@redhat.com --- configure |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/configure b/configure index

[PATCH QEMU-KVM 0/7] test: more IPI tests

2009-09-21 Thread Avi Kivity
The following patchset, besides fixing IPIs to actually work, adds two IPI latency tests (back-to-back IPIs and IPI-then-spin) and improves the framework a bit. Avi Kivity (7): test: issue EOI after IPI test: set up per-cpu area test: optimize smp_id() test: add conditional execution

[PATCH QEMU-KVM 2/7] test: set up per-cpu area

2009-09-21 Thread Avi Kivity
Currently sharing space with the stack. Signed-off-by: Avi Kivity a...@redhat.com --- kvm/user/test/x86/cstart64.S | 11 +++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/kvm/user/test/x86/cstart64.S b/kvm/user/test/x86/cstart64.S index e5554ba..f1a9d09 100644

[PATCH QEMU-KVM 3/7] test: optimize smp_id()

2009-09-21 Thread Avi Kivity
Rather than reading it from the APIC, read it from the per-cpu area. Signed-off-by: Avi Kivity a...@redhat.com --- kvm/user/test/lib/x86/smp.c | 17 +++-- 1 files changed, 15 insertions(+), 2 deletions(-) diff --git a/kvm/user/test/lib/x86/smp.c b/kvm/user/test/lib/x86/smp.c index

[PATCH QEMU-KVM 1/7] test: issue EOI after IPI

2009-09-21 Thread Avi Kivity
Otherwise, we can't take more than one IPI. Signed-off-by: Avi Kivity a...@redhat.com --- kvm/user/test/lib/x86/smp.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/kvm/user/test/lib/x86/smp.c b/kvm/user/test/lib/x86/smp.c index a3a5472..25f0cae 100644 --- a/kvm/user

[PATCH QEMU-KVM 4/7] test: add conditional execution for vmexit tests

2009-09-21 Thread Avi Kivity
ipi tests can only run on smp for example. Signed-off-by: Avi Kivity a...@redhat.com --- kvm/user/test/x86/vmexit.c |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/kvm/user/test/x86/vmexit.c b/kvm/user/test/x86/vmexit.c index cce26d9..76f676d 100644 --- a/kvm/user

[PATCH QEMU-KVM 6/7] test: Add ipi_halt benchmark

2009-09-21 Thread Avi Kivity
Wait for 2000 cycles after the IPI to allow the host to schedule out. Measures wake-from-idle overhead. Signed-off-by: Avi Kivity a...@redhat.com --- kvm/user/test/x86/vmexit.c | 11 +++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/kvm/user/test/x86/vmexit.c b/kvm

[PATCH QEMU-KVM 5/7] test: add ipi latency test

2009-09-21 Thread Avi Kivity
Signed-off-by: Avi Kivity a...@redhat.com --- kvm/user/test/x86/vmexit.c | 18 ++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/kvm/user/test/x86/vmexit.c b/kvm/user/test/x86/vmexit.c index 76f676d..29bb32a 100644 --- a/kvm/user/test/x86/vmexit.c +++ b/kvm/user

[PATCH QEMU-KVM 7/7] test: Auto-tune vmexit test

2009-09-21 Thread Avi Kivity
Scale up iterations until we measure at least 1G cycles. Signed-off-by: Avi Kivity a...@redhat.com --- kvm/user/test/x86/vmexit.c | 16 ++-- 1 files changed, 10 insertions(+), 6 deletions(-) diff --git a/kvm/user/test/x86/vmexit.c b/kvm/user/test/x86/vmexit.c index 5088dc9

Re: [PATCH] kvm-s390: fix memsize =4G on linus git head

2009-09-21 Thread Avi Kivity
On 09/21/2009 11:45 AM, Christian Borntraeger wrote: Avi, Marcelo, commit 628eb9b8a8f3ef31d8316112a4596b1a21b38159 KVM: s390: streamline memslot handling introduced kvm_s390_vcpu_get_memsize. This broke guests=4G, since this function returned an int. This patch changes the return value

Re: [PATCH 04/24] piix4_dev is not used for pc's

2009-09-21 Thread Avi Kivity
On 09/19/2009 12:42 AM, Juan Quintela wrote: Not applying because its dead code with the current state of pc.c configuration but this prevents one to use piix4. piix4 is not used for pci irq assignement in pc. It is only used on mips. I am the one that split the file in qemu upstream.

Re: [PATCH 23/24] Get CONFIG_CPU_EMULATION back to life

2009-09-21 Thread Avi Kivity
On 09/19/2009 12:44 AM, Juan Quintela wrote: Marcelo Tosattimtosa...@redhat.com wrote: On Fri, Sep 18, 2009 at 01:41:34PM +0200, Juan Quintela wrote: Code compile with --disable-cpu-emulation, and that don't compile tcg. This is the minimal set of changes to get it working

Re: [PATCH v2] fix typo

2009-09-21 Thread Avi Kivity
On 09/21/2009 11:46 AM, Juan Quintela wrote: Quintela learns to spell long words. Applied, thanks. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More

Re: [PATCH 0/2] make --disable-kvm to compile again (now all arches)

2009-09-21 Thread Avi Kivity
On 09/21/2009 11:19 AM, Juan Quintela wrote: Hi With this patch on top of my yesterday fixes, you can compile all architectures with/without --enable-kvm. Applied, thanks. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the

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

2009-09-21 Thread Avi Kivity
On 09/21/2009 05:43 AM, 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 be unmapped, and all

Re: [PATCH 0/2] make --disable-kvm to compile again

2009-09-21 Thread Avi Kivity
On 09/19/2009 03:59 PM, Juan Quintela wrote: There were a couple of missing #ifdef KVM_* from last merge. ./configure --disable-kvm compiles and boots again. It compiles, it boot, it is perfect!!! (*) Applied, thanks. -- error compiling committee.c: too many arguments to function

Re: [PATCH] qemu-kvm: Cleanup compatfd makefile rule

2009-09-21 Thread Avi Kivity
On 09/18/2009 08:31 PM, Jan Kiszka wrote: Signed-off-by: Jan Kiszkajan.kis...@siemens.com --- Makefile |7 +-- 1 files changed, 1 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 6a9ca7c..6855fa2 100644 --- a/Makefile +++ b/Makefile @@ -65,9 +65,8 @@ recurse-all:

Re: [PATCH 04/24] piix4_dev is not used for pc's

2009-09-21 Thread Avi Kivity
On 09/21/2009 12:37 PM, Juan Quintela wrote: Avi Kivitya...@redhat.com wrote: On 09/19/2009 12:42 AM, Juan Quintela wrote: Not applying because its dead code with the current state of pc.c configuration but this prevents one to use piix4. piix4 is not used for

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

2009-09-21 Thread Avi Kivity
On 09/21/2009 05:43 AM, 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 be unmapped, and all

Re: Differences on Intel and Amd

2009-09-21 Thread Avi Kivity
On 09/21/2009 01:05 PM, Alpár Török wrote: Hi all, Sorry if this issues, or parts of this issue have been covered in separate threads. We have an executable, of unknown origin, that is very likely to be malicious. We use KVM ( version 78) for sand-boxing the execution of such software. Each

Re: [PATCH] qemu-kvm: Cleanup compatfd makefile rule

2009-09-21 Thread Avi Kivity
On 09/21/2009 01:25 PM, Jan Kiszka wrote: Avi Kivity wrote: On 09/18/2009 08:31 PM, Jan Kiszka wrote: Signed-off-by: Jan Kiszkajan.kis...@siemens.com --- Makefile |7 +-- 1 files changed, 1 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 6a9ca7c

Re: [PATCH] Show registers and exit on unhandled errors

2009-09-21 Thread Avi Kivity
On 09/21/2009 02:31 PM, Mohammed Gamal wrote: Don't we currently suspend the VM on unknown exits? This is more useful than aborting as it allows to - disassemble the problematic code - poke around in the RAM - look at other VCPUs - attach a debugger to qemu - ... Good point.

Re: [PATCH] qemu-kvm: Cleanup compatfd makefile rule

2009-09-21 Thread Avi Kivity
On 09/21/2009 02:53 PM, Jan Kiszka wrote: I'm not sure it should be conditional, or part of block-obj-y. I am: compatfd requires POSIX, but the block layer is also built on non-POSIX hosts. Oh, it's POSIX, not the old POSIX_AIO. I'll make the change. -- error compiling

Re: [PATCH] qemu-kvm: fix no gsi routing warning

2009-09-21 Thread Avi Kivity
On 09/21/2009 05:51 PM, Michael S. Tsirkin wrote: When running on host kernel which does not let the guest manupulate the gsi routing, and user requested MSI-X to be enabled, we get the following warnings: kvm_msix_add: kvm_get_irq_route_gsi failed: No space left on device kvm_msix_update:

Re: [PATCH QEMU-KVM 6/7] test: Add ipi_halt benchmark

2009-09-22 Thread Avi Kivity
On 09/22/2009 04:54 AM, Marcelo Tosatti wrote: On Mon, Sep 21, 2009 at 11:55:37AM +0300, Avi Kivity wrote: Wait for 2000 cycles after the IPI to allow the host to schedule out. Measures wake-from-idle overhead. Signed-off-by: Avi Kivitya...@redhat.com --- kvm/user/test/x86/vmexit.c

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

2009-09-22 Thread Avi Kivity
On 09/22/2009 04:12 AM, Huang Ying wrote: On Mon, 2009-09-21 at 18:08 +0800, Avi Kivity wrote: On 09/21/2009 05:43 AM, 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

Re: [patch 03/10] KVM: switch dirty_log to mmu_lock protection

2009-09-22 Thread Avi Kivity
On 09/22/2009 02:37 AM, Marcelo Tosatti wrote: get_dirty_log vs mark_page_dirty need to be mutually exclusive. Switch to mmu_lock protection. I'm not sure all archs use mmu_lock. Also, I'm unhappy about introducing more use (especially as it's often unnecessary, if dirty logging is

Re: [patch 04/10] KVM: split kvm_arch_set_memory_region into prepare and commit

2009-09-22 Thread Avi Kivity
On 09/22/2009 02:37 AM, Marcelo Tosatti wrote: Required for SRCU convertion later. My feeling is that prepare/commit can be common code and only some small bits (like allocating x86 rmaps) can be arch specific. That's for another patchset though. -- Do not meddle in the internals of

Re: [patch 07/10] KVM: introduce kvm-srcu and convert kvm_set_memory_region to SRCU update

2009-09-22 Thread Avi Kivity
On 09/22/2009 02:37 AM, Marcelo Tosatti wrote: Use two steps for memslot deletion: mark the slot invalid (which stops instantiation of new shadow pages for that slot, but allows destruction), then instantiate the new empty slot. Also simplifies kvm_handle_hva locking. unsigned int

Re: [patch 08/10] KVM: x86: switch kvm_set_memory_alias to SRCU update

2009-09-22 Thread Avi Kivity
On 09/22/2009 02:37 AM, Marcelo Tosatti wrote: Using a similar two-step procedure as for memslots. - gfn = unalias_gfn(kvm, gfn); + gfn = unalias_gfn(kvm, gfn, false); To improve readability suggest two names, maybe unalias_gfn() and unalias_gfn_instantiation(). boolean

Re: [patch 10/10] KVM: switch vcpu context to use SRCU

2009-09-22 Thread Avi Kivity
On 09/22/2009 02:37 AM, Marcelo Tosatti wrote: Signed-off-by: Marcelo Tosattimtosa...@redhat.com I'd like an eleventh patch that converts slots_lock to a mutex; there should be no readers left, yes? -- Do not meddle in the internals of kernels, for they are subtle and quick to panic.

Re: [patch 00/10] RFC: switch vcpu context to use SRCU

2009-09-22 Thread Avi Kivity
On 09/22/2009 02:37 AM, Marcelo Tosatti wrote: Improves vmexit latency by ~= 13% on UP guest. Still requires decent stress testing and careful review, but posting for early comments. Okay, looks very nice. The only real problem I see is mmu_lock for mark_dirty(), the other comments are

Re: [PATCH] Add GDT, IDT and RFLAGS guest state validity checks

2009-09-22 Thread Avi Kivity
On 09/21/2009 06:33 PM, Mohammed Gamal wrote: With emulate_invalid_guest_state=1 Windows XP exits with an invalid guest state due to rflags not being in a VMX-compliant state. This patch fixes this issue, although Windows XP doesn't boot yet with invalid state emulation on. Also added GDT and

Re: [PATCH v2] core, x86: Add user return notifiers

2009-09-22 Thread Avi Kivity
On 09/19/2009 09:40 AM, Avi Kivity wrote: 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. Ingo/Peter? -- error

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

2009-09-22 Thread Avi Kivity
On 09/22/2009 12:43 AM, Ira W. Snyder wrote: Sure, virtio-ira and he is on his own to make a bus-model under that, or virtio-vbus + vbus-ira-connector to use the vbus framework. Either model can work, I agree. Yes, I'm having to create my own bus model, a-la lguest, virtio-pci, and

Re: [PATCH v2] core, x86: Add user return notifiers

2009-09-22 Thread Avi Kivity
On 09/22/2009 12:37 PM, Arjan van de Ven wrote: On Tue, 22 Sep 2009 12:25:33 +0300 Avi Kivitya...@redhat.com wrote: On 09/19/2009 09:40 AM, Avi Kivity wrote: Add a general per-cpu notifier that is called whenever the kernel is about to return to userspace. The notifier uses

Re: [patch 03/10] KVM: switch dirty_log to mmu_lock protection

2009-09-22 Thread Avi Kivity
On 09/22/2009 03:44 PM, Marcelo Tosatti wrote: I think you can use rcu for this as well. When you read the log, allocate a new empty bitmap, switch the memslots pointer to include it, and synchronize_srcu(). Now we are certain everyone is using the new bitmap we can copy the old one to

Re: [PATCH v2] core, x86: Add user return notifiers

2009-09-22 Thread Avi Kivity
On 09/22/2009 05:32 PM, Ingo Molnar wrote: * Avi Kivitya...@redhat.com wrote: On 09/19/2009 09:40 AM, Avi Kivity wrote: 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

Re: [PATCH v2] core, x86: Add user return notifiers

2009-09-22 Thread Avi Kivity
On 09/22/2009 05:45 PM, Avi Kivity wrote: Would be nice to convert some existing open-coded return-to-user-space logic to this facility. One such candidate would be lockdep_sys_exit? I only implemented this for x86, while lockdep is arch independent. If arch support is added, it should

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

2009-09-22 Thread Avi Kivity
On 09/22/2009 06:25 PM, Ira W. Snyder wrote: Yes. vbus is more finely layered so there is less code duplication. The virtio layering was more or less dictated by Xen which doesn't have shared memory (it uses grant references instead). As a matter of fact lguest, kvm/pci, and kvm/s390 all

Re: [PATCH v2] core, x86: Add user return notifiers

2009-09-22 Thread Avi Kivity
On 09/22/2009 07:50 PM, Peter Zijlstra wrote: Would be nice to convert some existing open-coded return-to-user-space logic to this facility. One such candidate would be lockdep_sys_exit? And here I was thinking this was one of the hottest code paths in the whole kernel... If you're

Re: [PATCH v2] core, x86: Add user return notifiers

2009-09-22 Thread Avi Kivity
On 09/22/2009 07:55 PM, Peter Zijlstra wrote: If you're using lockdep, surely that's not your biggest worry? No, but that's all under #ifdef and fully disappears when not enabled. Generic return-tu-user notifiers don't sound like they will though. They will if not selected. If

Re: [PATCH v2] core, x86: Add user return notifiers

2009-09-22 Thread Avi Kivity
On 09/22/2009 06:50 PM, Avi Kivity wrote: On 09/22/2009 05:45 PM, Avi Kivity wrote: Would be nice to convert some existing open-coded return-to-user-space logic to this facility. One such candidate would be lockdep_sys_exit? I only implemented this for x86, while lockdep is arch independent

Re: [PATCH] Update halted state from mpstate only in case of inkernel irq chip

2009-09-23 Thread Avi Kivity
On 09/22/2009 05:51 PM, Gleb Natapov wrote: Otherwise cpu is always unhalted by call to kvm_arch_get_registers() Applied, thanks. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to

Re: [PATCH] Don't call kvm_cpu_synchronize_state() if there is no irqchip events to process.

2009-09-23 Thread Avi Kivity
On 09/22/2009 05:51 PM, Gleb Natapov wrote: Signed-off-by: Gleb Natapovg...@redhat.com Applied, thanks. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org

Re: [PATCH] Don't call cpu_synchronize_state() in apic_init_reset()

2009-09-23 Thread Avi Kivity
On 09/22/2009 05:51 PM, Gleb Natapov wrote: Each caller of the function already calls it. Signed-off-by: Gleb Natapovg...@redhat.com --- hw/apic.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/hw/apic.c b/hw/apic.c index 3a2e128..a9d1fb8 100644 --- a/hw/apic.c +++

Re: [PATCH] qemu-kvm: fix no gsi routing warning

2009-09-23 Thread Avi Kivity
On 09/21/2009 10:50 PM, Michael S. Tsirkin wrote: On Mon, Sep 21, 2009 at 05:56:13PM +0300, Avi Kivity wrote: On 09/21/2009 05:51 PM, Michael S. Tsirkin wrote: When running on host kernel which does not let the guest manupulate the gsi routing, and user requested MSI-X to be enabled

<    5   6   7   8   9   10   11   12   13   14   >