Re: [Qemu-devel] [PATCH v12 0/8] pv event to notify host when the guest is panicked

2012-12-25 Thread Marcelo Tosatti
On Thu, Dec 20, 2012 at 03:53:59PM +0800, Hu Tao wrote: > Hi, > > Any comments? Did you verify possibilities listed at https://lkml.org/lkml/2012/11/20/653 ? If so, a summary in the patchset would be helpful. > On Wed, Dec 12, 2012 at 02:13:43PM +0800, Hu Tao wrote: > > This series implements

Re: [Qemu-devel] [PATCH v12 0/8] pv event to notify host when the guest is panicked

2012-12-25 Thread Marcelo Tosatti
On Thu, Dec 20, 2012 at 03:53:59PM +0800, Hu Tao wrote: > Hi, > > Any comments? As far as i can see, items 2 and 3 of https://lkml.org/lkml/2012/11/12/588 Have not been addressed. https://lkml.org/lkml/2012/11/20/653 contains discussions on those items. 2) Format of the interface for other

Re: [Qemu-devel] [PATCH v12 0/8] pv event to notify host when the guest is panicked

2012-12-25 Thread Marcelo Tosatti
On Thu, Dec 20, 2012 at 03:53:59PM +0800, Hu Tao wrote: Hi, Any comments? As far as i can see, items 2 and 3 of https://lkml.org/lkml/2012/11/12/588 Have not been addressed. https://lkml.org/lkml/2012/11/20/653 contains discussions on those items. 2) Format of the interface for other

Re: [Qemu-devel] [PATCH v12 0/8] pv event to notify host when the guest is panicked

2012-12-25 Thread Marcelo Tosatti
On Thu, Dec 20, 2012 at 03:53:59PM +0800, Hu Tao wrote: Hi, Any comments? Did you verify possibilities listed at https://lkml.org/lkml/2012/11/20/653 ? If so, a summary in the patchset would be helpful. On Wed, Dec 12, 2012 at 02:13:43PM +0800, Hu Tao wrote: This series implements a new

Re: [PATCH 0/7] KVM: Alleviate mmu_lock hold time when we start dirty logging

2012-12-20 Thread Marcelo Tosatti
On Thu, Dec 20, 2012 at 02:02:32PM +0900, Takuya Yoshikawa wrote: > On Wed, 19 Dec 2012 08:42:57 -0700 > Alex Williamson wrote: > > > Please let me know if you can identify one of these as the culprit. > > They're all very simple, but there's always a chance I've missed a hard > > coding of slot

Re: [PATCH 0/7] KVM: Alleviate mmu_lock hold time when we start dirty logging

2012-12-20 Thread Marcelo Tosatti
On Thu, Dec 20, 2012 at 02:02:32PM +0900, Takuya Yoshikawa wrote: On Wed, 19 Dec 2012 08:42:57 -0700 Alex Williamson alex.william...@redhat.com wrote: Please let me know if you can identify one of these as the culprit. They're all very simple, but there's always a chance I've missed a hard

Re: [PATCH] kvm: fix i8254 counter 0 wraparound

2012-12-17 Thread Marcelo Tosatti
; elapsed = ps->period - ktime_to_ns(remaining); > - elapsed = mod_64(elapsed, ps->period); > > return elapsed; > } Reviewed-by: Marcelo Tosatti -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH] kvm: fix i8254 counter 0 wraparound

2012-12-17 Thread Marcelo Tosatti
elapsed; } Reviewed-by: Marcelo Tosatti mtosa...@redhat.com -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: percpu allocation failures in kvm

2012-12-14 Thread Marcelo Tosatti
On Thu, Dec 13, 2012 at 09:43:23PM -0800, Andy Lutomirski wrote: > On 3.7.0 + irrelevant patches, I get this on boot. I've seen it on > and off on earlier kernels, I think (although I'm not currently > getting it on 3.5). > > [ 10.230054] PERCPU: allocation failed, size=304 align=32, alloc >

Re: [PATCH v2 00/10] kvm: memory slot cleanups, fix, and increase

2012-12-14 Thread Marcelo Tosatti
On Mon, Dec 10, 2012 at 10:32:39AM -0700, Alex Williamson wrote: > v2: Update 02/10 to not check userspace_addr when slot is removed. > Yoshikawa-san withdrew objection to increase slot_bitmap prior > to his series to remove slot_bitmap. > > This series does away with any kind of

Re: [PATCH v2 0/5] KVM: x86: improve reexecute_instruction

2012-12-14 Thread Marcelo Tosatti
On Fri, Dec 14, 2012 at 12:50:09PM +0800, Xiao Guangrong wrote: > >>> program a timer interrupt and #GP? > >> > >> Could you please explain the detail? > > > > Before the instruction which writes continuously to the pagetable, arm > > say lapic timer. #GP on the interrupt handler and test with

Re: [PATCH V3 RFC 1/2] sched: Bail out of yield_to when source and target runqueue has one task

2012-12-14 Thread Marcelo Tosatti
Raghavendra, Please get this integrate through x86 tree (Ingo CC'ed). On Mon, Nov 26, 2012 at 05:37:54PM +0530, Raghavendra K T wrote: > From: Peter Zijlstra > > In case of undercomitted scenarios, especially in large guests > yield_to overhead is significantly high. when run queue length of >

Re: [PATCH V3 RFC 1/2] sched: Bail out of yield_to when source and target runqueue has one task

2012-12-14 Thread Marcelo Tosatti
Raghavendra, Please get this integrate through x86 tree (Ingo CC'ed). On Mon, Nov 26, 2012 at 05:37:54PM +0530, Raghavendra K T wrote: From: Peter Zijlstra pet...@infradead.org In case of undercomitted scenarios, especially in large guests yield_to overhead is significantly high. when run

Re: [PATCH v2 0/5] KVM: x86: improve reexecute_instruction

2012-12-14 Thread Marcelo Tosatti
On Fri, Dec 14, 2012 at 12:50:09PM +0800, Xiao Guangrong wrote: program a timer interrupt and #GP? Could you please explain the detail? Before the instruction which writes continuously to the pagetable, arm say lapic timer. #GP on the interrupt handler and test with failure.

Re: [PATCH v2 00/10] kvm: memory slot cleanups, fix, and increase

2012-12-14 Thread Marcelo Tosatti
On Mon, Dec 10, 2012 at 10:32:39AM -0700, Alex Williamson wrote: v2: Update 02/10 to not check userspace_addr when slot is removed. Yoshikawa-san withdrew objection to increase slot_bitmap prior to his series to remove slot_bitmap. This series does away with any kind of complicated

Re: percpu allocation failures in kvm

2012-12-14 Thread Marcelo Tosatti
On Thu, Dec 13, 2012 at 09:43:23PM -0800, Andy Lutomirski wrote: On 3.7.0 + irrelevant patches, I get this on boot. I've seen it on and off on earlier kernels, I think (although I'm not currently getting it on 3.5). [ 10.230054] PERCPU: allocation failed, size=304 align=32, alloc from

Re: [PATCH v2 2/5] KVM: MMU: adjust page size early if gfn used as page table

2012-12-13 Thread Marcelo Tosatti
On Thu, Dec 13, 2012 at 03:23:26AM +0800, Xiao Guangrong wrote: > On 12/12/2012 08:57 AM, Marcelo Tosatti wrote: > > On Mon, Dec 10, 2012 at 05:13:03PM +0800, Xiao Guangrong wrote: > >> We have two issues in current code: > >> - if target gfn is used as its page table,

Re: [PATCH v2 5/5] KVM: x86: improve reexecute_instruction

2012-12-13 Thread Marcelo Tosatti
On Thu, Dec 13, 2012 at 03:29:21AM +0800, Xiao Guangrong wrote: > On 12/12/2012 09:09 AM, Marcelo Tosatti wrote: > > On Mon, Dec 10, 2012 at 05:14:47PM +0800, Xiao Guangrong wrote: > >> The current reexecute_instruction can not well detect the failed > >> instructio

Re: [PATCH v2 0/5] KVM: x86: improve reexecute_instruction

2012-12-13 Thread Marcelo Tosatti
On Thu, Dec 13, 2012 at 04:05:55AM +0800, Xiao Guangrong wrote: > On 12/12/2012 07:36 AM, Marcelo Tosatti wrote: > > On Mon, Dec 10, 2012 at 05:11:35PM +0800, Xiao Guangrong wrote: > >> Changelog: > >> There are some changes from Marcelo and Gleb's review, t

Re: [PATCH v2 0/5] KVM: x86: improve reexecute_instruction

2012-12-13 Thread Marcelo Tosatti
On Thu, Dec 13, 2012 at 04:05:55AM +0800, Xiao Guangrong wrote: On 12/12/2012 07:36 AM, Marcelo Tosatti wrote: On Mon, Dec 10, 2012 at 05:11:35PM +0800, Xiao Guangrong wrote: Changelog: There are some changes from Marcelo and Gleb's review, thank you all! - access indirect_shadow_pages

Re: [PATCH v2 5/5] KVM: x86: improve reexecute_instruction

2012-12-13 Thread Marcelo Tosatti
On Thu, Dec 13, 2012 at 03:29:21AM +0800, Xiao Guangrong wrote: On 12/12/2012 09:09 AM, Marcelo Tosatti wrote: On Mon, Dec 10, 2012 at 05:14:47PM +0800, Xiao Guangrong wrote: The current reexecute_instruction can not well detect the failed instruction emulation. It allows guest to retry

Re: [PATCH v2 2/5] KVM: MMU: adjust page size early if gfn used as page table

2012-12-13 Thread Marcelo Tosatti
On Thu, Dec 13, 2012 at 03:23:26AM +0800, Xiao Guangrong wrote: On 12/12/2012 08:57 AM, Marcelo Tosatti wrote: On Mon, Dec 10, 2012 at 05:13:03PM +0800, Xiao Guangrong wrote: We have two issues in current code: - if target gfn is used as its page table, guest will refault then kvm

[GIT PULL] KVM updates for the 3.8 merge window

2012-12-12 Thread Marcelo Tosatti
hcall support for e500 guests PPC: Don't use hardcoded opcode for ePAPR hcall invocation Marcelo Tosatti (22): Merge branch 'for-upstream' of http://github.com/agraf/linux-2.6 into queue Merge remote-tracking branch 'master' into queue Merge branch 'for-queue' of https://gith

[GIT PULL] KVM updates for the 3.8 merge window

2012-12-12 Thread Marcelo Tosatti
for e500 guests PPC: Don't use hardcoded opcode for ePAPR hcall invocation Marcelo Tosatti (22): Merge branch 'for-upstream' of http://github.com/agraf/linux-2.6 into queue Merge remote-tracking branch 'master' into queue Merge branch 'for-queue' of https://github.com

Re: [PATCH v2 01/10] kvm: Restrict non-existing slot state transitions

2012-12-11 Thread Marcelo Tosatti
On Mon, Dec 10, 2012 at 10:32:45AM -0700, Alex Williamson wrote: > The API documentation states: > > When changing an existing slot, it may be moved in the guest > physical memory space, or its flags may be modified. > > An "existing slot" requires a non-zero npages (memory_size).

Re: [PATCH v2 5/5] KVM: x86: improve reexecute_instruction

2012-12-11 Thread Marcelo Tosatti
On Mon, Dec 10, 2012 at 05:14:47PM +0800, Xiao Guangrong wrote: > The current reexecute_instruction can not well detect the failed instruction > emulation. It allows guest to retry all the instructions except it accesses > on error pfn > > For example, some cases are nested-write-protect - if the

Re: [PATCH v2 0/5] KVM: x86: improve reexecute_instruction

2012-12-11 Thread Marcelo Tosatti
On Mon, Dec 10, 2012 at 05:11:35PM +0800, Xiao Guangrong wrote: > Changelog: > There are some changes from Marcelo and Gleb's review, thank you all! > - access indirect_shadow_pages in the protection of mmu-lock > - fix the issue when unhandleable instruction access on large page > - add a new

Re: [PATCH v2 1/5] KVM: MMU: move adjusting pte access for softmmu to FNAME(page_fault)

2012-12-11 Thread Marcelo Tosatti
On Mon, Dec 10, 2012 at 05:12:20PM +0800, Xiao Guangrong wrote: > Then, no mmu specified code exists in the common function and drop two > parameters in set_spte > > Signed-off-by: Xiao Guangrong > --- > arch/x86/kvm/mmu.c | 47 --- >

Re: [PATCH v2 01/10] kvm: Restrict non-existing slot state transitions

2012-12-11 Thread Marcelo Tosatti
On Tue, Dec 11, 2012 at 11:29:09PM -0200, Marcelo Tosatti wrote: > On Mon, Dec 10, 2012 at 10:32:45AM -0700, Alex Williamson wrote: > > The API documentation states: > > > > When changing an existing slot, it may be moved in the guest > > physical mem

Re: [PATCH v2 00/10] kvm: memory slot cleanups, fix, and increase

2012-12-11 Thread Marcelo Tosatti
t; us to support between 28 and 56 typical devices per VM. > > Tested on x86_64, compiled on ia64, powerpc, and s390. > > Thanks, > Alex Reviewed-by: Marcelo Tosatti -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@

Re: [PATCH v2 2/5] KVM: MMU: adjust page size early if gfn used as page table

2012-12-11 Thread Marcelo Tosatti
On Mon, Dec 10, 2012 at 05:13:03PM +0800, Xiao Guangrong wrote: > We have two issues in current code: > - if target gfn is used as its page table, guest will refault then kvm will > use > small page size to map it. We need two #PF to fix its shadow page table > > - sometimes, say a exception

Re: [PATCH] [RESEND] x86/kexec: crash_vmclear_local_vmcss needs __rcu

2012-12-11 Thread Marcelo Tosatti
On Tue, Dec 11, 2012 at 05:11:34PM +0800, Zhang Yanfei wrote: > This removes the sparse warning: > arch/x86/kernel/crash.c:49:32: sparse: incompatible types in comparison > expression (different address spaces) > > Reported-by: kbuild test robot > Signed-off-by: Zhang Yanfei > --- >

Re: [PATCH] [RESEND] x86/kexec: crash_vmclear_local_vmcss needs __rcu

2012-12-11 Thread Marcelo Tosatti
On Tue, Dec 11, 2012 at 05:11:34PM +0800, Zhang Yanfei wrote: This removes the sparse warning: arch/x86/kernel/crash.c:49:32: sparse: incompatible types in comparison expression (different address spaces) Reported-by: kbuild test robot fengguang...@intel.com Signed-off-by: Zhang Yanfei

Re: [PATCH v2 2/5] KVM: MMU: adjust page size early if gfn used as page table

2012-12-11 Thread Marcelo Tosatti
On Mon, Dec 10, 2012 at 05:13:03PM +0800, Xiao Guangrong wrote: We have two issues in current code: - if target gfn is used as its page table, guest will refault then kvm will use small page size to map it. We need two #PF to fix its shadow page table - sometimes, say a exception is

Re: [PATCH v2 00/10] kvm: memory slot cleanups, fix, and increase

2012-12-11 Thread Marcelo Tosatti
, compiled on ia64, powerpc, and s390. Thanks, Alex Reviewed-by: Marcelo Tosatti mtosa...@redhat.com -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please

Re: [PATCH v2 01/10] kvm: Restrict non-existing slot state transitions

2012-12-11 Thread Marcelo Tosatti
On Tue, Dec 11, 2012 at 11:29:09PM -0200, Marcelo Tosatti wrote: On Mon, Dec 10, 2012 at 10:32:45AM -0700, Alex Williamson wrote: The API documentation states: When changing an existing slot, it may be moved in the guest physical memory space, or its flags may be modified

Re: [PATCH v2 1/5] KVM: MMU: move adjusting pte access for softmmu to FNAME(page_fault)

2012-12-11 Thread Marcelo Tosatti
On Mon, Dec 10, 2012 at 05:12:20PM +0800, Xiao Guangrong wrote: Then, no mmu specified code exists in the common function and drop two parameters in set_spte Signed-off-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com --- arch/x86/kvm/mmu.c | 47

Re: [PATCH v2 0/5] KVM: x86: improve reexecute_instruction

2012-12-11 Thread Marcelo Tosatti
On Mon, Dec 10, 2012 at 05:11:35PM +0800, Xiao Guangrong wrote: Changelog: There are some changes from Marcelo and Gleb's review, thank you all! - access indirect_shadow_pages in the protection of mmu-lock - fix the issue when unhandleable instruction access on large page - add a new test

Re: [PATCH v2 5/5] KVM: x86: improve reexecute_instruction

2012-12-11 Thread Marcelo Tosatti
On Mon, Dec 10, 2012 at 05:14:47PM +0800, Xiao Guangrong wrote: The current reexecute_instruction can not well detect the failed instruction emulation. It allows guest to retry all the instructions except it accesses on error pfn For example, some cases are nested-write-protect - if the page

Re: [PATCH v2 01/10] kvm: Restrict non-existing slot state transitions

2012-12-11 Thread Marcelo Tosatti
On Mon, Dec 10, 2012 at 10:32:45AM -0700, Alex Williamson wrote: The API documentation states: When changing an existing slot, it may be moved in the guest physical memory space, or its flags may be modified. An existing slot requires a non-zero npages (memory_size). The only

Re: [PATCH] x86/kexec: crash_vmclear_local_vmcss needs __rcu

2012-12-10 Thread Marcelo Tosatti
On Fri, Dec 07, 2012 at 01:40:56PM +0800, Zhang Yanfei wrote: > This removes the sparse warning: > arch/x86/kernel/crash.c:49:32: sparse: incompatible types in comparison > expression (different address spaces) > > Reported-by: kbuild test robot > Signed-off-by: Zhang Yanfei > --- >

Re: [PATCH] kvm: Fix irqfd resampler list walk

2012-12-10 Thread Marcelo Tosatti
On Thu, Dec 06, 2012 at 02:44:59PM -0700, Alex Williamson wrote: > Typo for the next pointer means we're walking random data here. > > Signed-off-by: Alex Williamson > Cc: sta...@vger.kernel.org [3.7] > --- > > Not sure if this will make 3.7, so preemptively adding the stable flag > >

Re: [PATCH] kvm: Fix irqfd resampler list walk

2012-12-10 Thread Marcelo Tosatti
On Thu, Dec 06, 2012 at 02:44:59PM -0700, Alex Williamson wrote: Typo for the next pointer means we're walking random data here. Signed-off-by: Alex Williamson alex.william...@redhat.com Cc: sta...@vger.kernel.org [3.7] --- Not sure if this will make 3.7, so preemptively adding the stable

Re: [PATCH] x86/kexec: crash_vmclear_local_vmcss needs __rcu

2012-12-10 Thread Marcelo Tosatti
On Fri, Dec 07, 2012 at 01:40:56PM +0800, Zhang Yanfei wrote: This removes the sparse warning: arch/x86/kernel/crash.c:49:32: sparse: incompatible types in comparison expression (different address spaces) Reported-by: kbuild test robot fengguang...@intel.com Signed-off-by: Zhang Yanfei

Re: [PATCH V3 RFC 2/2] kvm: Handle yield_to failure return code for potential undercommit case

2012-12-07 Thread Marcelo Tosatti
On Thu, Dec 06, 2012 at 12:29:02PM +0530, Raghavendra K T wrote: > On 12/04/2012 01:26 AM, Marcelo Tosatti wrote: > >On Wed, Nov 28, 2012 at 10:40:56AM +0530, Raghavendra K T wrote: > >>On 11/28/2012 06:42 AM, Marcelo Tosatti wrote: > >>> > >>>Don't under

Re: [PATCH V3 RFC 2/2] kvm: Handle yield_to failure return code for potential undercommit case

2012-12-07 Thread Marcelo Tosatti
On Thu, Dec 06, 2012 at 12:29:02PM +0530, Raghavendra K T wrote: On 12/04/2012 01:26 AM, Marcelo Tosatti wrote: On Wed, Nov 28, 2012 at 10:40:56AM +0530, Raghavendra K T wrote: On 11/28/2012 06:42 AM, Marcelo Tosatti wrote: Don't understand the reasoning behind why 3 is a good choice

Re: [RFC PATCH 5/6] kvm: Re-introduce memslots->nmemslots

2012-12-06 Thread Marcelo Tosatti
On Thu, Dec 06, 2012 at 09:58:48PM -0200, Marcelo Tosatti wrote: > On Wed, Dec 05, 2012 at 08:51:37PM -0700, Alex Williamson wrote: > > > > id_to_memslot seems like a good place to catch all the users since > > > > that's the only way to get a slot from a slot id after

Re: [RFC PATCH 5/6] kvm: Re-introduce memslots->nmemslots

2012-12-06 Thread Marcelo Tosatti
On Wed, Dec 05, 2012 at 08:51:37PM -0700, Alex Williamson wrote: > > > id_to_memslot seems like a good place to catch all the users since > > > that's the only way to get a slot from a slot id after the array is > > > sorted. We need to check both is the slot in bounds (EINVAL), but also > > > is

Re: [RFC PATCH 5/6] kvm: Re-introduce memslots-nmemslots

2012-12-06 Thread Marcelo Tosatti
On Wed, Dec 05, 2012 at 08:51:37PM -0700, Alex Williamson wrote: id_to_memslot seems like a good place to catch all the users since that's the only way to get a slot from a slot id after the array is sorted. We need to check both is the slot in bounds (EINVAL), but also is it

Re: [RFC PATCH 5/6] kvm: Re-introduce memslots-nmemslots

2012-12-06 Thread Marcelo Tosatti
On Thu, Dec 06, 2012 at 09:58:48PM -0200, Marcelo Tosatti wrote: On Wed, Dec 05, 2012 at 08:51:37PM -0700, Alex Williamson wrote: id_to_memslot seems like a good place to catch all the users since that's the only way to get a slot from a slot id after the array is sorted. We need

Re: [RFC PATCH 5/6] kvm: Re-introduce memslots->nmemslots

2012-12-05 Thread Marcelo Tosatti
On Wed, Dec 05, 2012 at 04:02:53PM -0700, Alex Williamson wrote: > On Wed, 2012-12-05 at 19:26 -0200, Marcelo Tosatti wrote: > > On Mon, Dec 03, 2012 at 04:39:36PM -0700, Alex Williamson wrote: > > > struct kvm_memory_slot is currently 52 bytes (LP64), not counting the > &

Re: [RFC PATCH 0/6] kvm: Growable memory slot array

2012-12-05 Thread Marcelo Tosatti
On Mon, Dec 03, 2012 at 04:39:05PM -0700, Alex Williamson wrote: > Memory slots are currently a fixed resource with a relatively small > limit. When using PCI device assignment in a qemu guest it's fairly > easy to exhaust the number of available slots. I posted patches > exploring growing the

Re: [RFC PATCH 5/6] kvm: Re-introduce memslots->nmemslots

2012-12-05 Thread Marcelo Tosatti
On Mon, Dec 03, 2012 at 04:39:36PM -0700, Alex Williamson wrote: > struct kvm_memory_slot is currently 52 bytes (LP64), not counting the > arch data. On x86 this means the memslot array to support a tiny 32+3 > entries (user+private) is over 2k. We'd like to support more slots > so that we can

Re: [RFC PATCH 3/6] kvm: Merge id_to_index into memslots

2012-12-05 Thread Marcelo Tosatti
On Mon, Dec 03, 2012 at 04:39:24PM -0700, Alex Williamson wrote: > This allows us to resize this structure and therefore the number of > memslots as part of the RCU update. Why is this necessary? "struct memslots" is updated, message above conflicts with that. If there is a reason, "id_to_index"

Re: [RFC PATCH 4/6] kvm: Move private memory slots to start of memslots array

2012-12-05 Thread Marcelo Tosatti
On Mon, Dec 03, 2012 at 04:39:30PM -0700, Alex Williamson wrote: > In order to make the memslots array grow on demand, move the private > slots to the lower indexes of the array. The private slots are > assumed likely to be in use, so if we didn't do this we'd end up > allocating the full

Re: [PATCH] KVM: MMU: optimize for set_spte

2012-12-05 Thread Marcelo Tosatti
On Tue, Dec 04, 2012 at 07:17:11AM +0800, Xiao Guangrong wrote: > There are two cases we need to adjust page size in set_spte: > 1): the one is other vcpu creates new sp in the window between mapping_level() > and acquiring mmu-lock. > 2): the another case is the new sp is created by itself

Re: [PATCH] KVM: MMU: optimize for set_spte

2012-12-05 Thread Marcelo Tosatti
On Tue, Dec 04, 2012 at 07:17:11AM +0800, Xiao Guangrong wrote: There are two cases we need to adjust page size in set_spte: 1): the one is other vcpu creates new sp in the window between mapping_level() and acquiring mmu-lock. 2): the another case is the new sp is created by itself

Re: [RFC PATCH 4/6] kvm: Move private memory slots to start of memslots array

2012-12-05 Thread Marcelo Tosatti
On Mon, Dec 03, 2012 at 04:39:30PM -0700, Alex Williamson wrote: In order to make the memslots array grow on demand, move the private slots to the lower indexes of the array. The private slots are assumed likely to be in use, so if we didn't do this we'd end up allocating the full memslots

Re: [RFC PATCH 3/6] kvm: Merge id_to_index into memslots

2012-12-05 Thread Marcelo Tosatti
On Mon, Dec 03, 2012 at 04:39:24PM -0700, Alex Williamson wrote: This allows us to resize this structure and therefore the number of memslots as part of the RCU update. Why is this necessary? struct memslots is updated, message above conflicts with that. If there is a reason, id_to_index

Re: [RFC PATCH 5/6] kvm: Re-introduce memslots-nmemslots

2012-12-05 Thread Marcelo Tosatti
On Mon, Dec 03, 2012 at 04:39:36PM -0700, Alex Williamson wrote: struct kvm_memory_slot is currently 52 bytes (LP64), not counting the arch data. On x86 this means the memslot array to support a tiny 32+3 entries (user+private) is over 2k. We'd like to support more slots so that we can

Re: [RFC PATCH 0/6] kvm: Growable memory slot array

2012-12-05 Thread Marcelo Tosatti
On Mon, Dec 03, 2012 at 04:39:05PM -0700, Alex Williamson wrote: Memory slots are currently a fixed resource with a relatively small limit. When using PCI device assignment in a qemu guest it's fairly easy to exhaust the number of available slots. I posted patches exploring growing the

Re: [RFC PATCH 5/6] kvm: Re-introduce memslots-nmemslots

2012-12-05 Thread Marcelo Tosatti
On Wed, Dec 05, 2012 at 04:02:53PM -0700, Alex Williamson wrote: On Wed, 2012-12-05 at 19:26 -0200, Marcelo Tosatti wrote: On Mon, Dec 03, 2012 at 04:39:36PM -0700, Alex Williamson wrote: struct kvm_memory_slot is currently 52 bytes (LP64), not counting the arch data. On x86 this means

Re: [PATCH V3 RFC 2/2] kvm: Handle yield_to failure return code for potential undercommit case

2012-12-03 Thread Marcelo Tosatti
On Wed, Nov 28, 2012 at 10:40:56AM +0530, Raghavendra K T wrote: > On 11/28/2012 06:42 AM, Marcelo Tosatti wrote: > > > >Don't understand the reasoning behind why 3 is a good choice. > > Here is where I came from. (explaining from scratch for > completeness, forg

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

2012-12-03 Thread Marcelo Tosatti
On Mon, Dec 03, 2012 at 04:33:01PM +0800, Xiao Guangrong wrote: > Hi Marcelo, > > Thanks for your patience. I was reading your reply over and over again, i > would > like to argue it more :). > Please see below. > > On 11/29/2012 08:21 AM, Marcelo Tosatti wrote: >

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

2012-12-03 Thread Marcelo Tosatti
On Mon, Dec 03, 2012 at 04:33:01PM +0800, Xiao Guangrong wrote: Hi Marcelo, Thanks for your patience. I was reading your reply over and over again, i would like to argue it more :). Please see below. On 11/29/2012 08:21 AM, Marcelo Tosatti wrote: https://lkml.org/lkml/2012/11/17

Re: [PATCH V3 RFC 2/2] kvm: Handle yield_to failure return code for potential undercommit case

2012-12-03 Thread Marcelo Tosatti
On Wed, Nov 28, 2012 at 10:40:56AM +0530, Raghavendra K T wrote: On 11/28/2012 06:42 AM, Marcelo Tosatti wrote: Don't understand the reasoning behind why 3 is a good choice. Here is where I came from. (explaining from scratch for completeness, forgive me :)) In moderate overcommits, we

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

2012-11-30 Thread Marcelo Tosatti
On Fri, Nov 30, 2012 at 10:36:43AM +0900, Yoshihiro YUNOMAE wrote: > Hi Marcelo, > > >>>Can you please write a succint but complete description of the method > >>>so it can be verified? > >> > >>Sure. > >> > >>- Prerequisite > >>1. the host TSC is synchronized and stable. > >>2.

Re: [PATCH 2/2] KVM: VMX: fix memory order between loading vmcs and clearing vmcs

2012-11-30 Thread Marcelo Tosatti
On Wed, Nov 28, 2012 at 08:54:14PM +0800, Xiao Guangrong wrote: > vmcs->cpu indicates whether it exists on the target cpu, -1 means the vmcs > does not exist on any vcpu > > If vcpu load vmcs with vmcs.cpu = -1, it can be directly added to cpu's percpu > list. The list can be corrupted if the cpu

Re: [PATCH v2] kvm: Fix user memslot overlap check

2012-11-30 Thread Marcelo Tosatti
On Thu, Nov 29, 2012 at 02:07:59PM -0700, Alex Williamson wrote: > Prior to memory slot sorting this loop compared all of the user memory > slots for overlap with new entries. With memory slot sorting, we're > just checking some number of entries in the array that may or may not > be user slots.

Re: [PATCH v2] kvm: Fix user memslot overlap check

2012-11-30 Thread Marcelo Tosatti
On Thu, Nov 29, 2012 at 02:07:59PM -0700, Alex Williamson wrote: Prior to memory slot sorting this loop compared all of the user memory slots for overlap with new entries. With memory slot sorting, we're just checking some number of entries in the array that may or may not be user slots.

Re: [PATCH 2/2] KVM: VMX: fix memory order between loading vmcs and clearing vmcs

2012-11-30 Thread Marcelo Tosatti
On Wed, Nov 28, 2012 at 08:54:14PM +0800, Xiao Guangrong wrote: vmcs-cpu indicates whether it exists on the target cpu, -1 means the vmcs does not exist on any vcpu If vcpu load vmcs with vmcs.cpu = -1, it can be directly added to cpu's percpu list. The list can be corrupted if the cpu

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

2012-11-30 Thread Marcelo Tosatti
On Fri, Nov 30, 2012 at 10:36:43AM +0900, Yoshihiro YUNOMAE wrote: Hi Marcelo, Can you please write a succint but complete description of the method so it can be verified? Sure. - Prerequisite 1. the host TSC is synchronized and stable. 2. kvm_write_tsc_offset events include previous

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

2012-11-29 Thread Marcelo Tosatti
On Tue, Nov 27, 2012 at 07:53:47PM +0900, Yoshihiro YUNOMAE wrote: > Hi Marcelo, > > (2012/11/27 8:16), Marcelo Tosatti wrote: > >On Mon, Nov 26, 2012 at 08:05:10PM +0900, Yoshihiro YUNOMAE wrote: > >>>>>500h. event tsc_write tsc_offset=-3000 > >>>&

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

2012-11-29 Thread Marcelo Tosatti
On Tue, Nov 27, 2012 at 07:53:47PM +0900, Yoshihiro YUNOMAE wrote: Hi Marcelo, (2012/11/27 8:16), Marcelo Tosatti wrote: On Mon, Nov 26, 2012 at 08:05:10PM +0900, Yoshihiro YUNOMAE wrote: 500h. event tsc_write tsc_offset=-3000 Then a guest trace containing events with a TSC timestamp

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

2012-11-28 Thread Marcelo Tosatti
On Thu, Nov 29, 2012 at 07:16:50AM +0800, Xiao Guangrong wrote: > On 11/29/2012 06:40 AM, Xiao Guangrong wrote: > > On 11/29/2012 05:57 AM, Marcelo Tosatti wrote: > >> On Wed, Nov 28, 2012 at 10:59:35PM +0800, Xiao Guangrong wrote: > >>> On 11/28/2012 10:12 PM, Gle

Re: [PATCH 2/2] KVM: VMX: fix memory order between loading vmcs and clearing vmcs

2012-11-28 Thread Marcelo Tosatti
On Wed, Nov 28, 2012 at 08:54:14PM +0800, Xiao Guangrong wrote: > vmcs->cpu indicates whether it exists on the target cpu, -1 means the vmcs > does not exist on any vcpu > > If vcpu load vmcs with vmcs.cpu = -1, it can be directly added to cpu's percpu > list. The list can be corrupted if the cpu

Re: [PATCH 1/2] KVM: VMX: fix invalid cpu passed to smp_call_function_single

2012-11-28 Thread Marcelo Tosatti
On Wed, Nov 28, 2012 at 08:53:15PM +0800, Xiao Guangrong wrote: > In loaded_vmcs_clear, loaded_vmcs->cpu is the fist parameter passed to > smp_call_function_single, if the target cpu is downing (doing cpu hot remove), > loaded_vmcs->cpu can become -1 then -1 is passed to smp_call_function_single >

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

2012-11-28 Thread Marcelo Tosatti
On Thu, Nov 29, 2012 at 06:40:51AM +0800, Xiao Guangrong wrote: > On 11/29/2012 05:57 AM, Marcelo Tosatti wrote: > > On Wed, Nov 28, 2012 at 10:59:35PM +0800, Xiao Guangrong wrote: > >> On 11/28/2012 10:12 PM, Gleb Natapov wrote: > >>> On Tue, Nov 27, 2012 at 11:30:24

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

2012-11-28 Thread Marcelo Tosatti
On Wed, Nov 28, 2012 at 10:59:35PM +0800, Xiao Guangrong wrote: > On 11/28/2012 10:12 PM, Gleb Natapov wrote: > > On Tue, Nov 27, 2012 at 11:30:24AM +0800, Xiao Guangrong wrote: > >> On 11/27/2012 06:41 AM, Marcelo Tosatti wrote: > >> > >>>> &

Re: [PATCH 2/3] KVM: x86: let reexecute_instruction work for tdp

2012-11-28 Thread Marcelo Tosatti
On Wed, Nov 28, 2012 at 10:55:26PM +0800, Xiao Guangrong wrote: > On 11/28/2012 10:01 PM, Gleb Natapov wrote: > > On Wed, Nov 28, 2012 at 11:15:13AM +0800, Xiao Guangrong wrote: > >> On 11/28/2012 07:32 AM, Marcelo Tosatti wrote: > >>> On Tue, Nov 27, 2012 at 11:13:11

Re: [PATCH] KVM: MMU: lazily drop large spte

2012-11-28 Thread Marcelo Tosatti
On Wed, Nov 28, 2012 at 01:27:38PM +0800, Xiao Guangrong wrote: > On 11/18/2012 11:00 AM, Marcelo Tosatti wrote: > map gfn 4? See corrected step 7 above. > >> > >> Ah, this is a real bug, and unfortunately, it exists in current > >> code. I will make a separ

Re: [PATCH] KVM: MMU: lazily drop large spte

2012-11-28 Thread Marcelo Tosatti
On Wed, Nov 28, 2012 at 01:27:38PM +0800, Xiao Guangrong wrote: On 11/18/2012 11:00 AM, Marcelo Tosatti wrote: map gfn 4? See corrected step 7 above. Ah, this is a real bug, and unfortunately, it exists in current code. I will make a separate patchset to fix it. Thank you, Marcelo

Re: [PATCH 2/3] KVM: x86: let reexecute_instruction work for tdp

2012-11-28 Thread Marcelo Tosatti
On Wed, Nov 28, 2012 at 10:55:26PM +0800, Xiao Guangrong wrote: On 11/28/2012 10:01 PM, Gleb Natapov wrote: On Wed, Nov 28, 2012 at 11:15:13AM +0800, Xiao Guangrong wrote: On 11/28/2012 07:32 AM, Marcelo Tosatti wrote: On Tue, Nov 27, 2012 at 11:13:11AM +0800, Xiao Guangrong wrote

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

2012-11-28 Thread Marcelo Tosatti
On Wed, Nov 28, 2012 at 10:59:35PM +0800, Xiao Guangrong wrote: On 11/28/2012 10:12 PM, Gleb Natapov wrote: On Tue, Nov 27, 2012 at 11:30:24AM +0800, Xiao Guangrong wrote: On 11/27/2012 06:41 AM, Marcelo Tosatti wrote: -return false; +again: +page_fault_count

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

2012-11-28 Thread Marcelo Tosatti
On Thu, Nov 29, 2012 at 06:40:51AM +0800, Xiao Guangrong wrote: On 11/29/2012 05:57 AM, Marcelo Tosatti wrote: On Wed, Nov 28, 2012 at 10:59:35PM +0800, Xiao Guangrong wrote: On 11/28/2012 10:12 PM, Gleb Natapov wrote: On Tue, Nov 27, 2012 at 11:30:24AM +0800, Xiao Guangrong wrote: On 11

Re: [PATCH 1/2] KVM: VMX: fix invalid cpu passed to smp_call_function_single

2012-11-28 Thread Marcelo Tosatti
On Wed, Nov 28, 2012 at 08:53:15PM +0800, Xiao Guangrong wrote: In loaded_vmcs_clear, loaded_vmcs-cpu is the fist parameter passed to smp_call_function_single, if the target cpu is downing (doing cpu hot remove), loaded_vmcs-cpu can become -1 then -1 is passed to smp_call_function_single It

Re: [PATCH 2/2] KVM: VMX: fix memory order between loading vmcs and clearing vmcs

2012-11-28 Thread Marcelo Tosatti
On Wed, Nov 28, 2012 at 08:54:14PM +0800, Xiao Guangrong wrote: vmcs-cpu indicates whether it exists on the target cpu, -1 means the vmcs does not exist on any vcpu If vcpu load vmcs with vmcs.cpu = -1, it can be directly added to cpu's percpu list. The list can be corrupted if the cpu

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

2012-11-28 Thread Marcelo Tosatti
On Thu, Nov 29, 2012 at 07:16:50AM +0800, Xiao Guangrong wrote: On 11/29/2012 06:40 AM, Xiao Guangrong wrote: On 11/29/2012 05:57 AM, Marcelo Tosatti wrote: On Wed, Nov 28, 2012 at 10:59:35PM +0800, Xiao Guangrong wrote: On 11/28/2012 10:12 PM, Gleb Natapov wrote: On Tue, Nov 27, 2012

Re: [PATCH V3 RFC 2/2] kvm: Handle yield_to failure return code for potential undercommit case

2012-11-27 Thread Marcelo Tosatti
Don't understand the reasoning behind why 3 is a good choice. On Mon, Nov 26, 2012 at 05:38:04PM +0530, Raghavendra K T wrote: > From: Raghavendra K T > > yield_to returns -ESRCH, When source and target of yield_to > run queue length is one. When we see three successive failures of > yield_to

Re: [PATCH 0/5] Alter steal time reporting in KVM

2012-11-27 Thread Marcelo Tosatti
On Tue, Nov 27, 2012 at 09:24:42PM -0200, Marcelo Tosatti wrote: > On Mon, Nov 26, 2012 at 02:36:24PM -0600, Michael Wolf wrote: > > In the case of where you have a system that is running in a > > capped or overcommitted environment the user may see steal time > > being r

Re: [PATCH 2/3] KVM: x86: let reexecute_instruction work for tdp

2012-11-27 Thread Marcelo Tosatti
On Tue, Nov 27, 2012 at 11:13:11AM +0800, Xiao Guangrong wrote: > >> +static bool reexecute_instruction(struct kvm_vcpu *vcpu, unsigned long > >> cr2) > >> { > >> - gpa_t gpa; > >> + gpa_t gpa = cr2; > >>pfn_t pfn; > >> > >> - if (tdp_enabled) > >> + if

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

2012-11-27 Thread Marcelo Tosatti
On Tue, Nov 27, 2012 at 11:30:24AM +0800, Xiao Guangrong wrote: > On 11/27/2012 06:41 AM, Marcelo Tosatti wrote: > > >> > >> - return false; > >> +again: > >> + page_fault_count = ACCESS_ONCE(vcpu->kvm->arch.page_fault_count); > >&g

Re: [PATCH 0/5] Alter steal time reporting in KVM

2012-11-27 Thread Marcelo Tosatti
On Mon, Nov 26, 2012 at 02:36:24PM -0600, Michael Wolf wrote: > In the case of where you have a system that is running in a > capped or overcommitted environment the user may see steal time > being reported in accounting tools such as top or vmstat. The definition of stolen time is 'time during

Re: [PATCH 0/5] Alter steal time reporting in KVM

2012-11-27 Thread Marcelo Tosatti
On Mon, Nov 26, 2012 at 02:36:24PM -0600, Michael Wolf wrote: In the case of where you have a system that is running in a capped or overcommitted environment the user may see steal time being reported in accounting tools such as top or vmstat. The definition of stolen time is 'time during

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

2012-11-27 Thread Marcelo Tosatti
On Tue, Nov 27, 2012 at 11:30:24AM +0800, Xiao Guangrong wrote: On 11/27/2012 06:41 AM, Marcelo Tosatti wrote: - return false; +again: + page_fault_count = ACCESS_ONCE(vcpu-kvm-arch.page_fault_count); + + /* + * if emulation was due to access to shadowed page table

Re: [PATCH 2/3] KVM: x86: let reexecute_instruction work for tdp

2012-11-27 Thread Marcelo Tosatti
On Tue, Nov 27, 2012 at 11:13:11AM +0800, Xiao Guangrong wrote: +static bool reexecute_instruction(struct kvm_vcpu *vcpu, unsigned long cr2) { - gpa_t gpa; + gpa_t gpa = cr2; pfn_t pfn; - if (tdp_enabled) + if (!ACCESS_ONCE(vcpu-kvm-arch.indirect_shadow_pages))

Re: [PATCH 0/5] Alter steal time reporting in KVM

2012-11-27 Thread Marcelo Tosatti
On Tue, Nov 27, 2012 at 09:24:42PM -0200, Marcelo Tosatti wrote: On Mon, Nov 26, 2012 at 02:36:24PM -0600, Michael Wolf wrote: In the case of where you have a system that is running in a capped or overcommitted environment the user may see steal time being reported in accounting tools

Re: [PATCH V3 RFC 2/2] kvm: Handle yield_to failure return code for potential undercommit case

2012-11-27 Thread Marcelo Tosatti
Don't understand the reasoning behind why 3 is a good choice. On Mon, Nov 26, 2012 at 05:38:04PM +0530, Raghavendra K T wrote: From: Raghavendra K T raghavendra...@linux.vnet.ibm.com yield_to returns -ESRCH, When source and target of yield_to run queue length is one. When we see three

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

2012-11-26 Thread Marcelo Tosatti
On Mon, Nov 26, 2012 at 03:49:36PM -0800, H. Peter Anvin wrote: > On 11/26/2012 03:48 PM, Marcelo Tosatti wrote: > >> > >> Gleb, Marcelo: are you going to apply this or would you prefer I took it > >> in x86/urgent? > >> > >>-hpa > > >

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

2012-11-26 Thread Marcelo Tosatti
On Mon, Nov 26, 2012 at 02:48:50PM -0800, H. Peter Anvin wrote: > On 11/25/2012 11:22 PM, Paolo Bonzini wrote: > > Il 21/11/2012 23:41, H. Peter Anvin ha scritto: > >> From: "H. Peter Anvin" > >> > >> In __emulate_1op_rax_rdx, we use "+a" and "+d" which are input/output > >> constraints, and

<    9   10   11   12   13   14   15   16   17   18   >