[COMMIT master] KVM: x86: fix CR8 handling

2010-12-29 Thread Avi Kivity
From: Andre Przywara andre.przyw...@amd.com The handling of CR8 writes in KVM is currently somewhat cumbersome. This patch makes it look like the other CR register handlers and fixes a possible issue in VMX, where the RIP would be incremented despite an injected #GP. Signed-off-by: Andre

[COMMIT master] KVM: move complete_insn_gp() into x86.c

2010-12-29 Thread Avi Kivity
From: Andre Przywara andre.przyw...@amd.com move the complete_insn_gp() helper function out of the VMX part into the generic x86 part to make it usable by SVM. Signed-off-by: Andre Przywara andre.przyw...@amd.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git

[COMMIT master] KVM: cleanup emulate_instruction

2010-12-29 Thread Avi Kivity
From: Andre Przywara andre.przyw...@amd.com emulate_instruction had many callers, but only one used all parameters. One parameter was unused, another one is now hidden by a wrapper function (required for a future addition anyway), so most callers use now a shorter parameter list. Signed-off-by:

[COMMIT master] KVM: SVM: add new SVM feature bit names

2010-12-29 Thread Avi Kivity
From: Andre Przywara andre.przyw...@amd.com the recent APM Vol.2 and the recent AMD CPUID specification describe new CPUID features bits for SVM. Name them here for later usage. Signed-off-by: Andre Przywara andre.przyw...@amd.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git

[COMMIT master] KVM: SVM: enhance mov DR intercept handler

2010-12-29 Thread Avi Kivity
From: Andre Przywara andre.przyw...@amd.com Newer SVM implementations provide the GPR number in the VMCB, so that the emulation path is no longer necesarry to handle debug register access intercepts. Implement the handling in svm.c and use it when the info is provided. Signed-off-by: Andre

[COMMIT master] KVM: SVM: enhance MOV CR intercept handler

2010-12-29 Thread Avi Kivity
From: Andre Przywara andre.przyw...@amd.com Newer SVM implementations provide the GPR number in the VMCB, so that the emulation path is no longer necesarry to handle CR register access intercepts. Implement the handling in svm.c and use it when the info is provided. Signed-off-by: Andre Przywara

[COMMIT master] KVM: SVM: copy instruction bytes from VMCB

2010-12-29 Thread Avi Kivity
From: Andre Przywara andre.przyw...@amd.com In case of a nested page fault or an intercepted #PF newer SVM implementations provide a copy of the faulting instruction bytes in the VMCB. Use these bytes to feed the instruction emulator and avoid the costly guest instruction fetch in this case.

[COMMIT master] KVM: VMX: Optimize atomic EFER load

2010-12-29 Thread Avi Kivity
From: Avi Kivity a...@redhat.com When NX is enabled on the host but not on the guest, we use the entry/exit msr load facility, which is slow. Optimize it to use entry/exit efer load, which is ~1200 cycles faster. Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti

[COMMIT master] KVM: MMU: only write protect mappings at pagetable level

2010-12-29 Thread Avi Kivity
From: Marcelo Tosatti mtosa...@redhat.com If a pagetable contains a writeable large spte, all of its sptes will be write protected, including non-leaf ones, leading to endless pagefaults. Do not write protect pages above PT_PAGE_TABLE_LEVEL, as the spte fault paths assume non-leaf sptes are

[COMMIT master] KVM: SVM: Load %fs early on vmexit path, on i386

2010-12-29 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Fixes an oops due to the per-cpu area being referenced with the guest's %fs. Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index c9d711f..af4b911 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -1148,8

[COMMIT master] KVM: VMX: Correct asm constraint in vmcs_load()/vmcs_clear()

2010-12-29 Thread Avi Kivity
From: Avi Kivity a...@redhat.com 'error' is byte sized, so use a byte register constraint. Acked-by: Randy Dunlap randy.dun...@oracle.com Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index

[COMMIT master] KVM: Fetch guest cr3 from hardware on demand

2010-12-29 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Instead of syncing the guest cr3 every exit, which is expensince on vmx with ept enabled, sync it only on demand. Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index 6268f6c..95f026b

[COMMIT master] KVM: MMU: handle 'map_writable' in set_spte() function

2010-12-29 Thread Avi Kivity
From: Xiao Guangrong xiaoguangr...@cn.fujitsu.com Move the operation of 'writable' to set_spte() to clean up code [avi: remove unneeded booleanification] Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/x86/kvm/mmu.c

[COMMIT master] KVM: Replace reads of vcpu-arch.cr3 by an accessor

2010-12-29 Thread Avi Kivity
From: Avi Kivity a...@redhat.com This allows us to keep cr3 in the VMCS, later on. Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/x86/kvm/kvm_cache_regs.h b/arch/x86/kvm/kvm_cache_regs.h index 95ac3af..a6bf8db 100644 --- a/arch/x86/kvm/kvm_cache_regs.h +++

[COMMIT master] KVM: MMU: audit: allow audit more guests at the same time

2010-12-29 Thread Avi Kivity
From: Xiao Guangrong xiaoguangr...@cn.fujitsu.com It only allows to audit one guest in the system since: - 'audit_point' is a glob variable - mmu_audit_disable() is called in kvm_mmu_destroy(), so audit is disabled after a guest exited this patch fix those issues then allow to audit more

[COMMIT master] KVM: VMX: when entering real mode align segment base to 16 bytes

2010-12-29 Thread Avi Kivity
From: Gleb Natapov g...@redhat.com VMX checks that base is equal segment shifted 4 bits left. Otherwise guest entry fails. Signed-off-by: Gleb Natapov g...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 2260783..f107315 100644 ---

[COMMIT master] Add try_main() for running a program under an exception handler

2010-12-29 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/api/exception.cc b/api/exception.cc index 500569a..910bdff 100644 --- a/api/exception.cc +++ b/api/exception.cc @@ -18,3 +18,16 @@ const char

[COMMIT master] Add exception class for kernel errors (errno)

2010-12-29 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/api/exception.cc b/api/exception.cc new file mode 100644 index 000..500569a --- /dev/null +++ b/api/exception.cc @@ -0,0 +1,20 @@ +#include exception.hh

[COMMIT master] Introduce a C++ wrapper for the kvm APIs

2010-12-29 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Introduce exception-safe objects for calling system, vm, and vcpu ioctls. Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/api/kvmxx.cc b/api/kvmxx.cc new file mode 100644 index 000..ad27907 ---

[COMMIT master] Makefile: add support for C++

2010-12-29 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/Makefile b/Makefile index d25e6f2..9b0256d 100644 --- a/Makefile +++ b/Makefile @@ -30,11 +30,13 @@ CFLAGS += -O1 CFLAGS += $(autodepend-flags) -g

[COMMIT master] Improve autodepend includes

2010-12-29 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Instead of listing all directories explicitly, include all autodepend files. Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/Makefile b/Makefile index 9b0256d..85ebd37 100644 --- a/Makefile +++ b/Makefile

[COMMIT master] api: add memory map management

2010-12-29 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Add a class to manage the memory map and a class to represent a memory slot. Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/api/memmap.cc b/api/memmap.cc new file mode 100644 index 000..c625852 ---

[COMMIT master] api: add support for KVM_SET_USER_MEMORY_REGION flags field

2010-12-29 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/api/kvmxx.cc b/api/kvmxx.cc index ad27907..42e8781 100644 --- a/api/kvmxx.cc +++ b/api/kvmxx.cc @@ -150,12 +150,13 @@ vm::vm(system system) { } -void

[COMMIT master] Add sample test using the api test harness

2010-12-29 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Call a function setting a global variable. Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/api/api-sample.cc b/api/api-sample.cc new file mode 100644 index 000..8d57c09 --- /dev/null +++

[COMMIT master] api: support KVM_GET_DIRTY_LOG ioctl

2010-12-29 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/api/kvmxx.cc b/api/kvmxx.cc index 42e8781..7ebebb5 100644 --- a/api/kvmxx.cc +++ b/api/kvmxx.cc @@ -163,6 +163,14 @@ void vm::set_memory_region(int slot,

[COMMIT master] Build tests with debug information

2010-12-29 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/Makefile b/Makefile index 85ebd37..b6e8759 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ DESTDIR := $(PREFIX)/share/qemu/tests .PHONY: arch_clean

[COMMIT master] Add support for calling a function in guest mode

2010-12-29 Thread Avi Kivity
From: Avi Kivity a...@redhat.com This patch provides a way to establish an identity guest which has a 1:1 gva-hva translation. This allows the host to switch to guest mode, call a function in the same address space, and return. Because long mode virtual addresses are 47 bits long, and some

[COMMIT master] Add dirty log test

2010-12-29 Thread Avi Kivity
From: Avi Kivity a...@redhat.com This checks the failure that was fixed by kernel commit edde99ce0529 (KVM: Write protect memory after slot swap). Two threads are used; a guest thread continuously updates a shared variable, which is also sampled by a host thread that also checks if dirty logging

[COMMIT master] Introduce libapi.a to avoid long Makefile recipes

2010-12-29 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/config-x86-common.mak b/config-x86-common.mak index 436f4bd..ce36cde 100644 --- a/config-x86-common.mak +++ b/config-x86-common.mak @@ -85,8 +85,10 @@

[COMMIT master] Honor cpuid.nx when enabling efer.nxe

2010-12-29 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/x86/vmexit.c b/x86/vmexit.c index 551083d..67746c6 100644 --- a/x86/vmexit.c +++ b/x86/vmexit.c @@ -144,7 +144,8 @@ static void do_test(struct test *test)

[COMMIT master] api: Add support for creating an identity map with a hole

2010-12-29 Thread Avi Kivity
From: Avi Kivity a...@redhat.com The hole may be used for mmio or dirty logging. Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/api/api-sample.cc b/api/api-sample.cc index 8d57c09..524ad7b 100644 --- a/api/api-sample.cc +++

[COMMIT master] access test: dump page mapping if test fail

2010-12-29 Thread Avi Kivity
From: Xiao Guangrong xiaoguangr...@cn.fujitsu.com It can help us to fix the bug Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/x86/access.c b/x86/access.c index f43f7f1..709d1a6 100644 --- a/x86/access.c +++ b/x86/access.c @@

[COMMIT master] access test: add the test case to check PFEC on prefetch pte path

2010-12-29 Thread Avi Kivity
From: Xiao Guangrong xiaoguangr...@cn.fujitsu.com Check page fault error code on prefetch pte path Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/x86/access.c b/x86/access.c index 067565b..f43f7f1 100644 --- a/x86/access.c +++

[COMMIT master] Make access.c use library functions

2010-12-29 Thread Avi Kivity
From: Gleb Natapov g...@redhat.com access.c has functions that are provided by library code. Remove them and use library functions instead. Signed-off-by: Gleb Natapov g...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/x86/access.c b/x86/access.c index 709d1a6..1c638a7

[COMMIT master] Remove duplicated idt code from apic test

2010-12-29 Thread Avi Kivity
From: Gleb Natapov g...@redhat.com Use library idt code instead. Signed-off-by: Gleb Natapov g...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/x86/apic.c b/x86/apic.c index 2207040..6d06f9f 100644 --- a/x86/apic.c +++ b/x86/apic.c @@ -2,22 +2,7 @@ #include apic.h #include

[COMMIT master] Move idt.c into lib code

2010-12-29 Thread Avi Kivity
From: Gleb Natapov g...@redhat.com Make it compilable in 32 and 64 bit mode. Signed-off-by: Gleb Natapov g...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/config-x86-common.mak b/config-x86-common.mak index b5c49f4..4d50e51 100644 --- a/config-x86-common.mak +++

[COMMIT master] Remove unused function from apic test

2010-12-29 Thread Avi Kivity
From: Gleb Natapov g...@redhat.com Signed-off-by: Gleb Natapov g...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/x86/apic.c b/x86/apic.c index 6d06f9f..bcb9fc1 100644 --- a/x86/apic.c +++ b/x86/apic.c @@ -78,11 +78,6 @@ asm ( static int g_fail; static int g_tests;

[COMMIT master] Rename idt.[ch] into desc.[ch]

2010-12-29 Thread Avi Kivity
From: Gleb Natapov g...@redhat.com All descriptor related code will go there. Signed-off-by: Gleb Natapov g...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/config-x86-common.mak b/config-x86-common.mak index 4d50e51..323da2e 100644 --- a/config-x86-common.mak +++

[COMMIT master] Change LTR's operand to be a u16

2010-12-29 Thread Avi Kivity
From: Avi Kivity a...@redhat.com This makes it pick the correct register size. Signed-off-by: Avi Kivity a...@redhat.com diff --git a/lib/x86/processor.h b/lib/x86/processor.h index c348808..d0ace9e 100644 --- a/lib/x86/processor.h +++ b/lib/x86/processor.h @@ -191,7 +191,7 @@ static inline u16

[COMMIT master] Move irq_(enable|disable) into library code

2010-12-29 Thread Avi Kivity
From: Gleb Natapov g...@redhat.com Signed-off-by: Gleb Natapov g...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/lib/x86/processor.h b/lib/x86/processor.h index d0ace9e..8fb70cd 100644 --- a/lib/x86/processor.h +++ b/lib/x86/processor.h @@ -280,4 +280,14 @@ static inline

[COMMIT master] Set WP bit in CR0 to make write protection work

2010-12-29 Thread Avi Kivity
From: Gleb Natapov g...@redhat.com Signed-off-by: Gleb Natapov g...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/lib/x86/vm.c b/lib/x86/vm.c index 4d0a955..1ca8a05 100644 --- a/lib/x86/vm.c +++ b/lib/x86/vm.c @@ -9,6 +9,7 @@ #endif #define X86_CR0_PE 0x0001

[COMMIT master] Fix mmu on 32 bit

2010-12-29 Thread Avi Kivity
From: Gleb Natapov g...@redhat.com The way virtual memory is setup now does not leave space for vmalloc on 32bit system. Make a hole in address space from 2G to 3G for vmalloc on 32 bit. Signed-off-by: Gleb Natapov g...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com diff --git

[COMMIT master] Move vm.[ch] info library code

2010-12-29 Thread Avi Kivity
From: Gleb Natapov g...@redhat.com Signed-off-by: Gleb Natapov g...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/config-x86-common.mak b/config-x86-common.mak index 323da2e..1e019f1 100644 --- a/config-x86-common.mak +++ b/config-x86-common.mak @@ -8,6 +8,7 @@ cflatobjs += \

[COMMIT master] Move invlpg() into library code

2010-12-29 Thread Avi Kivity
From: Gleb Natapov g...@redhat.com Signed-off-by: Gleb Natapov g...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/lib/x86/processor.h b/lib/x86/processor.h index 8fb70cd..f69f9ff 100644 --- a/lib/x86/processor.h +++ b/lib/x86/processor.h @@ -290,4 +290,8 @@ static inline void

[COMMIT master] Move handle_irq() from apic test into library code

2010-12-29 Thread Avi Kivity
From: Gleb Natapov g...@redhat.com Signed-off-by: Gleb Natapov g...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/config-x86-common.mak b/config-x86-common.mak index 1e019f1..17769fa 100644 --- a/config-x86-common.mak +++ b/config-x86-common.mak @@ -13,6 +13,7 @@ cflatobjs +=

[COMMIT master] Add event injection test

2010-12-29 Thread Avi Kivity
From: Gleb Natapov g...@redhat.com Add various event injection test. Those tests use testdev to unmap pages from shadow pages/ept tables which make it possible to test rare scenarios. [avi: my compiler didn't like fooRbar, added spaces] Signed-off-by: Gleb Natapov g...@redhat.com Signed-off-by:

Re: [PATCH 2/2][RFC] KVM: Emulate MSI-X table and PBA in kernel

2010-12-29 Thread Michael S. Tsirkin
On Wed, Dec 29, 2010 at 03:18:13PM +0800, Sheng Yang wrote: On Tuesday 28 December 2010 20:26:13 Avi Kivity wrote: On 12/22/2010 10:44 AM, Sheng Yang wrote: Then we can support mask bit operation of assigned devices now. @@ -3817,14 +3819,16 @@ static int

Re: [PATCH 2/2][RFC] KVM: Emulate MSI-X table and PBA in kernel

2010-12-29 Thread Sheng Yang
On Wednesday 29 December 2010 16:31:35 Michael S. Tsirkin wrote: On Wed, Dec 29, 2010 at 03:18:13PM +0800, Sheng Yang wrote: On Tuesday 28 December 2010 20:26:13 Avi Kivity wrote: On 12/22/2010 10:44 AM, Sheng Yang wrote: Then we can support mask bit operation of assigned devices now.

Re: [PATCH 1/2] KVM: test: add the test case to check PFEC on prefetch pte path

2010-12-29 Thread Avi Kivity
On 12/23/2010 10:10 AM, Xiao Guangrong wrote: Check page fault error code on prefetch pte path Applied both, 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 unit-tests 05/16] Rename idt.[ch] into desc.[ch]

2010-12-29 Thread Avi Kivity
On 12/22/2010 05:06 PM, Gleb Natapov wrote: All descriptor related code will go there. In the future, please set diff.rename = true in your global git configuration so renames look nicer. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send

Re: [PATCH unit-tests 06/16] Specify correct operand length for ltr and str.

2010-12-29 Thread Gleb Natapov
On Wed, Dec 29, 2010 at 11:37:58AM +0200, Avi Kivity wrote: On 12/22/2010 05:06 PM, Gleb Natapov wrote: Signed-off-by: Gleb Natapovg...@redhat.com --- lib/x86/processor.h |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/x86/processor.h b/lib/x86/processor.h

Re: [PATCH unit-tests 06/16] Specify correct operand length for ltr and str.

2010-12-29 Thread Gleb Natapov
On Wed, Dec 29, 2010 at 11:40:15AM +0200, Gleb Natapov wrote: On Wed, Dec 29, 2010 at 11:37:58AM +0200, Avi Kivity wrote: On 12/22/2010 05:06 PM, Gleb Natapov wrote: Signed-off-by: Gleb Natapovg...@redhat.com --- lib/x86/processor.h |4 ++-- 1 files changed, 2 insertions(+), 2

Re: [PATCH unit-tests 06/16] Specify correct operand length for ltr and str.

2010-12-29 Thread Avi Kivity
On 12/29/2010 11:43 AM, Gleb Natapov wrote: This looks completely unneeded, since val is already a u16. IIRC I got errors from assembler. Will recheck. You are correct. The error was only about ltr. Changing unsigned to u16 fixes it. Ok, I'll fix it. Applied all the other

Re: [PATCH] Add ability to drop pages through testdev

2010-12-29 Thread Avi Kivity
On 12/22/2010 05:18 PM, Gleb Natapov wrote: Signed-off-by: Gleb Natapovg...@redhat.com diff --git a/hw/testdev.c b/hw/testdev.c index d1abf59..29df385 100644 --- a/hw/testdev.c +++ b/hw/testdev.c @@ -1,3 +1,4 @@ +#includesys/mman.h #include hw.h #include qdev.h #include isa.h @@ -46,6

Re: [PATCH] Add ability to drop pages through testdev

2010-12-29 Thread Avi Kivity
On 12/29/2010 11:55 AM, Gleb Natapov wrote: On Wed, Dec 29, 2010 at 11:50:48AM +0200, Avi Kivity wrote: On 12/22/2010 05:18 PM, Gleb Natapov wrote: Signed-off-by: Gleb Natapovg...@redhat.com diff --git a/hw/testdev.c b/hw/testdev.c index d1abf59..29df385 100644 --- a/hw/testdev.c +++

Re: [PATCH] Add ability to drop pages through testdev

2010-12-29 Thread Gleb Natapov
On Wed, Dec 29, 2010 at 11:58:31AM +0200, Avi Kivity wrote: On 12/29/2010 11:55 AM, Gleb Natapov wrote: On Wed, Dec 29, 2010 at 11:50:48AM +0200, Avi Kivity wrote: On 12/22/2010 05:18 PM, Gleb Natapov wrote: Signed-off-by: Gleb Natapovg...@redhat.com diff --git a/hw/testdev.c

Re: [PATCH] Add ability to drop pages through testdev

2010-12-29 Thread Avi Kivity
On 12/29/2010 12:03 PM, Gleb Natapov wrote: Icky. This is much better done through the api tests. Applied it so as not to spoil all the effort. How would you do that there? Set up all the state using the KVM_SET_REGS family, pointing to the instruction you want to test, and

[PATCH 2/2] KVM-test: Add image_copy subtest to prepare images

2010-12-29 Thread Lucas Meneghel Rodrigues
From: Amos Kong ak...@redhat.com image_copy is used to copy guests' images from NFS server to test machines. It takes too much time for installing guests everytime. You can config NFS server directory in tests_base.cfg. Changes from v1: - Make better use of autotest API to control subprocesses -

Re: [GIT PULL] kvm upstream updates

2010-12-29 Thread Jan Kiszka
Am 28.12.2010 11:36, Avi Kivity wrote: The following changes since commit 4cdc1cd137e0b98766916a7cdf2d5a9b3c6632fa: target-mips: fix host CPU consumption when guest is idle (2010-12-27 00:58:06 +0100) are available in the git repository at:

[PATCH 3/4] KVM test: use the new Params methods instead of get_sub_dict_.*()

2010-12-29 Thread Lucas Meneghel Rodrigues
Changes from v1: - Resolved small rebase conflict Signed-off-by: Michael Goldish mgold...@redhat.com --- client/tests/kvm/kvm_preprocessing.py | 14 ++--- client/tests/kvm/kvm_vm.py | 58 ++-- client/tests/kvm/tests/pci_hotplug.py

[PATCH] qemu-kvm: Drop redundant kvm_reset_mpstate

2010-12-29 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com kvm_arch_reset_vcpu includes the same logic (minus the obsolete feature check), and every caller of kvm_reset_mpstate also calls that function. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- qemu-kvm-x86.c | 16 1 files changed, 0

[PATCH 0/6] [uq/master] More KVM upstream cleanups, fixes, enhancements

2010-12-29 Thread Jan Kiszka
Nothing critical, see patches for details. Jan Kiszka (6): kvm: Fix coding style violations kvm: Drop return value of kvm_cpu_exec kvm: x86: Align kvm_arch_put_registers code with comment kvm: Stop on all fatal exit reasons kvm: Improve reporting of fatal errors kvm: x86: Prepare

[PATCH 2/6] kvm: Drop return value of kvm_cpu_exec

2010-12-29 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com It is not used, it is not needed, so let's remove it. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- kvm-all.c |6 ++ kvm-stub.c |4 ++-- kvm.h |2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/kvm-all.c

[PATCH 6/6] kvm: x86: Prepare kvm_get_mp_state for in-kernel irqchip

2010-12-29 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com This code path will not yet be taken as we still lack in-kernel irqchip support. But qemu-kvm can already make use of it and drop its own mp_state access services. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- target-i386/kvm.c |3 +++ 1 files

[PATCH 5/6] kvm: Improve reporting of fatal errors

2010-12-29 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com Report KVM_EXIT_UNKNOWN, KVM_EXIT_FAIL_ENTRY, and KVM_EXIT_EXCEPTION with more details to stderr. The latter two are so far x86-only, so move them into the arch-specific handler. Integrate the Intel real mode warning on KVM_EXIT_FAIL_ENTRY that qemu-kvm

[PATCH 4/6] kvm: Stop on all fatal exit reasons

2010-12-29 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com Ensure that we stop the guest whenever we face a fatal or unknown exit reason. If we stop, we also have to enforce a cpu loop exit. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- kvm-all.c | 15 +++ target-i386/kvm.c |4

[PATCH 3/6] kvm: x86: Align kvm_arch_put_registers code with comment

2010-12-29 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com The ordering doesn't matter in this case, but better keep it consistent. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- target-i386/kvm.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/target-i386/kvm.c

[PATCH 1/6] kvm: Fix coding style violations

2010-12-29 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com No functional changes. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- kvm-all.c | 137 ++-- 1 files changed, 78 insertions(+), 59 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index

[PATCH 0/8] KVM test: Build code refactor + module_probe test

2010-12-29 Thread Lucas Meneghel Rodrigues
This patch series is a respin of Eduardo's patchset introducing a refactored build code in a separate library that can be reused by other tests, as well as saving state of the last build occurred. Eduardo Habkost (3): KVM test: rename 'mode' to 'install_mode' on the sample cfg files KVM

[PATCH 2/8] KVM test: rename 'mode' to 'install_mode' on the sample cfg files

2010-12-29 Thread Lucas Meneghel Rodrigues
From: Eduardo Habkost ehabk...@redhat.com The old name still works, but the new name is clearer. Signed-off-by: Eduardo Habkost ehabk...@redhat.com --- client/tests/kvm/build.cfg.sample | 14 +++--- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git

[PATCH 3/8] KVM test: add methods to store a installer object in 'env'

2010-12-29 Thread Lucas Meneghel Rodrigues
This way, tests can get information about Qemu and the modules that were installed by the 'build' test if needed. Signed-off-by: Eduardo Habkost ehabk...@redhat.com --- client/tests/kvm/kvm_utils.py | 18 ++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git

[PATCH 4/8] KVM test: Make the build test to use the installer library

2010-12-29 Thread Lucas Meneghel Rodrigues
Use the code on the new installer library and get rid of the original code. Signed-off-by: Lucas Meneghel Rodrigues l...@redhat.com --- client/tests/kvm/tests/build.py | 627 +-- 1 files changed, 12 insertions(+), 615 deletions(-) diff --git

[PATCH 5/8] KVM test: installer: fix the 'layout 1' detection

2010-12-29 Thread Lucas Meneghel Rodrigues
From: Eduardo Habkost ehabk...@redhat.com The common (or only) case where we have a 'qemu' directory (old KVM versions) also contains a 'kvm' directory, so the detection of the 'old layout' code was not working. Fix this by removing the 'and not has_kvm_dir' condition. Signed-off-by: Eduardo

[PATCH 6/8] KVM test: load/unload kvm module

2010-12-29 Thread Lucas Meneghel Rodrigues
From: Suqin Huang shu...@redhat.com check whether kvm modules exist, unload them if exist, else load them. Signed-off-by: Suqin Huang shu...@redhat.com --- client/tests/kvm/tests/module_probe.py | 53 client/tests/kvm/tests_base.cfg.sample |6 +++ 2 files

[PATCH 7/8] KVM test: add interface to get modules from cfg file, and load/unload them

2010-12-29 Thread Lucas Meneghel Rodrigues
From: Suqin Huang shu...@redhat.com The default modules are 'kvm, kvm_intel/amd, [ksm]' user can set the module list in cfg file the module names are splited with , Signed-off-by: Suqin Huang shu...@redhat.com Acked-by: Chen Cao k...@redhat.com --- client/tests/kvm/tests/module_probe.py | 10

[PATCH 8/8] KVM test: test/module_probe: use installer object to load modules

2010-12-29 Thread Lucas Meneghel Rodrigues
From: Eduardo Habkost ehabk...@redhat.com Instead of writing our own module loading code, use the load_modules() method offerred by the installer object registered by the 'build' test. If no previous installer was registered, assume the KVM modules were pre-installed on the system, and use the

Re: [PATCH 2/2][RFC] KVM: Emulate MSI-X table and PBA in kernel

2010-12-29 Thread Sheng Yang
On Wednesday 29 December 2010 17:28:24 Michael S. Tsirkin wrote: On Wed, Dec 29, 2010 at 04:55:19PM +0800, Sheng Yang wrote: On Wednesday 29 December 2010 16:31:35 Michael S. Tsirkin wrote: On Wed, Dec 29, 2010 at 03:18:13PM +0800, Sheng Yang wrote: On Tuesday 28 December 2010 20:26:13

Re: [PATCH 2/2][RFC] KVM: Emulate MSI-X table and PBA in kernel

2010-12-29 Thread Michael S. Tsirkin
On Thu, Dec 30, 2010 at 03:32:42PM +0800, Sheng Yang wrote: On Wednesday 29 December 2010 17:28:24 Michael S. Tsirkin wrote: On Wed, Dec 29, 2010 at 04:55:19PM +0800, Sheng Yang wrote: On Wednesday 29 December 2010 16:31:35 Michael S. Tsirkin wrote: On Wed, Dec 29, 2010 at 03:18:13PM

Re: [PATCH 2/2][RFC] KVM: Emulate MSI-X table and PBA in kernel

2010-12-29 Thread Sheng Yang
On Thursday 30 December 2010 15:47:48 Michael S. Tsirkin wrote: On Thu, Dec 30, 2010 at 03:32:42PM +0800, Sheng Yang wrote: On Wednesday 29 December 2010 17:28:24 Michael S. Tsirkin wrote: On Wed, Dec 29, 2010 at 04:55:19PM +0800, Sheng Yang wrote: On Wednesday 29 December 2010 16:31:35