Re: [User Question] Repeated severe performance problems on guest

2013-04-18 Thread Martin Wawro
On 04/19/2013 07:59 AM, Stefan Hajnoczi wrote: Hi Stefan, > BTW does the host CPU support Intel Extended Page Tables or AMD Nested > Page Tables? grep 'npt\|ept' /proc/cpuinfo > > (I think the kvm_stat is saying EPT/NPT are not in use) Host CPU has EPT. > That is virt-manager.py, exactly doing

Re: [User Question] Repeated severe performance problems on guest

2013-04-18 Thread Stefan Hajnoczi
On Thu, Apr 18, 2013 at 03:27:45PM +0200, Martin Wawro wrote: > On 04/18/2013 03:14 PM, Stefan Hajnoczi wrote: > > No answer but some more questions. > > > > Regarding the kvm_stat output, the exits are caused by 68,000 > > pagefaults/second (pf_fixed). Perhaps someone can explain what this > > me

[PATCH 2/2] KVM: PPC: Book3S HV: Report VPA and DTL modifications in dirty map

2013-04-18 Thread Paul Mackerras
At present, the KVM_GET_DIRTY_LOG ioctl doesn't report modifications done by the host to the virtual processor areas (VPAs) and dispatch trace logs (DTLs) registered by the guest. This is because those modifications are done either in real mode or in the host kernel context, and in neither case do

[PATCH 1/2] KVM: PPC: Book3S HV: Make HPT reading code notice R/C bit changes

2013-04-18 Thread Paul Mackerras
At present, the code that determines whether a HPT entry has changed, and thus needs to be sent to userspace when it is copying the HPT, doesn't consider a hardware update to the reference and change bits (R and C) in the HPT entries to constitute a change that needs to be sent to userspace. This

[PATCH 0/2] KVM: PPC: Migration bugfixes for HV KVM

2013-04-18 Thread Paul Mackerras
This series of two patches fixes a couple of bugs in live migration under HV-style KVM on PPC. They only touch PPC/HV code and add no new APIs. The patches are against Alex Graf's kvm-ppc-next branch. I would like them to go in for 3.10. Paul. arch/powerpc/include/asm/kvm_book3s.h|3 +

[PATCH] KVM/PPC: emulate ehpriv

2013-04-18 Thread Tiejun Chen
We can provide this emulation to simplify more extension later. Signed-off-by: Tiejun Chen --- arch/powerpc/include/asm/disassemble.h |4 arch/powerpc/kvm/e500_emulate.c| 17 + 2 files changed, 21 insertions(+) diff --git a/arch/powerpc/include/asm/disassemble

Re: [PATCH v7 3/3] tcm_vhost: Add hotplug/hotunplug support

2013-04-18 Thread Asias He
On Thu, Apr 18, 2013 at 11:21:54AM +0300, Michael S. Tsirkin wrote: > On Thu, Apr 18, 2013 at 04:59:08PM +0800, Asias He wrote: > > On Thu, Apr 18, 2013 at 10:34:29AM +0300, Michael S. Tsirkin wrote: > > > On Thu, Apr 18, 2013 at 09:05:54AM +0800, Asias He wrote: > > > > In commit 365a7150094 ([SCS

Re: [PATCH 15/17] KVM: PPC: Support irq routing and irqfd for in-kernel MPIC

2013-04-18 Thread Scott Wood
On 04/18/2013 08:09:23 PM, Alexander Graf wrote: On 19.04.2013, at 02:50, Scott Wood wrote: > On 04/18/2013 07:15:46 PM, Alexander Graf wrote: >> On 18.04.2013, at 23:39, Scott Wood wrote: >> > On 04/18/2013 09:11:55 AM, Alexander Graf wrote: >> >> +static inline int irqchip_in_kernel(struct kv

Re: [PATCH 15/17] KVM: PPC: Support irq routing and irqfd for in-kernel MPIC

2013-04-18 Thread Alexander Graf
On 19.04.2013, at 02:50, Scott Wood wrote: > On 04/18/2013 07:15:46 PM, Alexander Graf wrote: >> On 18.04.2013, at 23:39, Scott Wood wrote: >> > On 04/18/2013 09:11:55 AM, Alexander Graf wrote: >> >> +static inline int irqchip_in_kernel(struct kvm *kvm) >> >> +{ >> >> + int ret = 0; >> >> + >> >>

Re: KVM VM(windows xp) reseted when running geekbench for about 2 days

2013-04-18 Thread Zhanghaoyu (A)
>> On Thu, Apr 18, 2013 at 12:00:49PM +, Zhanghaoyu (A) wrote: >>> I start 10 VMs(windows xp), then running geekbench tool on them, >>> about 2 days, one of them was reset, I found the reset operation is >>> done by int kvm_cpu_exec(CPUArchState *env) { >>>... >>> switch (run->exit_

Re: [PATCH 15/17] KVM: PPC: Support irq routing and irqfd for in-kernel MPIC

2013-04-18 Thread Scott Wood
On 04/18/2013 07:15:46 PM, Alexander Graf wrote: On 18.04.2013, at 23:39, Scott Wood wrote: > On 04/18/2013 09:11:55 AM, Alexander Graf wrote: >> +static inline int irqchip_in_kernel(struct kvm *kvm) >> +{ >> + int ret = 0; >> + >> +#ifdef CONFIG_KVM_MPIC >> + ret = ret || (kvm->arch.

Re: [PATCH 15/17] KVM: PPC: Support irq routing and irqfd for in-kernel MPIC

2013-04-18 Thread Alexander Graf
On 18.04.2013, at 23:39, Scott Wood wrote: > On 04/18/2013 09:11:55 AM, Alexander Graf wrote: >> Now that all the irq routing and irqfd pieces are generic, we can expose >> real irqchip support to all of KVM's internal helpers. >> This allows us to use irqfd with the in-kernel MPIC. >> Signed-off

Re: [PATCH -v2] kvm: Emulate MOVBE

2013-04-18 Thread Borislav Petkov
On Wed, Apr 17, 2013 at 04:02:00PM +0200, Borislav Petkov wrote: > Right, so basically we want to handle features which were explicitly > enabled only for this guest as private, only relevant to this > particular guest run. Ok, here are two more ideas Joerg and I had today during lunch: * reuse

2013 Linux Plumbers ACPI/PM, PCI Microconference proposal call for participaton

2013-04-18 Thread Myron Stowe
All: We would like to hold a combined ACPI/PM, PCI focused microconference as part of this year's Linux Plumbers conference but first we need to show that there is enough interest and material that needs covered. There is a lot of activity in these subsystems so please respond by submitting prese

Re: [PATCH 15/17] KVM: PPC: Support irq routing and irqfd for in-kernel MPIC

2013-04-18 Thread Scott Wood
On 04/18/2013 09:11:55 AM, Alexander Graf wrote: Now that all the irq routing and irqfd pieces are generic, we can expose real irqchip support to all of KVM's internal helpers. This allows us to use irqfd with the in-kernel MPIC. Signed-off-by: Alexander Graf --- arch/powerpc/include/asm/kv

Re: [PATCH v2 0/7] KVM: MMU: fast zap all shadow pages

2013-04-18 Thread Marcelo Tosatti
On Thu, Apr 18, 2013 at 07:36:03PM +0300, Gleb Natapov wrote: > On Thu, Apr 18, 2013 at 11:01:18AM -0300, Marcelo Tosatti wrote: > > On Thu, Apr 18, 2013 at 12:42:39PM +0300, Gleb Natapov wrote: > > > > > that, but if not then less code is better. > > > > > > > > The number of sp->role.invalid=1 p

[PATCHv3] KVM: x86: Fix memory leak in vmx.c

2013-04-18 Thread Andrew Honig
If userspace creates and destroys multiple VMs within the same process we leak 20k of memory in the userspace process context per VM. This patch frees the memory in kvm_arch_destroy_vm. If the process exits without closing the VM file descriptor or the file descriptor has been shared with anothe

Re: [PATCH v2 0/7] KVM: MMU: fast zap all shadow pages

2013-04-18 Thread Gleb Natapov
On Thu, Apr 18, 2013 at 11:01:18AM -0300, Marcelo Tosatti wrote: > On Thu, Apr 18, 2013 at 12:42:39PM +0300, Gleb Natapov wrote: > > > > that, but if not then less code is better. > > > > > > The number of sp->role.invalid=1 pages is small (only shadow roots). It > > > can grow but is bounded to a

Re: [PATCH 6/7] ARM: KVM: switch to a dual-step HYP init code

2013-04-18 Thread Marc Zyngier
On 18/04/13 16:54, Russell King - ARM Linux wrote: > On Fri, Apr 05, 2013 at 10:08:04AM +0100, Marc Zyngier wrote: >> On 04/04/13 23:10, Geoff Levand wrote: >>> Hi, >>> >>> On Tue, 2013-04-02 at 14:25 +0100, Marc Zyngier wrote: + @ Jump to the trampoline page + ldr r2, =#PAGE_MASK >

Re: [PATCH 6/7] ARM: KVM: switch to a dual-step HYP init code

2013-04-18 Thread Russell King - ARM Linux
On Fri, Apr 05, 2013 at 10:08:04AM +0100, Marc Zyngier wrote: > On 04/04/13 23:10, Geoff Levand wrote: > > Hi, > > > > On Tue, 2013-04-02 at 14:25 +0100, Marc Zyngier wrote: > >> + @ Jump to the trampoline page > >> + ldr r2, =#PAGE_MASK > >> + adr r3, target > >> + bic r3, r3, r2

Re: [PATCH v3 12/15] KVM: MMU: fast invalid all shadow pages

2013-04-18 Thread Xiao Guangrong
On 04/18/2013 09:29 PM, Marcelo Tosatti wrote: > On Thu, Apr 18, 2013 at 10:03:06AM -0300, Marcelo Tosatti wrote: >> On Thu, Apr 18, 2013 at 12:00:16PM +0800, Xiao Guangrong wrote: What is the justification for this? >>> >>> We want the rmap of being deleted memslot is removed-only that

Re: [PATCH] target-i386: upgrade family number of qemu64 CPU model to 15

2013-04-18 Thread Eduardo Habkost
On Thu, Apr 18, 2013 at 02:47:21PM +, Ren, Yongjie wrote: > > -Original Message- > > From: Gleb Natapov [mailto:g...@redhat.com] > > Sent: Thursday, April 18, 2013 7:08 PM > > To: Ren, Yongjie > > Cc: Marcelo Tosatti; kvm@vger.kernel.org; qemu-de...@nongnu.org; > > ehabk...@redhat.com >

Re: [PATCH 17/17] KVM: PPC: MPIC: Restrict to e500 platforms

2013-04-18 Thread Alexander Graf
On 18.04.2013, at 16:29, Scott Wood wrote: > On 04/18/2013 09:11:57 AM, Alexander Graf wrote: >> The code as is doesn't make any sense on non-e500 platforms. > > Why? What actually breaks? It broke even compiling, because book3s doesn't provide anything for EPR for example. I fixed up the iss

RE: [PATCH] target-i386: upgrade family number of qemu64 CPU model to 15

2013-04-18 Thread Ren, Yongjie
> -Original Message- > From: Gleb Natapov [mailto:g...@redhat.com] > Sent: Thursday, April 18, 2013 7:08 PM > To: Ren, Yongjie > Cc: Marcelo Tosatti; kvm@vger.kernel.org; qemu-de...@nongnu.org; > ehabk...@redhat.com > Subject: Re: [PATCH] target-i386: upgrade family number of qemu64 CPU > m

Re: [PATCH 17/17] KVM: PPC: MPIC: Restrict to e500 platforms

2013-04-18 Thread Scott Wood
On 04/18/2013 09:11:57 AM, Alexander Graf wrote: The code as is doesn't make any sense on non-e500 platforms. Why? What actually breaks? You never answered my earlier question about whether 74xx is supported. MPC86xx is 74xx-derived and has an FSL MPIC. Plus, as pointed out earlier, this

Reply.

2013-04-18 Thread Cham Tao Soon
I need your assistance to move funds from Singapore. I will forward details upon your request. Cham Tao Soon This message was sent using IMP, the Internet Messaging Program. -- To unsubscribe from this list: send the line "u

[PATCH 05/17] KVM: Move irq routing to generic code

2013-04-18 Thread Alexander Graf
The IRQ routing set ioctl lives in the hacky device assignment code inside of KVM today. This is definitely the wrong place for it. Move it to the much more natural kvm_main.c. Signed-off-by: Alexander Graf --- virt/kvm/assigned-dev.c | 30 -- virt/kvm/kvm_main.c

[PATCH 01/17] KVM: Add KVM_IRQCHIP_NUM_PINS in addition to KVM_IOAPIC_NUM_PINS

2013-04-18 Thread Alexander Graf
The concept of routing interrupt lines to an irqchip is nothing that is IOAPIC specific. Every irqchip has a maximum number of pins that can be linked to irq lines. So let's add a new define that allows us to reuse generic code for non-IOAPIC platforms. Signed-off-by: Alexander Graf --- arch/x8

[PATCH 16/17] KVM: PPC: MPIC: Add support for KVM_IRQ_LINE

2013-04-18 Thread Alexander Graf
Now that all pieces are in place for reusing generic irq infrastructure, we can copy x86's implementation of KVM_IRQ_LINE irq injection and simply reuse it for PPC, as it will work there just as well. Signed-off-by: Alexander Graf --- arch/powerpc/include/uapi/asm/kvm.h |1 + arch/powerpc/kv

[PATCH 02/17] KVM: Introduce CONFIG_HAVE_KVM_IRQ_ROUTING

2013-04-18 Thread Alexander Graf
Quite a bit of code in KVM has been conditionalized on availability of IOAPIC emulation. However, most of it is generically applicable to platforms that don't have an IOPIC, but a different type of irq chip. Make code that only relies on IRQ routing, not an APIC itself, on CONFIG_HAVE_KVM_IRQ_ROUT

[PATCH 09/17] kvm: add device control API

2013-04-18 Thread Alexander Graf
From: Scott Wood Currently, devices that are emulated inside KVM are configured in a hardcoded manner based on an assumption that any given architecture only has one way to do it. If there's any need to access device state, it is done through inflexible one-purpose-only IOCTLs (e.g. KVM_GET/SET_

[PATCH 08/17] KVM: Move irqfd resample cap handling to generic code

2013-04-18 Thread Alexander Graf
Now that we have most irqfd code completely platform agnostic, let's move irqfd's resample capability return to generic code as well. Signed-off-by: Alexander Graf --- arch/x86/kvm/x86.c |1 - virt/kvm/kvm_main.c |3 +++ 2 files changed, 3 insertions(+), 1 deletions(-) diff --git a/arc

[PATCH 07/17] KVM: Move irq routing setup to irqchip.c

2013-04-18 Thread Alexander Graf
Setting up IRQ routes is nothing IOAPIC specific. Extract everything that really is generic code into irqchip.c and only leave the ioapic specific bits to irq_comm.c. Signed-off-by: Alexander Graf --- include/linux/kvm_host.h |3 ++ virt/kvm/irq_comm.c | 76 ++-

[PATCH 06/17] KVM: Extract generic irqchip logic into irqchip.c

2013-04-18 Thread Alexander Graf
The current irq_comm.c file contains pieces of code that are generic across different irqchip implementations, as well as code that is fully IOAPIC specific. Split the generic bits out into irqchip.c. Signed-off-by: Alexander Graf --- arch/x86/kvm/Makefile |2 +- include/trace/events/k

[PATCH 00/17] KVM: PPC: In-kernel MPIC support with irqfd

2013-04-18 Thread Alexander Graf
Hi, This patch set contains a fully working implementation of the in-kernel MPIC from Scott with a few fixups and a new version of my irqfd generalization patch set. Major changes to my last irqfd set are: - depend on CONFIG_ defines rather than __KVM defines - fix compile issues - fix the

[PATCH 10/17] kvm/ppc/mpic: import hw/openpic.c from QEMU

2013-04-18 Thread Alexander Graf
From: Scott Wood This is QEMU's hw/openpic.c from commit abd8d4a4d6dfea7ddea72f095f993e1de941614e ("Update version for 1.4.0-rc0"), run through Lindent with no other changes to ease merging future changes between Linux and QEMU. Remaining style issues (including those introduced by Lindent) will

[PATCH 17/17] KVM: PPC: MPIC: Restrict to e500 platforms

2013-04-18 Thread Alexander Graf
The code as is doesn't make any sense on non-e500 platforms. Restrict it there, so that people don't get wrong ideas on what would actually work. This patch should get reverted as soon as it's possible to either run e500 guests on non-e500 hosts or the MPIC emulation gains support for non-e500 mod

[PATCH 12/17] kvm/ppc/mpic: adapt to kernel style and environment

2013-04-18 Thread Alexander Graf
From: Scott Wood Remove braces that Linux style doesn't permit, remove space after '*' that Lindent added, keep error/debug strings contiguous, etc. Substitute type names, debug prints, etc. Signed-off-by: Scott Wood Signed-off-by: Alexander Graf --- arch/powerpc/kvm/mpic.c | 445 ++

[PATCH 15/17] KVM: PPC: Support irq routing and irqfd for in-kernel MPIC

2013-04-18 Thread Alexander Graf
Now that all the irq routing and irqfd pieces are generic, we can expose real irqchip support to all of KVM's internal helpers. This allows us to use irqfd with the in-kernel MPIC. Signed-off-by: Alexander Graf --- arch/powerpc/include/asm/kvm_host.h |7 ++ arch/powerpc/include/uapi/asm/kvm

[PATCH 11/17] kvm/ppc/mpic: remove some obviously unneeded code

2013-04-18 Thread Alexander Graf
From: Scott Wood Remove some parts of the code that are obviously QEMU or Raven specific before fixing style issues, to reduce the style issues that need to be fixed. Signed-off-by: Scott Wood Signed-off-by: Alexander Graf --- arch/powerpc/kvm/mpic.c | 344 ---

[PATCH 13/17] kvm/ppc/mpic: in-kernel MPIC emulation

2013-04-18 Thread Alexander Graf
From: Scott Wood Hook the MPIC code up to the KVM interfaces, add locking, etc. Signed-off-by: Scott Wood [agraf: add stub function for kvmppc_mpic_set_epr, non-booke, 64bit] Signed-off-by: Alexander Graf --- Documentation/virtual/kvm/devices/mpic.txt | 37 ++ arch/powerpc/include/asm/kvm_h

[PATCH 14/17] kvm/ppc/mpic: add KVM_CAP_IRQ_MPIC

2013-04-18 Thread Alexander Graf
From: Scott Wood Enabling this capability connects the vcpu to the designated in-kernel MPIC. Using explicit connections between vcpus and irqchips allows for flexibility, but the main benefit at the moment is that it simplifies the code -- KVM doesn't need vm-global state to remember which MPIC

[PATCH 03/17] KVM: Drop __KVM_HAVE_IOAPIC condition on irq routing

2013-04-18 Thread Alexander Graf
We have a capability enquire system that allows user space to ask kvm whether a feature is available. The point behind this system is that we can have different kernel configurations with different capabilities and user space can adjust accordingly. Because features can always be non existent, we

[PATCH 04/17] KVM: Remove kvm_get_intr_delivery_bitmask

2013-04-18 Thread Alexander Graf
The prototype has been stale for a while, I can't spot any real function define behind it. Let's just remove it. Signed-off-by: Alexander Graf --- include/linux/kvm_host.h |5 - 1 files changed, 0 insertions(+), 5 deletions(-) diff --git a/include/linux/kvm_host.h b/include/linux/kvm_ho

Re: [PATCH v2 0/7] KVM: MMU: fast zap all shadow pages

2013-04-18 Thread Marcelo Tosatti
On Thu, Apr 18, 2013 at 12:42:39PM +0300, Gleb Natapov wrote: > > > that, but if not then less code is better. > > > > The number of sp->role.invalid=1 pages is small (only shadow roots). It > > can grow but is bounded to a handful. No improvement visible there. > > > > The number of shadow pages

Re: [PATCH v3 12/15] KVM: MMU: fast invalid all shadow pages

2013-04-18 Thread Marcelo Tosatti
On Thu, Apr 18, 2013 at 12:00:16PM +0800, Xiao Guangrong wrote: > > > > What is the justification for this? > > We want the rmap of being deleted memslot is removed-only that is > needed for unmapping rmap out of mmu-lock. > > == > 1) do not corrupt the rmap > 2) keep pte-list-descs availab

Re: [PATCH] x86: Add a Kconfig shortcut for a kvm-bootable kernel

2013-04-18 Thread Marcelo Tosatti
On Thu, Apr 18, 2013 at 11:46:29AM +0200, Borislav Petkov wrote: > On Wed, Apr 17, 2013 at 08:25:07PM -0300, Marcelo Tosatti wrote: > > On Tue, Apr 16, 2013 at 06:18:52PM +0200, Borislav Petkov wrote: > > > On Sun, Apr 14, 2013 at 01:03:20PM +0200, Borislav Petkov wrote: > > > > On Sun, Apr 14, 201

Re: [PATCH v3 12/15] KVM: MMU: fast invalid all shadow pages

2013-04-18 Thread Marcelo Tosatti
On Thu, Apr 18, 2013 at 10:03:06AM -0300, Marcelo Tosatti wrote: > On Thu, Apr 18, 2013 at 12:00:16PM +0800, Xiao Guangrong wrote: > > > > > > What is the justification for this? > > > > We want the rmap of being deleted memslot is removed-only that is > > needed for unmapping rmap out of mmu-lo

Re: KVM VM(windows xp) reseted when running geekbench for about 2 days

2013-04-18 Thread Yan Vugenfirer
On Apr 18, 2013, at 3:55 PM, Gleb Natapov wrote: > On Thu, Apr 18, 2013 at 12:00:49PM +, Zhanghaoyu (A) wrote: >> I start 10 VMs(windows xp), then running geekbench tool on them, about 2 >> days, one of them was reset, >> I found the reset operation is done by >> int kvm_cpu_exec(CPUArchStat

Re: [User Question] Repeated severe performance problems on guest

2013-04-18 Thread Martin Wawro
On 04/18/2013 03:14 PM, Stefan Hajnoczi wrote: Dear Stefan, > No answer but some more questions. > > Regarding the kvm_stat output, the exits are caused by 68,000 > pagefaults/second (pf_fixed). Perhaps someone can explain what this > means? > > The host has 8 cores, the guest has 7. Host pidst

Re: [User Question] Repeated severe performance problems on guest

2013-04-18 Thread Stefan Hajnoczi
On Thu, Apr 18, 2013 at 12:00 PM, Martin Wawro wrote: > On 04/18/2013 09:25 AM, Stefan Hajnoczi wrote: >> I see. That's a good reason to carefully monitor the host for things >> that could interfere with guest performance. >> >> Stefan > Seems that today is a bad day for our server. We had to giv

Re: KVM VM(windows xp) reseted when running geekbench for about 2 days

2013-04-18 Thread Gleb Natapov
On Thu, Apr 18, 2013 at 12:00:49PM +, Zhanghaoyu (A) wrote: > I start 10 VMs(windows xp), then running geekbench tool on them, about 2 > days, one of them was reset, > I found the reset operation is done by > int kvm_cpu_exec(CPUArchState *env) > { > ... >switch (run->exit_reason)

Re: [PATCH 0/11] KVM: nVMX: shadow VMCS support, v5

2013-04-18 Thread Orit Wasserman
On 04/18/2013 02:34 PM, Abel Gordon wrote: > This series of patches implements shadow-vmcs capability for nested VMX. > > Shadow-vmcs - background and overview: > > In Intel VMX, vmread and vmwrite privileged instructions are used by the > hypervisor to read and modify the guest and host specif

Re: [PATCH 0/11] KVM: nVMX: shadow VMCS support, v5

2013-04-18 Thread Gleb Natapov
On Thu, Apr 18, 2013 at 02:34:25PM +0300, Abel Gordon wrote: > This series of patches implements shadow-vmcs capability for nested VMX. > > Shadow-vmcs - background and overview: > > In Intel VMX, vmread and vmwrite privileged instructions are used by the > hypervisor to read and modify the gue

Re: [PATCH v3 08/15] KVM: MMU: allow unmap invalid rmap out of mmu-lock

2013-04-18 Thread Xiao Guangrong
On 04/18/2013 07:38 PM, Gleb Natapov wrote: > On Thu, Apr 18, 2013 at 07:22:23PM +0800, Xiao Guangrong wrote: >> On 04/18/2013 07:00 PM, Gleb Natapov wrote: >>> On Tue, Apr 16, 2013 at 02:32:46PM +0800, Xiao Guangrong wrote: pte_list_clear_concurrently allows us to reset pte-desc entry ou

[PATCH 11/11] KVM: nVMX: Enable and disable shadow vmcs functionality

2013-04-18 Thread Abel Gordon
Once L1 loads VMCS12 we enable shadow-vmcs capability and copy all the VMCS12 shadowed fields to the shadow vmcs. When we release the VMCS12, we also disable shadow-vmcs capability. Signed-off-by: Abel Gordon --- arch/x86/kvm/vmx.c | 11 +++ 1 file changed, 11 insertions(+) --- .befo

[PATCH 10/11] KVM: nVMX: Synchronize VMCS12 content with the shadow vmcs

2013-04-18 Thread Abel Gordon
Synchronize between the VMCS12 software controlled structure and the processor-specific shadow vmcs Signed-off-by: Abel Gordon --- arch/x86/kvm/vmx.c | 32 1 file changed, 32 insertions(+) --- .before/arch/x86/kvm/vmx.c 2013-04-18 13:31:35.0 +0300 +++

[PATCH 09/11] KVM: nVMX: Copy VMCS12 to processor-specific shadow vmcs

2013-04-18 Thread Abel Gordon
Introduce a function used to copy fields from the software controlled VMCS12 to the processor-specific shadow vmcs Signed-off-by: Abel Gordon --- arch/x86/kvm/vmx.c | 45 +++ 1 file changed, 45 insertions(+) --- .before/arch/x86/kvm/vmx.c 2013-04-18 13

Re: [PATCH v3 08/15] KVM: MMU: allow unmap invalid rmap out of mmu-lock

2013-04-18 Thread Gleb Natapov
On Thu, Apr 18, 2013 at 07:22:23PM +0800, Xiao Guangrong wrote: > On 04/18/2013 07:00 PM, Gleb Natapov wrote: > > On Tue, Apr 16, 2013 at 02:32:46PM +0800, Xiao Guangrong wrote: > >> pte_list_clear_concurrently allows us to reset pte-desc entry > >> out of mmu-lock. We can reset spte out of mmu-loc

[PATCH 08/11] KVM: nVMX: Copy processor-specific shadow-vmcs to VMCS12

2013-04-18 Thread Abel Gordon
Introduce a function used to copy fields from the processor-specific shadow vmcs to the software controlled VMCS12 Signed-off-by: Abel Gordon --- arch/x86/kvm/vmx.c | 35 +++ 1 file changed, 35 insertions(+) --- .before/arch/x86/kvm/vmx.c 2013-04-18 13:31:35.0

[PATCH 07/11] KVM: nVMX: Release shadow vmcs

2013-04-18 Thread Abel Gordon
Unmap vmcs12 and release the corresponding shadow vmcs Signed-off-by: Abel Gordon --- arch/x86/kvm/vmx.c | 20 1 file changed, 12 insertions(+), 8 deletions(-) --- .before/arch/x86/kvm/vmx.c 2013-04-18 13:31:35.0 +0300 +++ .after/arch/x86/kvm/vmx.c 2013-04-18

[PATCH 06/11] KVM: nVMX: Allocate shadow vmcs

2013-04-18 Thread Abel Gordon
Allocate a shadow vmcs used by the processor to shadow part of the fields stored in the software defined VMCS12 (let L1 access fields without causing exits). Note we keep a shadow vmcs only for the current vmcs12. Once a vmcs12 becomes non-current, its shadow vmcs is released. Signed-off-by: Abe

[PATCH 05/11] KVM: nVMX: Fix VMXON emulation

2013-04-18 Thread Abel Gordon
handle_vmon doesn't check if L1 is already in root mode (VMXON was previously called). This patch adds this missing check and calls nested_vmx_failValid if VMX is already ON. We need this check because L0 will allocate the shadow vmcs when L1 executes VMXON and we want to avoid host leaks (due to s

[PATCH 04/11] KVM: nVMX: Refactor handle_vmwrite

2013-04-18 Thread Abel Gordon
Refactor existent code so we re-use vmcs12_write_any to copy fields from the shadow vmcs specified by the link pointer (used by the processor, implementation-specific) to the VMCS12 software format used by L0 to hold the fields in L1 memory address space. Signed-off-by: Abel Gordon --- arch/x86/

[PATCH 03/11] KVM: nVMX: Introduce vmread and vmwrite bitmaps

2013-04-18 Thread Abel Gordon
Prepare vmread and vmwrite bitmaps according to a pre-specified list of fields. These lists are intended to specifiy most frequent accessed fields so we can minimize the number of fields that are copied from/to the software controlled VMCS12 format to/from to processor-specific shadow vmcs. The lis

[PATCH 02/11] KVM: nVMX: Detect shadow-vmcs capability

2013-04-18 Thread Abel Gordon
Add logic required to detect if shadow-vmcs is supported by the processor. Introduce a new kernel module parameter to specify if L0 should use shadow vmcs (or not) to run L1. Signed-off-by: Abel Gordon --- arch/x86/kvm/vmx.c | 25 - 1 file changed, 24 insertions(+), 1 d

[PATCH 01/11] KVM: nVMX: Shadow-vmcs control fields/bits

2013-04-18 Thread Abel Gordon
Add definitions for all the vmcs control fields/bits required to enable vmcs-shadowing Signed-off-by: Abel Gordon --- arch/x86/include/asm/vmx.h|3 +++ arch/x86/include/uapi/asm/msr-index.h |2 ++ 2 files changed, 5 insertions(+) --- .before/arch/x86/include/asm/vmx.h 2013-

[PATCH 0/11] KVM: nVMX: shadow VMCS support, v5

2013-04-18 Thread Abel Gordon
This series of patches implements shadow-vmcs capability for nested VMX. Shadow-vmcs - background and overview: In Intel VMX, vmread and vmwrite privileged instructions are used by the hypervisor to read and modify the guest and host specifications (VMCS). In a nested virtualization environmen

Re: [PATCH v3 08/15] KVM: MMU: allow unmap invalid rmap out of mmu-lock

2013-04-18 Thread Xiao Guangrong
On 04/18/2013 07:00 PM, Gleb Natapov wrote: > On Tue, Apr 16, 2013 at 02:32:46PM +0800, Xiao Guangrong wrote: >> pte_list_clear_concurrently allows us to reset pte-desc entry >> out of mmu-lock. We can reset spte out of mmu-lock if we can protect the >> lifecycle of sp, we use this way to achieve t

reply: [Qemu-devel] reply: reply: qemu crashed when starting vm(kvm) with vnc connect

2013-04-18 Thread Zhanghaoyu (A)
> > On Mon, Apr 08, 2013 at 12:27:06PM +, Zhanghaoyu (A) wrote: > >> On Sun, Apr 07, 2013 at 04:58:07AM +, Zhanghaoyu (A) wrote: > >> I start a kvm VM with vnc(using the zrle protocol) connect, sometimes > >> qemu program crashed during starting period, received signal SIGABRT. > >

Re: [PATCH] target-i386: upgrade family number of qemu64 CPU model to 15

2013-04-18 Thread Gleb Natapov
On Thu, Apr 18, 2013 at 10:45:38AM +, Ren, Yongjie wrote: > qemu64 is the default CPU model for QEMU/KVM on x86-64, but its family number > definition is not accurate. The vendor of 'qemu64' is defined as 'AMD'. For > AMD > processors, AMD K8 (i.e. Family 15) firstly introduced SSE3 instruct

Re: [PATCH v3 08/15] KVM: MMU: allow unmap invalid rmap out of mmu-lock

2013-04-18 Thread Gleb Natapov
On Tue, Apr 16, 2013 at 02:32:46PM +0800, Xiao Guangrong wrote: > pte_list_clear_concurrently allows us to reset pte-desc entry > out of mmu-lock. We can reset spte out of mmu-lock if we can protect the > lifecycle of sp, we use this way to achieve the goal: > > unmap_memslot_rmap_nolock(): > for-

[PATCH] target-i386: upgrade family number of qemu64 CPU model to 15

2013-04-18 Thread Ren, Yongjie
qemu64 is the default CPU model for QEMU/KVM on x86-64, but its family number definition is not accurate. The vendor of 'qemu64' is defined as 'AMD'. For AMD processors, AMD K8 (i.e. Family 15) firstly introduced SSE3 instruction set. 'qemu64' already has 'CPUID_EXT_SSE3' in its ext_features, bu

Re: [PATCH 07/11] KVM: nVMX: Release shadow vmcs

2013-04-18 Thread Gleb Natapov
On Thu, Apr 18, 2013 at 01:16:34PM +0300, Abel Gordon wrote: > > > Gleb Natapov wrote on 18/04/2013 12:12:18 PM: > > > On Thu, Apr 18, 2013 at 11:37:59AM +0300, Abel Gordon wrote: > > > Unmap vmcs12 and release the corresponding shadow vmcs > > > > > > Signed-off-by: Abel Gordon > > > --- > >

Re: [PATCHv2] KVM: x86: Fix memory leak in vmx.c

2013-04-18 Thread Gleb Natapov
On Wed, Apr 17, 2013 at 10:54:32AM -0700, Andrew Honig wrote: > > If userspace creates and destroys multiple VMs within the same process > we leak 20k of memory in the userspace process context per VM. This > patch frees the memory in kvm_arch_destroy_vm. If the process exits > without closing t

Re: [PATCH] x86: Add a Kconfig shortcut for a kvm-bootable kernel

2013-04-18 Thread Borislav Petkov
On Thu, Apr 18, 2013 at 11:55:33AM +0200, Geert Uytterhoeven wrote: > On Thu, Apr 18, 2013 at 11:46 AM, Borislav Petkov wrote: > > ok, maybe I wasn't clear enough. My proposal was to actually add all (or > > maybe not *all* of them, but most) those selects above to the KVM_GUEST > > config option.

Re: [PATCH 07/11] KVM: nVMX: Release shadow vmcs

2013-04-18 Thread Abel Gordon
Gleb Natapov wrote on 18/04/2013 12:12:18 PM: > On Thu, Apr 18, 2013 at 11:37:59AM +0300, Abel Gordon wrote: > > Unmap vmcs12 and release the corresponding shadow vmcs > > > > Signed-off-by: Abel Gordon > > --- > > arch/x86/kvm/vmx.c | 20 > > 1 file changed, 12 inserti

Re: [User Question] Repeated severe performance problems on guest

2013-04-18 Thread Martin Wawro
On 04/18/2013 09:25 AM, Stefan Hajnoczi wrote: Hi Stefan, > I see. That's a good reason to carefully monitor the host for things > that could interfere with guest performance. > > Stefan Seems that today is a bad day for our server. We had to give him the boot (again). Also the results of the pi

Re: [PATCH] x86: Add a Kconfig shortcut for a kvm-bootable kernel

2013-04-18 Thread Geert Uytterhoeven
On Thu, Apr 18, 2013 at 11:46 AM, Borislav Petkov wrote: > ok, maybe I wasn't clear enough. My proposal was to actually add all (or > maybe not *all* of them, but most) those selects above to the KVM_GUEST > config option. Because, you very probably want to select all that stuff > above anyway if

Re: [PATCH] x86: Add a Kconfig shortcut for a kvm-bootable kernel

2013-04-18 Thread Borislav Petkov
On Wed, Apr 17, 2013 at 08:25:07PM -0300, Marcelo Tosatti wrote: > On Tue, Apr 16, 2013 at 06:18:52PM +0200, Borislav Petkov wrote: > > On Sun, Apr 14, 2013 at 01:03:20PM +0200, Borislav Petkov wrote: > > > On Sun, Apr 14, 2013 at 12:31:12PM +0300, Pekka Enberg wrote: > > > > I obviously support ha

Re: [PATCH v2 0/7] KVM: MMU: fast zap all shadow pages

2013-04-18 Thread Gleb Natapov
On Wed, Apr 17, 2013 at 05:39:04PM -0300, Marcelo Tosatti wrote: > On Fri, Mar 22, 2013 at 09:15:24PM +0200, Gleb Natapov wrote: > > On Fri, Mar 22, 2013 at 08:37:33PM +0800, Xiao Guangrong wrote: > > > On 03/22/2013 08:12 PM, Gleb Natapov wrote: > > > > On Fri, Mar 22, 2013 at 08:03:04PM +0800, Xi

Re: [Qemu-devel] reply: reply: qemu crashed when starting vm(kvm) with vnc connect

2013-04-18 Thread Gerd Hoffmann
On 04/11/13 11:29, Stefan Hajnoczi wrote: > On Mon, Apr 08, 2013 at 12:27:06PM +, Zhanghaoyu (A) wrote: >> On Sun, Apr 07, 2013 at 04:58:07AM +, Zhanghaoyu (A) wrote: >> I start a kvm VM with vnc(using the zrle protocol) connect, sometimes >> qemu program crashed during starting pe

Re: [PATCH v7 3/3] tcm_vhost: Add hotplug/hotunplug support

2013-04-18 Thread Michael S. Tsirkin
On Thu, Apr 18, 2013 at 04:59:08PM +0800, Asias He wrote: > On Thu, Apr 18, 2013 at 10:34:29AM +0300, Michael S. Tsirkin wrote: > > On Thu, Apr 18, 2013 at 09:05:54AM +0800, Asias He wrote: > > > In commit 365a7150094 ([SCSI] virtio-scsi: hotplug support for > > > virtio-scsi), hotplug support is a

Re: [PATCH 10/12] cpu: Pass CPUState to *cpu_synchronize_post*()

2013-04-18 Thread Gleb Natapov
On Tue, Apr 16, 2013 at 02:46:47AM +0200, Andreas Färber wrote: > From: Igor Mammedov > > ... so it could be called without requiring CPUArchState. > > Signed-off-by: Igor Mammedov > Reviewed-by: Eduardo Habkost > Signed-off-by: Andreas Färber Acked-by: Gleb Natapov > --- > cpus.c

Re: [PATCH 07/11] KVM: nVMX: Release shadow vmcs

2013-04-18 Thread Gleb Natapov
On Thu, Apr 18, 2013 at 11:37:59AM +0300, Abel Gordon wrote: > Unmap vmcs12 and release the corresponding shadow vmcs > > Signed-off-by: Abel Gordon > --- > arch/x86/kvm/vmx.c | 20 > 1 file changed, 12 insertions(+), 8 deletions(-) > > --- .before/arch/x86/kvm/vmx.c

Re: [PATCH v7 3/3] tcm_vhost: Add hotplug/hotunplug support

2013-04-18 Thread Asias He
On Thu, Apr 18, 2013 at 10:34:29AM +0300, Michael S. Tsirkin wrote: > On Thu, Apr 18, 2013 at 09:05:54AM +0800, Asias He wrote: > > In commit 365a7150094 ([SCSI] virtio-scsi: hotplug support for > > virtio-scsi), hotplug support is added to virtio-scsi. > > > > This patch adds hotplug and hotunplu

Re: [PATCHv2] KVM: x86: Fix memory leak in vmx.c

2013-04-18 Thread Gleb Natapov
On Thu, Apr 18, 2013 at 10:20:05AM +0200, Paolo Bonzini wrote: > Il 18/04/2013 01:03, Andrew Honig ha scritto: > > I don't have a significant objection to freeing the memory in > > kvm_arch_free_memslot, although I think it's a little harder to > > understand. I like the idea of being symmetric (m

Re: [PATCH v7 1/3] tcm_vhost: Introduce tcm_vhost_check_feature()

2013-04-18 Thread Michael S. Tsirkin
On Thu, Apr 18, 2013 at 04:25:21PM +0800, Asias He wrote: > On Thu, Apr 18, 2013 at 10:06:06AM +0300, Michael S. Tsirkin wrote: > > On Thu, Apr 18, 2013 at 09:05:52AM +0800, Asias He wrote: > > > This helper is useful to check if a feature is supported. > > > > > > Signed-off-by: Asias He > > > R

[PATCH 11/11] KVM: nVMX: Enable and disable shadow vmcs functionality

2013-04-18 Thread Abel Gordon
Once L1 loads VMCS12 we enable shadow-vmcs capability and copy all the VMCS12 shadowed fields to the shadow vmcs. When we release the VMCS12, we also disable shadow-vmcs capability. Signed-off-by: Abel Gordon --- arch/x86/kvm/vmx.c | 11 +++ 1 file changed, 11 insertions(+) --- .befo

[PATCH 10/11] KVM: nVMX: Synchronize VMCS12 content with the shadow vmcs

2013-04-18 Thread Abel Gordon
Synchronize between the VMCS12 software controlled structure and the processor-specific shadow vmcs Signed-off-by: Abel Gordon --- arch/x86/kvm/vmx.c | 32 1 file changed, 32 insertions(+) --- .before/arch/x86/kvm/vmx.c 2013-04-18 11:28:23.0 +0300 +++

[PATCH 09/11] KVM: nVMX: Copy VMCS12 to processor-specific shadow vmcs

2013-04-18 Thread Abel Gordon
Introduce a function used to copy fields from the software controlled VMCS12 to the processor-specific shadow vmcs Signed-off-by: Abel Gordon --- arch/x86/kvm/vmx.c | 45 +++ 1 file changed, 45 insertions(+) --- .before/arch/x86/kvm/vmx.c 2013-04-18 11

[PATCH 08/11] KVM: nVMX: Copy processor-specific shadow-vmcs to VMCS12

2013-04-18 Thread Abel Gordon
Introduce a function used to copy fields from the processor-specific shadow vmcs to the software controlled VMCS12 Signed-off-by: Abel Gordon --- arch/x86/kvm/vmx.c | 35 +++ 1 file changed, 35 insertions(+) --- .before/arch/x86/kvm/vmx.c 2013-04-18 11:28:23.0

[PATCH 07/11] KVM: nVMX: Release shadow vmcs

2013-04-18 Thread Abel Gordon
Unmap vmcs12 and release the corresponding shadow vmcs Signed-off-by: Abel Gordon --- arch/x86/kvm/vmx.c | 20 1 file changed, 12 insertions(+), 8 deletions(-) --- .before/arch/x86/kvm/vmx.c 2013-04-18 11:28:23.0 +0300 +++ .after/arch/x86/kvm/vmx.c 2013-04-18

[PATCH 06/11] KVM: nVMX: Allocate shadow vmcs

2013-04-18 Thread Abel Gordon
Allocate a shadow vmcs used by the processor to shadow part of the fields stored in the software defined VMCS12 (let L1 access fields without causing exits). Note we keep a shadow vmcs only for the current vmcs12. Once a vmcs12 becomes non-current, its shadow vmcs is released. Signed-off-by: Abe

Re: [PATCH v7 2/3] tcm_vhost: Add helper to check if endpoint is setup

2013-04-18 Thread Michael S. Tsirkin
On Thu, Apr 18, 2013 at 04:32:30PM +0800, Asias He wrote: > On Thu, Apr 18, 2013 at 10:09:53AM +0300, Michael S. Tsirkin wrote: > > On Thu, Apr 18, 2013 at 09:05:53AM +0800, Asias He wrote: > > > Signed-off-by: Asias He > > > --- > > > drivers/vhost/tcm_vhost.c | 18 ++ > > > 1 fi

[PATCH 05/11] KVM: nVMX: Fix VMXON emulation

2013-04-18 Thread Abel Gordon
handle_vmon doesn't check if L1 is already in root mode (VMXON was previously called). This patch adds this missing check and calls nested_vmx_failValid if VMX is already ON. We need this check because L0 will allocate the shadow vmcs when L1 executes VMXON and we want to avoid host leaks (due to s

[PATCH 04/11] KVM: nVMX: Refactor handle_vmwrite

2013-04-18 Thread Abel Gordon
Refactor existent code so we re-use vmcs12_write_any to copy fields from the shadow vmcs specified by the link pointer (used by the processor, implementation-specific) to the VMCS12 software format used by L0 to hold the fields in L1 memory address space. Signed-off-by: Abel Gordon --- arch/x86/

[PATCH 03/11] KVM: nVMX: Introduce vmread and vmwrite bitmaps

2013-04-18 Thread Abel Gordon
Prepare vmread and vmwrite bitmaps according to a pre-specified list of fields. These lists are intended to specifiy most frequent accessed fields so we can minimize the number of fields that are copied from/to the software controlled VMCS12 format to/from to processor-specific shadow vmcs. The lis

[PATCH 02/11] KVM: nVMX: Detect shadow-vmcs capability

2013-04-18 Thread Abel Gordon
Add logic required to detect if shadow-vmcs is supported by the processor. Introduce a new kernel module parameter to specify if L0 should use shadow vmcs (or not) to run L1. Signed-off-by: Abel Gordon --- arch/x86/kvm/vmx.c | 25 - 1 file changed, 24 insertions(+), 1 d

[PATCH 01/11] KVM: nVMX: Shadow-vmcs control fields/bits

2013-04-18 Thread Abel Gordon
Add definitions for all the vmcs control fields/bits required to enable vmcs-shadowing Signed-off-by: Abel Gordon --- arch/x86/include/asm/vmx.h|3 +++ arch/x86/include/uapi/asm/msr-index.h |2 ++ 2 files changed, 5 insertions(+) --- .before/arch/x86/include/asm/vmx.h 2013-

  1   2   >