Re: [PATCH 00/31] KVM/MIPS: Implement hardware virtualization via the MIPS-VZ extensions.

2013-06-09 Thread Gleb Natapov
On Fri, Jun 07, 2013 at 04:15:00PM -0700, David Daney wrote: > I should also add that I will shortly send patches for the kvm tool > required to drive this VM as well as a small set of patches that > create a para-virtualized MIPS/Linux guest kernel. > > The idea is that because there is no

Re: [PATCH 00/31] KVM/MIPS: Implement hardware virtualization via the MIPS-VZ extensions.

2013-06-09 Thread Gleb Natapov
On Fri, Jun 07, 2013 at 04:15:00PM -0700, David Daney wrote: I should also add that I will shortly send patches for the kvm tool required to drive this VM as well as a small set of patches that create a para-virtualized MIPS/Linux guest kernel. The idea is that because there is no standard

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-09 Thread Gleb Natapov
On Sat, Jun 08, 2013 at 11:15:37AM +0800, Xiao Guangrong wrote: From: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com Currently, memory synchronization is missed in emulator_fix_hypercall, please see the commit 758ccc89b83 (KVM: x86: drop calling kvm_mmu_zap_all in emulator_fix_hypercall)

Re: [PATCH v8 00/11] KVM: MMU: fast zap all shadow pages

2013-06-09 Thread Gleb Natapov
-mmu_valid_gen != kvm-arch.mmu_valid_gen) are zapped by using lock-break technique. Gleb Natapov (1): KVM: MMU: reduce KVM_REQ_MMU_RELOAD when root page is zapped Xiao Guangrong (10): KVM: x86: drop calling kvm_mmu_zap_all in emulator_fix_hypercall KVM: MMU: drop unnecessary

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-09 Thread Gleb Natapov
On Sun, Jun 09, 2013 at 04:56:42PM +0800, Xiao Guangrong wrote: On 06/09/2013 04:45 PM, Gleb Natapov wrote: On Sat, Jun 08, 2013 at 11:15:37AM +0800, Xiao Guangrong wrote: From: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com Currently, memory synchronization is missed

Re: [PATCH v8 00/11] KVM: MMU: fast zap all shadow pages

2013-06-09 Thread Gleb Natapov
On Sun, Jun 09, 2013 at 05:06:24PM +0800, Xiao Guangrong wrote: On 06/09/2013 04:53 PM, Gleb Natapov wrote: On Fri, May 31, 2013 at 08:36:19AM +0800, Xiao Guangrong wrote: Hi Gleb, Paolo, Marcelo, I have putted the potential controversial patches to the latter that are patch 8 ~ 10

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-09 Thread Gleb Natapov
On Sun, Jun 09, 2013 at 05:29:37PM +0800, Xiao Guangrong wrote: On 06/09/2013 04:45 PM, Gleb Natapov wrote: +static int emulator_fix_hypercall(struct x86_emulate_ctxt *ctxt) +{ + struct kvm_vcpu *vcpu = emul_to_vcpu(ctxt); + return kvm_exec_with_stopped_vcpu(vcpu-kvm

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-09 Thread Gleb Natapov
On Sun, Jun 09, 2013 at 06:01:45PM +0800, Xiao Guangrong wrote: On 06/09/2013 05:39 PM, Gleb Natapov wrote: On Sun, Jun 09, 2013 at 05:29:37PM +0800, Xiao Guangrong wrote: On 06/09/2013 04:45 PM, Gleb Natapov wrote: +static int emulator_fix_hypercall(struct x86_emulate_ctxt *ctxt

Re: Re: [PATCH V2 1/1] kvm/vmx: Add a tracepoint write_tsc_offset

2013-06-09 Thread Gleb Natapov
On Fri, Jun 07, 2013 at 02:22:22PM +0900, Yoshihiro YUNOMAE wrote: (2013/06/06 20:33), Gleb Natapov wrote: On Wed, Jun 05, 2013 at 09:23:22PM -0300, Marcelo Tosatti wrote: On Tue, Jun 04, 2013 at 05:36:19PM +0900, Yoshihiro YUNOMAE wrote: Add a tracepoint write_tsc_offset for tracing TSC

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-09 Thread Gleb Natapov
On Sun, Jun 09, 2013 at 07:25:17PM +0800, Xiao Guangrong wrote: On 06/09/2013 06:19 PM, Gleb Natapov wrote: On Sun, Jun 09, 2013 at 06:01:45PM +0800, Xiao Guangrong wrote: On 06/09/2013 05:39 PM, Gleb Natapov wrote: On Sun, Jun 09, 2013 at 05:29:37PM +0800, Xiao Guangrong wrote: On 06/09

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-09 Thread Gleb Natapov
On Sun, Jun 09, 2013 at 07:44:03PM +0800, Xiao Guangrong wrote: On 06/09/2013 07:36 PM, Gleb Natapov wrote: On Sun, Jun 09, 2013 at 07:25:17PM +0800, Xiao Guangrong wrote: On 06/09/2013 06:19 PM, Gleb Natapov wrote: On Sun, Jun 09, 2013 at 06:01:45PM +0800, Xiao Guangrong wrote: On 06/09

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-09 Thread Gleb Natapov
On Sun, Jun 09, 2013 at 08:17:19PM +0800, Xiao Guangrong wrote: On 06/09/2013 07:56 PM, Gleb Natapov wrote: On Sun, Jun 09, 2013 at 07:44:03PM +0800, Xiao Guangrong wrote: On 06/09/2013 07:36 PM, Gleb Natapov wrote: On Sun, Jun 09, 2013 at 07:25:17PM +0800, Xiao Guangrong wrote: On 06/09

Re: [PATCH v5 5/6] mips/kvm: Fix ABI by moving manipulation of CP0 registers to KVM_{G,S}ET_ONE_REG

2013-06-08 Thread Gleb Natapov
On Wed, May 22, 2013 at 11:43:55AM -0700, David Daney wrote: > From: David Daney > > Because not all 256 CP0 registers are ever implemented, we need a > different method of manipulating them. Use the > KVM_SET_ONE_REG/KVM_GET_ONE_REG mechanism. > > Now unused code and definitions are removed.

Re: [PATCH v5 5/6] mips/kvm: Fix ABI by moving manipulation of CP0 registers to KVM_{G,S}ET_ONE_REG

2013-06-08 Thread Gleb Natapov
On Wed, May 22, 2013 at 11:43:55AM -0700, David Daney wrote: From: David Daney david.da...@cavium.com Because not all 256 CP0 registers are ever implemented, we need a different method of manipulating them. Use the KVM_SET_ONE_REG/KVM_GET_ONE_REG mechanism. Now unused code and

Re: [PATCH V2 1/1] kvm/vmx: Add a tracepoint write_tsc_offset

2013-06-06 Thread Gleb Natapov
mmend to use a special > > instance for getting this event: > > > > 1. set a instance before booting a guest > > # cd /sys/kernel/debug/tracing/instances > > # mkdir tsc_offset > > # cd tsc_offset > > # echo x86-tsc > trace_clock > > # echo 1 >

Re: [PATCH V2 1/1] kvm/vmx: Add a tracepoint write_tsc_offset

2013-06-06 Thread Gleb Natapov
x86-tsc trace_clock # echo 1 events/kvm/kvm_write_tsc_offset/enable 2. boot a guest Signed-off-by: Yoshihiro YUNOMAE yoshihiro.yunomae...@hitachi.com Cc: Marcelo Tosatti mtosa...@redhat.com Cc: Gleb Natapov g...@redhat.com Cc: Thomas Gleixner t...@linutronix.de Cc: Ingo Molnar

Re: [PATCH 1/1] KVM: add kvm_para_available to asm-generic/kvm_para.h

2013-06-05 Thread Gleb Natapov
On Tue, Jun 04, 2013 at 12:33:19PM +0100, James Hogan wrote: > On 4 June 2013 10:05, Gleb Natapov wrote: > > On Wed, May 22, 2013 at 12:29:22PM +0100, James Hogan wrote: > >> According to include/uapi/linux/kvm_para.h architectures should define > >> kvm_para_availabl

Re: [PATCH v8 00/11] KVM: MMU: fast zap all shadow pages

2013-06-05 Thread Gleb Natapov
On Fri, May 31, 2013 at 08:36:19AM +0800, Xiao Guangrong wrote: > Hi Gleb, Paolo, Marcelo, > > I have putted the potential controversial patches to the latter that are > patch 8 ~ 10, patch 11 depends on patch 9. Other patches are fully reviewed, > I think its are ready for being merged. If not

Re: [PATCH v8 00/11] KVM: MMU: fast zap all shadow pages

2013-06-05 Thread Gleb Natapov
On Tue, Jun 04, 2013 at 10:26:01PM -0300, Marcelo Tosatti wrote: > On Fri, May 31, 2013 at 08:36:19AM +0800, Xiao Guangrong wrote: > > Hi Gleb, Paolo, Marcelo, > > > > I have putted the potential controversial patches to the latter that are > > patch 8 ~ 10, patch 11 depends on patch 9. Other

Re: [PATCH v8 00/11] KVM: MMU: fast zap all shadow pages

2013-06-05 Thread Gleb Natapov
On Tue, Jun 04, 2013 at 10:26:01PM -0300, Marcelo Tosatti wrote: On Fri, May 31, 2013 at 08:36:19AM +0800, Xiao Guangrong wrote: Hi Gleb, Paolo, Marcelo, I have putted the potential controversial patches to the latter that are patch 8 ~ 10, patch 11 depends on patch 9. Other patches are

Re: [PATCH v8 00/11] KVM: MMU: fast zap all shadow pages

2013-06-05 Thread Gleb Natapov
On Fri, May 31, 2013 at 08:36:19AM +0800, Xiao Guangrong wrote: Hi Gleb, Paolo, Marcelo, I have putted the potential controversial patches to the latter that are patch 8 ~ 10, patch 11 depends on patch 9. Other patches are fully reviewed, I think its are ready for being merged. If not luck

Re: [PATCH 1/1] KVM: add kvm_para_available to asm-generic/kvm_para.h

2013-06-05 Thread Gleb Natapov
On Tue, Jun 04, 2013 at 12:33:19PM +0100, James Hogan wrote: On 4 June 2013 10:05, Gleb Natapov g...@redhat.com wrote: On Wed, May 22, 2013 at 12:29:22PM +0100, James Hogan wrote: According to include/uapi/linux/kvm_para.h architectures should define kvm_para_available, so add

Re: [PATCH 1/2] KVM: x86: handle hardware breakpoints during emulation

2013-06-04 Thread Gleb Natapov
On Tue, Jun 04, 2013 at 02:19:13PM +0200, Paolo Bonzini wrote: > Il 04/06/2013 13:47, Gleb Natapov ha scritto: > > On Tue, Jun 04, 2013 at 01:33:20PM +0200, Paolo Bonzini wrote: > >> Il 04/06/2013 13:28, Gleb Natapov ha scritto: > >>> On Thu, May 30, 2013 at 06:00:3

[GIT PULL] KVM fixes for 3.10-rc4

2013-06-04 Thread Gleb Natapov
m: Use ARRAY_SIZE() instead of hardcoded constants in kvm_arch_vcpu_ioctl_{s,g}et_regs mips/kvm: Fix ABI by moving manipulation of CP0 registers to KVM_{G,S}ET_ONE_REG mips/kvm: Use ENOIOCTLCMD to indicate unimplemented ioctls. Gleb Natapov (1): KVM: Fix race in apic->pendi

Re: [PATCH 1/2] KVM: x86: handle hardware breakpoints during emulation

2013-06-04 Thread Gleb Natapov
On Tue, Jun 04, 2013 at 01:33:20PM +0200, Paolo Bonzini wrote: > Il 04/06/2013 13:28, Gleb Natapov ha scritto: > > On Thu, May 30, 2013 at 06:00:30PM +0200, Paolo Bonzini wrote: > >> This lets debugging work better during emulation of invalid > >> guest state. > &g

Re: [PATCH 1/2] KVM: x86: handle hardware breakpoints during emulation

2013-06-04 Thread Gleb Natapov
On Thu, May 30, 2013 at 06:00:30PM +0200, Paolo Bonzini wrote: > This lets debugging work better during emulation of invalid > guest state. > > The check is done before emulating the instruction, and (in the case > of guest debugging) reuses EMULATE_DO_MMIO to exit with KVM_EXIT_DEBUG. > >

Re: [PATCH 1/1] KVM: add kvm_para_available to asm-generic/kvm_para.h

2013-06-04 Thread Gleb Natapov
ra_available() that can benefit from this is in sound/pci/intel8x0.c, but I do not see follow up patch to use it there. > Signed-off-by: James Hogan > Cc: Marcelo Tosatti > Cc: Gleb Natapov > Cc: Arnd Bergmann > --- > include/asm-generic/kvm_para.h | 5 + > 1 file changed

Re: [PATCH 1/1] KVM: add kvm_para_available to asm-generic/kvm_para.h

2013-06-04 Thread Gleb Natapov
() that can benefit from this is in sound/pci/intel8x0.c, but I do not see follow up patch to use it there. Signed-off-by: James Hogan james.ho...@imgtec.com Cc: Marcelo Tosatti mtosa...@redhat.com Cc: Gleb Natapov g...@redhat.com Cc: Arnd Bergmann a...@arndb.de --- include/asm-generic/kvm_para.h

Re: [PATCH 1/2] KVM: x86: handle hardware breakpoints during emulation

2013-06-04 Thread Gleb Natapov
On Thu, May 30, 2013 at 06:00:30PM +0200, Paolo Bonzini wrote: This lets debugging work better during emulation of invalid guest state. The check is done before emulating the instruction, and (in the case of guest debugging) reuses EMULATE_DO_MMIO to exit with KVM_EXIT_DEBUG.

Re: [PATCH 1/2] KVM: x86: handle hardware breakpoints during emulation

2013-06-04 Thread Gleb Natapov
On Tue, Jun 04, 2013 at 01:33:20PM +0200, Paolo Bonzini wrote: Il 04/06/2013 13:28, Gleb Natapov ha scritto: On Thu, May 30, 2013 at 06:00:30PM +0200, Paolo Bonzini wrote: This lets debugging work better during emulation of invalid guest state. The check is done before emulating

[GIT PULL] KVM fixes for 3.10-rc4

2013-06-04 Thread Gleb Natapov
ARRAY_SIZE() instead of hardcoded constants in kvm_arch_vcpu_ioctl_{s,g}et_regs mips/kvm: Fix ABI by moving manipulation of CP0 registers to KVM_{G,S}ET_ONE_REG mips/kvm: Use ENOIOCTLCMD to indicate unimplemented ioctls. Gleb Natapov (1): KVM: Fix race in apic-pending_events processing

Re: [PATCH 1/2] KVM: x86: handle hardware breakpoints during emulation

2013-06-04 Thread Gleb Natapov
On Tue, Jun 04, 2013 at 02:19:13PM +0200, Paolo Bonzini wrote: Il 04/06/2013 13:47, Gleb Natapov ha scritto: On Tue, Jun 04, 2013 at 01:33:20PM +0200, Paolo Bonzini wrote: Il 04/06/2013 13:28, Gleb Natapov ha scritto: On Thu, May 30, 2013 at 06:00:30PM +0200, Paolo Bonzini wrote

Re: [PATCH] KVM: fix sil/dil/bpl/spl in the mod/rm fields

2013-06-03 Thread Gleb Natapov
On Mon, Jun 03, 2013 at 08:30:18PM +0300, Avi Kivity wrote: > On Jun 3, 2013 7:41 PM, "Gleb Natapov" wrote: > > > > On Mon, Jun 03, 2013 at 06:42:11PM +0300, Avi Kivity wrote: > > > On Thu, May 30, 2013 at 7:34 PM, Paolo Bonzini > wrote: > > > &

Re: [PATCH] KVM: fix sil/dil/bpl/spl in the mod/rm fields

2013-06-03 Thread Gleb Natapov
On Mon, Jun 03, 2013 at 06:42:11PM +0300, Avi Kivity wrote: > On Thu, May 30, 2013 at 7:34 PM, Paolo Bonzini wrote: > > Il 30/05/2013 17:34, Paolo Bonzini ha scritto: > >> Il 30/05/2013 16:35, Paolo Bonzini ha scritto: > >>> The x86-64 extended low-byte registers were fetched correctly from reg,

Re: [PATCH] KVM: fix sil/dil/bpl/spl in the mod/rm fields

2013-06-03 Thread Gleb Natapov
On Thu, May 30, 2013 at 05:34:21PM +0200, Paolo Bonzini wrote: > Il 30/05/2013 16:35, Paolo Bonzini ha scritto: > > The x86-64 extended low-byte registers were fetched correctly from reg, > > but not from mod/rm. > > > > This fixes another bug in the boot of RHEL5.9 64-bit, but it is still > >

Re: [PATCH] KVM: fix sil/dil/bpl/spl in the mod/rm fields

2013-06-03 Thread Gleb Natapov
On Thu, May 30, 2013 at 04:35:55PM +0200, Paolo Bonzini wrote: > The x86-64 extended low-byte registers were fetched correctly from reg, > but not from mod/rm. > > This fixes another bug in the boot of RHEL5.9 64-bit, but it is still > not enough. > > Cc: gnata...@redhat.com > Cc:

Re: [PATCH] KVM: Emulate multibyte NOP

2013-06-03 Thread Gleb Natapov
On Thu, May 30, 2013 at 01:22:39PM +0200, Paolo Bonzini wrote: > This is encountered when booting RHEL5.9 64-bit. There is another bug > after this one that is not a simple emulation failure, but this one lets > the boot proceed a bit. > > Cc: # 3.9 > Signed-off-by: Paolo Bonzini Applied to

Re: [PATCH] KVM: fix sil/dil/bpl/spl in the mod/rm fields

2013-06-03 Thread Gleb Natapov
On Mon, Jun 03, 2013 at 08:27:57AM +0200, Paolo Bonzini wrote: > Il 02/06/2013 20:12, Gleb Natapov ha scritto: > > On Thu, May 30, 2013 at 04:35:55PM +0200, Paolo Bonzini wrote: > >> The x86-64 extended low-byte registers were fetched correctly from reg, > &

Re: [PATCH] KVM: fix sil/dil/bpl/spl in the mod/rm fields

2013-06-03 Thread Gleb Natapov
On Mon, Jun 03, 2013 at 08:27:57AM +0200, Paolo Bonzini wrote: Il 02/06/2013 20:12, Gleb Natapov ha scritto: On Thu, May 30, 2013 at 04:35:55PM +0200, Paolo Bonzini wrote: The x86-64 extended low-byte registers were fetched correctly from reg, but not from mod/rm. This fixes another bug

Re: [PATCH] KVM: Emulate multibyte NOP

2013-06-03 Thread Gleb Natapov
On Thu, May 30, 2013 at 01:22:39PM +0200, Paolo Bonzini wrote: This is encountered when booting RHEL5.9 64-bit. There is another bug after this one that is not a simple emulation failure, but this one lets the boot proceed a bit. Cc: sta...@vger.kernel.org # 3.9 Signed-off-by: Paolo

Re: [PATCH] KVM: fix sil/dil/bpl/spl in the mod/rm fields

2013-06-03 Thread Gleb Natapov
On Thu, May 30, 2013 at 04:35:55PM +0200, Paolo Bonzini wrote: The x86-64 extended low-byte registers were fetched correctly from reg, but not from mod/rm. This fixes another bug in the boot of RHEL5.9 64-bit, but it is still not enough. Cc: gnata...@redhat.com Cc: k...@vger.kernel.org

Re: [PATCH] KVM: fix sil/dil/bpl/spl in the mod/rm fields

2013-06-03 Thread Gleb Natapov
On Thu, May 30, 2013 at 05:34:21PM +0200, Paolo Bonzini wrote: Il 30/05/2013 16:35, Paolo Bonzini ha scritto: The x86-64 extended low-byte registers were fetched correctly from reg, but not from mod/rm. This fixes another bug in the boot of RHEL5.9 64-bit, but it is still not enough.

Re: [PATCH] KVM: fix sil/dil/bpl/spl in the mod/rm fields

2013-06-03 Thread Gleb Natapov
On Mon, Jun 03, 2013 at 06:42:11PM +0300, Avi Kivity wrote: On Thu, May 30, 2013 at 7:34 PM, Paolo Bonzini pbonz...@redhat.com wrote: Il 30/05/2013 17:34, Paolo Bonzini ha scritto: Il 30/05/2013 16:35, Paolo Bonzini ha scritto: The x86-64 extended low-byte registers were fetched correctly

Re: [PATCH] KVM: fix sil/dil/bpl/spl in the mod/rm fields

2013-06-03 Thread Gleb Natapov
On Mon, Jun 03, 2013 at 08:30:18PM +0300, Avi Kivity wrote: On Jun 3, 2013 7:41 PM, Gleb Natapov g...@redhat.com wrote: On Mon, Jun 03, 2013 at 06:42:11PM +0300, Avi Kivity wrote: On Thu, May 30, 2013 at 7:34 PM, Paolo Bonzini pbonz...@redhat.com wrote: Il 30/05/2013 17:34, Paolo

Re: [PATCH] KVM: fix sil/dil/bpl/spl in the mod/rm fields

2013-06-02 Thread Gleb Natapov
On Thu, May 30, 2013 at 04:35:55PM +0200, Paolo Bonzini wrote: > The x86-64 extended low-byte registers were fetched correctly from reg, > but not from mod/rm. > > This fixes another bug in the boot of RHEL5.9 64-bit, but it is still > not enough. > Did I missed unit test patch? :) > Cc:

Re: [PATCH RFC V9 0/19] Paravirtualized ticket spinlocks

2013-06-02 Thread Gleb Natapov
On Sun, Jun 02, 2013 at 12:51:25AM +0530, Raghavendra K T wrote: > > This series replaces the existing paravirtualized spinlock mechanism > with a paravirtualized ticketlock mechanism. The series provides > implementation for both Xen and KVM. > High level question here. We have a big hope for

Re: [PATCH RFC V9 0/19] Paravirtualized ticket spinlocks

2013-06-02 Thread Gleb Natapov
On Sun, Jun 02, 2013 at 12:51:25AM +0530, Raghavendra K T wrote: This series replaces the existing paravirtualized spinlock mechanism with a paravirtualized ticketlock mechanism. The series provides implementation for both Xen and KVM. High level question here. We have a big hope for

Re: [PATCH] KVM: fix sil/dil/bpl/spl in the mod/rm fields

2013-06-02 Thread Gleb Natapov
On Thu, May 30, 2013 at 04:35:55PM +0200, Paolo Bonzini wrote: The x86-64 extended low-byte registers were fetched correctly from reg, but not from mod/rm. This fixes another bug in the boot of RHEL5.9 64-bit, but it is still not enough. Did I missed unit test patch? :) Cc:

Re: [PATCH v7 10/11] KVM: MMU: collapse TLB flushes when zap all pages

2013-05-29 Thread Gleb Natapov
On Wed, May 29, 2013 at 09:19:41PM +0800, Xiao Guangrong wrote: > On 05/29/2013 08:39 PM, Marcelo Tosatti wrote: > > On Wed, May 29, 2013 at 11:03:19AM +0800, Xiao Guangrong wrote: > > the pages since other vcpus may be doing locklessly shadow > > page walking > >>> > >>> Ah, yes, i agree

Re: [PATCH v7 10/11] KVM: MMU: collapse TLB flushes when zap all pages

2013-05-29 Thread Gleb Natapov
On Wed, May 29, 2013 at 09:19:41PM +0800, Xiao Guangrong wrote: On 05/29/2013 08:39 PM, Marcelo Tosatti wrote: On Wed, May 29, 2013 at 11:03:19AM +0800, Xiao Guangrong wrote: the pages since other vcpus may be doing locklessly shadow page walking Ah, yes, i agree with you. We can

Re: [PATCH v7 03/11] KVM: MMU: fast invalidate all pages

2013-05-26 Thread Gleb Natapov
On Fri, May 24, 2013 at 05:23:07PM -0300, Marcelo Tosatti wrote: > Hi Xiao, > > On Thu, May 23, 2013 at 03:55:52AM +0800, Xiao Guangrong wrote: > > The current kvm_mmu_zap_all is really slow - it is holding mmu-lock to > > walk and zap all shadow pages one by one, also it need to zap all guest >

Re: [PATCH v7 03/11] KVM: MMU: fast invalidate all pages

2013-05-26 Thread Gleb Natapov
On Fri, May 24, 2013 at 05:23:07PM -0300, Marcelo Tosatti wrote: Hi Xiao, On Thu, May 23, 2013 at 03:55:52AM +0800, Xiao Guangrong wrote: The current kvm_mmu_zap_all is really slow - it is holding mmu-lock to walk and zap all shadow pages one by one, also it need to zap all guest page's

Re: [GIT PULL] KVM fixes for 3.10-rc2

2013-05-23 Thread Gleb Natapov
On Thu, May 23, 2013 at 09:20:22AM -0700, Linus Torvalds wrote: > On Thu, May 23, 2013 at 3:41 AM, Gleb Natapov wrote: > > > > MAINTAINERS |7 ++-- > > arch/mips/include/asm/kvm.h | 55 > > --- >

Re: [PATCH v5 0/6] mips/kvm: Fix ABI for compatibility with 64-bit guests.

2013-05-23 Thread Gleb Natapov
On Thu, May 23, 2013 at 09:58:00AM -0700, David Daney wrote: > On 05/23/2013 03:28 AM, Gleb Natapov wrote: > >On Wed, May 22, 2013 at 11:43:50AM -0700, David Daney wrote: > >>From: David Daney > >> > >Please regenerate against master. arch/mips/include/asm/

Re: [PATCH v7 09/11] KVM: MMU: introduce kvm_mmu_prepare_zap_obsolete_page

2013-05-23 Thread Gleb Natapov
On Thu, May 23, 2013 at 09:03:50PM +0800, Xiao Guangrong wrote: > On 05/23/2013 08:39 PM, Gleb Natapov wrote: > > On Thu, May 23, 2013 at 07:13:58PM +0800, Xiao Guangrong wrote: > >> On 05/23/2013 04:09 PM, Gleb Natapov wrote: > >>> On Thu, May 23, 2013 at 03:50:16

Re: [PATCH v7 09/11] KVM: MMU: introduce kvm_mmu_prepare_zap_obsolete_page

2013-05-23 Thread Gleb Natapov
On Thu, May 23, 2013 at 07:13:58PM +0800, Xiao Guangrong wrote: > On 05/23/2013 04:09 PM, Gleb Natapov wrote: > > On Thu, May 23, 2013 at 03:50:16PM +0800, Xiao Guangrong wrote: > >> On 05/23/2013 03:37 PM, Gleb Natapov wrote: > >>> On Thu, May 23, 2013 at 02:31:47

[GIT PULL] KVM fixes for 3.10-rc2

2013-05-23 Thread Gleb Natapov
Linus, Please pull from git://git.kernel.org/pub/scm/virt/kvm/kvm.git master To receive the following KVM bug fixes Paolo Bonzini (1): KVM: take over co-maintainership from Marcelo, fix MAINTAINERS entry Sanjay Lal (2): KVM/MIPS32: Move include/asm/kvm.h =>

Re: [PATCH v5 0/6] mips/kvm: Fix ABI for compatibility with 64-bit guests.

2013-05-23 Thread Gleb Natapov
On Wed, May 22, 2013 at 11:43:50AM -0700, David Daney wrote: > From: David Daney > Please regenerate against master. arch/mips/include/asm/kvm.h does not exists any more. > The initial patch set implementing MIPS KVM does not handle 64-bit > guests or use of the FPU. This patch set corrects

Re: [PATCH v7 09/11] KVM: MMU: introduce kvm_mmu_prepare_zap_obsolete_page

2013-05-23 Thread Gleb Natapov
On Thu, May 23, 2013 at 03:50:16PM +0800, Xiao Guangrong wrote: > On 05/23/2013 03:37 PM, Gleb Natapov wrote: > > On Thu, May 23, 2013 at 02:31:47PM +0800, Xiao Guangrong wrote: > >> On 05/23/2013 02:18 PM, Gleb Natapov wrote: > >>> On Thu, May 23, 2013 at 02:13:06

Re: [PATCH v7 10/11] KVM: MMU: collapse TLB flushes when zap all pages

2013-05-23 Thread Gleb Natapov
On Thu, May 23, 2013 at 03:38:49PM +0800, Xiao Guangrong wrote: > On 05/23/2013 03:37 PM, Xiao Guangrong wrote: > > On 05/23/2013 03:24 PM, Gleb Natapov wrote: > >> On Thu, May 23, 2013 at 02:26:57PM +0800, Xiao Guangrong wrote: > >>> On 05/23/2013 02:12 PM, Gleb Nat

Re: [PATCH v7 09/11] KVM: MMU: introduce kvm_mmu_prepare_zap_obsolete_page

2013-05-23 Thread Gleb Natapov
On Thu, May 23, 2013 at 02:31:47PM +0800, Xiao Guangrong wrote: > On 05/23/2013 02:18 PM, Gleb Natapov wrote: > > On Thu, May 23, 2013 at 02:13:06PM +0800, Xiao Guangrong wrote: > >> On 05/23/2013 01:57 PM, Gleb Natapov wrote: > >>> On Thu, May 23, 2013 at 03:55:58

Re: [PATCH v7 10/11] KVM: MMU: collapse TLB flushes when zap all pages

2013-05-23 Thread Gleb Natapov
On Thu, May 23, 2013 at 02:26:57PM +0800, Xiao Guangrong wrote: > On 05/23/2013 02:12 PM, Gleb Natapov wrote: > > On Thu, May 23, 2013 at 03:55:59AM +0800, Xiao Guangrong wrote: > >> kvm_zap_obsolete_pages uses lock-break technique to zap pages, > >> it will flush tlb e

Re: [PATCH v7 09/11] KVM: MMU: introduce kvm_mmu_prepare_zap_obsolete_page

2013-05-23 Thread Gleb Natapov
On Thu, May 23, 2013 at 02:13:06PM +0800, Xiao Guangrong wrote: > On 05/23/2013 01:57 PM, Gleb Natapov wrote: > > On Thu, May 23, 2013 at 03:55:58AM +0800, Xiao Guangrong wrote: > >> It is only used to zap the obsolete page. Since the obsolete page > >> will not be u

Re: [PATCH v7 10/11] KVM: MMU: collapse TLB flushes when zap all pages

2013-05-23 Thread Gleb Natapov
On Thu, May 23, 2013 at 03:55:59AM +0800, Xiao Guangrong wrote: > kvm_zap_obsolete_pages uses lock-break technique to zap pages, > it will flush tlb every time when it does lock-break > > We can reload mmu on all vcpus after updating the generation > number so that the obsolete pages are not used

Re: [PATCH v7 10/11] KVM: MMU: collapse TLB flushes when zap all pages

2013-05-23 Thread Gleb Natapov
On Thu, May 23, 2013 at 03:55:59AM +0800, Xiao Guangrong wrote: kvm_zap_obsolete_pages uses lock-break technique to zap pages, it will flush tlb every time when it does lock-break We can reload mmu on all vcpus after updating the generation number so that the obsolete pages are not used on

Re: [PATCH v7 09/11] KVM: MMU: introduce kvm_mmu_prepare_zap_obsolete_page

2013-05-23 Thread Gleb Natapov
On Thu, May 23, 2013 at 02:13:06PM +0800, Xiao Guangrong wrote: On 05/23/2013 01:57 PM, Gleb Natapov wrote: On Thu, May 23, 2013 at 03:55:58AM +0800, Xiao Guangrong wrote: It is only used to zap the obsolete page. Since the obsolete page will not be used, we need not spend time to find its

Re: [PATCH v7 10/11] KVM: MMU: collapse TLB flushes when zap all pages

2013-05-23 Thread Gleb Natapov
On Thu, May 23, 2013 at 02:26:57PM +0800, Xiao Guangrong wrote: On 05/23/2013 02:12 PM, Gleb Natapov wrote: On Thu, May 23, 2013 at 03:55:59AM +0800, Xiao Guangrong wrote: kvm_zap_obsolete_pages uses lock-break technique to zap pages, it will flush tlb every time when it does lock-break

Re: [PATCH v7 09/11] KVM: MMU: introduce kvm_mmu_prepare_zap_obsolete_page

2013-05-23 Thread Gleb Natapov
On Thu, May 23, 2013 at 02:31:47PM +0800, Xiao Guangrong wrote: On 05/23/2013 02:18 PM, Gleb Natapov wrote: On Thu, May 23, 2013 at 02:13:06PM +0800, Xiao Guangrong wrote: On 05/23/2013 01:57 PM, Gleb Natapov wrote: On Thu, May 23, 2013 at 03:55:58AM +0800, Xiao Guangrong wrote

Re: [PATCH v7 10/11] KVM: MMU: collapse TLB flushes when zap all pages

2013-05-23 Thread Gleb Natapov
On Thu, May 23, 2013 at 03:38:49PM +0800, Xiao Guangrong wrote: On 05/23/2013 03:37 PM, Xiao Guangrong wrote: On 05/23/2013 03:24 PM, Gleb Natapov wrote: On Thu, May 23, 2013 at 02:26:57PM +0800, Xiao Guangrong wrote: On 05/23/2013 02:12 PM, Gleb Natapov wrote: On Thu, May 23, 2013 at 03

Re: [PATCH v7 09/11] KVM: MMU: introduce kvm_mmu_prepare_zap_obsolete_page

2013-05-23 Thread Gleb Natapov
On Thu, May 23, 2013 at 03:50:16PM +0800, Xiao Guangrong wrote: On 05/23/2013 03:37 PM, Gleb Natapov wrote: On Thu, May 23, 2013 at 02:31:47PM +0800, Xiao Guangrong wrote: On 05/23/2013 02:18 PM, Gleb Natapov wrote: On Thu, May 23, 2013 at 02:13:06PM +0800, Xiao Guangrong wrote: On 05/23

Re: [PATCH v5 0/6] mips/kvm: Fix ABI for compatibility with 64-bit guests.

2013-05-23 Thread Gleb Natapov
On Wed, May 22, 2013 at 11:43:50AM -0700, David Daney wrote: From: David Daney david.da...@cavium.com Please regenerate against master. arch/mips/include/asm/kvm.h does not exists any more. The initial patch set implementing MIPS KVM does not handle 64-bit guests or use of the FPU. This

[GIT PULL] KVM fixes for 3.10-rc2

2013-05-23 Thread Gleb Natapov
Linus, Please pull from git://git.kernel.org/pub/scm/virt/kvm/kvm.git master To receive the following KVM bug fixes Paolo Bonzini (1): KVM: take over co-maintainership from Marcelo, fix MAINTAINERS entry Sanjay Lal (2): KVM/MIPS32: Move include/asm/kvm.h = include/uapi/asm/kvm.h

Re: [PATCH v7 09/11] KVM: MMU: introduce kvm_mmu_prepare_zap_obsolete_page

2013-05-23 Thread Gleb Natapov
On Thu, May 23, 2013 at 07:13:58PM +0800, Xiao Guangrong wrote: On 05/23/2013 04:09 PM, Gleb Natapov wrote: On Thu, May 23, 2013 at 03:50:16PM +0800, Xiao Guangrong wrote: On 05/23/2013 03:37 PM, Gleb Natapov wrote: On Thu, May 23, 2013 at 02:31:47PM +0800, Xiao Guangrong wrote: On 05/23

Re: [PATCH v7 09/11] KVM: MMU: introduce kvm_mmu_prepare_zap_obsolete_page

2013-05-23 Thread Gleb Natapov
On Thu, May 23, 2013 at 09:03:50PM +0800, Xiao Guangrong wrote: On 05/23/2013 08:39 PM, Gleb Natapov wrote: On Thu, May 23, 2013 at 07:13:58PM +0800, Xiao Guangrong wrote: On 05/23/2013 04:09 PM, Gleb Natapov wrote: On Thu, May 23, 2013 at 03:50:16PM +0800, Xiao Guangrong wrote: On 05/23

Re: [PATCH v5 0/6] mips/kvm: Fix ABI for compatibility with 64-bit guests.

2013-05-23 Thread Gleb Natapov
On Thu, May 23, 2013 at 09:58:00AM -0700, David Daney wrote: On 05/23/2013 03:28 AM, Gleb Natapov wrote: On Wed, May 22, 2013 at 11:43:50AM -0700, David Daney wrote: From: David Daney david.da...@cavium.com Please regenerate against master. arch/mips/include/asm/kvm.h does not exists any

Re: [GIT PULL] KVM fixes for 3.10-rc2

2013-05-23 Thread Gleb Natapov
On Thu, May 23, 2013 at 09:20:22AM -0700, Linus Torvalds wrote: On Thu, May 23, 2013 at 3:41 AM, Gleb Natapov g...@redhat.com wrote: MAINTAINERS |7 ++-- arch/mips/include/asm/kvm.h | 55 --- arch/mips/include/uapi

Re: [PATCH v7 09/11] KVM: MMU: introduce kvm_mmu_prepare_zap_obsolete_page

2013-05-22 Thread Gleb Natapov
On Thu, May 23, 2013 at 03:55:58AM +0800, Xiao Guangrong wrote: > It is only used to zap the obsolete page. Since the obsolete page > will not be used, we need not spend time to find its unsync children > out. Also, we delete the page from shadow page cache so that the page > is completely

Re: [PATCH v6 3/7] KVM: MMU: fast invalidate all pages

2013-05-22 Thread Gleb Natapov
On Wed, May 22, 2013 at 11:25:13PM +0800, Xiao Guangrong wrote: > On 05/22/2013 09:17 PM, Gleb Natapov wrote: > > On Wed, May 22, 2013 at 05:41:10PM +0800, Xiao Guangrong wrote: > >> On 05/22/2013 04:54 PM, Gleb Natapov wrote: > >>> On Wed, May 22, 2013 at 04:46:04

Re: [PATCH v6 3/7] KVM: MMU: fast invalidate all pages

2013-05-22 Thread Gleb Natapov
On Wed, May 22, 2013 at 05:41:10PM +0800, Xiao Guangrong wrote: > On 05/22/2013 04:54 PM, Gleb Natapov wrote: > > On Wed, May 22, 2013 at 04:46:04PM +0800, Xiao Guangrong wrote: > >> On 05/22/2013 02:34 PM, Gleb Natapov wrote: > >>> On Tue, May 21, 2013 at 10:33:30P

Re: [PATCH v4 0/6] mips/kvm: Fix ABI for compatibility with 64-bit guests.

2013-05-22 Thread Gleb Natapov
On Tue, May 21, 2013 at 01:54:49PM -0700, David Daney wrote: > From: David Daney > > The initial patch set implementing MIPS KVM does not handle 64-bit > guests or use of the FPU. This patch set corrects these ABI issues, > and does some very minor clean up. > Sanjay, is this looks good to

Re: [PATCH v6 3/7] KVM: MMU: fast invalidate all pages

2013-05-22 Thread Gleb Natapov
On Wed, May 22, 2013 at 04:46:04PM +0800, Xiao Guangrong wrote: > On 05/22/2013 02:34 PM, Gleb Natapov wrote: > > On Tue, May 21, 2013 at 10:33:30PM -0300, Marcelo Tosatti wrote: > >> On Tue, May 21, 2013 at 11:39:03AM +0300, Gleb Natapov wrote: > >>>>

Re: [PATCH v6 3/7] KVM: MMU: fast invalidate all pages

2013-05-22 Thread Gleb Natapov
On Tue, May 21, 2013 at 10:33:30PM -0300, Marcelo Tosatti wrote: > On Tue, May 21, 2013 at 11:39:03AM +0300, Gleb Natapov wrote: > > > Any pages with stale information will be zapped by kvm_mmu_zap_all(). > > > When that happens, page faults will take place which will aut

Re: [PATCH v6 3/7] KVM: MMU: fast invalidate all pages

2013-05-22 Thread Gleb Natapov
On Tue, May 21, 2013 at 10:33:30PM -0300, Marcelo Tosatti wrote: On Tue, May 21, 2013 at 11:39:03AM +0300, Gleb Natapov wrote: Any pages with stale information will be zapped by kvm_mmu_zap_all(). When that happens, page faults will take place which will automatically use the new

Re: [PATCH v6 3/7] KVM: MMU: fast invalidate all pages

2013-05-22 Thread Gleb Natapov
On Wed, May 22, 2013 at 04:46:04PM +0800, Xiao Guangrong wrote: On 05/22/2013 02:34 PM, Gleb Natapov wrote: On Tue, May 21, 2013 at 10:33:30PM -0300, Marcelo Tosatti wrote: On Tue, May 21, 2013 at 11:39:03AM +0300, Gleb Natapov wrote: Any pages with stale information will be zapped

Re: [PATCH v4 0/6] mips/kvm: Fix ABI for compatibility with 64-bit guests.

2013-05-22 Thread Gleb Natapov
On Tue, May 21, 2013 at 01:54:49PM -0700, David Daney wrote: From: David Daney david.da...@cavium.com The initial patch set implementing MIPS KVM does not handle 64-bit guests or use of the FPU. This patch set corrects these ABI issues, and does some very minor clean up. Sanjay, is this

Re: [PATCH v6 3/7] KVM: MMU: fast invalidate all pages

2013-05-22 Thread Gleb Natapov
On Wed, May 22, 2013 at 05:41:10PM +0800, Xiao Guangrong wrote: On 05/22/2013 04:54 PM, Gleb Natapov wrote: On Wed, May 22, 2013 at 04:46:04PM +0800, Xiao Guangrong wrote: On 05/22/2013 02:34 PM, Gleb Natapov wrote: On Tue, May 21, 2013 at 10:33:30PM -0300, Marcelo Tosatti wrote: On Tue

Re: [PATCH v6 3/7] KVM: MMU: fast invalidate all pages

2013-05-22 Thread Gleb Natapov
On Wed, May 22, 2013 at 11:25:13PM +0800, Xiao Guangrong wrote: On 05/22/2013 09:17 PM, Gleb Natapov wrote: On Wed, May 22, 2013 at 05:41:10PM +0800, Xiao Guangrong wrote: On 05/22/2013 04:54 PM, Gleb Natapov wrote: On Wed, May 22, 2013 at 04:46:04PM +0800, Xiao Guangrong wrote: On 05/22

Re: [PATCH v7 09/11] KVM: MMU: introduce kvm_mmu_prepare_zap_obsolete_page

2013-05-22 Thread Gleb Natapov
On Thu, May 23, 2013 at 03:55:58AM +0800, Xiao Guangrong wrote: It is only used to zap the obsolete page. Since the obsolete page will not be used, we need not spend time to find its unsync children out. Also, we delete the page from shadow page cache so that the page is completely isolated

Re: [PATCH v3 5/5] mips/kvm: Fix ABI by moving manipulation of CP0 registers to KVM_{G,S}ET_MSRS

2013-05-21 Thread Gleb Natapov
On Tue, May 21, 2013 at 09:21:06AM -0700, David Daney wrote: > On 05/21/2013 08:37 AM, Gleb Natapov wrote: > >On Mon, May 20, 2013 at 02:01:26PM -0700, David Daney wrote: > >>From: David Daney > >> > >>Because not all 256 CP0 registers are ever impleme

Re: [PATCH v3 5/5] mips/kvm: Fix ABI by moving manipulation of CP0 registers to KVM_{G,S}ET_MSRS

2013-05-21 Thread Gleb Natapov
On Mon, May 20, 2013 at 02:01:26PM -0700, David Daney wrote: > From: David Daney > > Because not all 256 CP0 registers are ever implemented, we need a > different method of manipulating them. Use the > KVM_GET_MSRS/KVM_SET_MSRS mechanism as x86 does for its MSRs. > Have you looked at

Re: [PATCH v6 3/7] KVM: MMU: fast invalidate all pages

2013-05-21 Thread Gleb Natapov
On Tue, May 21, 2013 at 11:36:57AM +0800, Xiao Guangrong wrote: > > So its better to just > > > > if (need_resched()) { > > kvm_mmu_complete_zap_page(); > > is kvm_mmu_commit_zap_page()? > Also we need to check that someone waits on mmu_lock before entering here. > >

Re: [PATCH v6 3/7] KVM: MMU: fast invalidate all pages

2013-05-21 Thread Gleb Natapov
On Mon, May 20, 2013 at 05:40:47PM -0300, Marcelo Tosatti wrote: > On Mon, May 20, 2013 at 11:15:45PM +0300, Gleb Natapov wrote: > > On Mon, May 20, 2013 at 04:46:24PM -0300, Marcelo Tosatti wrote: > > > On Fri, May 17, 2013 at 05:12:58AM +0800, Xiao Guangrong wrote: &

Re: [PATCH v6 3/7] KVM: MMU: fast invalidate all pages

2013-05-21 Thread Gleb Natapov
On Mon, May 20, 2013 at 05:40:47PM -0300, Marcelo Tosatti wrote: On Mon, May 20, 2013 at 11:15:45PM +0300, Gleb Natapov wrote: On Mon, May 20, 2013 at 04:46:24PM -0300, Marcelo Tosatti wrote: On Fri, May 17, 2013 at 05:12:58AM +0800, Xiao Guangrong wrote: The current kvm_mmu_zap_all

Re: [PATCH v6 3/7] KVM: MMU: fast invalidate all pages

2013-05-21 Thread Gleb Natapov
On Tue, May 21, 2013 at 11:36:57AM +0800, Xiao Guangrong wrote: So its better to just if (need_resched()) { kvm_mmu_complete_zap_page(list); is kvm_mmu_commit_zap_page()? Also we need to check that someone waits on mmu_lock before entering here.

Re: [PATCH v3 5/5] mips/kvm: Fix ABI by moving manipulation of CP0 registers to KVM_{G,S}ET_MSRS

2013-05-21 Thread Gleb Natapov
On Mon, May 20, 2013 at 02:01:26PM -0700, David Daney wrote: From: David Daney david.da...@cavium.com Because not all 256 CP0 registers are ever implemented, we need a different method of manipulating them. Use the KVM_GET_MSRS/KVM_SET_MSRS mechanism as x86 does for its MSRs. Have you

Re: [PATCH v3 5/5] mips/kvm: Fix ABI by moving manipulation of CP0 registers to KVM_{G,S}ET_MSRS

2013-05-21 Thread Gleb Natapov
On Tue, May 21, 2013 at 09:21:06AM -0700, David Daney wrote: On 05/21/2013 08:37 AM, Gleb Natapov wrote: On Mon, May 20, 2013 at 02:01:26PM -0700, David Daney wrote: From: David Daney david.da...@cavium.com Because not all 256 CP0 registers are ever implemented, we need a different method

Re: [PATCH v6 3/7] KVM: MMU: fast invalidate all pages

2013-05-20 Thread Gleb Natapov
On Mon, May 20, 2013 at 04:46:24PM -0300, Marcelo Tosatti wrote: > On Fri, May 17, 2013 at 05:12:58AM +0800, Xiao Guangrong wrote: > > The current kvm_mmu_zap_all is really slow - it is holding mmu-lock to > > walk and zap all shadow pages one by one, also it need to zap all guest > > page's rmap

Re: [PATCH v6 2/7] KVM: MMU: delete shadow page from hash list in kvm_mmu_prepare_zap_page

2013-05-20 Thread Gleb Natapov
On Mon, May 20, 2013 at 05:19:26PM +0800, Xiao Guangrong wrote: > On 05/19/2013 06:47 PM, Gleb Natapov wrote: > > On Fri, May 17, 2013 at 05:12:57AM +0800, Xiao Guangrong wrote: > >> Move deletion shadow page from the hash list from kvm_mmu_commit_zap_page > >> to >

Re: [PATCH v6 2/7] KVM: MMU: delete shadow page from hash list in kvm_mmu_prepare_zap_page

2013-05-20 Thread Gleb Natapov
On Mon, May 20, 2013 at 05:19:26PM +0800, Xiao Guangrong wrote: On 05/19/2013 06:47 PM, Gleb Natapov wrote: On Fri, May 17, 2013 at 05:12:57AM +0800, Xiao Guangrong wrote: Move deletion shadow page from the hash list from kvm_mmu_commit_zap_page to kvm_mmu_prepare_zap_page so that we can

Re: [PATCH v6 3/7] KVM: MMU: fast invalidate all pages

2013-05-20 Thread Gleb Natapov
On Mon, May 20, 2013 at 04:46:24PM -0300, Marcelo Tosatti wrote: On Fri, May 17, 2013 at 05:12:58AM +0800, Xiao Guangrong wrote: The current kvm_mmu_zap_all is really slow - it is holding mmu-lock to walk and zap all shadow pages one by one, also it need to zap all guest page's rmap and all

<    3   4   5   6   7   8   9   10   11   12   >