[PATCH v2 4/4] nested vmx: use a list to store the launched vmcs12 for L1 VMM

2012-11-22 Thread Dongxiao Xu
The launch state is not a member in the VMCS area, use a separate variable (list) to store it instead. Signed-off-by: Dongxiao Xu dongxiao...@intel.com --- arch/x86/kvm/vmx.c | 86 +--- 1 files changed, 81 insertions(+), 5 deletions(-) diff

[PATCH v2 1/4] nested vmx: clean up for vmcs12 read and write

2012-11-22 Thread Dongxiao Xu
abstract vmcs12_read and vmcs12_write functions to do the vmcs12 read/write operations. Signed-off-by: Dongxiao Xu dongxiao...@intel.com --- arch/x86/kvm/vmx.c | 85 +--- 1 files changed, 41 insertions(+), 44 deletions(-) diff --git

[PATCH v2 3/4] nested vmx: use vmcs12_read/write() to operate VMCS fields

2012-11-22 Thread Dongxiao Xu
When referencing vmcs12 fields, the current approach is to use struct.field style. This commit replace all the current solution by calling vmcs12_read() and vmcs12_write() fucntions. Signed-off-by: Dongxiao Xu dongxiao...@intel.com --- arch/x86/kvm/vmx.c | 591

[PATCH v2 2/4] nested vmx: clean up for nested_cpu_has_xxx functions

2012-11-22 Thread Dongxiao Xu
This is a preparation for the later change, which use vmcs12_read() and vmcs12_write() to replace the way to access vmcs12 fields. Since the above functions uses 'vcpu' as parameter, we also use 'vcpu' as the parameter in nested_cpu_has_xxx functions. Signed-off-by: Dongxiao Xu

Re: [PATCH v2 8/8] kvm tools: add support for ARMv7 processors

2012-11-22 Thread Will Deacon
Hi Peter, On Thu, Nov 22, 2012 at 04:13:17PM +, Peter Maydell wrote: On 22 November 2012 15:58, Will Deacon will.dea...@arm.com wrote: +++ b/tools/kvm/arm/aarch32/smp-pen.S @@ -0,0 +1,30 @@ +#include kvm/kvm-arch.h + +#include arm-common/gic.h + + .arm + +

Re: [PATCH v2 1/8] rbtree: include linux/compiler.h for definition of __always_inline

2012-11-22 Thread Sasha Levin
On 11/22/2012 10:58 AM, Will Deacon wrote: Commit 29fc7c5a4f516d388fb6e1f6d24bfb04b8093e54 upstream. rb_erase_augmented() is a static function annotated with __always_inline. This causes a compile failure when attempting to use the rbtree implementation as a library (e.g. kvm tool):

[PATCH v2 02/18] KVM/MIPS32: Arch specific KVM data structures.

2012-11-22 Thread Sanjay Lal
Signed-off-by: Sanjay Lal sanj...@kymasys.com --- arch/mips/include/asm/kvm.h | 55 arch/mips/include/asm/kvm_host.h | 669 +++ 2 files changed, 724 insertions(+) create mode 100644 arch/mips/include/asm/kvm.h create mode 100644

[PATCH v2 00/18] KVM for MIPS32 Processors

2012-11-22 Thread Sanjay Lal
The following patchset implements KVM support for MIPS32R2 processors, using Trap Emulate, with basic runtime binary translation to improve performance. The goal has been to keep the Guest kernel changes to a minimum. The patch is against Linux 3.7-rc6. This is Version 2 of the patch set.

RE: [PATCH 4/4] nested vmx: use a list to store the launched vmcs12 for L1 VMM

2012-11-22 Thread Xu, Dongxiao
-Original Message- From: Gleb Natapov [mailto:g...@redhat.com] Sent: Wednesday, November 21, 2012 10:15 PM To: Xu, Dongxiao Cc: kvm@vger.kernel.org; mtosa...@redhat.com Subject: Re: [PATCH 4/4] nested vmx: use a list to store the launched vmcs12 for L1 VMM On Wed, Nov 21, 2012 at

hva_to_pfn and memory leak

2012-11-22 Thread Koshelev Vladimir
Hello, guys! I have written paravirtual interface for GPA-HPA translation inside guest. I build GPA-HPA translation table in guest virtual memory. To do this, I need to translate userspace virtual address from memslot to host physical address. I use hva_to_pfn for it. It works fine, but linux

[PATCH v2 18/18] KVM/MIPS32: Binary patching of select privileged instructions.

2012-11-22 Thread Sanjay Lal
Currently, the following instructions are translated: - CACHE (indexed) - CACHE (va based): translated to a synci, overkill on D-CACHE operations, but still much faster than a trap. - mfc0/mtc0: the virtual COP0 registers for the guest are implemented as 2-D array [COP#][SEL] and this is

Re: [PATCH v2 5/6] x86: Enable ack interrupt on vmexit

2012-11-22 Thread Gleb Natapov
On Wed, Nov 21, 2012 at 04:09:38PM +0800, Yang Zhang wrote: Ack interrupt on vmexit is required by Posted Interrupt. With it, when external interrupt caused vmexit, the cpu will acknowledge the interrupt controller and save the interrupt's vector in vmcs. There are several approaches to

[PATCH] x86, kvm: Remove incorrect redundant assembly constraint

2012-11-22 Thread H. Peter Anvin
From: H. Peter Anvin h...@linux.intel.com In __emulate_1op_rax_rdx, we use +a and +d which are input/output constraints, and *then* use a and d as input constraints. This is incorrect, but happens to work on some versions of gcc. However, it breaks gcc with -O0 and icc, and may break on future

[PATCH V2] Enabling IA32_TSC_ADJUST for Qemu KVM guest VMs

2012-11-22 Thread Will Auld
CPUID.7.0.EBX[1]=1 indicates IA32_TSC_ADJUST MSR 0x3b is supported Basic design is to emulate the MSR by allowing reads and writes to the hypervisor vcpu specific locations to store the value of the emulated MSRs. In this way the IA32_TSC_ADJUST value will be included in all reads to the TSC MSR

Performance issue

2012-11-22 Thread George-Cristian Bîrzan
I'm trying to understand a performance problem (50% degradation in the VM) that I'm experiencing some systems with qemu-kvm. Running Fedora with 3.5.3-1.fc17.x86_64 or 3.6.6-1.fc17.x86_64, qemu 1.0.1 or 1.2.1 on AMD Opteron 6176 and 6174, and all of them behave identically. A Windows guest is

Re: pci_enable_msix() fails with ENOMEM/EINVAL

2012-11-22 Thread Alex Williamson
On Wed, 2012-11-21 at 16:19 +0200, Alex Lyakas wrote: Hi, I was advised to turn off irqbalance and reproduced this issue, but the failure is in a different place now. Now request_threaded_irq() fails with EBUSY. According to the code, this can only happen on the path: request_threaded_irq()

[PATCH 1/5] KVM: PPC: Book3S HV: Handle guest-caused machine checks on POWER7 without panicking

2012-11-22 Thread Paul Mackerras
Currently, if a machine check interrupt happens while we are in the guest, we exit the guest and call the host's machine check handler, which tends to cause the host to panic. Some machine checks can be triggered by the guest; for example, if the guest creates two entries in the SLB that map the

[PATCH 4/5] KVM: PPC: Book3S HV: Don't give the guest RW access to RO pages

2012-11-22 Thread Paul Mackerras
Currently, if the guest does an H_PROTECT hcall requesting that the permissions on a HPT entry be changed to allow writing, we make the requested change even if the page is marked read-only in the host Linux page tables. This is a problem since it would for instance allow a guest to modify a page

[PATCH 2/5] KVM: PPC: Book3S HV: Reset reverse-map chains when resetting the HPT

2012-11-22 Thread Paul Mackerras
With HV-style KVM, we maintain reverse-mapping lists that enable us to find all the HPT (hashed page table) entries that reference each guest physical page, with the heads of the lists in the memslot-arch.rmap arrays. When we reset the HPT (i.e. when we reboot the VM), we clear out all the HPT

Re: [PATCH] vhost-blk: Add vhost-blk support v5

2012-11-22 Thread Asias He
On 11/21/2012 07:57 PM, Michael S. Tsirkin wrote: On Wed, Nov 21, 2012 at 12:24:55PM +0800, Asias He wrote: On 11/20/2012 09:37 PM, Michael S. Tsirkin wrote: On Tue, Nov 20, 2012 at 02:39:40PM +0800, Asias He wrote: On 11/20/2012 04:26 AM, Michael S. Tsirkin wrote: On Mon, Nov 19, 2012 at

[PATCH] Added x86/tsc_adjust.c to test the ia32_tsc_adjust funtionality.

2012-11-22 Thread Will Auld
Signed-off-by: Will Auld will.a...@intel.com --- config-x86-common.mak | 5 - x86/tsc_adjust.c | 43 +++ 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 x86/tsc_adjust.c diff --git a/config-x86-common.mak

Re: [PATCH v5 1/2] x86/kexec: VMCLEAR vmcss on all cpus if necessary

2012-11-22 Thread Gleb Natapov
On Thu, Nov 22, 2012 at 08:59:15AM +0800, Zhang Yanfei wrote: 于 2012年11月21日 18:33, Gleb Natapov 写道: On Wed, Nov 21, 2012 at 10:23:12AM +0800, Zhang Yanfei wrote: This patch adds an atomic notifier list named crash_notifier_list. When loading kvm-intel module, a notifier will be registered

Re: [PATCH v6 2/2] KVM-INTEL: add a notifier and a bitmap to support VMCLEAR in kdump

2012-11-22 Thread Marcelo Tosatti
On Wed, Nov 21, 2012 at 11:27:19PM +0800, Zhang Yanfei wrote: The notifier will be registered in vmclear_notifier_list when loading kvm-intel module. And the bitmap indicates whether we should do VMCLEAR operation in kdump. The bits in the bitmap are set/unset according to different

Re: [Qemu-devel] Ubuntu/Debian Installer + Virtio-SCSI - Bad ram pointer

2012-11-22 Thread Peter Lieven
On 19.11.2012 18:20, Stefan Hajnoczi wrote: On Thu, Nov 8, 2012 at 4:26 PM, Peter Lieven p...@dlhnet.de wrote: Has anyone any other idea what the cause could be or where to start? Hi Peter, I suggested posting the source tree you are building. Since you have applied patches yourself no one

RE: messed up with xml-files and configuration of a VM - SOLVED

2012-11-22 Thread Lentes, Bernd
-Original Message- From: kvm-ow...@vger.kernel.org [mailto:kvm-ow...@vger.kernel.org] On Behalf Of Lentes, Bernd Sent: Tuesday, November 20, 2012 5:14 PM To: KVM-ML (kvm@vger.kernel.org) Subject: messed up with xml-files and configuration of a VM Hi, first, i'm new to kvm. I'm

Re: [PATCH 1/4] nested vmx: clean up for vmcs12 read and write

2012-11-22 Thread Gleb Natapov
On Thu, Nov 22, 2012 at 03:16:47AM +, Xu, Dongxiao wrote: -Original Message- From: Gleb Natapov [mailto:g...@redhat.com] Sent: Wednesday, November 21, 2012 9:27 PM To: Xu, Dongxiao Cc: kvm@vger.kernel.org; mtosa...@redhat.com Subject: Re: [PATCH 1/4] nested vmx: clean

[PATCH v2 14/18] MIPS: ASM offsets for VCPU arch specific fields.

2012-11-22 Thread Sanjay Lal
Signed-off-by: Sanjay Lal sanj...@kymasys.com --- arch/mips/kernel/asm-offsets.c | 66 ++ 1 file changed, 66 insertions(+) diff --git a/arch/mips/kernel/asm-offsets.c b/arch/mips/kernel/asm-offsets.c index 0c4bce4..66895de 100644 ---

[PATCH v2 12/18] MIPS: Export routines needed by the KVM module.

2012-11-22 Thread Sanjay Lal
Signed-off-by: Sanjay Lal sanj...@kymasys.com --- arch/mips/mm/c-r4k.c | 6 -- arch/mips/mm/cache.c | 1 + arch/mips/mm/tlb-r4k.c | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c index 2b61462..1923063 100644 ---

[PATCH V2] Enabling IA32_TSC_ADJUST for Qemu KVM guest VMs

2012-11-22 Thread Will Auld
CPUID.7.0.EBX[1]=1 indicates IA32_TSC_ADJUST MSR 0x3b is supported Basic design is to emulate the MSR by allowing reads and writes to the hypervisor vcpu specific locations to store the value of the emulated MSRs. In this way the IA32_TSC_ADJUST value will be included in all reads to the TSC MSR

Re: pci_enable_msix() fails with ENOMEM/EINVAL

2012-11-22 Thread Alex Lyakas
Hi Alex, thanks for your response. I printed out the vector and entry values of dev-host_msix_entries[i] within assigned_device_enable_host_msix() before call to request_threaded_irq(). I see that they are all 0s: kernel: [ 3332.610980] kvm-8095: KVM_ASSIGN_DEV_IRQ assigned_dev_id=924 kernel:

Re: [PATCH v2 8/8] kvm tools: add support for ARMv7 processors

2012-11-22 Thread Peter Maydell
On 22 November 2012 15:58, Will Deacon will.dea...@arm.com wrote: +++ b/tools/kvm/arm/aarch32/smp-pen.S @@ -0,0 +1,30 @@ +#include kvm/kvm-arch.h + +#include arm-common/gic.h + + .arm + + .globl smp_pen_start + .globl smp_jump_addr + .globl smp_pen_end + +

[PATCHv4] virtio-spec: virtio network device RFS support

2012-11-22 Thread Michael S. Tsirkin
Add RFS support to virtio network device. Add a new feature flag VIRTIO_NET_F_RFS for this feature, a new configuration field max_virtqueue_pairs to detect supported number of virtqueues as well as a new command VIRTIO_NET_CTRL_RFS to program packet steering for unidirectional protocols.

Re: PROBLEM: compilation issue, inline assembly arch/x86/kvm/emulate.c fails at -O0

2012-11-22 Thread H. Peter Anvin
On 11/14/2012 11:45 AM, Blower, Melanie wrote: [1.] gcc -O0 assembly arch/x86/kvm/emulate.c gets compilation failure -- incorrect register restrictions [2.] Full description of the problem/report: I'm trying to compile this file at -O0, but gcc chokes in register allocation at the inline

Re: hva_to_pfn and memory leak

2012-11-22 Thread Koshelev Vladimir
22.11.2012, 18:13, Koshelev Vladimir vedu...@yandex.ru: gt; Hello, guys! gt; gt; I have written paravirtual interface for GPA-HPA translation inside guest. I build GPA-HPA translation table in guest virtual memory. gt; To do this, I need to translate userspace virtual address from  memslot to

[PATCH v2 07/18] KVM/MIPS32: MMU/TLB operations for the Guest.

2012-11-22 Thread Sanjay Lal
- Note that this file is statically linked with the rest of the host kernel (KSEG0). This is because kernel modules are loaded into mapped space on MIPS and we want to make sure that we don't get any host kernel TLB faults while manipulating TLBs. - Virtual Guest TLBs are implemented as 64 entry

[PATCH v2 08/18] KVM/MIPS32: Release notes and KVM module Makefile

2012-11-22 Thread Sanjay Lal
Signed-off-by: Sanjay Lal sanj...@kymasys.com --- arch/mips/kvm/00README.txt | 31 +++ arch/mips/kvm/Makefile | 17 + 2 files changed, 48 insertions(+) create mode 100644 arch/mips/kvm/00README.txt create mode 100644 arch/mips/kvm/Makefile diff

[PATCH v2 16/18] MIPS: Export symbols used by KVM/MIPS module

2012-11-22 Thread Sanjay Lal
Signed-off-by: Sanjay Lal sanj...@kymasys.com --- arch/mips/kernel/smp.c | 1 + mm/bootmem.c | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c index 9005bf9..60ea489 100644 --- a/arch/mips/kernel/smp.c +++ b/arch/mips/kernel/smp.c @@

RE: PROBLEM: compilation issue, inline assembly arch/x86/kvm/emulate.c fails at -O0

2012-11-22 Thread Blower, Melanie
Thank you so much, this patch solves the compilation errors that I was seeing in the Intel compiler, and with gcc -O0 BTW, my charter is to compile the kernel with the Intel compiler, and my testing stops short of verifying that the kernel build actually works. Best regards, Melanie Blower

[PATCH 1/2] Add code to track call origin for msr assignment.

2012-11-22 Thread Will Auld
In order to track who initiated the call (host or guest) to modify an msr value I have changed function call parameters along the call path. The specific change is to add a struct pointer parameter that points to (index, data, caller) information rather than having this information passed as

Re: Interrupt controller updates

2012-11-22 Thread Benjamin Herrenschmidt
On Thu, 2012-11-22 at 11:25 +0100, Paolo Bonzini wrote: Again, from memory, you were volunteered to do the initial x86 change so we could piggy back on it :-) Or do I remember wrong ? Please suggest an API, then we can work out the x86 changes. I can volunteer myself, but I wasn't in the

[PATCH 0/5] KVM: PPC: Fix various bugs and vulnerabilities in HV KVM

2012-11-22 Thread Paul Mackerras
This series of patches fixes various bugs that we have found recently. The bugs fixed in patches 1, 3 and 4 are also vulnerabilities where the guest could cause the host to crash or could access host memory inappropriately. The bug fixed in patch 2 could cause the host to hang or crash after the

[PATCH 5/5] KVM: PPC: Book3S HV: Report correct HPT entry index when reading HPT

2012-11-22 Thread Paul Mackerras
This fixes a bug in the code which allows userspace to read out the contents of the guest's hashed page table (HPT). On the second and subsequent passes through the HPT, when we are reporting only those entries that have changed, we were incorrectly initializing the index field of the header with

[PATCH 3/5] KVM: PPC: Book3S HV: Improve handling of local vs. global TLB invalidations

2012-11-22 Thread Paul Mackerras
When we change or remove a HPT (hashed page table) entry, we can do either a global TLB invalidation (tlbie) that works across the whole machine, or a local invalidation (tlbiel) that only affects this core. Currently we do local invalidations if the VM has only one vcpu or if the guest requests

[PATCH V3 1/2] Add code to track call origin for msr assignment.

2012-11-22 Thread Will Auld
In order to track who initiated the call (host or guest) to modify an msr value I have changed function call parameters along the call path. The specific change is to add a struct pointer parameter that points to (index, data, caller) information rather than having this information passed as

[PATCH v2 10/18] KVM/MIPS32: Guest interrupt delivery.

2012-11-22 Thread Sanjay Lal
Signed-off-by: Sanjay Lal sanj...@kymasys.com --- arch/mips/kvm/kvm_mips_int.c | 243 +++ arch/mips/kvm/kvm_mips_int.h | 49 + 2 files changed, 292 insertions(+) create mode 100644 arch/mips/kvm/kvm_mips_int.c create mode 100644

[PATCH v2 11/18] KVM/MIPS32: Routines to handle specific traps/exceptions while executing the guest.

2012-11-22 Thread Sanjay Lal
Signed-off-by: Sanjay Lal sanj...@kymasys.com --- arch/mips/kvm/kvm_cb.c| 14 ++ arch/mips/kvm/kvm_trap_emul.c | 482 ++ 2 files changed, 496 insertions(+) create mode 100644 arch/mips/kvm/kvm_cb.c create mode 100644

[PATCH v2 09/18] KVM/MIPS32: COP0 accesses profiling.

2012-11-22 Thread Sanjay Lal
Signed-off-by: Sanjay Lal sanj...@kymasys.com --- arch/mips/kvm/kvm_mips_stats.c | 81 ++ 1 file changed, 81 insertions(+) create mode 100644 arch/mips/kvm/kvm_mips_stats.c diff --git a/arch/mips/kvm/kvm_mips_stats.c b/arch/mips/kvm/kvm_mips_stats.c new

[PATCH v2 17/18] KVM/MIPS32: Do not call vcpu_load when injecting interrupts.

2012-11-22 Thread Sanjay Lal
Signed-off-by: Sanjay Lal sanj...@kymasys.com --- virt/kvm/kvm_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index be70035..ecd96ce 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -1880,7 +1880,7 @@ static long

[PATCH v2 15/18] MIPS: Pull in MIPS fix: fix endless loop when processing signals for kernel tasks.

2012-11-22 Thread Sanjay Lal
This bug is discussed in: http://lkml.indiana.edu/hypermail/linux/kernel/1205.2/00719.html Signed-off-by: Sanjay Lal sanj...@kymasys.com --- arch/mips/kernel/entry.S | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/mips/kernel/entry.S b/arch/mips/kernel/entry.S

[PATCH v2 06/18] KVM/MIPS32: Privileged instruction/target branch emulation.

2012-11-22 Thread Sanjay Lal
- The Guest kernel is run in UM and privileged instructions cause a trap. - If the instruction causing the trap is in a branch delay slot, the branch needs to be emulated to figure out the PC @ which the guest will resume execution. Signed-off-by: Sanjay Lal sanj...@kymasys.com ---

[PATCH v2 04/18] KVM/MIPS32: MIPS arch specific APIs for KVM

2012-11-22 Thread Sanjay Lal
- Implements the arch specific APIs for KVM, some are stubs for MIPS - kvm_mips_handle_exit(): Main 'C' distpatch routine for handling exceptions while in Guest mode. - Also implements in-kernel timer interrupt support for the guest. Signed-off-by: Sanjay Lal sanj...@kymasys.com ---

[PATCH v2 05/18] KVM/MIPS32: KVM Guest kernel support.

2012-11-22 Thread Sanjay Lal
Both Guest kernel and Guest Userspace execute in UM. The memory map is as follows: Guest User address space: 0x - 0x4000 Guest Kernel Unmapped: 0x4000 - 0x6000 Guest Kernel Mapped:0x6000 - 0x8000 - Guest Usermode virtual memory is limited to 1GB.

[PATCH v2 13/18] MIPS: If KVM is enabled then use the KVM specific routine to flush the TLBs on a ASID wrap.

2012-11-22 Thread Sanjay Lal
Signed-off-by: Sanjay Lal sanj...@kymasys.com --- arch/mips/include/asm/mmu_context.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/mips/include/asm/mmu_context.h b/arch/mips/include/asm/mmu_context.h index 9b02cfb..10a3fd2 100644 --- a/arch/mips/include/asm/mmu_context.h +++

[PATCH v2 03/18] KVM/MIPS32: Entry point for trampolining to the guest and trap handlers.

2012-11-22 Thread Sanjay Lal
- __kvm_mips_vcpu_run: main entry point to enter guest, we save kernel context, load up guest context from and ERET to guest context. - mips32_exception: L1 exception handler(s), save k0/k1 and jump to main handlers. - mips32_GuestException: Generic exception handlers for exceptions/interrupts

Re: Interrupt controller updates

2012-11-22 Thread Peter Maydell
On 22 November 2012 21:00, Benjamin Herrenschmidt b...@kernel.crashing.org wrote: Oh it's simple enough initially, just move the ioctl call from generic kvm init to machine init. The problem is then to add an argument, since that essentially means changing the ioctl number, but we need that for

RE: [PATCH 1/4] nested vmx: clean up for vmcs12 read and write

2012-11-22 Thread Xu, Dongxiao
-Original Message- From: Gleb Natapov [mailto:g...@redhat.com] Sent: Wednesday, November 21, 2012 9:27 PM To: Xu, Dongxiao Cc: kvm@vger.kernel.org; mtosa...@redhat.com Subject: Re: [PATCH 1/4] nested vmx: clean up for vmcs12 read and write On Wed, Nov 21, 2012 at 05:04:34PM

Re: [PATCH v2 09/18] KVM/MIPS32: COP0 accesses profiling.

2012-11-22 Thread Sergei Shtylyov
Hello. On 22-11-2012 6:34, Sanjay Lal wrote: Signed-off-by: Sanjay Lal sanj...@kymasys.com --- arch/mips/kvm/kvm_mips_stats.c | 81 ++ 1 file changed, 81 insertions(+) create mode 100644 arch/mips/kvm/kvm_mips_stats.c diff --git

Re: Interrupt controller updates

2012-11-22 Thread Paolo Bonzini
Il 21/11/2012 02:07, Benjamin Herrenschmidt ha scritto: David (CC) want to make some progress with our in-kernel PIC. From memory, one of the outcomes of the BOF was that we need to move the existing enable in-kernel PIC from generic KVM init to machine init in order to be able to add an

Re: [PATCH v2 3/6] x86, apicv: add virtual interrupt delivery support

2012-11-22 Thread Gleb Natapov
On Wed, Nov 21, 2012 at 04:09:36PM +0800, Yang Zhang wrote: Virtual interrupt delivery avoids KVM to inject vAPIC interrupts manually, which is fully taken care of by the hardware. This needs some special awareness into existing interrupr injection path: - for pending interrupt, instead of

[Bug 50891] New: The smp_affinity cannot work correctly when PCI passthrough device using msi/msi-x with KVM

2012-11-22 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=50891 Summary: The smp_affinity cannot work correctly when PCI passthrough device using msi/msi-x with KVM Product: Virtualization Version: unspecified Kernel Version: 3.7-rc6 Platform:

[Bug 50891] The smp_affinity cannot work correctly on guest os when PCI passthrough device using msi/msi-x with KVM

2012-11-22 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=50891 liyi yiliker...@gmail.com changed: What|Removed |Added Summary|The smp_affinity cannot |The smp_affinity cannot

[PATCH v2 2/8] kvm tools: don't bother including linux/compiler.h

2012-11-22 Thread Will Deacon
linux/compiler.h will never give us a definition for __compiler_offsetof because __KERNEL__ isn't defined, so just use the simple definition that we have already. This patch removes the redundant code. Signed-off-by: Will Deacon will.dea...@arm.com --- tools/kvm/include/linux/stddef.h | 6

[PATCH v2 5/8] kvm tools: keep track of registered memory banks in struct kvm

2012-11-22 Thread Will Deacon
When registering memory banks for a guest, it is useful to keep the range information around for translating between guest and host address spaces. This patch adds a list of kvm_mem_bank structures to struct kvm, which is updated when a new bank is registered. Signed-off-by: Will Deacon

[PATCH v2 0/8] kvm tools: add support for ARMv7 processors

2012-11-22 Thread Will Deacon
Hello, This is version two of the patches I originally posted here: http://www.spinics.net/lists/kvm/msg82447.html Changes since version one include: - MAX_MEMORY no longer needlessly page-aligned for ARM - Use xread instead of read for reading the kernel image -

[PATCH v2 1/8] rbtree: include linux/compiler.h for definition of __always_inline

2012-11-22 Thread Will Deacon
Commit 29fc7c5a4f516d388fb6e1f6d24bfb04b8093e54 upstream. rb_erase_augmented() is a static function annotated with __always_inline. This causes a compile failure when attempting to use the rbtree implementation as a library (e.g. kvm tool): rbtree_augmented.h:125:24: error: expected `=',

Re: Re: Re: Re: [RFC PATCH 0/2] kvm/vmx: Output TSC offset

2012-11-22 Thread Yoshihiro YUNOMAE
Hi Marcelo, (2012/11/21 7:51), Marcelo Tosatti wrote: On Tue, Nov 20, 2012 at 07:36:33PM +0900, Yoshihiro YUNOMAE wrote: Hi Marcelo, Sorry for the late reply. (2012/11/17 4:15), Marcelo Tosatti wrote: On Wed, Nov 14, 2012 at 05:26:10PM +0900, Yoshihiro YUNOMAE wrote: Thank you for

RE: [PATCH 1/4] nested vmx: clean up for vmcs12 read and write

2012-11-22 Thread Xu, Dongxiao
-Original Message- From: Gleb Natapov [mailto:g...@redhat.com] Sent: Wednesday, November 21, 2012 9:04 PM To: Xu, Dongxiao Cc: kvm@vger.kernel.org; mtosa...@redhat.com Subject: Re: [PATCH 1/4] nested vmx: clean up for vmcs12 read and write On Wed, Nov 21, 2012 at 05:04:34PM

KVM Disk i/o or VM activities causes soft lockup?

2012-11-22 Thread Vincent Li
Hi, We have users running on redhat based distro (Kernel 2.6.32-131.21.1.el6.x86_64 ) with kvm, when customer made cron job script to copy large files between kvm guest or some other user space program leads to disk i/o or VM activities, users get following soft lockup message from console: Nov

[PATCH v2 8/8] kvm tools: add support for ARMv7 processors

2012-11-22 Thread Will Deacon
This patch adds initial support for ARMv7 processors (more specifically, Cortex-A15) to kvmtool. Everything is driven by FDT, including dynamic generation of virtio nodes for MMIO devices (PCI is not used due to lack of a suitable host-bridge). The virtual timers and virtual interrupt controller

[PATCH v2 4/8] kvm tools: add generic device registration mechanism

2012-11-22 Thread Will Deacon
PCI devices are currently registered into the pci_devices array via the pci__register function, which can then be indexed later by architecture code to construct device tree nodes. For MMIO devices, there is no such utility. Rather than invent a similar mechanism for MMIO, this patch creates a

[PATCH v2 6/8] kvm tools: teach guest_flat_to_host about memory banks starting above 0

2012-11-22 Thread Will Deacon
Running a guest with multiple banks of memory based above 0 causes the guest_flat_to_host address conversion to fail, as it is assumed that guest memory addresses are offset linearly from 0. This patch changes the translation function so that the kvm_mem_bank structures registered by

[PATCH v2 7/8] kvm tools: provide a mechanism for translating host to guest addresses

2012-11-22 Thread Will Deacon
When generating a device tree for a guest, it is useful to have a helper for converting host addresses to guest addresses in order to populate the device nodes correctly. This patch adds such a helper, following a similar implementation to the reverse translation function that already exists.

[PATCH v2 3/8] kvm tools: balloon: add dummy set_size_vq implementation

2012-11-22 Thread Will Deacon
Commit 5e980d372620 (kvm tools: virtio: add dummy set_size_vq implementations) added dummy set_size_vq implementations for a number of devices now that they can use virtio MMIO as their transport. Unfortunately, it missed the balloon driver, so this patch adds the same implementation there.

[PATCH V3 2/2] Enabling IA32_TSC_ADJUST for KVM guest VM support

2012-11-22 Thread Will Auld
CPUID.7.0.EBX[1]=1 indicates IA32_TSC_ADJUST MSR 0x3b is supported Basic design is to emulate the MSR by allowing reads and writes to a guest vcpu specific location to store the value of the emulated MSR while adding the value to the vmcs tsc_offset. In this way the IA32_TSC_ADJUST value will be

RE: [PATCH] vfio powerpc: enabled and supported on powernv platform

2012-11-22 Thread Sethi Varun-B16395
-Original Message- From: linux-kernel-ow...@vger.kernel.org [mailto:linux-kernel- ow...@vger.kernel.org] On Behalf Of Alex Williamson Sent: Tuesday, November 20, 2012 11:50 PM To: Alexey Kardashevskiy Cc: Benjamin Herrenschmidt; Paul Mackerras; linuxppc- d...@lists.ozlabs.org;

[PATCH v2 0/4] nested vmx code clean up and restructure

2012-11-22 Thread Dongxiao Xu
This patch series clean up and restructure part of the nested vmx code. The main purpose is to abstract the vmcs12_read() and vmcs12_write() functions. With this change, we have a unified API to get/set field values from/to vmcs12. Changes from v1 to v2: Move the VMCS field valid check into

[PATCH 0/1] s390 fix

2012-11-22 Thread Christian Borntraeger
Marcelo, here is a kvm related fix for s390. Please consider for the next merge window. Since it is s390 core kernel, I will also push it into Martins s390 tree. Christian Borntraeger (1): Subject: [PATCH] s390/kvm: Fix address space mixup arch/s390/kernel/entry64.S | 25

[PATCH 1/1] Subject: [PATCH] s390/kvm: Fix address space mixup

2012-11-22 Thread Christian Borntraeger
I was chasing down a bug of random validity intercepts on s390. (guest prefix page not mapped in the host virtual aspace). Turns out that the problem was a wrong address space control element. The cause was quite complex: During paging activity a DAT protection during SIE caused a program

Re: [PATCH 0/3] KVM: x86: improve reexecute_instruction

2012-11-22 Thread Marcelo Tosatti
On Tue, Nov 20, 2012 at 07:57:48AM +0800, Xiao Guangrong wrote: The current reexecute_instruction can not well detect the failed instruction emulation. It allows guest to retry all the instructions except it accesses on error pfn. For example, these cases can not be detected: - for tdp used

Re: [PATCH] vfio powerpc: enabled and supported on powernv platform

2012-11-22 Thread Alexey Kardashevskiy
On 22/11/12 22:56, Sethi Varun-B16395 wrote: -Original Message- From: linux-kernel-ow...@vger.kernel.org [mailto:linux-kernel- ow...@vger.kernel.org] On Behalf Of Alex Williamson Sent: Tuesday, November 20, 2012 11:50 PM To: Alexey Kardashevskiy Cc: Benjamin Herrenschmidt; Paul

The smp_affinity cannot work correctly on guest os when PCI passthrough device using msi/msi-x with KVM

2012-11-22 Thread yi li
Hi Guys, there have a issue about smp_affinity cannot work correctly on guest os when PCI passthrough device using msi/msi-x with KVM. My reason: pcpu will occur a lot of ipi interrupt to find the vcpu to handle the irq. so the guest os will VM_EXIT frequelty. right? if smp_affinity can work

[PATCH V3 0/2] IA32_TSC_ADJUST for KVM

2012-11-22 Thread Will Auld
Marcelo, I have addressed your comments for this patch set, the following patch for QEMU-KVM and for adding a test case for tsc_adjust also to follow today. Thanks, Will Will Auld (2): Add code to track call origin for msr assignment. Enabling IA32_TSC_ADJUST for KVM guest VM support

Re: [PATCHv4] virtio-spec: virtio network device RFS support

2012-11-22 Thread Jason Wang
On 11/22/2012 10:46 PM, Michael S. Tsirkin wrote: Add RFS support to virtio network device. Add a new feature flag VIRTIO_NET_F_RFS for this feature, a new configuration field max_virtqueue_pairs to detect supported number of virtqueues as well as a new command VIRTIO_NET_CTRL_RFS to program

RE: [PATCH v2 5/6] x86: Enable ack interrupt on vmexit

2012-11-22 Thread Zhang, Yang Z
Gleb Natapov wrote on 2012-11-22: On Wed, Nov 21, 2012 at 04:09:38PM +0800, Yang Zhang wrote: Ack interrupt on vmexit is required by Posted Interrupt. With it, when external interrupt caused vmexit, the cpu will acknowledge the interrupt controller and save the interrupt's vector in vmcs.

[PATCH 2/2] Enabling IA32_TSC_ADJUST for KVM guest VM support

2012-11-22 Thread Will Auld
CPUID.7.0.EBX[1]=1 indicates IA32_TSC_ADJUST MSR 0x3b is supported Basic design is to emulate the MSR by allowing reads and writes to a guest vcpu specific location to store the value of the emulated MSR while adding the value to the vmcs tsc_offset. In this way the IA32_TSC_ADJUST value will be

Re: qemu-kvm-1.2.0: double free or corruption in VNC code

2012-11-22 Thread Stefan Hajnoczi
On Wed, Nov 21, 2012 at 07:43:16AM +0100, Nikola Ciprich wrote: Hello Stefan, thanks! here it goes.. *** glibc detected *** /usr/bin/qemu-kvm: double free or corruption (!prev): 0x7fc634008cd0 *** === Backtrace: = /lib64/libc.so.6(+0x75916)[0x7fc9026f4916]

Re: Performance issue

2012-11-22 Thread Stefan Hajnoczi
On Thu, Nov 22, 2012 at 09:17:34PM +0200, George-Cristian Bîrzan wrote: I'm trying to understand a performance problem (50% degradation in the VM) that I'm experiencing some systems with qemu-kvm. Running Fedora with 3.5.3-1.fc17.x86_64 or 3.6.6-1.fc17.x86_64, qemu 1.0.1 or 1.2.1 on AMD

Re: KVM Disk i/o or VM activities causes soft lockup?

2012-11-22 Thread Stefan Hajnoczi
On Wed, Nov 21, 2012 at 03:36:50PM -0800, Vincent Li wrote: We have users running on redhat based distro (Kernel 2.6.32-131.21.1.el6.x86_64 ) with kvm, when customer made cron job script to copy large files between kvm guest or some other user space program leads to disk i/o or VM activities,

[PATCH 1/5] KVM: PPC: Book3S HV: Handle guest-caused machine checks on POWER7 without panicking

2012-11-22 Thread Paul Mackerras
Currently, if a machine check interrupt happens while we are in the guest, we exit the guest and call the host's machine check handler, which tends to cause the host to panic. Some machine checks can be triggered by the guest; for example, if the guest creates two entries in the SLB that map the

[PATCH 2/5] KVM: PPC: Book3S HV: Reset reverse-map chains when resetting the HPT

2012-11-22 Thread Paul Mackerras
With HV-style KVM, we maintain reverse-mapping lists that enable us to find all the HPT (hashed page table) entries that reference each guest physical page, with the heads of the lists in the memslot-arch.rmap arrays. When we reset the HPT (i.e. when we reboot the VM), we clear out all the HPT

[PATCH 4/5] KVM: PPC: Book3S HV: Don't give the guest RW access to RO pages

2012-11-22 Thread Paul Mackerras
Currently, if the guest does an H_PROTECT hcall requesting that the permissions on a HPT entry be changed to allow writing, we make the requested change even if the page is marked read-only in the host Linux page tables. This is a problem since it would for instance allow a guest to modify a page