Re: [PATCH 0/3] Trivial KVM patches for 3.12

2013-08-27 Thread Gleb Natapov
On Tue, Aug 27, 2013 at 03:41:40PM +0200, Paolo Bonzini wrote: > Gleb, > > these are fixups for the patches I sent on July 31. It would > be nice to have them for the next merge window. > > Thanks, > Applied, thanks. > Paolo > > Paolo Bonzini (3): > KVM: rename __kvm_io_bus_sort_cmp to kvm_

Re: [PATCH 06/12] KVM: MMU: flush tlb if the spte can be locklessly modified

2013-08-28 Thread Gleb Natapov
On Tue, Jul 30, 2013 at 09:02:04PM +0800, Xiao Guangrong wrote: > Relax the tlb flush condition since we will write-protect the spte out of mmu > lock. Note lockless write-protection only marks the writable spte to readonly > and the spte can be writable only if both SPTE_HOST_WRITEABLE and > SPTE_

Re: [PATCH 07/12] KVM: MMU: redesign the algorithm of pte_list

2013-08-28 Thread Gleb Natapov
On Tue, Jul 30, 2013 at 09:02:05PM +0800, Xiao Guangrong wrote: > Change the algorithm to: > 1) always add new desc to the first desc (pointed by parent_ptes/rmap) >that is good to implement rcu-nulls-list-like lockless rmap >walking > > 2) always move the entry in first desc to the the po

Re: [PATCH 08/12] KVM: MMU: introduce nulls desc

2013-08-28 Thread Gleb Natapov
On Tue, Jul 30, 2013 at 09:02:06PM +0800, Xiao Guangrong wrote: > It likes nulls list and we use the pte-list as the nulls which can help us to > detect whether the "desc" is moved to anther rmap then we can re-walk the rmap > if that happened > > Signed-off-by: Xiao Guangrong > --- > arch/x86/k

Re: [PATCH 07/12] KVM: MMU: redesign the algorithm of pte_list

2013-08-28 Thread Gleb Natapov
On Wed, Aug 28, 2013 at 04:37:32PM +0800, Xiao Guangrong wrote: > On 08/28/2013 04:12 PM, Gleb Natapov wrote: > > >> + > >> + rmap_printk("pte_list_add: %p %llx many->many\n", spte, *spte); > >> + desc = (struct pte_list_desc *)(*pte_list & ~1ul

Re: [PATCH 09/12] KVM: MMU: introduce pte-list lockless walker

2013-08-28 Thread Gleb Natapov
On Tue, Jul 30, 2013 at 09:02:07PM +0800, Xiao Guangrong wrote: > The basic idea is from nulls list which uses a nulls to indicate > whether the desc is moved to different pte-list > > Thanks to SLAB_DESTROY_BY_RCU, the desc can be quickly reused > > Signed-off-by: Xiao Guangrong > --- > arch/x

Re: [PATCH 09/12] KVM: MMU: introduce pte-list lockless walker

2013-08-28 Thread Gleb Natapov
On Wed, Aug 28, 2013 at 05:33:49PM +0800, Xiao Guangrong wrote: > > Or what if desc is moved to another rmap, but then it > > is moved back to initial rmap (but another place in the desc list) so > > the check here will not catch that we need to restart walking? > > It is okay. We always add the n

Re: [PATCH 09/12] KVM: MMU: introduce pte-list lockless walker

2013-08-28 Thread Gleb Natapov
On Wed, Aug 28, 2013 at 06:13:43PM +0800, Xiao Guangrong wrote: > On 08/28/2013 05:46 PM, Gleb Natapov wrote: > > On Wed, Aug 28, 2013 at 05:33:49PM +0800, Xiao Guangrong wrote: > >>> Or what if desc is moved to another rmap, but then it > >>> is moved back to i

Re: [PATCH 09/12] KVM: MMU: introduce pte-list lockless walker

2013-08-28 Thread Gleb Natapov
On Wed, Aug 28, 2013 at 08:15:36PM +0800, Xiao Guangrong wrote: > On 08/28/2013 06:49 PM, Gleb Natapov wrote: > > On Wed, Aug 28, 2013 at 06:13:43PM +0800, Xiao Guangrong wrote: > >> On 08/28/2013 05:46 PM, Gleb Natapov wrote: > >>> On Wed, Aug 28, 2013 at 05:33:49

Re: [RFC PATCH 00/12] KVM: MMU: locklessly wirte-protect

2013-08-29 Thread Gleb Natapov
On Sat, Aug 03, 2013 at 02:09:43PM +0900, Takuya Yoshikawa wrote: > On Tue, 30 Jul 2013 21:01:58 +0800 > Xiao Guangrong wrote: > > > Background > > == > > Currently, when mark memslot dirty logged or get dirty page, we need to > > write-protect large guest memory, it is the heavy work, es

Re: [PATCH 01/12] KVM: MMU: remove unused parameter

2013-08-29 Thread Gleb Natapov
On Tue, Jul 30, 2013 at 09:01:59PM +0800, Xiao Guangrong wrote: > @vcpu in page_fault_can_be_fast() is not used so remove it > > Signed-off-by: Xiao Guangrong Applied this one. Thanks. > --- > arch/x86/kvm/mmu.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/

Re: [PATCH 09/12] KVM: MMU: introduce pte-list lockless walker

2013-08-29 Thread Gleb Natapov
On Thu, Aug 29, 2013 at 02:50:51PM +0800, Xiao Guangrong wrote: > >>> BTW I do not see > >>> rcu_assign_pointer()/rcu_dereference() in your patches which hints on > >> > >> IIUC, We can not directly use rcu_assign_pointer(), that is something like: > >> p = v to assign a pointer to a pointer. But i

Re: [PATCH 10/12] KVM: MMU: allow locklessly access shadow page table out of vcpu thread

2013-08-29 Thread Gleb Natapov
On Tue, Jul 30, 2013 at 09:02:08PM +0800, Xiao Guangrong wrote: > It is easy if the handler is in the vcpu context, in that case we can use > walk_shadow_page_lockless_begin() and walk_shadow_page_lockless_end() that > disable interrupt to stop shadow page be freed. But we are on the ioctl > conte

Re: [PATCH 09/12] KVM: MMU: introduce pte-list lockless walker

2013-08-29 Thread Gleb Natapov
On Thu, Aug 29, 2013 at 02:50:51PM +0800, Xiao Guangrong wrote: > After more thinking, I still think rcu_assign_pointer() is unneeded when a > entry > is removed. The remove-API does not care the order between unlink the entry > and > the changes to its fields. It is the caller's responsibility:

Re: [PATCH 09/12] KVM: MMU: introduce pte-list lockless walker

2013-08-29 Thread Gleb Natapov
On Thu, Aug 29, 2013 at 05:31:42PM +0800, Xiao Guangrong wrote: > > As Documentation/RCU/whatisRCU.txt says: > > > > As with rcu_assign_pointer(), an important function of > > rcu_dereference() is to document which pointers are protected by > > RCU, in particular, flagging

[PULL] KVM fixes for 3.12-rc4

2013-10-01 Thread Gleb Natapov
u to fetch changes up to bcd1c2949501869631b25fd62d8df5079677a101: KVM: VMX: do not check bit 12 of EPT violation exit qualification when undefined (2013-09-25 11:38:26 +0200) ---- Gleb Natapov (1): KVM: VMX: do not check bit

Re: [PATCH v3 1/3] tile: support KVM host mode

2013-10-01 Thread Gleb Natapov
On Mon, Sep 30, 2013 at 04:11:18PM -0400, Chris Metcalf wrote: > On 9/10/2013 6:53 AM, Gleb Natapov wrote: > > On Wed, Aug 28, 2013 at 03:45:50PM -0400, Chris Metcalf wrote: > >> This commit enables the host side of KVM support for tilegx. > >> > >> [...] >

Re: [PATCH 3/3] KVM: PPC: Book3S: Add support for hwrng found on some powernv systems

2013-10-02 Thread Gleb Natapov
On Wed, Oct 02, 2013 at 11:50:50AM +0200, Alexander Graf wrote: > > On 02.10.2013, at 11:11, Alexander Graf wrote: > > > > > On 02.10.2013, at 11:06, Benjamin Herrenschmidt wrote: > > > >> On Wed, 2013-10-02 at 10:46 +0200, Paolo Bonzini wrote: > >> > >>> > >>> Thanks. Any chance you can giv

Re: [PATCH 1/1] virt/kvm/iommu.c: Add leading zeros to device's BDF notation in debug messages

2013-10-02 Thread Gleb Natapov
On Wed, Oct 02, 2013 at 12:23:26PM +0200, Andre Richter wrote: > When KVM (de)assigns PCI(e) devices to VMs, a debug message is printed > including the BDF notation of the respective device. Currently, the BDF > notation does not have the commonly used leading zeros. This produces > messages like "

Re: [PATCH 3/3] KVM: PPC: Book3S: Add support for hwrng found on some powernv systems

2013-10-02 Thread Gleb Natapov
On Wed, Oct 02, 2013 at 11:57:55PM +1000, Michael Ellerman wrote: > On Wed, 2013-10-02 at 13:02 +0300, Gleb Natapov wrote: > > On Wed, Oct 02, 2013 at 11:50:50AM +0200, Alexander Graf wrote: > > > > > > On 02.10.2013, at 11:11, Alexander Graf wrote: > > > >

Re: [PATCH 3/3] KVM: PPC: Book3S: Add support for hwrng found on some powernv systems

2013-10-02 Thread Gleb Natapov
On Wed, Oct 02, 2013 at 04:33:18PM +0200, Paolo Bonzini wrote: > Il 02/10/2013 16:08, Alexander Graf ha scritto: > > > The hwrng is accessible by host userspace via /dev/mem. > > > > A guest should live on the same permission level as a user space > > application. If you run QEMU as UID 1000 witho

Re: [PATCH 17/26] kvm: Use get_user_pages_unlocked() in async_pf_execute()

2013-10-02 Thread Gleb Natapov
Looks straightforward. On Wed, Oct 02, 2013 at 04:27:58PM +0200, Jan Kara wrote: > CC: Gleb Natapov > CC: Paolo Bonzini > CC: k...@vger.kernel.org > Signed-off-by: Jan Kara > --- > virt/kvm/async_pf.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) >

Re: [PATCH 3/3] KVM: PPC: Book3S: Add support for hwrng found on some powernv systems

2013-10-02 Thread Gleb Natapov
On Thu, Oct 03, 2013 at 08:02:20AM +1000, Benjamin Herrenschmidt wrote: > On Wed, 2013-10-02 at 13:02 +0300, Gleb Natapov wrote: > > > Yes, I alluded to it in my email to Paul and Paolo asked also. How this > > interface is disabled? Also hwrnd is MMIO in a host why gues

Re: [PATCH 3/3] KVM: PPC: Book3S: Add support for hwrng found on some powernv systems

2013-10-02 Thread Gleb Natapov
On Thu, Oct 03, 2013 at 08:45:42AM +1000, Paul Mackerras wrote: > On Wed, Oct 02, 2013 at 04:36:05PM +0200, Alexander Graf wrote: > > > > On 02.10.2013, at 16:33, Paolo Bonzini wrote: > > > > > Il 02/10/2013 16:08, Alexander Graf ha scritto: > > >>> The hwrng is accessible by host userspace via /

Re: [PATCH 3/3] KVM: PPC: Book3S: Add support for hwrng found on some powernv systems

2013-10-02 Thread Gleb Natapov
On Thu, Oct 03, 2013 at 08:21:20AM +1000, Benjamin Herrenschmidt wrote: > On Wed, 2013-10-02 at 17:37 +0300, Gleb Natapov wrote: > > On Wed, Oct 02, 2013 at 04:33:18PM +0200, Paolo Bonzini wrote: > > > Il 02/10/2013 16:08, Alexander Graf ha scritto: > > > > >

Re: [PATCH 3/3] KVM: PPC: Book3S: Add support for hwrng found on some powernv systems

2013-10-02 Thread Gleb Natapov
On Thu, Oct 03, 2013 at 08:07:22AM +1000, Benjamin Herrenschmidt wrote: > On Wed, 2013-10-02 at 13:02 +0300, Gleb Natapov wrote: > > > Yes, I alluded to it in my email to Paul and Paolo asked also. How this > > interface is disabled? Also hwrnd is MMIO in a host why gues

Re: [PATCH 1/1] virt/kvm/iommu.c: Add leading zeros to device's BDF notation in debug messages

2013-10-03 Thread Gleb Natapov
On Wed, Oct 02, 2013 at 12:23:26PM +0200, Andre Richter wrote: > When KVM (de)assigns PCI(e) devices to VMs, a debug message is printed > including the BDF notation of the respective device. Currently, the BDF > notation does not have the commonly used leading zeros. This produces > messages like "

Re: [PATCH v3 0/3] KVM: prepare for future XSAVE extensions

2013-10-03 Thread Gleb Natapov
On Wed, Oct 02, 2013 at 04:06:13PM +0200, Paolo Bonzini wrote: > As soon as the kernel will support the XSAVE extensions in Skylake > processors, we will want both userspace and the hypervisor to run > guests without showing any trace of the new features (because > support for them in the hyperviso

Re: [PATCH 2/7] KVM: mmu: remove uninteresting MMU "new_cr3" callbacks

2013-10-03 Thread Gleb Natapov
On Wed, Oct 02, 2013 at 04:56:11PM +0200, Paolo Bonzini wrote: > The new_cr3 MMU callback has been a wrapper for mmu_free_roots since commit > e676505 (KVM: MMU: Force cr3 reload with two dimensional paging on mov > cr3 emulation, 2012-07-08). > > The commit message mentioned that "mmu_free_roots(

Re: [PATCH 5/7] KVM: mmu: remove argument to kvm_init_shadow_mmu and kvm_init_shadow_ept_mmu

2013-10-03 Thread Gleb Natapov
On Wed, Oct 02, 2013 at 04:56:14PM +0200, Paolo Bonzini wrote: > The initialization function in mmu.c can always use walk_mmu, which > is known to be vcpu->arch.mmu. Only init_kvm_nested_mmu is used to > initialize vcpu->arch.nested_mmu. > > Signed-off-by: Paolo Bonzini > --- > arch/x86/kvm/mmu

Re: [PATCH 3/3] KVM: PPC: Book3S: Add support for hwrng found on some powernv systems

2013-10-03 Thread Gleb Natapov
On Thu, Oct 03, 2013 at 08:06:30PM +1000, Paul Mackerras wrote: > On Thu, Oct 03, 2013 at 08:48:03AM +0300, Gleb Natapov wrote: > > On Thu, Oct 03, 2013 at 08:45:42AM +1000, Paul Mackerras wrote: > > > On Wed, Oct 02, 2013 at 04:36:05PM +0200, Alexander Graf wrote: > > &g

Re: [PATCH 5/7] KVM: mmu: remove argument to kvm_init_shadow_mmu and kvm_init_shadow_ept_mmu

2013-10-03 Thread Gleb Natapov
On Thu, Oct 03, 2013 at 01:51:09PM +0200, Paolo Bonzini wrote: > Il 03/10/2013 13:25, Gleb Natapov ha scritto: > > On Wed, Oct 02, 2013 at 04:56:14PM +0200, Paolo Bonzini wrote: > >> The initialization function in mmu.c can always use walk_mmu, which > >> is known

[PULL] KVM fix for 3.12-rc4

2013-10-03 Thread Gleb Natapov
t: git://git.kernel.org/pub/scm/virt/kvm/kvm.git master for you to fetch changes up to a2ac07fe292ea41296049dfdbfeed203e2467ee7: Fix NULL dereference in gfn_to_hva_prot() (2013-10-03 10:08:52 +0300) ---- Gleb Natapov (1): Fix NULL dere

Re: [PATCH 0/7] KVM: x86: small MMU cleanups

2013-10-03 Thread Gleb Natapov
On Wed, Oct 02, 2013 at 04:56:09PM +0200, Paolo Bonzini wrote: > A few small things (uninteresting callbacks or arguments, duplicate or > dead code) that I noticed while reviewing Gleb's latest nVMX series. > I applied 1-4 meanwhile. > Paolo Bonzini (7): > KVM: mmu: remove uninteresting MMU "fr

[GIT PULL] more KVM changes for 3.11

2013-07-08 Thread Gleb Natapov
Kconfig. Gleb Natapov (1): KVM: VMX: mark unusable segment as nonpresent Marc Zyngier (1): arm64: KVM: Kconfig integration arch/arm64/Kconfig |2 ++ arch/arm64/kernel/asm-offsets.c |1 + arch/arm64/kvm

Re: [PATCH 1/4] PF: Add FAULT_FLAG_RETRY_NOWAIT for guest fault

2013-07-09 Thread Gleb Natapov
On Tue, Jul 09, 2013 at 03:56:44PM +0200, Dominik Dingel wrote: > In case of a fault retry exit sie64() with gmap_fault indication for the > running thread set. This makes it possible to handle async page faults > without the need for mm notifiers. > > Based on a patch from Martin Schwidefsky. >

Re: [PATCH 1/4] PF: Add FAULT_FLAG_RETRY_NOWAIT for guest fault

2013-07-09 Thread Gleb Natapov
On Tue, Jul 09, 2013 at 05:36:46PM +0200, Christian Borntraeger wrote: > On 09/07/13 17:23, Gleb Natapov wrote: > > On Tue, Jul 09, 2013 at 03:56:44PM +0200, Dominik Dingel wrote: > >> In case of a fault retry exit sie64() with gmap_fault indication for the > >> runnin

Re: [PATCH 2/4] PF: Make KVM_HVA_ERR_BAD usable on s390

2013-07-09 Thread Gleb Natapov
On Tue, Jul 09, 2013 at 03:56:45PM +0200, Dominik Dingel wrote: > Current common code 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), an additional implementation

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

2013-07-10 Thread Gleb Natapov
On Tue, Jul 09, 2013 at 02:41:30PM +0530, Raghavendra K T wrote: > On 06/26/2013 11:24 PM, Raghavendra K T wrote: > >On 06/26/2013 09:41 PM, Gleb Natapov wrote: > >>On Wed, Jun 26, 2013 at 07:10:21PM +0530, Raghavendra K T wrote: > >>>On 06/26/2013 06:22 PM, Gleb Na

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

2013-07-10 Thread Gleb Natapov
On Wed, Jul 10, 2013 at 12:39:01PM +0200, Alexander Graf wrote: > > On 09.07.2013, at 18:01, Christian Borntraeger wrote: > > > On 09/07/13 15:56, Dominik Dingel wrote: > >> By setting a Kconfig option, the architecture can control when > >> guest notifications will be presented by the apf backen

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

2013-07-10 Thread Gleb Natapov
On Wed, Jul 10, 2013 at 12:40:47PM +0200, Peter Zijlstra wrote: > On Wed, Jul 10, 2013 at 01:33:25PM +0300, Gleb Natapov wrote: > > Here's an idea, trim the damn email ;-) -- not only directed at gleb. > Good idea. > > > Ingo, Gleb, > > > > > >

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

2013-07-10 Thread Gleb Natapov
On Wed, Jul 10, 2013 at 12:45:59PM +0200, Alexander Graf wrote: > > On 10.07.2013, at 12:42, Gleb Natapov wrote: > > > On Wed, Jul 10, 2013 at 12:39:01PM +0200, Alexander Graf wrote: > >> > >> On 09.07.2013, at 18:01, Christian Borntraeger wrote: > >>

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

2013-07-10 Thread Gleb Natapov
On Wed, Jul 10, 2013 at 04:58:29PM +0530, Raghavendra K T wrote: > On 07/10/2013 04:17 PM, Gleb Natapov wrote: > >On Wed, Jul 10, 2013 at 12:40:47PM +0200, Peter Zijlstra wrote: > >>On Wed, Jul 10, 2013 at 01:33:25PM +0300, Gleb Natapov wrote: > >> > >>

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

2013-07-10 Thread Gleb Natapov
On Wed, Jul 10, 2013 at 04:54:12PM +0530, Raghavendra K T wrote: > >>Ingo, Gleb, > >> > >> From the results perspective, Andrew Theurer, Vinod's test results are > >>pro-pvspinlock. > >>Could you please help me to know what will make it a mergeable > >>candidate?. > >> > >I need to spend more time

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

2013-07-10 Thread Gleb Natapov
On Wed, Jul 10, 2013 at 11:03:15AM -0400, Konrad Rzeszutek Wilk wrote: > On Wed, Jul 10, 2013 at 01:47:17PM +0300, Gleb Natapov wrote: > > On Wed, Jul 10, 2013 at 12:40:47PM +0200, Peter Zijlstra wrote: > > > On Wed, Jul 10, 2013 at 01:33:25PM +0300, Gleb Natapov wrote: > >

Re: [PATCH] kvm: reset arch memslot info on memslot creation

2013-07-11 Thread Gleb Natapov
On Wed, Jul 10, 2013 at 10:49:56PM +0900, Takuya Yoshikawa wrote: > On Wed, 10 Jul 2013 11:24:39 +0300 > "Michael S. Tsirkin" wrote: > > > On x86, kvm_arch_create_memslot assumes that rmap/lpage_info for the > > slot are zeroed out: if they weren't, error handling code after out_free > > label wi

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

2013-07-11 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 4/4] PF: Async page fault support on s390

2013-07-11 Thread Gleb Natapov
On Wed, Jul 10, 2013 at 02:59:55PM +0200, Dominik Dingel wrote: > This patch enables async page faults for s390 kvm guests. > It provides the userspace API to enable, disable or get the status of this > feature. Also it includes the diagnose code, called by the guest to enable > async page faults.

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

2013-07-11 Thread Gleb Natapov
On Thu, Jul 11, 2013 at 02:43:03PM +0530, Raghavendra K T wrote: > On 07/10/2013 04:03 PM, Gleb Natapov wrote: > [...] trimmed > > >>>Yes. you are right. dynamic ple window was an attempt to solve it. > >>> > >>>Probelm is, reducing the SPIN_THRESH

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

2013-07-11 Thread Gleb Natapov
On Thu, Jul 11, 2013 at 03:40:38PM +0530, Raghavendra K T wrote: > Gleb, > Can you elaborate little more on what you have in mind regarding per > VM ple_window. (maintaining part of it as a per vm variable is clear > to > me), but is it that we have to load that every time of

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

2013-07-11 Thread Gleb Natapov
On Thu, Jul 11, 2013 at 04:23:58PM +0530, Raghavendra K T wrote: > On 07/11/2013 03:41 PM, Gleb Natapov wrote: > >On Thu, Jul 11, 2013 at 03:40:38PM +0530, Raghavendra K T wrote: > >>>>>>Gleb, > >>>>>>Can you elaborate little more on what y

Re: [PATCH 4/4] PF: Async page fault support on s390

2013-07-11 Thread Gleb Natapov
On Thu, Jul 11, 2013 at 12:41:37PM +0200, Christian Borntraeger wrote: > On 11/07/13 11:04, Gleb Natapov wrote: > > On Wed, Jul 10, 2013 at 02:59:55PM +0200, Dominik Dingel wrote: > >> This patch enables async page faults for s390 kvm guests. > >> It provides the users

Re: [PATCH] [RFC] x86: kvm: remove KVM_SOFT_MAX_VCPUS

2013-09-15 Thread Gleb Natapov
On Sat, Sep 14, 2013 at 02:16:51PM +0200, Andrew Jones wrote: > This patch removes KVM_SOFT_MAX_VCPUS and uses num_online_cpus() for > KVM_CAP_NR_VCPUS instead, as ARM does. While the API doc simply says > KVM_CAP_NR_VCPUS should return the recommended maximum number of vcpus, > it has been returni

Re: [PATCH] x86: kvm: introduce CONFIG_KVM_MAX_VCPUS

2013-09-15 Thread Gleb Natapov
On Sat, Sep 14, 2013 at 02:18:49PM +0200, Andrew Jones wrote: > Take CONFIG_KVM_MAX_VCPUS from arm32, but set the default to 255. > > Signed-off-by: Andrew Jones > --- > arch/x86/include/asm/kvm_host.h | 5 +++-- > arch/x86/kvm/Kconfig| 10 ++ > 2 files changed, 13 insertion

Re: [PATCH 2/3] arm32: kvm: rename CONFIG_KVM_ARM_MAX_VCPUS

2013-09-15 Thread Gleb Natapov
On Sat, Sep 14, 2013 at 02:10:55PM +0200, Andrew Jones wrote: > Drop the _ARM_ part of the name. We can then introduce a config option > like this to aarch64 and other arches using the same name - allowing > grep to show them all. Also update the help text to describe the option > more completely.

Re: [PATCH v2 00/15] KVM: MMU: locklessly wirte-protect

2013-09-15 Thread Gleb Natapov
Marcelo do you feel your comments are addressed in patches 3 and 5 of this series? On Thu, Sep 05, 2013 at 06:29:03PM +0800, Xiao Guangrong wrote: > Changelog v2: > > - the changes from Gleb's review: > 1) fix calculating the number of spte in the pte_list_add() > 2) set iter->desc to NULL if

Re: [PATCH 2/3] arm32: kvm: rename CONFIG_KVM_ARM_MAX_VCPUS

2013-09-16 Thread Gleb Natapov
On Mon, Sep 16, 2013 at 09:09:27AM +0100, Marc Zyngier wrote: > On 15/09/13 10:30, Gleb Natapov wrote: > > On Sat, Sep 14, 2013 at 02:10:55PM +0200, Andrew Jones wrote: > >> Drop the _ARM_ part of the name. We can then introduce a config option > >> like this to aarch64

Re: [PATCH] x86: kvm: introduce CONFIG_KVM_MAX_VCPUS

2013-09-16 Thread Gleb Natapov
On Mon, Sep 16, 2013 at 10:28:20AM +0200, Andrew Jones wrote: > On Sun, Sep 15, 2013 at 12:08:38PM +0300, Gleb Natapov wrote: > > On Sat, Sep 14, 2013 at 02:18:49PM +0200, Andrew Jones wrote: > > > Take CONFIG_KVM_MAX_VCPUS from arm32, but set the default to 255. > > >

Re: [PATCH] [RFC] x86: kvm: remove KVM_SOFT_MAX_VCPUS

2013-09-16 Thread Gleb Natapov
On Mon, Sep 16, 2013 at 10:22:09AM +0200, Andrew Jones wrote: > > > [1] Actually, until 972fc544b6034a in uq/master is merged there won't be > > > any warnings either. > > > > > > Signed-off-by: Andrew Jones > > > --- > > > arch/x86/include/asm/kvm_host.h | 1 - > > > arch/x86/kvm/x86.c

Re: [PATCH v2 09/15] KVM: MMU: introduce pte-list lockless walker

2013-09-16 Thread Gleb Natapov
On Thu, Sep 05, 2013 at 06:29:12PM +0800, Xiao Guangrong wrote: > The basic idea is from nulls list which uses a nulls to indicate > whether the desc is moved to different pte-list > > Note, we should do bottom-up walk in the desc since we always move > the bottom entry to the deleted position. A

Re: [PATCH] x86: kvm: introduce CONFIG_KVM_MAX_VCPUS

2013-09-16 Thread Gleb Natapov
On Mon, Sep 16, 2013 at 02:03:33PM +0200, Andrew Jones wrote: > On Mon, Sep 16, 2013 at 11:47:10AM +0300, Gleb Natapov wrote: > > On Mon, Sep 16, 2013 at 10:28:20AM +0200, Andrew Jones wrote: > > > On Sun, Sep 15, 2013 at 12:08:38PM +0300, Gleb Natapov wrote: > > > >

Re: [PATCH] [RFC] x86: kvm: remove KVM_SOFT_MAX_VCPUS

2013-09-16 Thread Gleb Natapov
On Mon, Sep 16, 2013 at 01:47:26PM +0200, Andrew Jones wrote: > On Mon, Sep 16, 2013 at 11:55:17AM +0300, Gleb Natapov wrote: > > On Mon, Sep 16, 2013 at 10:22:09AM +0200, Andrew Jones wrote: > > > > > [1] Actually, until 972fc544b6034a in uq/master is merged t

Re: [PATCH v2 09/15] KVM: MMU: introduce pte-list lockless walker

2013-09-16 Thread Gleb Natapov
On Mon, Sep 16, 2013 at 09:52:26PM +0800, Xiao Guangrong wrote: > Hi Gleb, > > On 09/16/2013 08:42 PM, Gleb Natapov wrote: > > >> static unsigned long *__gfn_to_rmap(gfn_t gfn, int level, > >>struct kvm_memory_slot *slot) > >

Re: [PATCH] [RFC] x86: kvm: remove KVM_SOFT_MAX_VCPUS

2013-09-17 Thread Gleb Natapov
On Mon, Sep 16, 2013 at 05:22:26PM +0200, Andrew Jones wrote: > On Mon, Sep 16, 2013 at 05:41:18PM +0300, Gleb Natapov wrote: > > On Mon, Sep 16, 2013 at 01:47:26PM +0200, Andrew Jones wrote: > > > On Mon, Sep 16, 2013 at 11:55:17AM +0300, Gleb Natapov wrote: > > > >

Re: [PATCH] [RFC] x86: kvm: remove KVM_SOFT_MAX_VCPUS

2013-09-17 Thread Gleb Natapov
On Tue, Sep 17, 2013 at 12:03:09PM +0200, Andrew Jones wrote: > On Tue, Sep 17, 2013 at 12:36:19PM +0300, Gleb Natapov wrote: > > On Mon, Sep 16, 2013 at 05:22:26PM +0200, Andrew Jones wrote: > > > On Mon, Sep 16, 2013 at 05:41:18PM +0300, Gleb Natapov wrote: > > > >

Re: [PATCH V2 1/1] X86: Hyper-V: Get the local APIC timer frequency from the hypervisor

2013-09-17 Thread Gleb Natapov
On Fri, Sep 13, 2013 at 02:28:35PM +, KY Srinivasan wrote: > > > > -Original Message- > > From: Gleb Natapov [mailto:g...@redhat.com] > > Sent: Friday, September 13, 2013 2:55 AM > > To: KY Srinivasan > > Cc: H. Peter Anvin; x...@kernel.org; gre...

Re: [PATCH V2 1/1] X86: Hyper-V: Get the local APIC timer frequency from the hypervisor

2013-09-17 Thread Gleb Natapov
On Tue, Sep 17, 2013 at 07:53:36PM +, KY Srinivasan wrote: > > > Thanks Gleb. Here is the link for the latest Hyper-V specification: > > > http://www.microsoft.com/en-us/download/details.aspx?id=39289 > > > > > > This spec talks about how migration is handled with regards to TSC. > > > > > All

Re: [PATCH 3/3] aarch64: kvm: introduce CONFIG_KVM_MAX_VCPUS

2013-09-17 Thread Gleb Natapov
On Tue, Sep 17, 2013 at 10:34:28PM +0100, Christoffer Dall wrote: > On Sat, Sep 14, 2013 at 02:10:56PM +0200, Andrew Jones wrote: > > Take CONFIG_KVM_MAX_VCPUS from arm32, but set the default to 8. > > > > Signed-off-by: Andrew Jones > > --- > > arch/arm64/include/asm/kvm_host.h | 7 ++- > >

Re: [PATCH V3] Documentation/kvm: Update cpuid documentation for steal time and pv eoi

2013-09-18 Thread Gleb Natapov
On Wed, Sep 18, 2013 at 03:22:21PM +0530, Raghavendra K T wrote: > On 09/12/2013 01:58 PM, Michael S. Tsirkin wrote: > >On Thu, Sep 12, 2013 at 01:00:11PM +0530, Raghavendra K T wrote: > >>Thanks Michael S Tsirkin for rewriting the description and suggestions. > >> > >>Signed-off-by: Raghavendra K

Re: [PATCH V2 1/1] X86: Hyper-V: Get the local APIC timer frequency from the hypervisor

2013-09-04 Thread Gleb Natapov
On Tue, Sep 03, 2013 at 11:30:23AM -0700, K. Y. Srinivasan wrote: > Hyper-V supports a mechanism for retrieving the local APIC frequency.Use this > and bypass > the calibration code in the kernel. This would allow us to boot the Linux > kernel as a > "modern VM" on Hyper-V where many of the legac

Re: [GIT PULL] KVM changes for 3.12

2013-09-04 Thread Gleb Natapov
Copying Marek, Aneesh and Alex since this came through PPC kvm tree. On Wed, Sep 04, 2013 at 12:18:28PM +0200, Thierry Reding wrote: > On Tue, Sep 03, 2013 at 03:10:46PM +0300, Gleb Natapov wrote: > [...] > > Aneesh Kumar K.V (5): > > mm/cma: Move dma contiguous chang

Re: [PATCH V2 1/1] X86: Hyper-V: Get the local APIC timer frequency from the hypervisor

2013-09-05 Thread Gleb Natapov
On Wed, Sep 04, 2013 at 03:16:30PM +, KY Srinivasan wrote: > > > > -Original Message- > > From: Gleb Natapov [mailto:g...@redhat.com] > > Sent: Wednesday, September 04, 2013 2:40 AM > > To: KY Srinivasan > > Cc: x...@kernel.org; gre...@li

Re: [PATCH v9 12/13] KVM: PPC: Add support for IOMMU in-kernel handling

2013-09-05 Thread Gleb Natapov
On Wed, Sep 04, 2013 at 02:01:28AM +1000, Alexey Kardashevskiy wrote: > On 09/03/2013 08:53 PM, Gleb Natapov wrote: > > On Mon, Sep 02, 2013 at 01:14:29PM +1000, Alexey Kardashevskiy wrote: > >> On 09/01/2013 10:06 PM, Gleb Natapov wrote: > >>> On Wed, Aug 28, 20

Re: [PATCH v9 12/13] KVM: PPC: Add support for IOMMU in-kernel handling

2013-09-05 Thread Gleb Natapov
On Fri, Sep 06, 2013 at 09:38:21AM +1000, Alexey Kardashevskiy wrote: > On 09/06/2013 04:10 AM, Gleb Natapov wrote: > > On Wed, Sep 04, 2013 at 02:01:28AM +1000, Alexey Kardashevskiy wrote: > >> On 09/03/2013 08:53 PM, Gleb Natapov wrote: > >>> On Mon, Sep 02, 20

Re: [PATCH v9 12/13] KVM: PPC: Add support for IOMMU in-kernel handling

2013-09-05 Thread Gleb Natapov
On Thu, Sep 05, 2013 at 02:05:09PM +1000, Benjamin Herrenschmidt wrote: > On Tue, 2013-09-03 at 13:53 +0300, Gleb Natapov wrote: > > > Or supporting all IOMMU links (and leaving emulated stuff as is) in on > > > "device" is the last thing I have to do and then you&#x

Re: [PATCH 0/2] kvm: fix a bug and remove a redundancy in async_pf

2013-09-08 Thread Gleb Natapov
On Wed, Sep 04, 2013 at 10:32:22PM +0200, Radim Krčmář wrote: > I did not reproduce the bug fixed in [1/2], but there are not that many > reasons why we could not unload a module, so the spot is quite obvious. > > Reviewed-by: Gleb Natapov > Radim Krčmář (2): > kvm: fr

Re: [PATCH v2] KVM: mmu: allow page tables to be in read-only slots

2013-09-08 Thread Gleb Natapov
checks it when updating the accessed and > dirty bits. > > Note that this scenario is not supported by NPT at all, as explained by > comments in the code. > > Cc: sta...@vger.kernel.org > Cc: k...@vger.kernel.org > Cc: Xiao Guangrong > Cc: Gleb Natapov > Signed-off-by

Re: [PATCH] KVM: x86: prevent setting unsupported XSAVE states

2013-09-08 Thread Gleb Natapov
r kernel/processor before the > guest starts running. > > Cc: k...@vger.kernel.org > Cc: Gleb Natapov > Signed-off-by: Paolo Bonzini > --- > arch/x86/kvm/cpuid.c | 2 +- > arch/x86/kvm/x86.c | 10 -- > arch/x86/kvm/x86.h | 1 + > 3 files changed, 10 ins

Re: [PATCH v2 01/15] KVM: MMU: fix the count of spte number

2013-09-08 Thread Gleb Natapov
On Thu, Sep 05, 2013 at 06:29:04PM +0800, Xiao Guangrong wrote: > If the desc is the last one and it is full, its sptes is not counted > Hmm, if desc is not full but it is not the last one all sptes after the desc are not counted too. > Signed-off-by: Xiao Guangrong > --- > arch/x86/kvm/mmu.c |

Re: [PATCH v2 01/15] KVM: MMU: fix the count of spte number

2013-09-08 Thread Gleb Natapov
On Sun, Sep 08, 2013 at 09:55:04PM +0800, Xiao Guangrong wrote: > > On Sep 8, 2013, at 8:19 PM, Gleb Natapov wrote: > > > On Thu, Sep 05, 2013 at 06:29:04PM +0800, Xiao Guangrong wrote: > >> If the desc is the last one and it is full, its sptes is not counted > >&

Re: [PATCH v10 12/13] KVM: PPC: Add support for IOMMU in-kernel handling

2013-09-08 Thread Gleb Natapov
On Fri, Sep 06, 2013 at 08:40:26PM +1000, Alexey Kardashevskiy wrote: > This allows the host kernel to handle H_PUT_TCE, H_PUT_TCE_INDIRECT > and H_STUFF_TCE requests targeted an IOMMU TCE table without passing > them to user space which saves time on switching to user space and back. > > Both rea

Re: [PATCH v2 01/15] KVM: MMU: fix the count of spte number

2013-09-08 Thread Gleb Natapov
On Sun, Sep 08, 2013 at 10:24:05PM +0800, Xiao Guangrong wrote: > > On Sep 8, 2013, at 10:01 PM, Gleb Natapov wrote: > > > On Sun, Sep 08, 2013 at 09:55:04PM +0800, Xiao Guangrong wrote: > >> > >> On Sep 8, 2013, at 8:19 PM, Gleb Natapov wrote: > >>

Re: [PATCH] KVM: x86: prevent setting unsupported XSAVE states

2013-09-09 Thread Gleb Natapov
On Mon, Sep 09, 2013 at 04:09:47PM +0200, Paolo Bonzini wrote: > Il 08/09/2013 11:54, Gleb Natapov ha scritto: > > On Thu, Sep 05, 2013 at 02:21:54PM +0200, Paolo Bonzini wrote: > >> A guest can still attempt to save and restore XSAVE states even if they > >> have be

Re: [PATCH V2 1/1] X86: Hyper-V: Get the local APIC timer frequency from the hypervisor

2013-09-13 Thread Gleb Natapov
On Fri, Sep 13, 2013 at 01:43:09AM +, KY Srinivasan wrote: > > > > -Original Message- > > From: H. Peter Anvin [mailto:h...@zytor.com] > > Sent: Thursday, September 12, 2013 5:28 PM > > To: KY Srinivasan > > Cc: x...@kernel.org; gre...@linuxfoundation.org; > > linux-kernel@vger.kerne

Re: [RFC/query] kvm async_pf anon pined pages migration

2013-10-09 Thread Gleb Natapov
On Tue, Oct 08, 2013 at 02:58:22PM +0800, chai wen wrote: > On 10/02/2013 12:04 AM, chaiwen wrote: > >On 09/30/2013 08:51 PM, Gleb Natapov wrote: > >>On Mon, Sep 30, 2013 at 06:03:07PM +0800, chai wen wrote: > >>>Hi all > >>> > >>>Async page fa

Re: [RFC/query] kvm async_pf anon pined pages migration

2013-10-10 Thread Gleb Natapov
On Thu, Oct 10, 2013 at 03:05:58PM +0800, chai wen wrote: > On 10/08/2013 03:39 PM, Gleb Natapov wrote: > > On Tue, Oct 08, 2013 at 02:58:22PM +0800, chai wen wrote: > >> On 10/02/2013 12:04 AM, chaiwen wrote: > >>> On 09/30/2013 08:51 PM, Gleb Natapov wrote: > &

Re: [RFC/query] kvm async_pf anon pined pages migration

2013-10-10 Thread Gleb Natapov
On Thu, Oct 10, 2013 at 03:53:08PM +0800, Gu Zheng wrote: > Hi Gleb, > > On 10/10/2013 03:15 PM, Gleb Natapov wrote: > > > On Thu, Oct 10, 2013 at 03:05:58PM +0800, chai wen wrote: > >> On 10/08/2013 03:39 PM, Gleb Natapov wrote: > >>> On Tue, Oct 08, 2

Re: [PATCH v2 12/15] KVM: MMU: allow locklessly access shadow page table out of vcpu thread

2013-10-10 Thread Gleb Natapov
On Wed, Oct 09, 2013 at 10:47:10PM -0300, Marcelo Tosatti wrote: > > >> Gleb has a idea that uses RCU_DESTORY to protect the shadow page table > > >> and encodes the page-level into the spte (since we need to check if the > > >> spte > > >> is the last-spte. ). How about this? > > > > > > Pointe

Re: [RFC][PATCH] Drop FOLL_GET in GUP when doing async_pf in kvm

2013-10-10 Thread Gleb Natapov
On Thu, Oct 10, 2013 at 09:20:15PM +0800, chai wen wrote: > Hi Gleb > > Thanks for you explanation about async_pf in kvm. > Page pinning is not mandatory in kvm async_pf processing and probably should > be dropped later.this patch drops the FOLL_GET flag when doing GUP in async_pf > and uses a boo

Re: [PATCH v2 12/15] KVM: MMU: allow locklessly access shadow page table out of vcpu thread

2013-10-10 Thread Gleb Natapov
On Thu, Oct 10, 2013 at 01:42:22PM -0300, Marcelo Tosatti wrote: > On Thu, Oct 10, 2013 at 03:08:45PM +0300, Gleb Natapov wrote: > > On Wed, Oct 09, 2013 at 10:47:10PM -0300, Marcelo Tosatti wrote: > > > > >> Gleb has a idea that uses RCU_DESTORY to protect the sh

Re: [PATCH 09/12] KVM: MMU: introduce pte-list lockless walker

2013-08-30 Thread Gleb Natapov
On Thu, Aug 29, 2013 at 07:26:40PM +0800, Xiao Guangrong wrote: > On 08/29/2013 05:51 PM, Gleb Natapov wrote: > > On Thu, Aug 29, 2013 at 05:31:42PM +0800, Xiao Guangrong wrote: > >>> As Documentation/RCU/whatisRCU.txt says: > >>> > >>> As wit

Re: [PATCH 09/12] KVM: MMU: introduce pte-list lockless walker

2013-08-30 Thread Gleb Natapov
On Thu, Aug 29, 2013 at 08:02:30PM +0800, Xiao Guangrong wrote: > On 08/29/2013 07:33 PM, Xiao Guangrong wrote: > > On 08/29/2013 05:31 PM, Gleb Natapov wrote: > >> On Thu, Aug 29, 2013 at 02:50:51PM +0800, Xiao Guangrong wrote: > >>> After more thinking, I still

Re: [PATCH v9 00/13] KVM: PPC: IOMMU in-kernel handling of VFIO

2013-08-30 Thread Gleb Natapov
On Fri, Aug 30, 2013 at 08:26:54PM +1000, Alexey Kardashevskiy wrote: > On 08/28/2013 06:37 PM, Alexey Kardashevskiy wrote: > > This accelerates VFIO DMA operations on POWER by moving them > > into kernel. > > > > This depends on VFIO external API patch which is on its way to upstream. > > > > Ch

Re: [PATCH] KVM: mmu: allow page tables to be in read-only slots

2013-09-01 Thread Gleb Natapov
On Fri, Aug 30, 2013 at 02:41:37PM +0200, Paolo Bonzini wrote: > Page tables in a read-only memory slot will currently cause a triple > fault because the page walker uses gfn_to_hva and it fails on such a slot. > > OVMF uses such a page table; however, real hardware seems to be fine with > that as

Re: [PATCH v9 04/13] KVM: PPC: reserve a capability and KVM device type for realmode VFIO

2013-09-01 Thread Gleb Natapov
On Wed, Aug 28, 2013 at 06:37:41PM +1000, Alexey Kardashevskiy wrote: > This reserves a capability number for upcoming support > of VFIO-IOMMU DMA operations in real mode. > > This reserves a number for a new "SPAPR TCE IOMMU" KVM device > which is going to manage lifetime of SPAPR TCE IOMMU objec

Re: [PATCH v9 04/13] KVM: PPC: reserve a capability and KVM device type for realmode VFIO

2013-09-01 Thread Gleb Natapov
On Sun, Sep 01, 2013 at 09:39:23PM +1000, Alexey Kardashevskiy wrote: > On 09/01/2013 09:27 PM, Gleb Natapov wrote: > > On Wed, Aug 28, 2013 at 06:37:41PM +1000, Alexey Kardashevskiy wrote: > >> This reserves a capability number for upcoming support > >> of VFIO-IOMMU

Re: [PATCH v9 12/13] KVM: PPC: Add support for IOMMU in-kernel handling

2013-09-01 Thread Gleb Natapov
On Wed, Aug 28, 2013 at 06:50:41PM +1000, Alexey Kardashevskiy wrote: > This allows the host kernel to handle H_PUT_TCE, H_PUT_TCE_INDIRECT > and H_STUFF_TCE requests targeted an IOMMU TCE table without passing > them to user space which saves time on switching to user space and back. > > Both rea

Re: [PATCH] KVM: mmu: allow page tables to be in read-only slots

2013-09-02 Thread Gleb Natapov
On Mon, Sep 02, 2013 at 05:20:15PM +0800, Xiao Guangrong wrote: > On 08/30/2013 08:41 PM, Paolo Bonzini wrote: > > Page tables in a read-only memory slot will currently cause a triple > > fault because the page walker uses gfn_to_hva and it fails on such a slot. > > > > OVMF uses such a page table

Re: [PATCH] KVM: mmu: allow page tables to be in read-only slots

2013-09-02 Thread Gleb Natapov
On Mon, Sep 02, 2013 at 05:42:25PM +0800, Xiao Guangrong wrote: > On 09/01/2013 05:17 PM, Gleb Natapov wrote: > > On Fri, Aug 30, 2013 at 02:41:37PM +0200, Paolo Bonzini wrote: > >> Page tables in a read-only memory slot will currently cause a triple > >> fault b

Re: [PATCH] KVM: mmu: allow page tables to be in read-only slots

2013-09-02 Thread Gleb Natapov
On Mon, Sep 02, 2013 at 06:00:39PM +0800, Xiao Guangrong wrote: > On 09/02/2013 05:25 PM, Gleb Natapov wrote: > > On Mon, Sep 02, 2013 at 05:20:15PM +0800, Xiao Guangrong wrote: > >> On 08/30/2013 08:41 PM, Paolo Bonzini wrote: > >>> Page tables in a read-only memo

<    1   2   3   4   5   6   7   8   >