[kvm-devel] [PATCH] KVM: fix PIC interrupt delivery on different APIC conditions

2007-09-17 Thread He, Qing
This patch changes the PIC interrupts delivery. Now it is only deliverd to vcpu0 when either condition is met (on vcpu0): 1. local APIC is hardware disabled 2. LVT0 is unmasked and configured to delivery mode ExtInt It fixes the 2x faster wall clock on x86_64 and SMP i386 Linux guests

Re: [kvm-devel] [PATCH] KVM: fix PIC interrupt delivery on different APIC conditions

2007-09-17 Thread Avi Kivity
He, Qing wrote: This patch changes the PIC interrupts delivery. Now it is only deliverd to vcpu0 when either condition is met (on vcpu0): 1. local APIC is hardware disabled 2. LVT0 is unmasked and configured to delivery mode ExtInt It fixes the 2x faster wall clock on x86_64 and SMP i386

[kvm-devel] [PATCH 002/104] KVM: SMP: Add vcpu_id field in struct vcpu

2007-09-17 Thread Avi Kivity
From: Qing He [EMAIL PROTECTED] This patch adds a `vcpu_id' field in `struct vcpu', so we can differentiate BSP and APs without pointer comparison or arithmetic. Signed-off-by: Qing He [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/kvm.h |1 +

[kvm-devel] [PATCH 001/104] KVM: Fix *nopage() in kvm_main.c

2007-09-17 Thread Avi Kivity
From: Nguyen Anh Quynh [EMAIL PROTECTED] *nopage() in kvm_main.c should only store the type of mmap() fault if the pointers are not NULL. This patch fixes the problem. Signed-off-by: Nguyen Anh Quynh [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/kvm_main.c |8

[kvm-devel] [PATCH 003/104] KVM: Future-proof the exit information union ABI

2007-09-17 Thread Avi Kivity
Note that as the size of struct kvm_run is not part of the ABI, we can add things at the end. Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- include/linux/kvm.h |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/include/linux/kvm.h b/include/linux/kvm.h index

[kvm-devel] [PATCH 004/104] KVM: In-kernel string pio write support

2007-09-17 Thread Avi Kivity
From: Eddie Dong [EMAIL PROTECTED] Add string pio write support to support some version of Windows. Signed-off-by: Yaozu (Eddie) Dong [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/kvm_main.c | 48 +--- 1 files

[kvm-devel] [PATCH 000/104] KVM patch queue for the 2.6.24 merge window

2007-09-17 Thread Avi Kivity
The following represents the patch queue for the 2.6.24, posted here for review. Most of the patches have already been on kvm-devel (and all of them on kvm-commits), but some folding has occured to merge fixes and to make the whole series bisect-friendly. A few patches are likely to change in

[kvm-devel] [PATCH 009/104] KVM: Trivial: Avoid hardware_disable predeclaration

2007-09-17 Thread Avi Kivity
From: Rusty Russell [EMAIL PROTECTED] Don't pre-declare hardware_disable: shuffle the reboot hook down. Signed-off-by: Rusty Russell [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/kvm_main.c | 40 +++- 1 files changed, 19

[kvm-devel] [PATCH 007/104] KVM: Trivial: Make decode_register() static

2007-09-17 Thread Avi Kivity
From: Rusty Russell [EMAIL PROTECTED] I have shied away from touching x86_emulate.c (it could definitely use some love, but it is forked from the Xen code, and it would be more productive to cross-merge fixes). Signed-off-by: Rusty Russell [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL

[kvm-devel] [PATCH 006/104] KVM: Trivial: Remove unused struct cpu_user_regs declaration

2007-09-17 Thread Avi Kivity
From: Rusty Russell [EMAIL PROTECTED] Signed-off-by: Rusty Russell [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/x86_emulate.h |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/drivers/kvm/x86_emulate.h b/drivers/kvm/x86_emulate.h index

[kvm-devel] [PATCH 014/104] KVM: Set exit_reason to KVM_EXIT_MMIO where run-mmio is initialized.

2007-09-17 Thread Avi Kivity
From: Jeff Dike [EMAIL PROTECTED] Signed-off-by: Jeff Dike [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/kvm_main.c |2 +- drivers/kvm/svm.c |1 - drivers/kvm/vmx.c |1 - 3 files changed, 1 insertions(+), 3 deletions(-) diff --git

[kvm-devel] [PATCH 013/104] KVM: Trivial: Use standard BITMAP macros, open-code userspace-exposed header

2007-09-17 Thread Avi Kivity
From: Rusty Russell [EMAIL PROTECTED] Creating one's own BITMAP macro seems suboptimal: if we use manual arithmetic in the one place exposed to userspace, we can use standard macros elsewhere. Signed-off-by: Rusty Russell [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] ---

[kvm-devel] [PATCH 011/104] KVM: Use standard CR3 flags, tighten checking

2007-09-17 Thread Avi Kivity
From: Rusty Russell [EMAIL PROTECTED] The kernel now has asm/cpu-features.h: use those macros instead of inventing our own. Also spell out definition of CR3_RESEVED_BITS, fix spelling and tighten it for the non-PAE case. Signed-off-by: Rusty Russell [EMAIL PROTECTED] Signed-off-by: Avi Kivity

[kvm-devel] [PATCH 005/104] KVM: Trivial: /dev/kvm interface is no longer experimental.

2007-09-17 Thread Avi Kivity
From: Rusty Russell [EMAIL PROTECTED] KVM interface is no longer experimental. Signed-off-by: Rusty Russell [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- include/linux/kvm.h |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/include/linux/kvm.h

[kvm-devel] [PATCH 016/104] KVM: x86 emulator: fix cmov for writeback changes

2007-09-17 Thread Avi Kivity
The writeback fixes (02c03a326a5df825cc01de426f72e160db2b9538) broke cmov emulation. Fix. Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/x86_emulate.c | 22 +++--- 1 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/kvm/x86_emulate.c

[kvm-devel] [PATCH 008/104] KVM: Trivial: Comment spelling may escape grep

2007-09-17 Thread Avi Kivity
From: Rusty Russell [EMAIL PROTECTED] Speling error in comment. Signed-off-by: Rusty Russell [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/x86_emulate.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/kvm/x86_emulate.c

[kvm-devel] [PATCH 019/104] KVM: Hoist kvm_mmu_reload() out of the critical section

2007-09-17 Thread Avi Kivity
From: Shaohua Li [EMAIL PROTECTED] vmx_cpu_run doesn't handle error correctly and kvm_mmu_reload might sleep with mutex changes, so I move it above. Signed-off-by: Shaohua Li [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/vmx.c |8 1 files changed, 4

[kvm-devel] [PATCH 015/104] KVM: Use standard CR8 flags, and fix TPR definition

2007-09-17 Thread Avi Kivity
From: Rusty Russell [EMAIL PROTECTED] Intel manual (and KVM definition) say the TPR is 4 bits wide. Also fix CR8_RESEVED_BITS typo. Signed-off-by: Rusty Russell [EMAIL PROTECTED] Acked-by: H. Peter Anvin [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/kvm_main.c

[kvm-devel] [PATCH 012/104] KVM: Use standard CR4 flags, tighten checking

2007-09-17 Thread Avi Kivity
From: Rusty Russell [EMAIL PROTECTED] On this machine (Intel), writing to the CR4 bits 0x0800 and 0x1000 cause a GPF. The Intel manual is a little unclear, but AFIACT they're reserved, too. Also fix spelling of CR4_RESEVED_BITS. Signed-off-by: Rusty Russell [EMAIL PROTECTED]

[kvm-devel] [PATCH 034/104] KVM: SVM: internal function name cleanup

2007-09-17 Thread Avi Kivity
From: Rusty Russell [EMAIL PROTECTED] Changes some svm.c internal function names: 1) io_adress - io_address (de-germanify the spelling) 2) kvm_reput_irq - reput_irq (it's not a generic kvm function) 3) kvm_do_inject_irq - (it's not a generic kvm function) Signed-off-by: Rusty Russell [EMAIL

[kvm-devel] [PATCH 022/104] KVM: Remove dead code in the cmpxchg instruction emulation

2007-09-17 Thread Avi Kivity
From: Aurelien Jarno [EMAIL PROTECTED] The writeback fixes (02c03a326a5df825cc01de426f72e160db2b9538) let some dead code in the cmpxchg instruction emulation. Remove it. Signed-off-by: Aurelien Jarno [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/x86_emulate.c |

[kvm-devel] [PATCH 037/104] KVM: Use kmem cache for allocating vcpus

2007-09-17 Thread Avi Kivity
From: Rusty Russell [EMAIL PROTECTED] Avi wants the allocations of vcpus centralized again. The easiest way is to add a size arg to kvm_init_arch, and expose the thus-prepared cache to the modules. Signed-off-by: Rusty Russell [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] ---

[kvm-devel] [PATCH 026/104] KVM: VMX: Improve the method of writing vmcs control

2007-09-17 Thread Avi Kivity
From: Yang, Sheng [EMAIL PROTECTED] Put cpu feature detecting part in hardware_setup, and stored the vmcs condition in global variable for further check. [glommer: fix for some i386-only machines not supporting CR8 load/store exiting] Signed-off-by: Sheng Yang [EMAIL PROTECTED] Signed-off-by:

[kvm-devel] [PATCH 023/104] KVM: load_pdptrs() cleanups

2007-09-17 Thread Avi Kivity
From: Rusty Russell [EMAIL PROTECTED] load_pdptrs can be handed an invalid cr3, and it should not oops. This can happen because we injected #gp in set_cr3() after we set vcpu-cr3 to the invalid value, or from kvm_vcpu_ioctl_set_sregs(), or memory configuration changes after the guest did

[kvm-devel] [PATCH 027/104] KVM: add hypercall nr to kvm_run

2007-09-17 Thread Avi Kivity
From: Jeff Dike [EMAIL PROTECTED] Add the hypercall number to kvm_run and initialize it. This changes the ABI, but as this particular ABI was unusable before this no users are affected. Signed-off-by: Jeff Dike [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] ---

[kvm-devel] [PATCH 018/104] KVM: Return if the pdptrs are invalid when the guest turns on PAE.

2007-09-17 Thread Avi Kivity
From: Rusty Russell [EMAIL PROTECTED] Don't fall through and turn on PAE in this case. Signed-off-by: Rusty Russell [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/kvm_main.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git

[kvm-devel] [PATCH 038/104] KVM: Use alignment properties of vcpu to simplify FPU ops

2007-09-17 Thread Avi Kivity
From: Rusty Russell [EMAIL PROTECTED] Now we use a kmem cache for allocating vcpus, we can get the 16-byte alignment required by fxsave fxrstor instructions, and avoid manually aligning the buffer. Signed-off-by: Rusty Russell [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] ---

[kvm-devel] [PATCH 031/104] KVM: VMX: pass vcpu_vmx internally

2007-09-17 Thread Avi Kivity
From: Rusty Russell [EMAIL PROTECTED] container_of is wonderful, but not casting at all is better. This patch changes vmx.c's internal functions to pass struct vcpu_vmx instead of struct kvm_vcpu and using container_of. Signed-off-by: Rusty Russell [EMAIL PROTECTED] Signed-off-by: Avi Kivity

[kvm-devel] [PATCH 020/104] KVM: Move gfn_to_page out of kmap/unmap pairs

2007-09-17 Thread Avi Kivity
From: Shaohua Li [EMAIL PROTECTED] gfn_to_page might sleep with swap support. Move it out of the kmap calls. Signed-off-by: Shaohua Li [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/kvm.h |2 +- drivers/kvm/kvm_main.c|7 ++-- drivers/kvm/mmu.c

[kvm-devel] [PATCH 040/104] KVM: VMX: Add cpu consistency check

2007-09-17 Thread Avi Kivity
From: Yang, Sheng [EMAIL PROTECTED] All the physical CPUs on the board should support the same VMX feature set. Add check_processor_compatibility to kvm_arch_ops for the consistency check. Signed-off-by: Sheng Yang [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] ---

[kvm-devel] [PATCH 017/104] KVM: x86 emulator: fix faulty check for two-byte opcode

2007-09-17 Thread Avi Kivity
Right now, the bug is harmless as we never emulate one-byte 0xb6 or 0xb7. But things may change. Noted by the mysterious Gabriel C. Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/x86_emulate.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git

[kvm-devel] [PATCH 043/104] KVM: SVM: Make set_msr_interception more reliable

2007-09-17 Thread Avi Kivity
From: Rusty Russell [EMAIL PROTECTED] set_msr_interception() is used by svm to set up which MSRs should be intercepted. It can only fail if someone has changed the code to try to intercept an MSR without updating the array of ranges. The return value is ignored anyway: it should just BUG() if

[kvm-devel] [PATCH 042/104] KVM: Cleanup mark_page_dirty

2007-09-17 Thread Avi Kivity
From: Rusty Russell [EMAIL PROTECTED] For some reason, mark_page_dirty open-codes __gfn_to_memslot(). Signed-off-by: Rusty Russell [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/kvm_main.c | 24 +++- 1 files changed, 7 insertions(+), 17

[kvm-devel] [PATCH 049/104] KVM: Use kmem_cache_free for kmem_cache_zalloc'ed objects

2007-09-17 Thread Avi Kivity
From: Rusty Russell [EMAIL PROTECTED] We use kfree in svm.c and vmx.c, and this works, but it could break at any time. kfree() is supposed to match up with kmalloc(). Signed-off-by: Rusty Russell [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/svm.c |4 ++--

[kvm-devel] [PATCH 030/104] KVM: fx_init() needs preemption disabled while it plays with the FPU state

2007-09-17 Thread Avi Kivity
From: Rusty Russell [EMAIL PROTECTED] Now that kvm generally runs with preemption enabled, we need to protect the fpu intialization sequence. Signed-off-by: Rusty Russell [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/kvm_main.c |3 +++ 1 files changed, 3

[kvm-devel] [PATCH 050/104] KVM: VMX: Remove a duplicated ia32e mode vm entry control

2007-09-17 Thread Avi Kivity
From: Li, Xin B [EMAIL PROTECTED] Remove a duplicated ia32e mode VM Entry control definition and use the proper one. Signed-off-by: Xin Li [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/vmx.c |8 drivers/kvm/vmx.h |3 --- 2 files changed, 4

[kvm-devel] [PATCH 028/104] KVM: Use the scheduler preemption notifiers to make kvm preemptible

2007-09-17 Thread Avi Kivity
Current kvm disables preemption while the new virtualization registers are in use. This of course is not very good for latency sensitive workloads (one use of virtualization is to offload user interface and other latency insensitive stuff to a container, so that it is easier to analyze the

[kvm-devel] [PATCH 057/104] KVM: x86 emulator: implement 'jmp rel' instruction (opcode 0xe9)

2007-09-17 Thread Avi Kivity
From: Nitin A Kamble [EMAIL PROTECTED] Signed-off-by: Nitin A Kamble [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/x86_emulate.c | 16 ++-- 1 files changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/kvm/x86_emulate.c

[kvm-devel] [PATCH 055/104] KVM: Communicate cr8 changes to userspace

2007-09-17 Thread Avi Kivity
From: Yang, Sheng [EMAIL PROTECTED] This allows running 64-bit Windows. Signed-off-by: Sheng Yang [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/vmx.c |3 ++- include/linux/kvm.h |1 + 2 files changed, 3 insertions(+), 1 deletions(-) diff --git

[kvm-devel] [PATCH 046/104] KVM: Remove stat_set from debugfs

2007-09-17 Thread Avi Kivity
From: Rusty Russell [EMAIL PROTECTED] We shouldn't define stat_set on the debug attributes, since that will cause silent failure on writing: without a set argument, userspace will get -EACCESS. Signed-off-by: Rusty Russell [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] ---

[kvm-devel] [PATCH 065/104] KVM: Define and use cr8 access functions

2007-09-17 Thread Avi Kivity
From: Eddie Dong [EMAIL PROTECTED] This patch is to wrap APIC base register and CR8 operation which can provide a unique API for user level irqchip and kernel irqchip. This is a preparation of merging lapic/ioapic patch. Signed-off-by: Yaozu (Eddie) Dong [EMAIL PROTECTED] Signed-off-by: Avi

[kvm-devel] [PATCH 053/104] KVM: Clean up kvm_setup_pio()

2007-09-17 Thread Avi Kivity
From: Laurent Vivier [EMAIL PROTECTED] Split kvm_setup_pio() into two functions, one to setup in/out pio (kvm_emulate_pio()) and one to setup ins/outs pio (kvm_emulate_pio_string()). Signed-off-by: Laurent Vivier [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] ---

[kvm-devel] [PATCH 047/104] KVM: Remove unneeded kvm_dev_open and kvm_dev_release functions.

2007-09-17 Thread Avi Kivity
From: Rusty Russell [EMAIL PROTECTED] Devices don't need open or release functions. Signed-off-by: Rusty Russell [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/kvm_main.c | 12 1 files changed, 0 insertions(+), 12 deletions(-) diff --git

[kvm-devel] [PATCH 052/104] KVM: Cleanup string I/O instruction emulation

2007-09-17 Thread Avi Kivity
From: Laurent Vivier [EMAIL PROTECTED] Both vmx and svm decode the I/O instructions, and both botch the job, requiring the instruction prefixes to be fetched in order to completely decode the instruction. So, if we see a string I/O instruction, use the x86 emulator to decode it, as it already

[kvm-devel] [PATCH 032/104] KVM: Remove three magic numbers

2007-09-17 Thread Avi Kivity
From: Rusty Russell [EMAIL PROTECTED] There are several places where hardcoded numbers are used in place of the easily-available constant, which is poor form. Signed-off-by: Rusty Russell [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/kvm_main.c |2 +-

[kvm-devel] [PATCH 060/104] KVM: VMX: allow rmode_tss_base() to work with 2G of guest memory

2007-09-17 Thread Avi Kivity
From: Izik Eidus [EMAIL PROTECTED] Signed-off-by: Izik Eidus [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/vmx.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c index cd999c0..b400668 100644 ---

[kvm-devel] [PATCH 051/104] KVM: Remove useless assignment

2007-09-17 Thread Avi Kivity
From: Laurent Vivier [EMAIL PROTECTED] Line 1809 of kvm_main.c is useless, value is overwritten in line 1815: 1809 now = min(count, PAGE_SIZE / size); 1810 1811 if (!down) 1812 in_page = PAGE_SIZE - offset_in_page(address); 1813 else 1814

[kvm-devel] [PATCH 069/104] KVM: Protect in-kernel pio using kvm-lock

2007-09-17 Thread Avi Kivity
From: Eddie Dong [EMAIL PROTECTED] pio operation and IRQ_LINE kvm_vm_ioctl is not kvm-lock protected. Add lock to same with IOAPIC MMIO operations. Signed-off-by: Yaozu (Eddie) Dong [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/kvm_main.c |6 ++ 1 files

[kvm-devel] [PATCH 056/104] KVM: x86 emulator: implement 'and $imm, %{al|ax|eax}'

2007-09-17 Thread Avi Kivity
From: Nitin A Kamble [EMAIL PROTECTED] Implement emulation of instruction and al imm8 (opcode 0x24) and ax/eax imm16/imm32 (opcode 0x25) Signed-off-by: Nitin A Kamble [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/x86_emulate.c | 21 +++--

[kvm-devel] [PATCH 059/104] KVM: x86 emulator: implement 'push reg' (opcodes 0x50-0x57)

2007-09-17 Thread Avi Kivity
From: Nitin A Kamble [EMAIL PROTECTED] Signed-off-by: Nitin A Kamble [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/x86_emulate.c | 16 +++- 1 files changed, 15 insertions(+), 1 deletions(-) diff --git a/drivers/kvm/x86_emulate.c

[kvm-devel] [PATCH 062/104] KVM: X86 emulator: fix 'push reg' writeback

2007-09-17 Thread Avi Kivity
Pointed out by Rusty Russell. Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/x86_emulate.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c index cf895aa..7439b34 100644 --- a/drivers/kvm/x86_emulate.c +++

[kvm-devel] [PATCH 064/104] KVM: Add support for in-kernel PIC emulation

2007-09-17 Thread Avi Kivity
From: Eddie Dong [EMAIL PROTECTED] Signed-off-by: Yaozu (Eddie) Dong [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/Makefile |2 +- drivers/kvm/i8259.c| 442 drivers/kvm/irq.c | 61 +++

[kvm-devel] [PATCH 048/104] KVM: Add and use pr_unimpl for standard formatting of unimplemented features

2007-09-17 Thread Avi Kivity
From: Rusty Russell [EMAIL PROTECTED] All guest-invokable printks should be ratelimited to prevent malicious guests from flooding logs. This is a start. Signed-off-by: Rusty Russell [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/kvm.h |8

[kvm-devel] [PATCH 080/104] KVM: round robin for APIC lowest priority delivery mode

2007-09-17 Thread Avi Kivity
From: He, Qing [EMAIL PROTECTED] Signed-off-by: Qing He [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/kvm.h |1 + drivers/kvm/lapic.c | 33 - 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/drivers/kvm/kvm.h

[kvm-devel] [PATCH 058/104] KVM: x86 emulator: Implement 'jmp rel short' instruction (opcode 0xeb)

2007-09-17 Thread Avi Kivity
From: Nitin A Kamble [EMAIL PROTECTED] Signed-off-by: Nitin A Kamble [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/x86_emulate.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c index

[kvm-devel] [PATCH 077/104] KVM: Migrate lapic hrtimer when vcpu moves to another cpu

2007-09-17 Thread Avi Kivity
From: Eddie Dong [EMAIL PROTECTED] This reduces overhead by accessing cachelines from the wrong node, as well as simplifying locking. [Qing: fix for inactive or expired one-shot timer] Signed-off-by: Yaozu (Eddie) Dong [EMAIL PROTECTED] Signed-off-by: Qing He [EMAIL PROTECTED] Signed-off-by:

[kvm-devel] [PATCH 079/104] KVM: deliver PIC interrupt only to vcpu0

2007-09-17 Thread Avi Kivity
From: Qing He [EMAIL PROTECTED] This patch changes the PIC interrupts delivery. Now it is only delivered to vcpu0 when either condition is met (on vcpu0): 1. local APIC is hardware disabled 2. LVT0 is unmasked and configured to delivery mode ExtInt It fixes the 2x faster wall clock on x86_64

[kvm-devel] [PATCH 074/104] KVM: pending irq save/restore

2007-09-17 Thread Avi Kivity
From: Eddie Dong [EMAIL PROTECTED] Add in kernel irqchip save/restore support for pending vectors. Signed-off-by: Yaozu (Eddie) Dong [EMAIL PROTECTED] Signed-off-by: Qing He [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/kvm.h |2 ++

[kvm-devel] [PATCH 076/104] KVM: Keep track of missed timer irq injections

2007-09-17 Thread Avi Kivity
From: Eddie Dong [EMAIL PROTECTED] APIC timer IRQ is set every time when a certain period expires at host time, but the guest may be descheduled at that time and thus the irq be overwritten by later fire. This patch keep track of firing irq numbers and decrease only when the IRQ is injected to

[kvm-devel] [PATCH 063/104] KVM: VMX: Split segments reload in vmx_load_host_state()

2007-09-17 Thread Avi Kivity
From: Laurent Vivier [EMAIL PROTECTED] vmx_load_host_state() bundles fs, gs, ldt, and tss reloading into one in the hope that it is infrequent. With smp guests, fs reloading is frequent due to fs being used by threads. Unbundle the reloads so reduce expensive gs reloads. Signed-off-by: Laurent

[kvm-devel] [PATCH 086/104] KVM: Hoist SVM's get_cs_db_l_bits into core code.

2007-09-17 Thread Avi Kivity
From: Rusty Russell [EMAIL PROTECTED] SVM gets the DB and L bits for the cs by decoding the segment. This is in fact the completely generic code, so hoist it for kvm-lite to use. Signed-off-by: Rusty Russell [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/kvm.h

[kvm-devel] [PATCH 070/104] KVM: Add get/set irqchip ioctls for in-kernel PIC live migration support

2007-09-17 Thread Avi Kivity
From: He, Qing [EMAIL PROTECTED] This patch adds two new ioctls to dump and write kernel irqchips for save/restore and live migration. PIC s/r and l/m is implemented in this patch. Signed-off-by: Yaozu (Eddie) Dong [EMAIL PROTECTED] Signed-off-by: Qing He [EMAIL PROTECTED] Signed-off-by: Avi

[kvm-devel] [PATCH 084/104] KVM: Clean up unloved invlpg emulation

2007-09-17 Thread Avi Kivity
From: Rusty Russell [EMAIL PROTECTED] invlpg shouldn't fetch the src address, since it may not be valid, however SVM's solution which neuters emulation of all group 7 instruction is horrible and breaks kvm-lite. The simplest fix is to put a special check in for invlpg. Signed-off-by: Rusty

[kvm-devel] [PATCH 082/104] KVM: Set the ET flag in CR0 after initializing FX

2007-09-17 Thread Avi Kivity
From: Amit Shah [EMAIL PROTECTED] This was missed when moving stuff around in fbc4f2e Fixes Solaris guests and bug #1773613 Signed-off-by: Amit Shah [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/kvm_main.c |1 + 1 files changed, 1 insertions(+), 0

[kvm-devel] [PATCH 078/104] KVM: disable tpr/cr8 sync when in-kernel APIC is used

2007-09-17 Thread Avi Kivity
From: He, Qing [EMAIL PROTECTED] Signed-off-by: Qing He [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/kvm_main.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c index f4cbd4f..a25dfc9

[kvm-devel] [PATCH 085/104] KVM: Keep control regs in sync

2007-09-17 Thread Avi Kivity
From: Rusty Russell [EMAIL PROTECTED] We don't update the vcpu control registers in various places. We should do so. Signed-off-by: Rusty Russell [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/kvm_main.c |8 1 files changed, 4 insertions(+), 4

[kvm-devel] [PATCH 083/104] KVM: Remove the unused invlpg member of struct kvm_arch_ops.

2007-09-17 Thread Avi Kivity
From: Rusty Russell [EMAIL PROTECTED] Signed-off-by: Rusty Russell [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/kvm.h |1 - drivers/kvm/svm.c |6 -- 2 files changed, 0 insertions(+), 7 deletions(-) diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h

[kvm-devel] [PATCH 024/104] KVM: Remove arch specific components from the general code

2007-09-17 Thread Avi Kivity
From: Gregory Haskins [EMAIL PROTECTED] struct kvm_vcpu has vmx-specific members; remove them to a private structure. Signed-off-by: Gregory Haskins [EMAIL PROTECTED] Signed-off-by: Rusty Russell [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/kvm.h | 31

[kvm-devel] [PATCH 073/104] KVM: in-kernel LAPIC save and restore support

2007-09-17 Thread Avi Kivity
From: Eddie Dong [EMAIL PROTECTED] This patch adds a new vcpu-based IOCTL to save and restore the local apic registers for a single vcpu. The kernel only copies the apic page as a whole, extraction of registers is left to userspace side. On restore, the APIC timer is restarted from the initial

[kvm-devel] [PATCH 075/104] KVM: VMX: Use shadow TPR/cr8 for 64-bits guests

2007-09-17 Thread Avi Kivity
From: Yang, Sheng [EMAIL PROTECTED] This patch enables TPR shadow of VMX on CR8 access. 64bit Windows using CR8 access TPR frequently. The TPR shadow can improve the performance of access TPR by not causing vmexit. Signed-off-by: Sheng Yang [EMAIL PROTECTED] Signed-off-by: Yaozu (Eddie) Dong

[kvm-devel] [PATCH 072/104] KVM: in-kernel IOAPIC save and restore support

2007-09-17 Thread Avi Kivity
From: He, Qing [EMAIL PROTECTED] This patch adds support for in-kernel ioapic save and restore (to and from userspace). It uses the same get/set_irqchip ioctl as in-kernel PIC. Signed-off-by: Qing He [EMAIL PROTECTED] Signed-off-by: Yaozu (Eddie) Dong [EMAIL PROTECTED] Signed-off-by: Avi Kivity

[kvm-devel] [PATCH 088/104] KVM: Rename kvm_arch_ops to kvm_x86_ops

2007-09-17 Thread Avi Kivity
From: Christian Ehrhardt [EMAIL PROTECTED] This patch just renames the current (misnamed) _arch namings to _x86 to ensure better readability when a real arch layer takes place. Signed-off-by: Christian Ehrhardt [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/kvm.h

[kvm-devel] [PATCH 021/104] KVM: VMX: Import some constants of vmcs from IA32 SDM

2007-09-17 Thread Avi Kivity
From: Yang, Sheng [EMAIL PROTECTED] This patch mainly imports some constants and rename two exist constants of vmcs according to IA32 SDM. It also adds two constants to indicate Lock bit and Enable bit in MSR_IA32_FEATURE_CONTROL, and replace the hardcode _5_ with these two bits. Signed-off-by:

[kvm-devel] [PATCH 092/104] KVM: VMX: Fix exit qualification width on i386

2007-09-17 Thread Avi Kivity
From: He, Qing [EMAIL PROTECTED] According to Intel Software Developer's Manual, Vol. 3B, Appendix H.4.2, exit qualification should be of natural width. However, current code uses u64 as the data type for this register, which occasionally introduces invalid value to VMExit handling logics. This

[kvm-devel] [PATCH 103/104] KVM: x86 emulator: popf

2007-09-17 Thread Avi Kivity
From: Nitin A Kamble [EMAIL PROTECTED] Implement emulation of instruction: popf opcode: 0x9d Signed-off-by: Nitin A Kamble [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/x86_emulate.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff

[kvm-devel] [PATCH 093/104] KVM: x86 emulator: push imm8

2007-09-17 Thread Avi Kivity
From: Nitin A Kamble [EMAIL PROTECTED] Implement the instruction push imm8 opcode: 0x6a Signed-off-by: Nitin A Kamble [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/x86_emulate.c | 17 ++--- 1 files changed, 14 insertions(+), 3

[kvm-devel] [PATCH 102/104] KVM: x86 emulator: fix src, dst value initialization

2007-09-17 Thread Avi Kivity
From: Nitin A Kamble [EMAIL PROTECTED] Some operand fetches are less than the machine word size and can result in stale bits if used together with operands of different sizes. Signed-off-by: Nitin A Kamble [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] ---

[kvm-devel] [PATCH 066/104] KVM: Emulate local APIC in kernel

2007-09-17 Thread Avi Kivity
From: Eddie Dong [EMAIL PROTECTED] Because lightweight exits (exits which don't involve userspace) are many times faster than heavyweight exits, it makes sense to emulate high usage devices in the kernel. The local APIC is one such device, especially for Windows and for SMP, so we add an APIC

[kvm-devel] [PATCH 097/104] KVM: x86 emulator: sort opcodes into ascending order

2007-09-17 Thread Avi Kivity
From: Nitin A Kamble [EMAIL PROTECTED] Signed-off-by: Nitin A Kamble [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/x86_emulate.c | 99 ++--- 1 files changed, 49 insertions(+), 50 deletions(-) diff --git

[kvm-devel] [PATCH 096/104] KVM: Improve emulation failure reporting

2007-09-17 Thread Avi Kivity
Report failed opcodes from all locations. Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/kvm.h |1 + drivers/kvm/kvm_main.c | 16 drivers/kvm/svm.c |2 +- drivers/kvm/vmx.c |2 +- 4 files changed, 11 insertions(+), 10 deletions(-) diff

[kvm-devel] [PATCH 067/104] KVM: In-kernel I/O APIC model

2007-09-17 Thread Avi Kivity
From: Eddie Dong [EMAIL PROTECTED] This allows in-kernel host-side device drivers to raise guest interrupts without going to userspace. Signed-off-by: Yaozu (Eddie) Dong [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/Makefile |2 +- drivers/kvm/ioapic.c |

[kvm-devel] [PATCH 068/104] KVM: Emulate hlt in the kernel

2007-09-17 Thread Avi Kivity
From: Eddie Dong [EMAIL PROTECTED] By sleeping in the kernel when hlt is executed, we simplify the in-kernel guest interrupt path considerably. Signed-off-by: Gregory Haskins [EMAIL PROTECTED] Signed-off-by: Yaozu (Eddie) Dong [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] ---

[kvm-devel] [PATCH 100/104] KVM: x86 emulator: lea

2007-09-17 Thread Avi Kivity
From: Nitin A Kamble [EMAIL PROTECTED] Implement emulation of instruction lea r16/r32, m opcode: 0x8d: Signed-off-by: Nitin A Kamble [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/x86_emulate.c |5 - 1 files changed, 4 insertions(+), 1

[kvm-devel] [PATCH 095/104] KVM: x86 emulator: pushf

2007-09-17 Thread Avi Kivity
From: Nitin A Kamble [EMAIL PROTECTED] Implement emulation of instruction pushf opcode: 0x9c Signed-off-by: Nitin A Kamble [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/x86_emulate.c | 11 +-- 1 files changed, 9 insertions(+), 2

[kvm-devel] [PATCH 081/104] KVM: enable in-kernel APIC INIT/SIPI handling

2007-09-17 Thread Avi Kivity
From: He, Qing [EMAIL PROTECTED] This patch enables INIT/SIPI handling using in-kernel APIC by introducing a -mp_state field to emulate the SMP state transition. [avi: remove smp_processor_id() warning] Signed-off-by: Qing He [EMAIL PROTECTED] Signed-off-by: Xin Li [EMAIL PROTECTED]

[kvm-devel] [PATCH 090/104] KVM: VMX: Move vm entry failure handling to the exit handler

2007-09-17 Thread Avi Kivity
This will help moving the main loop to subarch independent code. Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/vmx.c | 19 ++- 1 files changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c index 57a6055..713f78a 100644 ---

[kvm-devel] [PATCH 091/104] KVM: Move main vcpu loop into subarch independent code

2007-09-17 Thread Avi Kivity
This simplifies adding new code as well as reducing overall code size. Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/kvm.h |9 +++- drivers/kvm/kvm_main.c | 124 +- drivers/kvm/svm.c | 142

[kvm-devel] [PATCH 089/104] KVM: MMU: Don't do GFP_NOWAIT allocations

2007-09-17 Thread Avi Kivity
Before preempt notifiers, kvm needed to allocate memory with GFP_NOWAIT so as not to have to enable preemption and take a heavyweight exit. On oom, we'd fall back to a GFP_KERNEL allocation. With preemption notifiers, we can do a GFP_KERNEL allocation, and perform the heavyweight exit only if

[kvm-devel] [PATCH 101/104] KVM: x86 emulator: jmp abs

2007-09-17 Thread Avi Kivity
From: Nitin A Kamble [EMAIL PROTECTED] Implement emulation of instruction: jump absolute r/m opcode: 0xff /4 Signed-off-by: Nitin A Kamble [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/x86_emulate.c |6 ++ 1 files changed, 6 insertions(+), 0

[kvm-devel] [PATCH -rc] KVM: Fix virtualization menu help text

2007-09-17 Thread Avi Kivity
What guest drivers? Cc: Jan Engelhardt [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- An August 18 patch from Jan Engelhardt (06bfb7e) added help text for the virtualization menu. Unfortunately the text is misleading, as guest drivers are usually interpreted to mean drivers

[kvm-devel] [PATCH 099/104] KVM: X86 emulator: jump conditional short

2007-09-17 Thread Avi Kivity
From: Nitin A Kamble [EMAIL PROTECTED] Implement emulation of more jump conditional instructions jcc shortrel opcodes: 0x70 - 0x7f Signed-off-by: Nitin A Kamble [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/x86_emulate.c | 15 +-- 1 files

[kvm-devel] [PATCH 098/104] KVM: x86 emulator: imlpement jump conditional relative

2007-09-17 Thread Avi Kivity
From: Nitin A Kamble [EMAIL PROTECTED] Implement emulation of instruction: jump conditional rel opcodes: 0x0f 0x80 - 0x0f 0x8f Signed-off-by: Nitin A Kamble [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/x86_emulate.c | 61

Re: [kvm-devel] [PATCH 001/104] KVM: Fix *nopage() in kvm_main.c

2007-09-17 Thread Christoph Hellwig
On Mon, Sep 17, 2007 at 10:30:43AM +0200, Avi Kivity wrote: From: Nguyen Anh Quynh [EMAIL PROTECTED] *nopage() in kvm_main.c should only store the type of mmap() fault if the pointers are not NULL. This patch fixes the problem. Care to convert it to -faul while you're at it?

Re: [kvm-devel] [PATCH 001/104] KVM: Fix *nopage() in kvm_main.c

2007-09-17 Thread Avi Kivity
Christoph Hellwig wrote: On Mon, Sep 17, 2007 at 10:30:43AM +0200, Avi Kivity wrote: From: Nguyen Anh Quynh [EMAIL PROTECTED] *nopage() in kvm_main.c should only store the type of mmap() fault if the pointers are not NULL. This patch fixes the problem. Care to convert it to -faul

Re: [kvm-devel] [PATCH 001/104] KVM: Fix *nopage() in kvm_main.c

2007-09-17 Thread Avi Kivity
Avi Kivity wrote: Christoph Hellwig wrote: On Mon, Sep 17, 2007 at 10:30:43AM +0200, Avi Kivity wrote: From: Nguyen Anh Quynh [EMAIL PROTECTED] *nopage() in kvm_main.c should only store the type of mmap() fault if the pointers are not NULL. This patch fixes the problem.

[kvm-devel] [PATCH 094/104] KVM: x86 emulator: call near

2007-09-17 Thread Avi Kivity
From: Nitin A Kamble [EMAIL PROTECTED] Implement emulation of instruction opcode: 0xe8 call (near) Signed-off-by: Nitin A Kamble [EMAIL PROTECTED] Signed-off-by: Avi Kivity [EMAIL PROTECTED] --- drivers/kvm/x86_emulate.c | 22 +- 1 files changed, 21

Re: [kvm-devel] [PATCH 001/104] KVM: Fix *nopage() in kvm_main.c

2007-09-17 Thread Nick Piggin
On Monday 17 September 2007 19:18, Avi Kivity wrote: Avi Kivity wrote: Christoph Hellwig wrote: On Mon, Sep 17, 2007 at 10:30:43AM +0200, Avi Kivity wrote: From: Nguyen Anh Quynh [EMAIL PROTECTED] *nopage() in kvm_main.c should only store the type of mmap() fault if the pointers are

[kvm-devel] (: .)! )(*:.

2007-09-17 Thread Antwan Pearson
Sy m[b+oool F[D+E!G Last 0.04 Ta.rg et 0.12

Re: [kvm-devel] [ANNOUNCE] kvm-40 release

2007-09-17 Thread Farkas Levente
i've try kvm-40 it now on centos-5 with kernel-2.6.18-8.1.10.el5 x86_64 host (8gb ram and 4 core) and one centos-5 x86_64, centos-5 i386, mandrake i586 guests. i try to give 4 cpu for the first 2 guest and 1 cpu for the last. after i start these 3 guests the host kernel crash all the time after

Re: [kvm-devel] [ANNOUNCE] kvm-40 release

2007-09-17 Thread Farkas Levente
Dor Laor wrote: i've try kvm-40 it now on centos-5 with kernel-2.6.18-8.1.10.el5 x86_64 host (8gb ram and 4 core) and one centos-5 x86_64, centos-5 i386, mandrake i586 guests. i try to give 4 cpu for the first 2 guest and 1 cpu for the last. after i start these 3 guests the host kernel crash

  1   2   >