Re: [PATCH v2 7/9] KVM: MMU: Optimize is_last_gpte()

2012-09-19 Thread Avi Kivity
On 09/18/2012 10:36 AM, Xiao Guangrong wrote: > On 09/16/2012 08:07 PM, Avi Kivity wrote: >> Instead of branchy code depending on level, gpte.ps, and mmu configuration, >> prepare everything in a bitmap during mode changes and look it up during >> runtime. >> >

Re: [PATCH v2 7/9] KVM: MMU: Optimize is_last_gpte()

2012-09-19 Thread Avi Kivity
On 09/19/2012 08:17 PM, Avi Kivity wrote: > On 09/18/2012 10:36 AM, Xiao Guangrong wrote: >> On 09/16/2012 08:07 PM, Avi Kivity wrote: >>> Instead of branchy code depending on level, gpte.ps, and mmu configuration, >>> prepare everything in a bitmap during mode ch

Re: [PATCH v3] kvm/fpu: Enable fully eager restore kvm FPU

2012-09-20 Thread Avi Kivity
On 09/20/2012 04:43 AM, Hao, Xudong wrote: >> -Original Message- >> From: Avi Kivity [mailto:a...@redhat.com] >> Sent: Wednesday, September 19, 2012 6:24 PM >> To: Hao, Xudong >> Cc: Marcelo Tosatti; kvm@vger.kernel.org; Zhang, Xiantao >> Subject: Re: [P

Re: [PATCH v2 3/5] KVM: MMU: cleanup FNAME(page_fault)

2012-09-20 Thread Avi Kivity
On 09/14/2012 12:58 PM, Xiao Guangrong wrote: > Let it return emulate state instead of spte like __direct_map > > Signed-off-by: Xiao Guangrong > --- > arch/x86/kvm/paging_tmpl.h | 28 ++-- > 1 files changed, 10 insertions(+), 18 deletions(-) > > diff --git a/arch/x86/

Re: [PATCH v2 4/5] KVM: MMU: introduce page_fault_start and page_fault_end

2012-09-20 Thread Avi Kivity
On 09/14/2012 12:59 PM, Xiao Guangrong wrote: > Wrap the common operations into these two functions > > Signed-off-by: Xiao Guangrong > --- > arch/x86/kvm/mmu.c | 53 +++ > arch/x86/kvm/paging_tmpl.h | 16 + > 2 files changed, 39 in

Re: [PATCH] Enabling IA32_TSC_ADJUST for guest VM

2012-09-20 Thread Avi Kivity
On 09/19/2012 08:44 PM, Auld, Will wrote: > From 9982bb73460b05c1328068aae047b14b2294e2da Mon Sep 17 00:00:00 2001 > From: Will Auld > Date: Wed, 12 Sep 2012 18:10:56 -0700 > Subject: [PATCH] Enabling IA32_TSC_ADJUST for guest VM > > CPUID.7.0.EBX[1]=1 indicates IA32_TSC_ADJUST MSR 0x3b is suppor

Re: [PATCH] Enabling IA32_TSC_ADJUST for guest VM

2012-09-20 Thread Avi Kivity
On 09/19/2012 08:44 PM, Auld, Will wrote: > @@ -2241,6 +2244,13 @@ static int vmx_set_msr(struct kvm_vcpu *vcpu, u32 > msr_index, u64 data) > } > ret = kvm_set_msr_common(vcpu, msr_index, data); > break; > + case MSR_TSC_ADJUST: > +#define DUMMY 1 > +

Re: [PATCH] KVM: x86: Fix guest debug across vcpu INIT reset

2012-09-20 Thread Avi Kivity
On 09/19/2012 10:38 PM, Jan Kiszka wrote: > If we reset a vcpu on INIT, make sure to not touch dr7 as stored in the > VMCS/VMCB and also switch_db_regs if guest debugging is using hardware > breakpoints. Otherwise, the vcpu will not trigger hardware breakpoints > until userspace issues another KVM_

Re: [PATCHv4] KVM: optimize apic interrupt delivery

2012-09-20 Thread Avi Kivity
On 09/13/2012 05:19 PM, Gleb Natapov wrote: > Most interrupt are delivered to only one vcpu. Use pre-build tables to > find interrupt destination instead of looping through all vcpus. In case > of logical mode loop only through vcpus in a logical cluster irq is sent > to. Applied, thanks. -- er

Re: [PATCH v3] kvm/fpu: Enable fully eager restore kvm FPU

2012-09-23 Thread Avi Kivity
On 09/21/2012 11:47 AM, Hao, Xudong wrote: > > -Original Message- > > From: Avi Kivity [mailto:a...@redhat.com] > > Sent: Thursday, September 20, 2012 5:20 PM > > To: Hao, Xudong > > Cc: Marcelo Tosatti; kvm@vger.kernel.org; Zhang, Xiantao > > Subject:

Re: [PATCH v11] kvm: Add resampling irqfds for level triggered interrupts

2012-09-23 Thread Avi Kivity
On 09/21/2012 08:58 PM, Alex Williamson wrote: > To emulate level triggered interrupts, add a resample option to > KVM_IRQFD. When specified, a new resamplefd is provided that notifies > the user when the irqchip has been resampled by the VM. This may, for > instance, indicate an EOI. Also in th

Re: [PATCH v2] KVM: x86: Fix guest debug across vcpu INIT reset

2012-09-23 Thread Avi Kivity
On 09/21/2012 06:42 AM, Jan Kiszka wrote: > From: Jan Kiszka > > If we reset a vcpu on INIT, we so far overwrote dr7 as provided by > KVM_SET_GUEST_DEBUG, and we also cleared switch_db_regs unconditionally. > > Fix this by saving the dr7 used for guest debugging and calculating the > effective reg

Re: [PATCH v3 0/6] Optimize vcpu->requests processing

2012-09-24 Thread Avi Kivity
On 09/24/2012 07:55 AM, Xiao Guangrong wrote: > On 07/10/2012 01:05 AM, Avi Kivity wrote: >> Currently, any time a request bit is set (not too uncommon) we check all of >> them. >> This patchset optimizes the process slightly by skipping over unset bits >> using >&g

Re: [RFC PATCH] KVM: x86: Skip request checking branches in vcpu_enter_guest() more effectively

2012-09-24 Thread Avi Kivity
On 09/24/2012 08:24 AM, Takuya Yoshikawa wrote: > This is an RFC since I have not done any comparison with the approach > using for_each_set_bit() which can be seen in Avi's work. > > Takuya > --- > > We did a simple test to see which requests we would get at the same time > in vcpu_enter_g

Re: [PATCH v3 0/6] Optimize vcpu->requests processing

2012-09-24 Thread Avi Kivity
On 09/24/2012 12:19 PM, Xiao Guangrong wrote: > On 09/24/2012 05:48 PM, Avi Kivity wrote: >> On 09/24/2012 07:55 AM, Xiao Guangrong wrote: >>> On 07/10/2012 01:05 AM, Avi Kivity wrote: >>>> Currently, any time a request bit is set (not too uncommon) we check all &g

Re: [RFC PATCH] KVM: x86: Skip request checking branches in vcpu_enter_guest() more effectively

2012-09-24 Thread Avi Kivity
On 09/24/2012 09:16 AM, Gleb Natapov wrote: > On Mon, Sep 24, 2012 at 03:24:47PM +0900, Takuya Yoshikawa wrote: >> This is an RFC since I have not done any comparison with the approach >> using for_each_set_bit() which can be seen in Avi's work. >> >> Takuya >> --- >> >> We did a simple test

Re: [RFC PATCH] KVM: x86: Skip request checking branches in vcpu_enter_guest() more effectively

2012-09-24 Thread Avi Kivity
On 09/24/2012 08:59 AM, Xiao Guangrong wrote: > On 09/24/2012 02:24 PM, Takuya Yoshikawa wrote: >> This is an RFC since I have not done any comparison with the approach >> using for_each_set_bit() which can be seen in Avi's work. >> > > Why not compare it? I think for_each_set_bit is better and i

Re: [PATCH v3 0/6] Optimize vcpu->requests processing

2012-09-24 Thread Avi Kivity
On 09/24/2012 01:16 PM, Xiao Guangrong wrote: > On 09/24/2012 06:52 PM, Avi Kivity wrote: >> On 09/24/2012 12:19 PM, Xiao Guangrong wrote: >>> On 09/24/2012 05:48 PM, Avi Kivity wrote: >>>> On 09/24/2012 07:55 AM, Xiao Guangrong wrote: >>>>

Re: [PATCH v4] kvm/fpu: Enable fully eager restore kvm FPU

2012-09-24 Thread Avi Kivity
On 09/24/2012 05:28 AM, Xudong Hao wrote: > Enable KVM FPU fully eager restore, if there is other FPU state which isn't > tracked by CR0.TS bit. > > v4 changes from v3: > - Wrap up some confused code with a clear functio lazy_fpu_allowed() > - Update fpu while update cr4 too. > > v3 changes from

Re: [RFC PATCH] KVM: x86: Skip request checking branches in vcpu_enter_guest() more effectively

2012-09-24 Thread Avi Kivity
On 09/24/2012 04:14 PM, Takuya Yoshikawa wrote: > On Mon, 24 Sep 2012 12:18:15 +0200 > Avi Kivity wrote: > >> On 09/24/2012 08:24 AM, Takuya Yoshikawa wrote: >> > This is an RFC since I have not done any comparison with the approach >> > using for_each_set_bit(

Re: [RFC PATCH] KVM: x86: Skip request checking branches in vcpu_enter_guest() more effectively

2012-09-24 Thread Avi Kivity
On 09/24/2012 04:32 PM, Takuya Yoshikawa wrote: > On Mon, 24 Sep 2012 12:09:00 +0200 > Avi Kivity wrote: > >> > while (vcpu->request) { >> >xchg(vcpu->request, request); >> > >> >for_

Re: [PATCH RFC 2/2] kvm: Be courteous to other VMs in overcommitted scenario in PLE handler

2012-09-24 Thread Avi Kivity
On 09/21/2012 03:00 PM, Raghavendra K T wrote: > From: Raghavendra K T > > When PLE handler fails to find a better candidate to yield_to, it > goes back and does spin again. This is acceptable when we do not > have overcommit. > But in overcommitted scenarios (especially when we have large > numb

Re: [PATCH RFC 1/2] kvm: Handle undercommitted guest case in PLE handler

2012-09-24 Thread Avi Kivity
On 09/21/2012 08:24 PM, Raghavendra K T wrote: > On 09/21/2012 06:32 PM, Rik van Riel wrote: >> On 09/21/2012 08:00 AM, Raghavendra K T wrote: >>> From: Raghavendra K T >>> >>> When total number of VCPUs of system is less than or equal to physical >>> CPUs, >>> PLE exits become costly since each V

Re: [PATCH RFC 2/2] kvm: Be courteous to other VMs in overcommitted scenario in PLE handler

2012-09-24 Thread Avi Kivity
On 09/24/2012 05:34 PM, Peter Zijlstra wrote: > On Mon, 2012-09-24 at 17:26 +0200, Avi Kivity wrote: >> I think this is a no-op these (CFS) days. To get schedule() to do >> anything, you need to wake up a task, or let time pass, or block. >> Otherwise it will see that nothi

Re: [PATCH RFC 0/2] kvm: Improving undercommit,overcommit scenarios in PLE handler

2012-09-24 Thread Avi Kivity
On 09/24/2012 03:54 PM, Peter Zijlstra wrote: > On Mon, 2012-09-24 at 18:59 +0530, Raghavendra K T wrote: >> However Rik had a genuine concern in the cases where runqueue is not >> equally distributed and lockholder might actually be on a different run >> queue but not running. > > Load should ev

Re: [PATCH RFC 2/2] kvm: Be courteous to other VMs in overcommitted scenario in PLE handler

2012-09-24 Thread Avi Kivity
On 09/24/2012 05:52 PM, Peter Zijlstra wrote: > On Mon, 2012-09-24 at 17:43 +0200, Avi Kivity wrote: >> Wouldn't this correspond to the scheduler interrupt firing and causing a >> reschedule? I thought the timer was programmed for exactly the point in >> time that CFS co

Re: [PATCH RFC 1/2] kvm: Handle undercommitted guest case in PLE handler

2012-09-24 Thread Avi Kivity
On 09/24/2012 05:41 PM, Avi Kivity wrote: > >> >> case 2) >> rq1 : vcpu1->wait(lockA) (spinning) >> rq2 : vcpu3 (running) , vcpu2->holding(lockA) [scheduled out] >> >> I agree that checking rq1 length is not proper in this case, and as you &

Re: [PATCH RFC 2/2] kvm: Be courteous to other VMs in overcommitted scenario in PLE handler

2012-09-24 Thread Avi Kivity
On 09/24/2012 06:05 PM, Peter Zijlstra wrote: > On Mon, 2012-09-24 at 17:58 +0200, Avi Kivity wrote: >> There is the TSC deadline timer mode of newer Intels. Programming the >> timer is a simple wrmsr, and it will fire immediately if it already >> expired. Unfortunat

Re: [PATCH RFC 0/2] kvm: Improving undercommit,overcommit scenarios in PLE handler

2012-09-24 Thread Avi Kivity
On 09/24/2012 06:03 PM, Peter Zijlstra wrote: > On Mon, 2012-09-24 at 17:51 +0200, Avi Kivity wrote: >> On 09/24/2012 03:54 PM, Peter Zijlstra wrote: >> > On Mon, 2012-09-24 at 18:59 +0530, Raghavendra K T wrote: >> >> However Rik had a genuine concern in t

Re: [PATCH RFC 2/2] kvm: Be courteous to other VMs in overcommitted scenario in PLE handler

2012-09-24 Thread Avi Kivity
On 09/24/2012 06:13 PM, Peter Zijlstra wrote: > On Mon, 2012-09-24 at 18:10 +0200, Avi Kivity wrote: >> > Its also still a LAPIC write -- disguised as an MSR though :/ >> >> It's probably a whole lot faster though. > > I've been told its not, I hav

Re: [PATCH RFC 1/2] kvm: Handle undercommitted guest case in PLE handler

2012-09-24 Thread Avi Kivity
On 09/24/2012 06:14 PM, Peter Zijlstra wrote: > On Mon, 2012-09-24 at 18:06 +0200, Avi Kivity wrote: >> >> We would probably need a ->sched_exit() preempt notifier to make this >> work. Peter, I know how much you love those, would it be acceptable? > > Where exact

Re: [PATCH RFC 1/2] kvm: Handle undercommitted guest case in PLE handler

2012-09-25 Thread Avi Kivity
On 09/25/2012 09:36 AM, Raghavendra K T wrote: > On 09/24/2012 09:11 PM, Avi Kivity wrote: >> On 09/21/2012 08:24 PM, Raghavendra K T wrote: >>> On 09/21/2012 06:32 PM, Rik van Riel wrote: >>>> On 09/21/2012 08:00 AM, Raghavendra K T wrote: >>>>> From:

Re: [PATCH v4] kvm/fpu: Enable fully eager restore kvm FPU

2012-09-25 Thread Avi Kivity
On 09/25/2012 04:32 AM, Hao, Xudong wrote: > > > > btw, it is clear that long term the fpu will always be eagerly loaded, > > as hosts and guests (and hardware) are updated. At that time it will > > make sense to remove the lazy fpu code entirely. But maybe that time is > > here already, since e

Re: [PATCH RFC 1/2] kvm: Handle undercommitted guest case in PLE handler

2012-09-25 Thread Avi Kivity
On 09/25/2012 10:09 AM, Raghavendra K T wrote: > On 09/24/2012 09:36 PM, Avi Kivity wrote: >> On 09/24/2012 05:41 PM, Avi Kivity wrote: >>> >>>> >>>> case 2) >>>> rq1 : vcpu1->wait(lockA) (spinning) >>>> rq2 : vcpu3 (running) ,

Re: [PATCH RFC 2/2] kvm: Be courteous to other VMs in overcommitted scenario in PLE handler

2012-09-25 Thread Avi Kivity
On 09/24/2012 06:21 PM, Avi Kivity wrote: > On 09/24/2012 06:13 PM, Peter Zijlstra wrote: > > On Mon, 2012-09-24 at 18:10 +0200, Avi Kivity wrote: > >> > Its also still a LAPIC write -- disguised as an MSR though :/ > >> > >> It's probably a whole lot

Re: [PATCH RFC 0/2] kvm: Improving undercommit,overcommit scenarios in PLE handler

2012-09-27 Thread Avi Kivity
On 09/25/2012 03:40 PM, Raghavendra K T wrote: > On 09/24/2012 07:46 PM, Raghavendra K T wrote: >> On 09/24/2012 07:24 PM, Peter Zijlstra wrote: >>> On Mon, 2012-09-24 at 18:59 +0530, Raghavendra K T wrote: However Rik had a genuine concern in the cases where runqueue is not equally distr

Re: [PATCH RFC 1/2] kvm: Handle undercommitted guest case in PLE handler

2012-09-27 Thread Avi Kivity
On 09/25/2012 04:21 PM, Takuya Yoshikawa wrote: > On Tue, 25 Sep 2012 10:12:49 +0200 > Avi Kivity wrote: > >> It will. The tradeoff is between false-positive costs (undercommit) and >> true positive costs (overcommit). I think undercommit should perform >> well n

Re: [PATCH RFC 1/2] kvm: Handle undercommitted guest case in PLE handler

2012-09-27 Thread Avi Kivity
On 09/25/2012 04:43 PM, Jiannan Ouyang wrote: > I've actually implemented this preempted_bitmap idea. Interesting, please share the code if you can. > However, I'm doing this to expose this information to the guest, so the > guest is able to know if the lock holder is preempted or not before > s

Re: [PATCH RFC 1/2] kvm: Handle undercommitted guest case in PLE handler

2012-09-27 Thread Avi Kivity
On 09/27/2012 09:44 AM, Gleb Natapov wrote: > On Tue, Sep 25, 2012 at 10:54:21AM +0200, Avi Kivity wrote: >> On 09/25/2012 10:09 AM, Raghavendra K T wrote: >> > On 09/24/2012 09:36 PM, Avi Kivity wrote: >> >> On 09/24/2012 05:41 PM, Avi Kivity wrote: >> >

Re: [RFC PATCH] KVM: x86: Skip request checking branches in vcpu_enter_guest() more effectively

2012-09-27 Thread Avi Kivity
On 09/26/2012 04:06 AM, Takuya Yoshikawa wrote: > On Mon, 24 Sep 2012 16:50:13 +0200 > Avi Kivity wrote: > >> Afterwards, most exits are APIC and interrupt related, HLT, and MMIO. >> Of these, some are special (HLT, interrupt injection) and some are not >> (read/wri

Re: [PATCH RFC 1/2] kvm: Handle undercommitted guest case in PLE handler

2012-09-27 Thread Avi Kivity
On 09/27/2012 11:11 AM, Gleb Natapov wrote: >> >> User return notifier is per-cpu, not per-task. There is a new task_work >> () that does what you want. With these >> technicalities out of the way, I think it's the wrong idea. If a vcpu >> thread is in userspace, that doesn't mean it's preempte

Re: [PATCH RFC 1/2] kvm: Handle undercommitted guest case in PLE handler

2012-09-27 Thread Avi Kivity
On 09/27/2012 11:58 AM, Gleb Natapov wrote: > >> > >> >> btw, we can have secondary effects. A vcpu can be waiting for a lock in >> >> the host kernel, or for a host page fault. There's no point in boosting >> >> anything for that. Or a vcpu in userspace can be waiting for a lock >> >> that i

Re: [PATCH v4] kvm/fpu: Enable fully eager restore kvm FPU

2012-09-27 Thread Avi Kivity
On 09/26/2012 07:54 AM, Hao, Xudong wrote: >> -Original Message- >> From: kvm-ow...@vger.kernel.org [mailto:kvm-ow...@vger.kernel.org] On >> Behalf Of Avi Kivity >> Sent: Tuesday, September 25, 2012 4:16 PM >> To: Hao, Xudong >> Cc: kvm@vger.kerne

Re: [PATCH RFC 1/2] kvm: Handle undercommitted guest case in PLE handler

2012-09-27 Thread Avi Kivity
On 09/27/2012 12:08 PM, Gleb Natapov wrote: > On Thu, Sep 27, 2012 at 12:04:58PM +0200, Avi Kivity wrote: >> On 09/27/2012 11:58 AM, Gleb Natapov wrote: >> > >> >> > >> >> >> btw, we can have secondary effects. A vcpu can be waiting for a l

Re: [PATCH RFC 0/2] kvm: Improving undercommit,overcommit scenarios in PLE handler

2012-09-27 Thread Avi Kivity
On 09/27/2012 12:28 PM, Andrew Jones wrote: >> No, I am not there yet. >> >> So In summary, we are suffering with inconsistent benchmark result, >> while measuring the benefit of our improvement in PLE/pvlock etc.. > > Are you measuring the combined throughput of all running guests, or > just lo

Re: [PATCH RFC 0/2] kvm: Improving undercommit,overcommit scenarios in PLE handler

2012-09-27 Thread Avi Kivity
On 09/27/2012 01:23 PM, Raghavendra K T wrote: >> >> This gives us a good case for tracking preemption on a per-vm basis. As >> long as we aren't preempted, we can keep the PLE window high, and also >> return immediately from the handler without looking for candidates. > > 1) So do you think, def

Re: [PATCH RFC 1/2] kvm: Handle undercommitted guest case in PLE handler

2012-09-27 Thread Avi Kivity
On 09/27/2012 01:26 PM, Raghavendra K T wrote: > On 09/27/2012 02:20 PM, Avi Kivity wrote: >> On 09/25/2012 04:43 PM, Jiannan Ouyang wrote: >>> I've actually implemented this preempted_bitmap idea. >> >> Interesting, please share the code if you can. >> &

Re: [kvm:queue 41/42] arch/s390/kvm/interrupt.c:428:12: warning: ignoring return value of 'vcpu_load', declared with attribute warn_unused_result

2012-09-27 Thread Avi Kivity
On 09/27/2012 05:02 PM, Christian Borntraeger wrote: > On 20/09/12 07:22, Michael S. Tsirkin wrote: >> On Thu, Sep 20, 2012 at 08:16:08AM +0800, Fengguang Wu wrote: >>> Hi Michael, >>> >>> FYI, there are new compile warnings show up in >>> >>> tree: git://git.kernel.org/pub/scm/virt/kvm/kvm.git q

Re: [PATCH] s390/kvm: Fix vcpu_load handling in interrupt code

2012-09-27 Thread Avi Kivity
On 09/27/2012 05:29 PM, Christian Borntraeger wrote: > Recent changes (KVM: make processes waiting on vcpu mutex killable) > now requires to check the return value of vcpu_load. This triggered > a warning in s390 specific kvm code. Turns out that we can actually > remove the put/load, since schedul

Re: [PATCH v3 1/7] KVM: MMU: fix release noslot pfn

2012-09-27 Thread Avi Kivity
On 09/24/2012 02:32 PM, Xiao Guangrong wrote: > 3 places after the whole patchset (There are some cleanups after this patch). > >> and one by even stronger is_error_pfn(). > > This one is: > > | if (!is_error_pfn(pfn)) { > |kvm_release_pfn_clean(pfn); > |ret

Re: [PATCH 1/2] KVM: PPC: e500: fix allocation size error on g2h_tlb1_map

2012-09-27 Thread Avi Kivity
On 09/27/2012 06:03 PM, Marcelo Tosatti wrote: > On Tue, Sep 25, 2012 at 09:46:01AM +0200, Alexander Graf wrote: >> >> On 23.08.2012, at 03:04, Scott Wood wrote: >> >> > We were only allocating half the bytes we need, which was made more >> > obvious by a recent fix to the memset in clear_tlb1_b

Re: [PATCH RFC 1/2] kvm: Handle undercommitted guest case in PLE handler

2012-09-30 Thread Avi Kivity
On 09/28/2012 08:18 PM, Konrad Rzeszutek Wilk wrote: >> >> PLE: >> >> - works for unmodified / non-Linux guests >> >> - works for all types of spins (e.g. smp_call_function*()) >> >> - utilizes an existing hardware interface (PAUSE instruction) so likely >> >> more robust compared to a software int

Re: [PATCH RFC 1/2] kvm: Handle undercommitted guest case in PLE handler

2012-09-30 Thread Avi Kivity
On 09/28/2012 08:16 AM, Raghavendra K T wrote: > >> >> +struct pv_sched_info { >> + unsigned long sched_bitmap; > > Thinking, whether we need something similar to cpumask here? > Only thing is we are representing guest (v)cpumask. > DECLARE_BITMAP(sched_bitmap, KVM_MAX_VCPUS) c

Re: [PATCH RFC 0/2] kvm: Improving undercommit,overcommit scenarios in PLE handler

2012-09-30 Thread Avi Kivity
On 09/28/2012 01:40 PM, Andrew Theurer wrote: >> >> >> >> >> IIRC, with defer preemption : >> >> we will have hook in spinlock/unlock path to measure depth of lock held, >> >> and shared with host scheduler (may be via MSRs now). >> >> Host scheduler 'prefers' not to preempt lock holding vcpu. (or

Re: INFO: rcu_preempt detected stalls on CPUs/tasks: { 1} (detected by 0, t=10002 jiffies)

2012-09-30 Thread Avi Kivity
On 09/28/2012 05:35 AM, Paul E. McKenney wrote: > On Thu, Sep 27, 2012 at 12:40:44PM +0800, Fengguang Wu wrote: >> On Wed, Sep 26, 2012 at 09:28:50PM -0700, Paul E. McKenney wrote: >> > On Thu, Sep 27, 2012 at 10:54:00AM +0800, Fengguang Wu wrote: >> > > On Wed, Sep 26, 2012 at 09:45:43AM -0700, Pa

Re: [PATCH RFC 1/2] kvm: Handle undercommitted guest case in PLE handler

2012-09-30 Thread Avi Kivity
On 09/30/2012 01:07 PM, Gleb Natapov wrote: > On Sun, Sep 30, 2012 at 10:18:17AM +0200, Avi Kivity wrote: >> On 09/28/2012 08:16 AM, Raghavendra K T wrote: >> > >> >> >> >> +struct pv_sched_info { >> >> + unsigned long sched_

Re: [PATCH 1/2] KVM: PPC: e500: fix allocation size error on g2h_tlb1_map

2012-09-30 Thread Avi Kivity
On 09/27/2012 09:59 PM, Alexander Graf wrote: > >> Do you have the auto-autotest setup ready? I guess we can do it >> manually until it is. > > I do have a local autotest setup. Or what exactly are you referring to? Getting autotest to run automatically and produce readable reports, and auto-bi

Re: INFO: rcu_preempt detected stalls on CPUs/tasks: { 1} (detected by 0, t=10002 jiffies)

2012-09-30 Thread Avi Kivity
On 09/30/2012 01:18 PM, Fengguang Wu wrote: > On Sun, Sep 30, 2012 at 01:10:55PM +0200, Avi Kivity wrote: >> On 09/28/2012 05:35 AM, Paul E. McKenney wrote: >> > On Thu, Sep 27, 2012 at 12:40:44PM +0800, Fengguang Wu wrote: >> >> On Wed, Sep 26, 2012 at 09:28:50PM

Re: INFO: rcu_preempt detected stalls on CPUs/tasks: { 1} (detected by 0, t=10002 jiffies)

2012-09-30 Thread Avi Kivity
On 09/30/2012 01:23 PM, Fengguang Wu wrote: > On Sun, Sep 30, 2012 at 01:10:55PM +0200, Avi Kivity wrote: >> On 09/28/2012 05:35 AM, Paul E. McKenney wrote: >> > On Thu, Sep 27, 2012 at 12:40:44PM +0800, Fengguang Wu wrote: >> >> On Wed, Sep 26, 2012 at 09:28:50PM

Re: [PATCH 1/2] KVM: PPC: e500: fix allocation size error on g2h_tlb1_map

2012-10-02 Thread Avi Kivity
On 10/01/2012 12:59 PM, Alexander Graf wrote: > > On 30.09.2012, at 13:29, Avi Kivity wrote: > >> On 09/27/2012 09:59 PM, Alexander Graf wrote: >>> >>>> Do you have the auto-autotest setup ready? I guess we can do it >>>> manually until it is. &g

Re: [PATCH RFC 1/2] kvm: Handle undercommitted guest case in PLE handler

2012-10-03 Thread Avi Kivity
On 10/03/2012 04:17 PM, Raghavendra K T wrote: > * Avi Kivity [2012-09-30 13:13:09]: > >> On 09/30/2012 01:07 PM, Gleb Natapov wrote: >> > On Sun, Sep 30, 2012 at 10:18:17AM +0200, Avi Kivity wrote: >> >> On 09/28/2012 08:16 AM, Raghavendra K T wrote: >&

Re: [PATCH RFC 1/2] kvm: Handle undercommitted guest case in PLE handler

2012-10-03 Thread Avi Kivity
On 10/03/2012 02:22 PM, Raghavendra K T wrote: >> So I think it's worth trying again with ple_window of 2-4. >> > > Hi Avi, > > I ran different benchmarks increasing ple_window, and results does not > seem to be encouraging for increasing ple_window. Thanks for testing! Comments below.

Re: [PATCH RFC 0/2] kvm: Improving undercommit,overcommit scenarios in PLE handler

2012-10-03 Thread Avi Kivity
On 10/03/2012 04:29 PM, Raghavendra K T wrote: > * Avi Kivity [2012-09-27 14:03:59]: > >> On 09/27/2012 01:23 PM, Raghavendra K T wrote: >> >> > [...] >> > 2) looking at the result (comparing A & C) , I do feel we have >> > significant in i

Re: [PATCH RFC 1/2] kvm: Handle undercommitted guest case in PLE handler

2012-10-04 Thread Avi Kivity
On 10/04/2012 12:49 PM, Raghavendra K T wrote: > On 10/03/2012 10:35 PM, Avi Kivity wrote: >> On 10/03/2012 02:22 PM, Raghavendra K T wrote: >>>> So I think it's worth trying again with ple_window of 2-4. >>>> >>> >>> Hi Avi, >&

Re: [PATCH RFC 0/2] kvm: Improving undercommit,overcommit scenarios in PLE handler

2012-10-04 Thread Avi Kivity
On 10/04/2012 12:56 PM, Raghavendra K T wrote: > On 10/03/2012 10:55 PM, Avi Kivity wrote: >> On 10/03/2012 04:29 PM, Raghavendra K T wrote: >>> * Avi Kivity [2012-09-27 14:03:59]: >>> >>>> On 09/27/2012 01:23 PM, Raghavendra K T wrote: >>>>>&

Re: [kvmarm] [PATCH 06/15] KVM: ARM: Initial skeleton to compile KVM support

2012-10-04 Thread Avi Kivity
On 09/25/2012 05:20 PM, Will Deacon wrote: >> + case KVM_GET_REG_LIST: { >> + struct kvm_reg_list __user *user_list = argp; >> + struct kvm_reg_list reg_list; >> + unsigned n; >> + >> + if (copy_from_user(®_list, user_list, sizeof reg_li

[GIT PULL] KVM updates for the 3.7 merge window

2012-10-04 Thread Avi Kivity
Alex Williamson (1): KVM: Add resampling irqfds for level triggered interrupts Alexander Graf (1): KVM: Add ppc hypercall documentation Avi Kivity (36): Merge branch 'queue' into next KVM: Don't update PPR on any APIC

Re: [PATCH RFC 1/2] kvm: Handle undercommitted guest case in PLE handler

2012-10-04 Thread Avi Kivity
On 10/04/2012 03:07 PM, Peter Zijlstra wrote: > On Thu, 2012-10-04 at 14:41 +0200, Avi Kivity wrote: >> >> Again the numbers are ridiculously high for arch_local_irq_restore. >> Maybe there's a bad perf/kvm interaction when we're injecting an >> interrupt,

Re: [PATCH RFC 1/2] kvm: Handle undercommitted guest case in PLE handler

2012-10-07 Thread Avi Kivity
On 10/05/2012 10:36 AM, Raghavendra K T wrote: >>> >>> You can store i in the vcpu itself: >>> >>>set_bit(vcpu->index, &kvm->preempted); >>> >> This will make the fact that vcpus are stored in an array into API >> instead of implementation detail :( There were patches for vcpu >> destruction th

Re: Fwd: [PULL 00/56] ppc patch queue 2012-10-04

2012-10-07 Thread Avi Kivity
On 10/05/2012 11:21 PM, Alexander Graf wrote: > Hi Avi / Marcelo, > > Apparently I messed up while sending the pull request yesterday and didn't CC > kvm@vger. Do you want me to resend or is this good enough for you? :) This is fine now you've copied the list. Do any of the "small bug fixes" wa

Re: [PATCH 2/3] KVM: PPC: Add SPR emulation exits

2012-10-07 Thread Avi Kivity
On 10/07/2012 01:41 AM, Alexander Graf wrote: > SPRs on PowerPC are the equivalent to MSRs on x86. They usually > control behavior inside a core, so the best place to emulate them > traditionally has been the kernel side of kvm. > > However, some SPRs should be emulated by user space. For example

Re: [PATCH 2/3] KVM: PPC: Add SPR emulation exits

2012-10-07 Thread Avi Kivity
On 10/07/2012 03:19 PM, Alexander Graf wrote: > > On 07.10.2012, at 15:13, Avi Kivity wrote: > >> On 10/07/2012 01:41 AM, Alexander Graf wrote: >>> SPRs on PowerPC are the equivalent to MSRs on x86. They usually >>> control behavior inside a core,

Re: [PATCH 2/3] KVM: PPC: Add SPR emulation exits

2012-10-07 Thread Avi Kivity
On 10/07/2012 03:26 PM, Alexander Graf wrote: >> >> Ah, yes. I forgot to add this exit to that section of the spec. > > Patch submitted :). Ugh, the whole point of finding problems in patches is that I don't have to think about them for a while. Posting a new patch in a few minutes negates this

Re: [PATCH 2/3] KVM: PPC: Add SPR emulation exits

2012-10-07 Thread Avi Kivity
On 10/07/2012 03:30 PM, Alexander Graf wrote: >>> >>> Yup. The new APIC MSR registers would also have the same problem, right? >> >> Which new APIC MSR registers? > > I thought x2apic can be accessed through MSRs? If you want to emulate that in > user space, you need something similar. It's em

Re: [Qemu-devel] Using PCI config space to indicate config location

2012-10-09 Thread Avi Kivity
On 10/09/2012 05:16 AM, Rusty Russell wrote: > Anthony Liguori writes: >> We'll never remove legacy so we shouldn't plan on it. There are >> literally hundreds of thousands of VMs out there with the current virtio >> drivers installed in them. We'll be supporting them for a very, very >> long ti

Re: [PATCH] Enabling IA32_TSC_ADJUST for guest VM

2012-10-09 Thread Avi Kivity
On 10/08/2012 07:30 PM, Marcelo Tosatti wrote: > > From Intel's manual: > > • If an execution of WRMSR to the IA32_TIME_STAMP_COUNTER MSR adds (or > subtracts) value X from the TSC, > the logical processor also adds (or subtracts) value X from the > IA32_TSC_ADJUST MSR. > > This is not handled i

Re: kvm-kmod 3.6 on linux 3.2.0

2012-10-09 Thread Avi Kivity
On 10/04/2012 02:14 PM, Peter Lieven wrote: > Hi, > > kvm-kmod 3.6 fails to compile against a 3.2.0 kernel with the following error: > > /usr/src/kvm-kmod-3.6/x86/x86.c: In function ‘get_msr_mce’: > /usr/src/kvm-kmod-3.6/x86/x86.c:1908:27: error: ‘kvm’ undeclared (first use > in this function) >

Re: [PATCH] Enabling IA32_TSC_ADJUST for guest VM

2012-10-09 Thread Avi Kivity
On 10/09/2012 04:24 PM, Marcelo Tosatti wrote: > On Tue, Oct 09, 2012 at 02:12:18PM +0200, Avi Kivity wrote: >> On 10/08/2012 07:30 PM, Marcelo Tosatti wrote: >> > >> > From Intel's manual: >> > >> > • If an execution of WRMSR to the IA32_TIME_

Re: [PATCH] Enabling IA32_TSC_ADJUST for guest VM

2012-10-09 Thread Avi Kivity
On 10/09/2012 04:27 PM, Marcelo Tosatti wrote: > On Tue, Oct 09, 2012 at 04:26:32PM +0200, Avi Kivity wrote: >> On 10/09/2012 04:24 PM, Marcelo Tosatti wrote: >> > On Tue, Oct 09, 2012 at 02:12:18PM +0200, Avi Kivity wrote: >> >> On 10/08/2012 07:30 PM, Marcelo Tosatt

Re: [PATCH 0/3] x86: clear vmcss on all cpus when doing kdump if necessary

2012-10-15 Thread Avi Kivity
On 10/12/2012 08:40 AM, Zhang Yanfei wrote: > Currently, kdump just makes all the logical processors leave VMX operation by > executing VMXOFF instruction, so any VMCSs active on the logical processors > may > be corrupted. But, sometimes, we need the VMCSs to debug guest images > contained > in

Re: [Patch]KVM: enabling per domain PLE

2012-10-16 Thread Avi Kivity
On 10/16/2012 08:53 AM, Hu, Xuekun wrote: > Setting the same PLE parameter arbitrarily for different > workloads is not a good solution. True. > The solution enables > per domain PLE which gives user ability to set PLE parameter > for different domain for better performance. The problem with th

Re: Secure migration of LVM based guests over WAN

2012-10-16 Thread Avi Kivity
On 10/16/2012 11:12 AM, Lukas Laukamp wrote: > Hey all, > > I have a question about a solution for migrate LVM based guests directly > over the network. > > So the situation: Two KVM hosts with libvirt, multiple LVM based guests > Want to do: Migrate a LVM based guest directly to the other host o

Re: [PATCH 1/5] KVM: Provide mmu notifier retry test based on struct kvm

2012-10-16 Thread Avi Kivity
On 10/16/2012 05:59 AM, Paul Mackerras wrote: > The mmu_notifier_retry() function, used to test whether any page > invalidations are in progress, currently takes a vcpu pointer, though > the code only needs the VM's struct kvm pointer. Forthcoming patches > to the powerpc Book3S HV code will need

Re: [PATCH 5/5] KVM: PPC: Book3S HV: Provide a method for userspace to read and write the HPT

2012-10-16 Thread Avi Kivity
On 10/16/2012 06:01 AM, Paul Mackerras wrote: > A new ioctl, KVM_PPC_GET_HTAB_FD, returns a file descriptor. Reads on > this fd return the contents of the HPT (hashed page table), writes > create and/or remove entries in the HPT. There is a new capability, > KVM_CAP_PPC_HTAB_FD, to indicate the p

Re: Secure migration of LVM based guests over WAN

2012-10-16 Thread Avi Kivity
On 10/16/2012 11:48 AM, Lukas Laukamp wrote: > Am 16.10.2012 11:40, schrieb Avi Kivity: >> On 10/16/2012 11:12 AM, Lukas Laukamp wrote: >>> Hey all, >>> >>> I have a question about a solution for migrate LVM based guests directly >>> over the network.

Re: [PATCH 0/2] KVM: PPC: Support ioeventfd

2012-10-16 Thread Avi Kivity
On 10/15/2012 02:02 PM, Alexander Graf wrote: > In order to support vhost, we need to be able to support ioeventfd. > > This patch set adds support for ioeventfd to PPC and makes it possible to > do so without implementing irqfd along the way, as it requires an in-kernel > irqchip which we don't h

Re: [PATCH 1/2] KVM: Distangle eventfd code from irqchip

2012-10-16 Thread Avi Kivity
On 10/15/2012 02:02 PM, Alexander Graf wrote: > The current eventfd code assumes that when we have eventfd, we also have > irqfd for in-kernel interrupt delivery. This is not necessarily true. On > PPC we don't have an in-kernel irqchip yet, but we can still support easily > support eventfd. > Do

Re: [PATCH 0/2] KVM: PPC: Support ioeventfd

2012-10-16 Thread Avi Kivity
On 10/16/2012 12:59 PM, Alexander Graf wrote: > > On 16.10.2012, at 12:56, Avi Kivity wrote: > >> On 10/15/2012 02:02 PM, Alexander Graf wrote: >>> In order to support vhost, we need to be able to support ioeventfd. >>> >>> This patch set adds support

Re: [PATCH 5/5] KVM: PPC: Book3S HV: Provide a method for userspace to read and write the HPT

2012-10-16 Thread Avi Kivity
On 10/16/2012 01:58 PM, Paul Mackerras wrote: > On Tue, Oct 16, 2012 at 12:06:58PM +0200, Avi Kivity wrote: >> On 10/16/2012 06:01 AM, Paul Mackerras wrote: >> > +4.78 KVM_PPC_GET_HTAB_FD >> > + >> > +Capability: KVM_CAP_PPC_HTAB_FD >> >

Re: [PATCH 0/2] KVM: PPC: Support ioeventfd

2012-10-16 Thread Avi Kivity
On 10/16/2012 01:06 PM, Alexander Graf wrote: > > On 16.10.2012, at 13:01, Avi Kivity wrote: > >> On 10/16/2012 12:59 PM, Alexander Graf wrote: >>> >>> On 16.10.2012, at 12:56, Avi Kivity wrote: >>> >>>> On 10/15/2012 02:02 PM, Alexander G

Re: KVM ept flush

2012-10-16 Thread Avi Kivity
On 10/16/2012 01:57 PM, Rohan Sharma wrote: > Is there a way to flush ept entries in qemu-kvm. No. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordom

Re: KVM ept flush

2012-10-17 Thread Avi Kivity
; I guess there is some mmu notifier which ensures that entries of EPT > are synced with the host entries. > > On Tue, Oct 16, 2012 at 8:27 PM, Avi Kivity wrote: >> On 10/16/2012 01:57 PM, Rohan Sharma wrote: >>> Is there a way to flush ept entries in qemu-kvm. &

Re: [RFC PATCH v3 06/19] Implement "-dimm" command line option

2012-10-17 Thread Avi Kivity
On 10/17/2012 11:19 AM, Vasilis Liaskovitis wrote: >> >> I don't think so, but probably there's a limit of DIMMs that real >> controllers have, something like 8 max. > > In the case of i440fx specifically, do you mean that we should model the DRB > (Dram row boundary registers in section 3.2.19 o

Re: [Patch]KVM: enabling per domain PLE

2012-10-17 Thread Avi Kivity
On 10/17/2012 10:02 AM, Hu, Xuekun wrote: >> >> The problem with this is that it requires an administrator to understand the >> workload, not only of the guest, but also of other guests on the machine. >> With low overcommit, a high PLE window reduces unneeded exits, but with >> high overcommit we

Re: [PATCH 0/3] x86: clear vmcss on all cpus when doing kdump if necessary

2012-10-17 Thread Avi Kivity
On 10/17/2012 04:28 AM, Zhang Yanfei wrote: > 于 2012年10月15日 23:43, Avi Kivity 写道: >> On 10/12/2012 08:40 AM, Zhang Yanfei wrote: >>> Currently, kdump just makes all the logical processors leave VMX operation >>> by >>> executing VMXOFF instruction, so any VM

Re: [PATCH 5/5] KVM: PPC: Book3S HV: Provide a method for userspace to read and write the HPT

2012-10-17 Thread Avi Kivity
On 10/16/2012 10:03 PM, Anthony Liguori wrote: >> >> This forces userspace to dedicate a thread for the HPT. > > If no changes are available, does read return a size > 0? I don't think > it's necessary to support polling. The kernel should always be able to > respond to userspace here. The only

Re: [PATCH 5/5] KVM: PPC: Book3S HV: Provide a method for userspace to read and write the HPT

2012-10-17 Thread Avi Kivity
On 10/16/2012 11:52 PM, Paul Mackerras wrote: > On Tue, Oct 16, 2012 at 03:06:33PM +0200, Avi Kivity wrote: >> On 10/16/2012 01:58 PM, Paul Mackerras wrote: >> > On Tue, Oct 16, 2012 at 12:06:58PM +0200, Avi Kivity wrote: >> >> Does/should the fd support O_NONBLOCK an

Re: [PATCH] Added call parameter to track whether invocation originated with guest or elsewhere

2012-10-17 Thread Avi Kivity
On 10/17/2012 04:10 AM, Will Auld wrote: > Signed-off-by: Will Auld > --- > > Resending to full list > > Marcelo, > > This patch is what I believe you ask for as foundational for later > patches to address IA32_TSC_ADJUST. > Please write a changelog to reflect the motivation. All those bool

Re: KVM on NFS

2012-10-17 Thread Avi Kivity
On 10/17/2012 11:20 AM, Andrew Holway wrote: > Hello, > > I am testing KVM on an Oracle NFS box that I have. > > Does the list have any advice on best practice? I remember reading that there > is stuff you can do with I/O schedulers and stuff to make it more efficient. > > My VMs will primarily

Re: KVM on NFS

2012-10-17 Thread Avi Kivity
On 10/17/2012 01:04 PM, Andrew Holway wrote: > > >> O_DIRECT is good. I/O schedulers don't affect NFS so no need to tune >> anything on the host. You might experiment with switching to the >> deadline scheduler in the guest. > > Ill give it a go. Any ideas how I should be tuning my NFS? Not r

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