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 controve

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_ex

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 emulato

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 tracepoin

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:37

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:45

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:17

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

2013-06-09 Thread Gleb Natapov
On Sun, Jun 09, 2013 at 04:23:51PM -0700, David Daney wrote: > On 06/09/2013 12:31 AM, Gleb Natapov wrote: > >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 V

Re: [PATCH v3 0/6] KVM: MMU: fast invalidate all mmio sptes

2013-06-10 Thread Gleb Natapov
On Fri, Jun 07, 2013 at 04:51:22PM +0800, Xiao Guangrong wrote: > Changelog: > V3: > All of these changes are from Gleb's review: > 1) rename RET_MMIO_PF_EMU to RET_MMIO_PF_EMULATE. > 2) smartly adjust kvm generation number in kvm_current_mmio_generatio() > to avoid kvm_memslots->generat

Re: [PATCH v3 3/6] KVM: MMU: make return value of mmio page fault handler more readable

2013-06-10 Thread Gleb Natapov
On Fri, Jun 07, 2013 at 04:51:25PM +0800, Xiao Guangrong wrote: > Define some meaningful names instead of raw code > > Signed-off-by: Xiao Guangrong > --- > arch/x86/kvm/mmu.c | 15 +-- > arch/x86/kvm/mmu.h | 14 ++ > arch/x86/kvm/vmx.c | 4 ++-- > 3 files changed, 21 in

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

2013-06-10 Thread Gleb Natapov
On Mon, Jun 10, 2013 at 06:30:42PM +0900, Yoshihiro YUNOMAE wrote: > Hi Gleb, > > (2013/06/09 20:14), Gleb Natapov wrote: > >On Fri, Jun 07, 2013 at 02:22:22PM +0900, Yoshihiro YUNOMAE wrote: > >>(2013/06/06 20:33), Gleb Natapov wrote: > >>>On Wed, Jun 0

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

2013-06-10 Thread Gleb Natapov
On Mon, Jun 10, 2013 at 11:04:24AM -0300, Marcelo Tosatti wrote: > On Mon, Jun 10, 2013 at 01:05:05PM +0300, Gleb Natapov wrote: > > On Mon, Jun 10, 2013 at 06:30:42PM +0900, Yoshihiro YUNOMAE wrote: > > > Hi Gleb, > > > > > > (2013/06/09 20:14), Gleb Natapov w

Re: [PATCH v3 0/6] KVM: MMU: fast invalidate all mmio sptes

2013-06-10 Thread Gleb Natapov
On Mon, Jun 10, 2013 at 10:43:52PM +0900, Takuya Yoshikawa wrote: > On Mon, 10 Jun 2013 16:39:37 +0800 > Xiao Guangrong wrote: > > > On 06/10/2013 03:56 PM, Gleb Natapov wrote: > > > On Fri, Jun 07, 2013 at 04:51:22PM +0800, Xiao Guangrong wrote: > > > &g

Re: [PATCH 3/4] PF: Additional flag for direct page fault inject

2013-06-10 Thread Gleb Natapov
On Mon, Jun 10, 2013 at 02:03:47PM +0200, Dominik Dingel wrote: > On some architectures, as on s390x we may want to be able to directly inject > notifications to the guest in case of a swapped in page. Also on s390x > there is no need to go from gfn to hva as by calling gmap_fault we already > have

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

2013-06-10 Thread Gleb Natapov
On Mon, Jun 10, 2013 at 05:28:23PM -0300, Marcelo Tosatti wrote: > On Mon, Jun 10, 2013 at 07:38:34PM +0300, Gleb Natapov wrote: > > > Guest traces contain vcpu number and not pid (because guest is unaware > > > of host PID). > > > > > No, guest trace is just

Re: [PATCH v3 3/6] KVM: MMU: make return value of mmio page fault handler more readable

2013-06-11 Thread Gleb Natapov
On Mon, Jun 10, 2013 at 10:16:04PM +0900, Takuya Yoshikawa wrote: > On Mon, 10 Jun 2013 10:57:50 +0300 > Gleb Natapov wrote: > > > On Fri, Jun 07, 2013 at 04:51:25PM +0800, Xiao Guangrong wrote: > > > > + > > > +/* > > > + * R

[GIT PULL] KVM fixes for 3.10-rc5

2013-06-11 Thread Gleb Natapov
Linus, Please pull from git://git.kernel.org/pub/scm/virt/kvm/kvm.git fixes To receive the following KVM bug fixes. There is one more fix for MIPS KVM ABI here, MIPS and PPC build breakage fixes and a couple of PPC bug fixes. David Daney (2): kvm: Add definition of KVM_REG_MIPS mi

Re: [PATCH] x86/kvm/emulate.c: simplify NOP (opcode 0x90) check

2013-07-04 Thread Gleb Natapov
On Thu, Jul 04, 2013 at 10:58:29AM +0200, Denys Vlasenko wrote: > The check sits in switch() statement which itself can check > for opcode 0x90 far more efficiently. > > On assembler level, this change simply eliminates the following > bit of code: > > 4c 8b a3 d8 00 00 00mov0xd8(%rbx),%r

Re: [PATCH] x86/kvm/emulate.c: simplify NOP (opcode 0x90) check

2013-07-04 Thread Gleb Natapov
On Thu, Jul 04, 2013 at 01:06:16PM +0200, Denys Vlasenko wrote: > On 07/04/2013 11:13 AM, Gleb Natapov wrote: > > On Thu, Jul 04, 2013 at 10:58:29AM +0200, Denys Vlasenko wrote: > >> The check sits in switch() statement which itself can check > >> for opcode 0x90 far mor

Re: [PATCH v2] x86/kvm/emulate.c: simplify NOP (opcode 0x90) check

2013-07-04 Thread Gleb Natapov
Please send kvm patches to k...@vger.kernel.org too. On Thu, Jul 04, 2013 at 01:27:00PM +0200, Denys Vlasenko wrote: > We do not need to check for reg == RAX for opcodes 0x91...0x97. > The is no reason to optimize here. This is not performance sensitive path, far from it. If not for "clear high b

Re: [PATCH 2/4] PF: Move architecture specifics to the backends

2013-07-07 Thread Gleb Natapov
On Fri, Jul 05, 2013 at 10:55:52PM +0200, Dominik Dingel wrote: > Current common codes uses PAGE_OFFSET to indicate a bad host virtual address. > As this check won't work on architectures that don't map kernel and user > memory > into the same address space (e.g. s390), it is moved into architctur

Re: [PATCH 3/4] PF: Provide additional direct page notification

2013-07-07 Thread Gleb Natapov
On Fri, Jul 05, 2013 at 10:55:53PM +0200, Dominik Dingel wrote: > By setting a Kconfig option, the architecture can control when > guest notifications will be presented by the apf backend. > So there is the default batch mechanism, working as before, where the vcpu > thread > should pull in this i

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

2013-06-26 Thread Gleb Natapov
On Wed, Jun 26, 2013 at 01:37:45PM +0200, Andrew Jones wrote: > On Wed, Jun 26, 2013 at 02:15:26PM +0530, Raghavendra K T wrote: > > On 06/25/2013 08:20 PM, Andrew Theurer wrote: > > >On Sun, 2013-06-02 at 00:51 +0530, Raghavendra K T wrote: > > >>This series replaces the existing paravirtualized s

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

2013-06-26 Thread Gleb Natapov
On Wed, Jun 26, 2013 at 07:10:21PM +0530, Raghavendra K T wrote: > On 06/26/2013 06:22 PM, Gleb Natapov wrote: > >On Wed, Jun 26, 2013 at 01:37:45PM +0200, Andrew Jones wrote: > >>On Wed, Jun 26, 2013 at 02:15:26PM +0530, Raghavendra K T wrote: > >>>On 06/25/2013

Re: [PATCH v3 4/6] KVM: MMU: fast invalidate all mmio sptes

2013-06-27 Thread Gleb Natapov
On Fri, Jun 07, 2013 at 04:51:26PM +0800, Xiao Guangrong wrote: > This patch tries to introduce a very simple and scale way to invalidate > all mmio sptes - it need not walk any shadow pages and hold mmu-lock > > KVM maintains a global mmio valid generation-number which is stored in > kvm->memslot

Re: [PATCH v3 4/6] KVM: MMU: fast invalidate all mmio sptes

2013-06-27 Thread Gleb Natapov
On Thu, Jun 27, 2013 at 11:29:00AM +0300, Gleb Natapov wrote: > On Fri, Jun 07, 2013 at 04:51:26PM +0800, Xiao Guangrong wrote: > > This patch tries to introduce a very simple and scale way to invalidate > > all mmio sptes - it need not walk any shadow pages and hold mmu-lo

Re: [PATCH v3 4/6] KVM: MMU: fast invalidate all mmio sptes

2013-06-27 Thread Gleb Natapov
On Thu, Jun 27, 2013 at 12:01:10PM +0300, Gleb Natapov wrote: > On Thu, Jun 27, 2013 at 11:29:00AM +0300, Gleb Natapov wrote: > > On Fri, Jun 07, 2013 at 04:51:26PM +0800, Xiao Guangrong wrote: > > > This patch tries to introduce a very simple and scale way to invalidate > &g

Re: [PATCH v3 4/6] KVM: MMU: fast invalidate all mmio sptes

2013-06-27 Thread Gleb Natapov
On Thu, Jun 27, 2013 at 12:14:24PM +0300, Gleb Natapov wrote: > On Thu, Jun 27, 2013 at 12:01:10PM +0300, Gleb Natapov wrote: > > On Thu, Jun 27, 2013 at 11:29:00AM +0300, Gleb Natapov wrote: > > > On Fri, Jun 07, 2013 at 04:51:26PM +0800, Xiao Guangrong wrote: > >

Re: [PATCH v3 4/6] KVM: MMU: fast invalidate all mmio sptes

2013-06-27 Thread Gleb Natapov
On Thu, Jun 27, 2013 at 05:50:08PM +0800, Xiao Guangrong wrote: > On 06/27/2013 05:21 PM, Gleb Natapov wrote: > > On Thu, Jun 27, 2013 at 12:14:24PM +0300, Gleb Natapov wrote: > >> On Thu, Jun 27, 2013 at 12:01:10PM +0300, Gleb Natapov wrote: > >>> On Thu, Jun 27,

Re: [PATCH v3 4/6] KVM: MMU: fast invalidate all mmio sptes

2013-06-27 Thread Gleb Natapov
On Thu, Jun 27, 2013 at 07:05:20PM +0800, Xiao Guangrong wrote: > On 06/27/2013 06:19 PM, Gleb Natapov wrote: > > On Thu, Jun 27, 2013 at 05:50:08PM +0800, Xiao Guangrong wrote: > >> On 06/27/2013 05:21 PM, Gleb Natapov wrote: > >>> On Thu, Jun 27, 2013 at 12:14:

Re: [PATCH] KVM: allow host header to be included even for !CONFIG_KVM

2013-03-21 Thread Gleb Natapov
On Thu, Mar 21, 2013 at 01:42:34PM -0500, Scott Wood wrote: > On 03/21/2013 09:27:14 AM, Kevin Hilman wrote: > >Gleb Natapov writes: > > > >> On Wed, Mar 20, 2013 at 06:58:41PM -0500, Scott Wood wrote: > >>> On 03/14/2013 07:13:46 PM, Kevin Hilman wrote: >

Re: [PATCH] KVM: allow host header to be included even for !CONFIG_KVM

2013-03-21 Thread Gleb Natapov
On Thu, Mar 21, 2013 at 02:33:13PM -0500, Scott Wood wrote: > On 03/21/2013 02:16:00 PM, Gleb Natapov wrote: > >On Thu, Mar 21, 2013 at 01:42:34PM -0500, Scott Wood wrote: > >> On 03/21/2013 09:27:14 AM, Kevin Hilman wrote: > >> >Gleb Natapov writes: > >>

Re: [PATCH] KVM: fix powerpc build error for !CONFIG_KVM

2013-03-22 Thread Gleb Natapov
On Fri, Mar 22, 2013 at 02:35:50PM +1100, Stephen Rothwell wrote: > Fixes these build error when CONFIG_KVM is not defined: > > In file included from arch/powerpc/include/asm/kvm_ppc.h:33:0, > from arch/powerpc/kernel/setup_64.c:67: > arch/powerpc/include/asm/kvm_book3s.h:65:20: e

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

2013-03-22 Thread Gleb Natapov
On Fri, Mar 22, 2013 at 07:10:44PM +0800, Xiao Guangrong wrote: > On 03/22/2013 06:54 PM, Marcelo Tosatti wrote: > > >> > >>> > >>> And then have codepaths that nuke shadow pages break from the spinlock, > >> > >> I think this is not needed any more. We can let mmu_notify use the > >> generation

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

2013-03-22 Thread Gleb Natapov
On Fri, Mar 22, 2013 at 07:39:24PM +0800, Xiao Guangrong wrote: > On 03/22/2013 07:28 PM, Gleb Natapov wrote: > > On Fri, Mar 22, 2013 at 07:10:44PM +0800, Xiao Guangrong wrote: > >> On 03/22/2013 06:54 PM, Marcelo Tosatti wrote: > >> > >>>> > >>&

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

2013-03-22 Thread Gleb Natapov
On Fri, Mar 22, 2013 at 08:03:04PM +0800, Xiao Guangrong wrote: > On 03/22/2013 07:47 PM, Gleb Natapov wrote: > > On Fri, Mar 22, 2013 at 07:39:24PM +0800, Xiao Guangrong wrote: > >> On 03/22/2013 07:28 PM, Gleb Natapov wrote: > >>> On Fri, Mar 22, 2013 at 07:10:44

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

2013-03-22 Thread Gleb Natapov
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, Xiao Guangrong wrote: > >> On 03/22/2013 07:47 PM, Gleb Natapov wrote: > >>> On Fri, Mar 22, 2013 at 07:39:24

Re: [PATCH] KVM: allow host header to be included even for !CONFIG_KVM

2013-03-24 Thread Gleb Natapov
On Thu, Mar 21, 2013 at 05:02:15PM -0700, Kevin Hilman wrote: > Gleb Natapov writes: > > > On Thu, Mar 21, 2013 at 02:33:13PM -0500, Scott Wood wrote: > >> On 03/21/2013 02:16:00 PM, Gleb Natapov wrote: > >> >On Thu, Mar 21, 2013 at 01:42:34PM -0500, Scott Wood w

Re: [PATCH] KVM: allow host header to be included even for !CONFIG_KVM

2013-03-24 Thread Gleb Natapov
On Sun, Mar 24, 2013 at 02:44:26PM +0100, Frederic Weisbecker wrote: > 2013/3/21 Gleb Natapov : > > Isn't is simpler for kernel/context_tracking.c to define empty > > __guest_enter()/__guest_exit() if !CONFIG_KVM. > > That doesn't look right. Off-cases are usu

Re: [PATCH] remove sched notifier for cross-cpu migrations

2013-07-14 Thread Gleb Natapov
On Wed, Jul 10, 2013 at 10:21:57PM -0300, Marcelo Tosatti wrote: > > Linux as a guest on KVM hypervisor, the only user of the pvclock > vsyscall interface, does not require notification on task migration > because: > > 1. cpu ID number maps 1:1 to per-CPU pvclock time info. > 2. per-CPU pv

Re: [PATCH RFC V10 15/18] kvm : Paravirtual ticketlocks support for linux guests running on KVM hypervisor

2013-07-14 Thread Gleb Natapov
On Mon, Jun 24, 2013 at 06:13:42PM +0530, Raghavendra K T wrote: > kvm : Paravirtual ticketlocks support for linux guests running on KVM > hypervisor > > From: Srivatsa Vaddagiri > > During smp_boot_cpus paravirtualied KVM guest detects if the hypervisor has > required feature (KVM_FEATURE_PV_

Re: [PATCH RFC V10 16/18] kvm hypervisor : Simplify kvm_for_each_vcpu with kvm_irq_delivery_to_apic

2013-07-14 Thread Gleb Natapov
should > find some other way or go back to old method. > > Suggested-by: Gleb Natapov > Signed-off-by: Raghavendra K T > --- > arch/x86/kvm/lapic.c |5 - > arch/x86/kvm/x86.c | 25 ++--- > 2 files changed, 10 insertions(+), 20 deletions(-

Re: [PATCH RFC V10 12/18] kvm hypervisor : Add a hypercall to KVM hypervisor to support pv-ticketlocks

2013-07-14 Thread Gleb Natapov
On Mon, Jun 24, 2013 at 06:13:04PM +0530, Raghavendra K T wrote: > kvm hypervisor : Add a hypercall to KVM hypervisor to support pv-ticketlocks > > From: Srivatsa Vaddagiri > > kvm_hc_kick_cpu allows the calling vcpu to kick another vcpu out of halt > state. > the presence of these hypercalls i

Re: [PATCH RFC V10 18/18] kvm hypervisor: Add directed yield in vcpu block path

2013-07-14 Thread Gleb Natapov
On Mon, Jun 24, 2013 at 06:14:15PM +0530, Raghavendra K T wrote: > kvm hypervisor: Add directed yield in vcpu block path > > From: Raghavendra K T > > We use the improved PLE handler logic in vcpu block patch for > scheduling rather than plain schedule, so that we can make > intelligent decision

Re: [PATCH RFC V10 15/18] kvm : Paravirtual ticketlocks support for linux guests running on KVM hypervisor

2013-07-15 Thread Gleb Natapov
On Mon, Jul 15, 2013 at 03:20:06PM +0530, Raghavendra K T wrote: > On 07/14/2013 06:42 PM, Gleb Natapov wrote: > >On Mon, Jun 24, 2013 at 06:13:42PM +0530, Raghavendra K T wrote: > >>kvm : Paravirtual ticketlocks support for linux guests running on KVM > >>hypervi

Re: [PATCH RFC V10 16/18] kvm hypervisor : Simplify kvm_for_each_vcpu with kvm_irq_delivery_to_apic

2013-07-15 Thread Gleb Natapov
On Mon, Jul 15, 2013 at 09:06:13PM +0530, Raghavendra K T wrote: > On 07/14/2013 06:54 PM, Gleb Natapov wrote: > >On Mon, Jun 24, 2013 at 06:13:53PM +0530, Raghavendra K T wrote: > >>Simplify kvm_for_each_vcpu with kvm_irq_delivery_to_apic > >> > >>From: Raghav

Re: [PATCH RFC V10 15/18] kvm : Paravirtual ticketlocks support for linux guests running on KVM hypervisor

2013-07-15 Thread Gleb Natapov
On Tue, Jul 16, 2013 at 09:07:53AM +0530, Raghavendra K T wrote: > On 07/15/2013 04:06 PM, Gleb Natapov wrote: > >On Mon, Jul 15, 2013 at 03:20:06PM +0530, Raghavendra K T wrote: > >>On 07/14/2013 06:42 PM, Gleb Natapov wrote: > >>>On Mon, Jun 24, 2013 at 06:13:42P

Re: [PATCH RFC V10 15/18] kvm : Paravirtual ticketlocks support for linux guests running on KVM hypervisor

2013-07-16 Thread Gleb Natapov
On Tue, Jul 16, 2013 at 05:48:52PM +0200, Peter Zijlstra wrote: > On Tue, Jul 16, 2013 at 09:02:15AM +0300, Gleb Natapov wrote: > > BTW can NMI handler take spinlocks? > > No -- that is, yes you can using trylock, but you still shouldn't. > Great new

Re: [PATCH RFC V10 15/18] kvm : Paravirtual ticketlocks support for linux guests running on KVM hypervisor

2013-07-17 Thread Gleb Natapov
On Wed, Jul 17, 2013 at 12:12:35AM +0530, Raghavendra K T wrote: >> I do not think it is very rare to get interrupt between >> local_irq_restore() and halt() under load since any interrupt that >> occurs between local_irq_save() and local_irq_restore() will be >> delivered >> immediately after loca

Re: [PATCH RFC V10 15/18] kvm : Paravirtual ticketlocks support for linux guests running on KVM hypervisor

2013-07-17 Thread Gleb Natapov
On Wed, Jul 17, 2013 at 03:35:37PM +0530, Raghavendra K T wrote: > >>Instead of halt we started with a sleep hypercall in those > >> versions. Changed to halt() once Avi suggested to reuse existing sleep. > >> > >>If we use older hypercall with few changes like below: > >> > >>kvm_pv_wait_for_kick

Re: [PATCH RFC V10 15/18] kvm : Paravirtual ticketlocks support for linux guests running on KVM hypervisor

2013-07-17 Thread Gleb Natapov
On Wed, Jul 17, 2013 at 06:25:05PM +0530, Raghavendra K T wrote: > On 07/17/2013 06:15 PM, Gleb Natapov wrote: > >On Wed, Jul 17, 2013 at 03:35:37PM +0530, Raghavendra K T wrote: > >>>>Instead of halt we started with a sleep hypercall in those > >>>> version

Re: [PATCH RFC V10 15/18] kvm : Paravirtual ticketlocks support for linux guests running on KVM hypervisor

2013-07-17 Thread Gleb Natapov
On Wed, Jul 17, 2013 at 07:43:01PM +0530, Raghavendra K T wrote: > On 07/17/2013 06:55 PM, Gleb Natapov wrote: > >On Wed, Jul 17, 2013 at 06:25:05PM +0530, Raghavendra K T wrote: > >>On 07/17/2013 06:15 PM, Gleb Natapov wrote: > >>>On Wed, Jul 17, 2013 at 03:35:37P

Re: [PATCH RFC V10 15/18] kvm : Paravirtual ticketlocks support for linux guests running on KVM hypervisor

2013-07-17 Thread Gleb Natapov
On Wed, Jul 17, 2013 at 08:25:19PM +0530, Raghavendra K T wrote: > On 07/17/2013 08:14 PM, Gleb Natapov wrote: > >On Wed, Jul 17, 2013 at 07:43:01PM +0530, Raghavendra K T wrote: > >>On 07/17/2013 06:55 PM, Gleb Natapov wrote: > >>>On Wed, Jul 17, 2013 at 06:25:05P

Re: commit f8f559422b (KVM: MMU: fast invalidate all mmio sptes) causes hang

2013-07-17 Thread Gleb Natapov
On Wed, Jul 17, 2013 at 06:32:15PM +0200, Markus Trippelsdorf wrote: > The following commit: > commit f8f559422b6c6a05469dfde614b67789b6142cb5 > Author: Xiao Guangrong > Date: Fri Jun 7 16:51:26 2013 +0800 > > KVM: MMU: fast invalidate all mmio sptes > > causes my kvm qemu qcow2 images

Re: commit f8f559422b (KVM: MMU: fast invalidate all mmio sptes) causes hang

2013-07-17 Thread Gleb Natapov
On Wed, Jul 17, 2013 at 08:42:26PM +0200, Markus Trippelsdorf wrote: > On 2013.07.18 at 01:25 +0800, Xiao Guangrong wrote: > > Hi Markus, > > > > Thanks for your report! I am downloading the ubuntu iso and will try to > > reproducible it. > > > > Could you please enable these tracepoints: > > kv

Re: commit f8f559422b (KVM: MMU: fast invalidate all mmio sptes) causes hang

2013-07-17 Thread Gleb Natapov
On Wed, Jul 17, 2013 at 09:00:29PM +0200, Markus Trippelsdorf wrote: > > > 10346403 qemu-system-x86-1403 [001] 1451.422260: check_mmio_spte: > > > spte fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0 > > > ... Can you trace only this event and record stack information: trace-cmd re

Re: commit f8f559422b (KVM: MMU: fast invalidate all mmio sptes) causes hang

2013-07-17 Thread Gleb Natapov
On Thu, Jul 18, 2013 at 03:07:11AM +0800, Xiao Guangrong wrote: > Ouch! > > The guest is hang when boot from ubuntu iso, i bisected the code and found it > is caused by: > > cad55f1aed000db46dfd1b5706707f33624d8604 is the first bad commit > commit cad55f1aed000db46dfd1b5706707f33624d8604 > Autho

Re: [PATCH] KVM: MMU: avoid fast page fault fixing mmio page fault

2013-07-17 Thread Gleb Natapov
On Thu, Jul 18, 2013 at 12:52:37PM +0800, Xiao Guangrong wrote: > Currently, fast page fault tries to fix mmio page fault when the > generation number is invalid (spte.gen != kvm.gen) and returns to > guest to retry the fault since it sees the last spte is nonpresent > which causes infinity loop >

Re: [PATCH] KVM: MMU: avoid fast page fault fixing mmio page fault

2013-07-17 Thread Gleb Natapov
On Thu, Jul 18, 2013 at 02:01:47PM +0800, Xiao Guangrong wrote: > On 07/18/2013 01:31 PM, Gleb Natapov wrote: > > On Thu, Jul 18, 2013 at 12:52:37PM +0800, Xiao Guangrong wrote: > >> Currently, fast page fault tries to fix mmio page fault when the > >> generation

Re: [PATCH] KVM: MMU: avoid fast page fault fixing mmio page fault

2013-07-17 Thread Gleb Natapov
On Thu, Jul 18, 2013 at 02:25:19PM +0800, Xiao Guangrong wrote: > On 07/18/2013 02:06 PM, Gleb Natapov wrote: > > On Thu, Jul 18, 2013 at 02:01:47PM +0800, Xiao Guangrong wrote: > >> On 07/18/2013 01:31 PM, Gleb Natapov wrote: > >>> On Thu, Jul 18, 2013 at 12:52:37

Re: [PATCH RFC V11 15/18] kvm : Paravirtual ticketlocks support for linux guests running on KVM hypervisor

2013-07-30 Thread Gleb Natapov
On Tue, Jul 30, 2013 at 10:13:12PM +0530, Raghavendra K T wrote: > On 07/25/2013 03:08 PM, Raghavendra K T wrote: > >On 07/25/2013 02:45 PM, Gleb Natapov wrote: > >>On Thu, Jul 25, 2013 at 02:47:37PM +0530, Raghavendra K T wrote: > >>>On 07/24/2013 06:06 PM, Raghave

Re: [PATCH] KVM: introduce __kvm_io_bus_sort_cmp

2013-07-31 Thread Gleb Natapov
On Tue, Jul 30, 2013 at 05:05:37PM +0200, Paolo Bonzini wrote: > kvm_io_bus_sort_cmp is used also directly, not just as a callback for > sort and bsearch. In these cases, it is handy to have a type-safe > variant. This patch introduces such a variant, __kvm_io_bus_sort_cmp, > and uses it througho

Re: [PATCH 1/3] KVM: x86: rename EMULATE_DO_MMIO

2013-07-31 Thread Gleb Natapov
On Tue, Jul 30, 2013 at 05:11:34PM +0200, Paolo Bonzini wrote: > The next patch will reuse it for other userspace exits than MMIO, > namely debug events. > > Signed-off-by: Paolo Bonzini > --- > arch/x86/include/asm/kvm_host.h | 4 ++-- > arch/x86/kvm/mmu.c | 2 +- > arch/x86/kvm/vm

Re: [PATCH 3/3] KVM: x86: handle singlestep during emulation

2013-07-31 Thread Gleb Natapov
On Tue, Jul 30, 2013 at 05:11:36PM +0200, Paolo Bonzini wrote: > This lets debugging work better during emulation of invalid > guest state. > > This time the check is done after emulation, but before writeback > of the flags; we need to check the flags *before* execution of the > instruction, we c

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

2013-07-31 Thread Gleb Natapov
On Tue, Jul 30, 2013 at 05:11:35PM +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. > Not EMUL

Re: [PATCH 3/3] KVM: x86: handle singlestep during emulation

2013-07-31 Thread Gleb Natapov
On Wed, Jul 31, 2013 at 06:30:31AM -0400, Paolo Bonzini wrote: > > - Gleb Natapov wrote: > > On Tue, Jul 30, 2013 at 05:11:36PM +0200, Paolo Bonzini wrote: > > > This lets debugging work better during emulation of invalid > > > guest state. > > >

Re: [PATCH RFC V11 15/18] kvm : Paravirtual ticketlocks support for linux guests running on KVM hypervisor

2013-08-01 Thread Gleb Natapov
On Thu, Aug 01, 2013 at 01:08:47PM +0530, Raghavendra K T wrote: > On 07/31/2013 11:54 AM, Gleb Natapov wrote: > >On Tue, Jul 30, 2013 at 10:13:12PM +0530, Raghavendra K T wrote: > >>On 07/25/2013 03:08 PM, Raghavendra K T wrote: > >>>On 07/25/2013 02:45 PM, Gleb Na

Re: [PATCH RFC V11 15/18] kvm : Paravirtual ticketlocks support for linux guests running on KVM hypervisor

2013-08-02 Thread Gleb Natapov
On Fri, Aug 02, 2013 at 11:25:39AM +0200, Ingo Molnar wrote: > > Ingo, > > > > Do you have any concerns reg this series? please let me know if this > > looks good now to you. > > I'm inclined to NAK it for excessive quotation - who knows how many people > left the discussion in disgust? Was it

Re: [QUERY] lguest64

2013-08-04 Thread Gleb Natapov
On Fri, Aug 02, 2013 at 03:09:34PM -0400, Konrad Rzeszutek Wilk wrote: > On Wed, Jul 31, 2013 at 06:25:04AM -0700, H. Peter Anvin wrote: > > On 07/31/2013 06:17 AM, Konrad Rzeszutek Wilk wrote: > > >> > > >> The big problem with pvops is that they are a permanent tax on future > > >> development --

Re: [PATCH] KVM: MMU: fix check the reserved bits on the gpte of L2

2013-08-04 Thread Gleb Natapov
ng @mmu instead since it is adapted to the current mmu mode > automatically > > The bug can be triggered when nested npt is used and L1 guest and L2 guest > use different mmu mode > > Reported-by: Jan Kiszka > Signed-off-by: Xiao Guangrong Reviewed-by: Gleb Natapov >

Re: [PATCH 1/3] mips/kvm: Improve code formatting in arch/mips/kvm/kvm_locore.S

2013-08-05 Thread Gleb Natapov
On Mon, Aug 05, 2013 at 03:21:57PM +0200, Ralf Baechle wrote: > On Mon, Aug 05, 2013 at 02:17:01PM +0100, James Hogan wrote: > > > > > On 01/08/13 21:22, David Daney wrote: > > > From: David Daney > > > > > > No code changes, just reflowing some comments and consistently using > > > tabs and sp

Re: [PATCH 1/3] mips/kvm: Improve code formatting in arch/mips/kvm/kvm_locore.S

2013-08-05 Thread Gleb Natapov
On Mon, Aug 05, 2013 at 07:06:10PM +0200, Ralf Baechle wrote: > On Mon, Aug 05, 2013 at 04:43:27PM +0300, Gleb Natapov wrote: > > Date: Mon, 5 Aug 2013 16:43:27 +0300 > > From: Gleb Natapov > > To: Ralf Baechle > > Cc: James Hogan , David Daney > >

Re: [PATCH] remove sched notifier for cross-cpu migrations

2013-08-23 Thread Gleb Natapov
On Fri, Aug 23, 2013 at 12:22:30PM +0200, Peter Zijlstra wrote: > On Wed, Jul 10, 2013 at 10:21:57PM -0300, Marcelo Tosatti wrote: > > > > Linux as a guest on KVM hypervisor, the only user of the pvclock > > vsyscall interface, does not require notification on task migration > > because: >

Re: [PATCH V12 0/14] Paravirtualized ticket spinlocks

2013-08-07 Thread Gleb Natapov
On Wed, Aug 07, 2013 at 08:50:12PM -0400, Konrad Rzeszutek Wilk wrote: > On Wed, Aug 07, 2013 at 12:15:21PM +0530, Raghavendra K T wrote: > > On 08/07/2013 10:18 AM, H. Peter Anvin wrote: > > >>Please let me know, if I should rebase again. > > >> > > > > > >tip:master is not a stable branch; it is

module unloading hangs after using ftrace with 3.11.0-rc1

2013-07-21 Thread Gleb Natapov
Hi Steven, After tracing KVM using trace-cmd with kvm trace points enables I tried to unload kvm modules and rmmod hanged in tracing_reset_all_online_cpus: [ 1234.665038] rmmod D 0 7819 7664 0x [ 1234.665038] 880129661d38 0086 880374c

Re: module unloading hangs after using ftrace with 3.11.0-rc1

2013-07-21 Thread Gleb Natapov
On Sun, Jul 21, 2013 at 02:52:16PM +0300, Gleb Natapov wrote: > Hi Steven, > > After tracing KVM using trace-cmd with kvm trace points enables I tried > to unload kvm modules and rmmod hanged in tracing_reset_all_online_cpus: > > [ 1234.665038] rmmod D ff

Re: [PATCH 1/4] x86: introduce hypervisor_cpuid_base()

2013-07-23 Thread Gleb Natapov
stence of > hypervisor. > Looks good to me. Since this touches common code, kvm and xen I expect this to be taken via the tip tree, correct? > Cc: Thomas Gleixner > Cc: Ingo Molnar > Cc: "H. Peter Anvin" > Cc: "Paolo Bonzini" > Cc: Gleb Natapov

Re: [PATCH RFC V11 15/18] kvm : Paravirtual ticketlocks support for linux guests running on KVM hypervisor

2013-07-23 Thread Gleb Natapov
On Mon, Jul 22, 2013 at 11:50:16AM +0530, Raghavendra K T wrote: > +static void kvm_lock_spinning(struct arch_spinlock *lock, __ticket_t want) > +{ > + struct kvm_lock_waiting *w; > + int cpu; > + u64 start; > + unsigned long flags; > + Why don't you bailout if in nmi here like we d

Re: [PATCH] x86, apic: Enable x2APIC physical when cpu < 256 native

2013-07-23 Thread Gleb Natapov
On Tue, Jul 23, 2013 at 09:24:45PM -0700, Yinghai Lu wrote: > On Thu, Jul 11, 2013 at 6:22 PM, Youquan Song wrote: > > x2APIC extends APICID from 8 bits to 32 bits, but the device interrupt > > routed > > from IOAPIC or delivered in MSI mode will keep 8 bits destination APICID. > > In order to su

Re: [PATCH RFC V11 15/18] kvm : Paravirtual ticketlocks support for linux guests running on KVM hypervisor

2013-07-24 Thread Gleb Natapov
On Wed, Jul 24, 2013 at 03:15:50PM +0530, Raghavendra K T wrote: > On 07/23/2013 08:37 PM, Gleb Natapov wrote: > >On Mon, Jul 22, 2013 at 11:50:16AM +0530, Raghavendra K T wrote: > >>+static void kvm_lock_spinning(struct arch_spinlock *loc

Re: [PATCH RFC V11 15/18] kvm : Paravirtual ticketlocks support for linux guests running on KVM hypervisor

2013-07-24 Thread Gleb Natapov
On Wed, Jul 24, 2013 at 05:30:20PM +0530, Raghavendra K T wrote: > On 07/24/2013 04:09 PM, Gleb Natapov wrote: > >On Wed, Jul 24, 2013 at 03:15:50PM +0530, Raghavendra K T wrote: > >>On 07/23/2013 08:37 PM, Gleb Natapov wrote: > >>>On Mon, Jul 22, 2013 at 11:50:16A

Re: [PATCH RFC V11 15/18] kvm : Paravirtual ticketlocks support for linux guests running on KVM hypervisor

2013-07-25 Thread Gleb Natapov
On Thu, Jul 25, 2013 at 02:47:37PM +0530, Raghavendra K T wrote: > On 07/24/2013 06:06 PM, Raghavendra K T wrote: > >On 07/24/2013 05:36 PM, Gleb Natapov wrote: > >>On Wed, Jul 24, 2013 at 05:30:20PM +0530, Raghavendra K T wrote: > >>>On 07/24/2013 04:09 PM, Gleb Na

Re: [PATCH v13 0/8] pv event interface between host and guest

2013-03-03 Thread Gleb Natapov
On Thu, Feb 28, 2013 at 08:13:10PM +0800, Hu Tao wrote: > This series implements a new interface, kvm pv event, to notify host when > some events happen in guest. Right now there is one supported event: guest > panic. > What other event do you have in mind? Is interface generic enough to accommoda

Re: [PATCH v12 rebased] kvm: notify host when the guest is panicked

2013-03-03 Thread Gleb Natapov
On Fri, Mar 01, 2013 at 09:03:12PM -0300, Marcelo Tosatti wrote: > On Thu, Feb 28, 2013 at 04:54:25PM +0800, Hu Tao wrote: > > > > diff --git a/arch/x86/include/uapi/asm/kvm_para.h > > > > b/arch/x86/include/uapi/asm/kvm_para.h > > > > index 06fdbd9..c15ef33 100644 > > > > --- a/arch/x86/include/u

Re: [PATCH v13 0/8] pv event interface between host and guest

2013-03-04 Thread Gleb Natapov
On Mon, Mar 04, 2013 at 11:28:05AM +0100, Paolo Bonzini wrote: > Il 04/03/2013 11:21, Gleb Natapov ha scritto: > >> > Just to clarify it for Hu Tao, the read from a random ioport is how the > >> > ACPI code will detect presence of the device. > >> > > &g

Re: [PATCH v13 0/8] pv event interface between host and guest

2013-03-04 Thread Gleb Natapov
On Mon, Mar 04, 2013 at 11:49:07AM +0100, Paolo Bonzini wrote: > Il 04/03/2013 11:43, Gleb Natapov ha scritto: > > > Anyhow, this does not apply to the next submission of this series. I > > > think we can agree to the compromise of using ACPI but still read the > > >

Re: [PATCH v13 0/8] pv event interface between host and guest

2013-03-04 Thread Gleb Natapov
On Mon, Mar 04, 2013 at 11:05:37AM +0100, Paolo Bonzini wrote: > > Guest uses acpi_get_devices() to discover a platform device by > > its name (QEMU0001). Then you put the driver for the platform device > > into drivers/platform/x86/ and QEMU/kvm/Xen all will be able to use it. > > Just to clarif

Re: [PATCH v13 0/8] pv event interface between host and guest

2013-03-04 Thread Gleb Natapov
On Mon, Mar 04, 2013 at 12:10:58PM +0100, Paolo Bonzini wrote: > Il 04/03/2013 11:59, Gleb Natapov ha scritto: > > > I want to make the ioport configurable in the device, but the PIIX and > > > ICH9 (which are what the DSDT is written for) will always use port 0x505. > >

Re: [PATCH v13 0/8] pv event interface between host and guest

2013-03-04 Thread Gleb Natapov
On Mon, Mar 04, 2013 at 12:35:08PM +0100, Paolo Bonzini wrote: > Il 04/03/2013 12:20, Gleb Natapov ha scritto: > > On Mon, Mar 04, 2013 at 12:10:58PM +0100, Paolo Bonzini wrote: > >>> It is additional device that > >>> may or may not be present depending on a comma

Re: [PATCH v12 rebased] kvm: notify host when the guest is panicked

2013-03-04 Thread Gleb Natapov
On Sun, Mar 03, 2013 at 07:29:53PM -0300, Marcelo Tosatti wrote: > On Sun, Mar 03, 2013 at 03:00:22PM +0200, Gleb Natapov wrote: > > On Fri, Mar 01, 2013 at 09:03:12PM -0300, Marcelo Tosatti wrote: > > > On Thu, Feb 28, 2013 at 04:54:25PM +0800, Hu Tao wrote: > > >

Re: [PATCH v12 rebased] kvm: notify host when the guest is panicked

2013-03-04 Thread Gleb Natapov
On Mon, Mar 04, 2013 at 05:43:48PM -0300, Marcelo Tosatti wrote: > On Mon, Mar 04, 2013 at 07:49:13PM +0200, Gleb Natapov wrote: > > On Sun, Mar 03, 2013 at 07:29:53PM -0300, Marcelo Tosatti wrote: > > > On Sun, Mar 03, 2013 at 03:00:22PM +0200, Gleb Natapov wrote: > > >

Re: [PATCH v13 0/8] pv event interface between host and guest

2013-03-06 Thread Gleb Natapov
On Wed, Mar 06, 2013 at 04:46:58PM +0800, Hu Tao wrote: > On Sun, Mar 03, 2013 at 11:17:38AM +0200, Gleb Natapov wrote: > > On Thu, Feb 28, 2013 at 08:13:10PM +0800, Hu Tao wrote: > > > This series implements a new interface, kvm pv event, to notify host when > > >

Re: [PATCH v13 0/8] pv event interface between host and guest

2013-03-06 Thread Gleb Natapov
On Wed, Mar 06, 2013 at 10:07:31AM +0100, Paolo Bonzini wrote: > Il 06/03/2013 09:56, Hu Tao ha scritto: > >> > > >> > Something like this should work (in SeaBIOS's src/acpi-dsdt-isa.dsl): > >> > > >> > Device(PEVT) { > >> > Name(_HID, EisaId("QEMU0001")) > >> > OperationRegio

Re: [PATCH v13 0/8] pv event interface between host and guest

2013-03-06 Thread Gleb Natapov
On Wed, Mar 06, 2013 at 04:48:17AM -0500, Paolo Bonzini wrote: > > > On Wed, Mar 06, 2013 at 10:07:31AM +0100, Paolo Bonzini wrote: > > > Il 06/03/2013 09:56, Hu Tao ha scritto: > > > >> > > > > >> > Something like this should work (in SeaBIOS's > > > >> > src/acpi-dsdt-isa.dsl): > > > >> > > >

Re: [PATCH 00/13] perf: kvm live mode

2013-05-13 Thread Gleb Natapov
On Thu, May 09, 2013 at 08:53:24PM +0800, Xiao Guangrong wrote: > CC kvm list. > > On 05/09/2013 12:31 PM, David Ahern wrote: > > With the consolidation of the open counters code in December 2012 > > (late to the party figuring that out) I think all of the past > > comments on the live mode for pe

Re: [PATCH 0/9] perf: Adding better precise_ip field handling

2013-05-14 Thread Gleb Natapov
On Mon, May 13, 2013 at 09:43:13PM +0200, Ingo Molnar wrote: > Note that at least for user-space, REP MOVS is getting rarer. libc uses > SSE based memcpy/memset variants - which is not miscounted by PEBS. The > kernel still uses REP MOVS - but it's a special case because it cannot > cheaply use

Re: [PATCH v5 3/8] KVM: MMU: fast invalidate all pages

2013-05-16 Thread Gleb Natapov
On Thu, May 16, 2013 at 08:17:48PM +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 shadow page's parent spte list. Particularly, things > become wors

Re: [PATCH v5 3/8] KVM: MMU: fast invalidate all pages

2013-05-16 Thread Gleb Natapov
On Thu, May 16, 2013 at 03:14:35PM +0200, Paolo Bonzini wrote: > Il 16/05/2013 14:43, Gleb Natapov ha scritto: > >> > +restart: > >> > +list_for_each_entry_safe(sp, node, &kvm->arch.active_mmu_pages, > >> > link) { >

Re: [PATCH v5 3/8] KVM: MMU: fast invalidate all pages

2013-05-16 Thread Gleb Natapov
On Thu, May 16, 2013 at 09:25:28PM +0800, Xiao Guangrong wrote: > On 05/16/2013 08:43 PM, Gleb Natapov wrote: > > On Thu, May 16, 2013 at 08:17:48PM +0800, Xiao Guangrong wrote: > >> The current kvm_mmu_zap_all is really slow - it is holding mmu-lock to > >> walk and

Re: [PATCH RFC] kvm: add PV MMIO EVENTFD

2013-04-07 Thread Gleb Natapov
On Thu, Apr 04, 2013 at 04:14:57PM +0300, Gleb Natapov wrote: > > > > > >>> is to move to MMIO only when PIO address space is exhausted. For PCI it > > >>> will be never, for PCI-e it will be after ~16 devices. > > >> > > >> Ok,

<    1   2   3   4   5   6   7   8   >