[COMMIT master] kvmclock_test: fix smp initialization

2011-01-16 Thread Avi Kivity
From: Avi Kivity a...@redhat.com cpu_count() is not valid before smp_init(). Signed-off-by: Avi Kivity a...@redhat.com diff --git a/x86/kvmclock_test.c b/x86/kvmclock_test.c index 5b14ae2..52a43fb 100644 --- a/x86/kvmclock_test.c +++ b/x86/kvmclock_test.c @@ -115,7 +115,7 @@ static int

[COMMIT master] qemu-kvm: Drop redundant kvm_reset_mpstate

2011-01-13 Thread Avi Kivity
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 Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git

[COMMIT master] Merge branch 'upstream-merge'

2011-01-13 Thread Avi Kivity
From: Marcelo Tosatti mtosa...@redhat.com * upstream-merge: (279 commits) target-ppc: Implement correct NaN propagation rules target-mips: Implement correct NaN propagation rules softfloat: use float{32,64,x80,128}_maybe_silence_nan() softfloat: add float{x80,128}_maybe_silence_nan()

[COMMIT master] remove qemu-kvm.h inclusion from monitor.c

2011-01-13 Thread Avi Kivity
From: Marcelo Tosatti mtosa...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/monitor.c b/monitor.c index cf1d3d0..40768bb 100644 --- a/monitor.c +++ b/monitor.c @@ -61,7 +61,6 @@ #include trace.h #endif #include ui/qemu-spice.h -#include qemu-kvm.h //#define

[COMMIT master] pci-assign: Fix transition MSI-INTx

2011-01-13 Thread Avi Kivity
From: Jan Kiszka jan.kis...@siemens.com Make sure to re-register the IRQ of an assigned device as INTx when the guest disables MSI[X] mode again. Acked-by: Michael S. Tsirkin m...@redhat.com Acked-by: Alex Williamson alex.william...@redhat.com Signed-off-by: Jan Kiszka jan.kis...@siemens.com

[COMMIT master] KVM: MMU: Don't flush shadow when enabling dirty tracking

2011-01-13 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Instead, drop large mappings, which were the reason we dropped shadow. Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 9cafbb4..772d212 100644 --- a/arch/x86

[COMMIT master] KVM: PPC: Fix SPRG get/set for Book3S and BookE

2011-01-13 Thread Avi Kivity
From: Peter Tyser pty...@xes-inc.com Previously SPRGs 4-7 were improperly read and written in kvm_arch_vcpu_ioctl_get_regs() and kvm_arch_vcpu_ioctl_set_regs(); Signed-off-by: Alexander Graf ag...@suse.de Signed-off-by: Peter Tyser pty...@xes-inc.com Signed-off-by: Marcelo Tosatti

[COMMIT master] KVM guest: Fix section mismatch derived from kvm_guest_cpu_online()

2011-01-13 Thread Avi Kivity
From: Sedat Dilek sedat.di...@googlemail.com WARNING: arch/x86/built-in.o(.text+0x1bb74): Section mismatch in reference from the function kvm_guest_cpu_online() to the function .cpuinit.text:kvm_guest_cpu_init() The function kvm_guest_cpu_online() references the function __cpuinit

[COMMIT master] Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6

2011-01-13 Thread Avi Kivity
From: Marcelo Tosatti mtosa...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com -- To unsubscribe from this list: send the line unsubscribe kvm-commits in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[COMMIT master] KVM: VMX: Avoid leaking fake realmode state to userspace

2011-01-13 Thread Avi Kivity
From: Avi Kivity a...@redhat.com When emulating real mode, we fake some state: - tr.base points to a fake vm86 tss - segment registers are made to conform to vm86 restrictions change vmx_get_segment() not to expose this fake state to userspace; instead, return the original state. Signed-off

[COMMIT master] KVM: VMX: Save and restore tr selector across mode switches

2011-01-13 Thread Avi Kivity
From: Avi Kivity a...@redhat.com When emulating real mode we play with tr hidden state, but leave tr.selector alone. That works well, except for save/restore, since loading TR writes it to the hidden state in vmx-rmode. Fix by also saving and restoring the tr selector; this makes things more

[COMMIT master] KVM: Initialize fpu state in preemptible context

2011-01-13 Thread Avi Kivity
From: Avi Kivity a...@redhat.com init_fpu() (which is indirectly called by the fpu switching code) assumes it is in process context. Rather than makeing init_fpu() use an atomic allocation, which can cause a task to be killed, make sure the fpu is already initialized when we enter the run loop

[COMMIT master] smp: speed up cpu_count()

2011-01-13 Thread Avi Kivity
From: Avi Kivity a...@redhat.com cpu_count() is used in important places, like vmexit.flat's measuring loop, yet it is ridiculously slow as it talks to the firmware config interface. Speed it up by reading the value from memory. Signed-off-by: Avi Kivity a...@redhat.com diff --git a/lib/x86

[COMMIT master] vmexit: fix race in joining smp tests

2011-01-13 Thread Avi Kivity
From: Avi Kivity a...@redhat.com 'nr_cpus_done' is not incremented atomically; this has been observed to cause tests to stall. Fix by using a proper atomic increment. Signed-off-by: Avi Kivity a...@redhat.com diff --git a/x86/vmexit.c b/x86/vmexit.c index 875caa3..ad8ab55 100644 --- a/x86

[COMMIT master] smp: fix race in async on_cpu()

2011-01-13 Thread Avi Kivity
From: Avi Kivity a...@redhat.com We fire off the IPI, but don't wait for the other cpu to pickk up the function and data before returning. Fix by making the other cpu ACK the receipt of the IPI (but still execute the result asynchrously). Signed-off-by: Avi Kivity a...@redhat.com diff --git

[COMMIT master] qemu-kvm: Switch to upstream -enable-kvm semantics

2011-01-02 Thread Avi Kivity
|fail+ | disabled * differs from upstream + changed by this patch Bonus fix: -no-kvm -enable-kvm now enables KVM. Before, it disabled it. Signed-off-by: Markus Armbruster arm...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/vl.c b/vl.c index e3c8919..1958e01 100644

[COMMIT master] KVM: VMX: Fix incorrect cr3 with ept when clearing cr0.pg

2011-01-02 Thread Avi Kivity
it by decache CR3 before CR0 change, for both paging to nonpaging, and nonpaging to paging switch. Signed-off-by: Sheng Yang sh...@linux.intel.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index f107315..bf89ec2 100644 --- a/arch/x86/kvm/vmx.c +++ b

[COMMIT master] KVM: i8259: initialize isr_ack

2011-01-02 Thread Avi Kivity
From: Avi Kivity a...@redhat.com isr_ack is never initialized. So, until the first PIC reset, interrupts may fail to be injected. This can cause Windows XP to fail to boot, as reported in the fallout from the fix to https://bugzilla.kernel.org/show_bug.cgi?id=21962. Reported-and-tested

[COMMIT master] vmexit: add support for running a selected set of tests

2011-01-02 Thread Avi Kivity
From: Avi Kivity a...@redhat.com qemu -device testdev,chardev=log -chardev stdio,id=log \ -kernel vmexit.flat -append 'test1 test2 test3' will run test1, test2, and test3, and skip all others. Signed-off-by: Avi Kivity a...@redhat.com diff --git a/x86/vmexit.c b/x86/vmexit.c index

[COMMIT master] lib: add strcmp() implementation

2011-01-02 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/lib/libcflat.h b/lib/libcflat.h index d4ee2e0..0c62e4c 100644 --- a/lib/libcflat.h +++ b/lib/libcflat.h @@ -42,6 +42,7 @@ extern void panic(char *fmt, ...); extern unsigned long strlen(const char *buf

[COMMIT master] vmexit: add ple stress test

2011-01-02 Thread Avi Kivity
From: Avi Kivity a...@redhat.com This test round-robins executions among all cpus. If overcommitted, it will execute at the rate the host switches vcpu contexts. Signed-off-by: Avi Kivity a...@redhat.com diff --git a/x86/vmexit.c b/x86/vmexit.c index 31858ea..875caa3 100644 --- a/x86/vmexit.c

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

[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 b/arch

[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 +++ b/arch/x86/kvm

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

2010-12-29 Thread Avi Kivity
guests at the same time Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com 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 95f026b..aa75f21 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm

[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 --- /dev

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

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

[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 +++ b/api/api

[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 +++ b/api/api

[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 +++ b

[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 +++ b/config

[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 +++ b/config

[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 a/lib/x86

[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
-by: Avi Kivity a...@redhat.com diff --git a/config-x86-common.mak b/config-x86-common.mak index 17769fa..cca8f87 100644 --- a/config-x86-common.mak +++ b/config-x86-common.mak @@ -33,7 +33,7 @@ tests-common = $(TEST_DIR)/vmexit.flat $(TEST_DIR)/tsc.flat \ $(TEST_DIR)/smptest.flat

[COMMIT master] pci: Fix PCI capabilities collision error value

2010-12-19 Thread Avi Kivity
From: Alex Williamson alex.william...@redhat.com Signed-off-by: Alex Williamson alex.william...@redhat.com Acked-by: Markus Armbruster arm...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/hw/pci.c b/hw/pci.c index 288d6fd..0962416 100644 --- a/hw/pci.c +++ b/hw/pci.c

[COMMIT master] fix compile error of hw/device-assignment.c

2010-12-19 Thread Avi Kivity
) hw/device-assignment.c:1463: error: (Each undeclared identifier is reported only once hw/device-assignment.c:1463: error: for each function it appears in.) Signed-off-by: Wei Yongjun yj...@cn.fujitsu.com Acked-by: Alex Williamson alex.william...@redhat.com Signed-off-by: Avi Kivity

[COMMIT master] KVM: Correct kvm_pio tracepoint count field

2010-12-19 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Currently, we record '1' for count regardless of the real count. Fix. Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 8d76150..cf5fab1 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -3948,7

[COMMIT master] KVM: return true when user space query KVM_CAP_USER_NMI extension

2010-12-19 Thread Avi Kivity
From: Lai Jiangshan la...@cn.fujitsu.com userspace may check this extension in runtime. Signed-off-by: Lai Jiangshan la...@cn.fujitsu.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index cf5fab1..3625779 100644 --- a/arch/x86/kvm/x86.c +++ b

[COMMIT master] KVM guest: Fix kvm clock initialization when it's configured out

2010-12-19 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c index 91b3d65..8dc4466 100644 --- a/arch/x86/kernel/kvm.c +++ b/arch/x86/kernel/kvm.c @@ -486,7 +486,9 @@ static struct notifier_block kvm_pv_reboot_nb

[COMMIT master] KVM: Fix whitespace errors

2010-12-19 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 5bc820c..c3853d5 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -2644,7 +2644,7 @@ static bool try_async_pf(struct kvm_vcpu *vcpu, bool prefault

[COMMIT master] KVM: Fix preemption counter leak in kvm_timer_init()

2010-12-19 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Based on a patch from Thomas Meyer. Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index e0bd952..f569da8 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -4622,9 +4622,11 @@ static void kvm_timer_init

[COMMIT master] Merge branch 'master' of ssh://master.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into next

2010-12-19 Thread Avi Kivity
From: Avi Kivity a...@redhat.com * 'master' of ssh://master.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6: (332 commits) arch/tile: handle rt_sigreturn() more cleanly arch/tile: handle CLONE_SETTLS in copy_thread(), not user space MIPS: Fix build errors in sc-mips.c x86: avoid

[COMMIT master] fix i386 arch compilation.

2010-12-19 Thread Avi Kivity
From: Gleb Natapov g...@redhat.com Commit 750bbdb forgot to convert i386 arch to .elf. Signed-off-by: Avi Kivity a...@redhat.com diff --git a/config-i386.mak b/config-i386.mak index 6dbd19f..c1b6e08 100644 --- a/config-i386.mak +++ b/config-i386.mak @@ -9,4 +9,4 @@ tests = $(TEST_DIR

[COMMIT master] device-assignment: Fix off-by-one in header check

2010-12-13 Thread Avi Kivity
-by: Avi Kivity a...@redhat.com diff --git a/hw/device-assignment.c b/hw/device-assignment.c index 832c236..6d6e657 100644 --- a/hw/device-assignment.c +++ b/hw/device-assignment.c @@ -410,7 +410,7 @@ static void assigned_dev_pci_write_config(PCIDevice *d, uint32_t address, ((d-devfn 3) 0x1F

[COMMIT master] pci: Remove PCI_CAPABILITY_CONFIG_*

2010-12-13 Thread Avi Kivity
length depending on features, but for the current device assignment implementation, it's always the minimum length of 10 bytes. Signed-off-by: Alex Williamson alex.william...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/hw/device-assignment.c b/hw/device-assignment.c index

[COMMIT master] pci: Error on PCI capability collisions

2010-12-13 Thread Avi Kivity
From: Alex Williamson alex.william...@redhat.com Nothing good can happen when we overlap capabilities Signed-off-by: Alex Williamson alex.william...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/hw/pci.c b/hw/pci.c index b08113d..288d6fd 100644 --- a/hw/pci.c +++ b/hw/pci.c

[COMMIT master] device-assignment: Error checking when adding capabilities

2010-12-13 Thread Avi Kivity
From: Alex Williamson alex.william...@redhat.com Signed-off-by: Alex Williamson alex.william...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/hw/device-assignment.c b/hw/device-assignment.c index 1a90a89..0ae04de 100644 --- a/hw/device-assignment.c +++ b/hw/device

[COMMIT master] device-assignment: pass through and stub more PCI caps

2010-12-13 Thread Avi Kivity
with hardware and what bits are purely emulated. Signed-off-by: Alex Williamson alex.william...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/hw/device-assignment.c b/hw/device-assignment.c index 0ae04de..50c6408 100644 --- a/hw/device-assignment.c +++ b/hw/device-assignment.c

[COMMIT master] KVM: SVM: Add clean-bit for intercetps, tsc-offset and pause filter count

2010-12-13 Thread Avi Kivity
From: Joerg Roedel joerg.roe...@amd.com This patch adds the clean-bit for intercepts-vectors, the TSC offset and the pause-filter count to the appropriate places. The IO and MSR permission bitmaps are not subject to this bit. Signed-off-by: Joerg Roedel joerg.roe...@amd.com Signed-off-by: Avi

[COMMIT master] KVM: SVM: Add clean-bit for IOPM_BASE and MSRPM_BASE

2010-12-13 Thread Avi Kivity
the complete VMCB as dirty. Signed-off-by: Joerg Roedel joerg.roe...@amd.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 609f661..1802f7c 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -188,6 +188,7 @@ static int

[COMMIT master] KVM: SVM: Add clean-bits infrastructure code

2010-12-13 Thread Avi Kivity
From: Roedel, Joerg joerg.roe...@amd.com This patch adds the infrastructure for the implementation of the individual clean-bits. Signed-off-by: Joerg Roedel joerg.roe...@amd.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/x86/include/asm/svm.h b/arch/x86/include/asm/svm.h index

[COMMIT master] KVM: SVM: Add clean-bit for the ASID

2010-12-13 Thread Avi Kivity
From: Joerg Roedel joerg.roe...@amd.com This patch implements the clean-bit for the asid in the vmcb. Signed-off-by: Joerg Roedel joerg.roe...@amd.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 1802f7c..a3fd9ba 100644 --- a/arch/x86/kvm

[COMMIT master] KVM: SVM: Add clean-bit for interrupt state

2010-12-13 Thread Avi Kivity
From: Joerg Roedel joerg.roe...@amd.com This patch implements the clean-bit for all interrupt related state in the vmcb. This corresponds to vmcb offset 0x60-0x67. Signed-off-by: Joerg Roedel joerg.roe...@amd.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/x86/kvm/svm.c b/arch

[COMMIT master] KVM: SVM: Add clean-bit for control registers

2010-12-13 Thread Avi Kivity
From: Joerg Roedel joerg.roe...@amd.com This patch implements the CRx clean-bit for the vmcb. This bit covers cr0, cr3, cr4, and efer. Signed-off-by: Joerg Roedel joerg.roe...@amd.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 2a63dfa

[COMMIT master] KVM: SVM: Add clean-bit for Segements and CPL

2010-12-13 Thread Avi Kivity
From: Joerg Roedel joerg.roe...@amd.com This patch implements the clean-bit defined for the cs, ds, ss, an es segemnts and the current cpl saved in the vmcb. Signed-off-by: Joerg Roedel joerg.roe...@amd.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm

[COMMIT master] KVM: SVM: Add clean-bit for LBR state

2010-12-13 Thread Avi Kivity
From: Joerg Roedel joerg.roe...@amd.com This patch implements the clean-bit for all LBR related state. This includes the debugctl, br_from, br_to, last_excp_from, and last_excp_to msrs. Signed-off-by: Joerg Roedel joerg.roe...@amd.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch

[COMMIT master] KVM: SVM: Add clean-bit for CR2 register

2010-12-13 Thread Avi Kivity
From: Joerg Roedel joerg.roe...@amd.com This patch implements the clean-bit for the cr2 register in the vmcb. Signed-off-by: Joerg Roedel joerg.roe...@amd.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 85d3350..e5db339 100644 --- a/arch

[COMMIT master] KVM: MMU: rename 'no_apf' to 'prefault'

2010-12-13 Thread Avi Kivity
From: Xiao Guangrong xiaoguangr...@cn.fujitsu.com It's the speculative path if 'no_apf = 1' and we will specially handle this speculative path in the later patch, so 'prefault' is better to fit the sense. Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com Signed-off-by: Avi Kivity

[COMMIT master] KVM: SVM: Remove flush_guest_tlb function

2010-12-13 Thread Avi Kivity
From: Joerg Roedel joerg.roe...@amd.com This function is unused and there is svm_flush_tlb which does the same. So this function can be removed. Signed-off-by: Joerg Roedel joerg.roe...@amd.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index

[COMMIT master] KVM: MMU: fix accessed bit set on prefault path

2010-12-13 Thread Avi Kivity
From: Xiao Guangrong xiaoguangr...@cn.fujitsu.com Retry #PF is the speculative path, so don't set the accessed bit 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 b/arch/x86/kvm/mmu.c index 4954de9..04f9033

[COMMIT master] KVM: MMU: retry #PF for softmmu

2010-12-13 Thread Avi Kivity
From: Xiao Guangrong xiaoguangr...@cn.fujitsu.com Retry #PF for softmmu only when the current vcpu has the same cr3 as the time when #PF occurs Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/x86/include/asm/kvm_host.h b

[COMMIT master] KVM: SVM: Use svm_flush_tlb instead of force_new_asid

2010-12-13 Thread Avi Kivity
-by: Avi Kivity a...@redhat.com diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 16334bb..b4aad21 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -421,11 +421,6 @@ static inline void invlpga(unsigned long addr, u32 asid) asm volatile (__ex(SVM_INVLPGA) : : a(addr), c

[COMMIT master] KVM: SVM: Implement Flush-By-Asid feature

2010-12-13 Thread Avi Kivity
From: Joerg Roedel joerg.roe...@amd.com This patch adds the new flush-by-asid of upcoming AMD processors to the KVM-AMD module. Signed-off-by: Joerg Roedel joerg.roe...@amd.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/x86/include/asm/svm.h b/arch/x86/include/asm/svm.h index

[COMMIT master] KVM: VMX: add module parameter to avoid trapping HLT instructions (v5)

2010-12-13 Thread Avi Kivity
directly execute the instruction putting the processor to sleep. Introduce this as a module-level option for kvm-vmx.ko since if you do this for one guest, you probably want to do it for all. Signed-off-by: Anthony Liguori aligu...@us.ibm.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch

[COMMIT master] KVM: Fix OSXSAVE after migration

2010-12-13 Thread Avi Kivity
From: Sheng Yang sh...@linux.intel.com CPUID's OSXSAVE is a mirror of CR4.OSXSAVE bit. We need to update the CPUID after migration. KVM-Stable-Tag. Signed-off-by: Sheng Yang sh...@linux.intel.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c

[COMMIT master] KVM: MMU: Fix incorrect direct page write protection due to ro host page

2010-12-13 Thread Avi Kivity
From: Avi Kivity a...@redhat.com If KVM sees a read-only host page, it will map it as read-only to prevent breaking a COW. However, if the page was part of a large guest page, KVM incorrectly extends the write protection to the entire large page frame instead of limiting it to the normal host

[COMMIT master] KVM: Fix build error on s390 due to missing tlbs_dirty

2010-12-13 Thread Avi Kivity
From: Avi Kivity a...@redhat.com Make it available for all archs. Signed-off-by: Avi Kivity a...@redhat.com diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index bd0da8f..b5021db 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -256,8 +256,8 @@ struct kvm

  1   2   3   4   5   6   7   8   9   10   >