Re: [PATCH v2] kvm: iommu: Add cond_resched to legacy device assignment code

2015-01-27 Thread Paolo Bonzini
On 27/01/2015 11:57, Joerg Roedel wrote: > From: Joerg Roedel > > When assigning devices to large memory guests (>=128GB guest > memory in the failure case) the functions to create the > IOMMU page-tables for the whole guest might run for a very > long time. On non-preemptible kernels this migh

[PATCH v2] kvm: iommu: Add cond_resched to legacy device assignment code

2015-01-27 Thread Joerg Roedel
From: Joerg Roedel When assigning devices to large memory guests (>=128GB guest memory in the failure case) the functions to create the IOMMU page-tables for the whole guest might run for a very long time. On non-preemptible kernels this might cause Soft-Lockup warnings. Fix these by adding a con

Re: [PATCH] kvm: iommu: Add cond_resched to legacy device assignment code

2014-12-17 Thread Joerg Roedel
On Wed, Dec 17, 2014 at 11:46:24AM +0100, Paolo Bonzini wrote: > > > On 17/12/2014 11:35, Joerg Roedel wrote: > >> > > >> > This file is already gone after one latest commit c274e03af705, > >> > "kvm: x86: move assigned-dev.c and iommu.c to arch/x86/" is > >> > introduced, so you need to pull yo

Re: [PATCH] kvm: iommu: Add cond_resched to legacy device assignment code

2014-12-17 Thread Paolo Bonzini
On 17/12/2014 11:35, Joerg Roedel wrote: >> > >> > This file is already gone after one latest commit c274e03af705, >> > "kvm: x86: move assigned-dev.c and iommu.c to arch/x86/" is >> > introduced, so you need to pull your tree firstly :) > Hmm, I based the patch on kvm/master, where the file is

Re: [PATCH] kvm: iommu: Add cond_resched to legacy device assignment code

2014-12-17 Thread Joerg Roedel
On Wed, Dec 17, 2014 at 09:38:57AM +0800, Chen, Tiejun wrote: > On 2014/12/16 23:47, Joerg Roedel wrote: > >diff --git a/virt/kvm/iommu.c b/virt/kvm/iommu.c > >index c1e6ae9..ac427e8 100644 > >--- a/virt/kvm/iommu.c > >+++ b/virt/kvm/iommu.c > > This file is already gone after one latest commit c2

Re: [PATCH] kvm: iommu: Add cond_resched to legacy device assignment code

2014-12-16 Thread Chen, Tiejun
On 2014/12/16 23:47, Joerg Roedel wrote: From: Joerg Roedel When assigning devices to large memory guests (>=128GB guest memory in the failure case) the functions to create the IOMMU page-tables for the whole guest might run for a very long time. On non-preemptible kernels this might cause Soft

[PATCH] kvm: iommu: Add cond_resched to legacy device assignment code

2014-12-16 Thread Joerg Roedel
From: Joerg Roedel When assigning devices to large memory guests (>=128GB guest memory in the failure case) the functions to create the IOMMU page-tables for the whole guest might run for a very long time. On non-preemptible kernels this might cause Soft-Lockup warnings. Fix these by adding a con

[PATCH 3.4 08/45] kvm: iommu: fix the third parameter of kvm_iommu_put_pages (CVE-2014-3601)

2014-09-22 Thread Zefan Li
From: "Michael S. Tsirkin" 3.4.104-rc1 review patch. If anyone has any objections, please let me know. -- commit 350b8bdd689cd2ab2c67c8a86a0be86cfa0751a7 upstream. The third parameter of kvm_iommu_put_pages is wrong, It should be 'gfn - slot->base_gfn'. By making gfn very lar

Re: [PATCH 09/12] kvm: iommu: Convert to use new iommu_capable() API function

2014-09-17 Thread Joerg Roedel
Hi Paolo, Gleb, On Fri, Sep 05, 2014 at 12:53:01PM +0200, Joerg Roedel wrote: > From: Joerg Roedel > > Cc: Gleb Natapov > Cc: Paolo Bonzini > Signed-off-by: Joerg Roedel > --- > virt/kvm/iommu.c | 6 ++ > 1 file changed, 2 insertions(+), 4 deletions(-) Do you have any objections against

[PATCH 3.13 002/187] kvm: iommu: fix the third parameter of kvm_iommu_put_pages (CVE-2014-3601)

2014-09-15 Thread Kamal Mostafa
3.13.11.7 -stable review patch. If anyone has any objections, please let me know. -- From: "Michael S. Tsirkin" commit 350b8bdd689cd2ab2c67c8a86a0be86cfa0751a7 upstream. The third parameter of kvm_iommu_put_pages is wrong, It should be 'gfn - slot->base_gfn'. By making gfn v

[PATCH 3.2 076/131] kvm: iommu: fix the third parameter of kvm_iommu_put_pages (CVE-2014-3601)

2014-09-11 Thread Ben Hutchings
3.2.63-rc1 review patch. If anyone has any objections, please let me know. -- From: "Michael S. Tsirkin" commit 350b8bdd689cd2ab2c67c8a86a0be86cfa0751a7 upstream. The third parameter of kvm_iommu_put_pages is wrong, It should be 'gfn - slot->base_gfn'. By making gfn very larg

[PATCH 09/12] kvm: iommu: Convert to use new iommu_capable() API function

2014-09-05 Thread Joerg Roedel
From: Joerg Roedel Cc: Gleb Natapov Cc: Paolo Bonzini Signed-off-by: Joerg Roedel --- virt/kvm/iommu.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/virt/kvm/iommu.c b/virt/kvm/iommu.c index 714b949..45ee080 100644 --- a/virt/kvm/iommu.c +++ b/virt/kvm/iommu.c @@ -

[PATCH 3.10 32/55] kvm: iommu: fix the third parameter of kvm_iommu_put_pages (CVE-2014-3601)

2014-09-03 Thread Greg Kroah-Hartman
3.10-stable review patch. If anyone has any objections, please let me know. -- From: "Michael S. Tsirkin" commit 350b8bdd689cd2ab2c67c8a86a0be86cfa0751a7 upstream. The third parameter of kvm_iommu_put_pages is wrong, It should be 'gfn - slot->base_gfn'. By making gfn very lar

[PATCH 3.14 44/88] kvm: iommu: fix the third parameter of kvm_iommu_put_pages (CVE-2014-3601)

2014-09-03 Thread Greg Kroah-Hartman
3.14-stable review patch. If anyone has any objections, please let me know. -- From: "Michael S. Tsirkin" commit 350b8bdd689cd2ab2c67c8a86a0be86cfa0751a7 upstream. The third parameter of kvm_iommu_put_pages is wrong, It should be 'gfn - slot->base_gfn'. By making gfn very lar

[PATCH 3.16 062/125] kvm: iommu: fix the third parameter of kvm_iommu_put_pages (CVE-2014-3601)

2014-09-03 Thread Greg Kroah-Hartman
3.16-stable review patch. If anyone has any objections, please let me know. -- From: "Michael S. Tsirkin" commit 350b8bdd689cd2ab2c67c8a86a0be86cfa0751a7 upstream. The third parameter of kvm_iommu_put_pages is wrong, It should be 'gfn - slot->base_gfn'. By making gfn very lar

[PATCH 3.12 47/56] kvm: iommu: fix the third parameter of kvm_iommu_put_pages (CVE-2014-3601)

2014-09-03 Thread Jiri Slaby
From: "Michael S. Tsirkin" 3.12-stable review patch. If anyone has any objections, please let me know. === commit 350b8bdd689cd2ab2c67c8a86a0be86cfa0751a7 upstream. The third parameter of kvm_iommu_put_pages is wrong, It should be 'gfn - slot->base_gfn'. By making gfn very large,

[PATCH 3.4 48/99] KVM: IOMMU: hva align mapping page size

2014-03-07 Thread Greg Kroah-Hartman
3.4-stable review patch. If anyone has any objections, please let me know. -- From: Greg Edwards commit 27ef63c7e97d1e585051c03f8d44cc887f34 upstream. When determining the page size we could use to map with the IOMMU, the page size should also be aligned with the hva, not

[PATCH 3.5 15/96] KVM: IOMMU: hva align mapping page size

2014-01-13 Thread Luis Henriques
3.5.7.29 -stable review patch. If anyone has any objections, please let me know. -- From: Greg Edwards commit 27ef63c7e97d1e585051c03f8d44cc887f34 upstream. When determining the page size we could use to map with the IOMMU, the page size should also be aligned with the hv

[PATCH 3.2 025/185] KVM: IOMMU: hva align mapping page size

2013-12-28 Thread Ben Hutchings
3.2.54-rc1 review patch. If anyone has any objections, please let me know. -- From: Greg Edwards commit 27ef63c7e97d1e585051c03f8d44cc887f34 upstream. When determining the page size we could use to map with the IOMMU, the page size should also be aligned with the hva, not

[PATCH 3.8 049/152] KVM: IOMMU: hva align mapping page size

2013-12-06 Thread Kamal Mostafa
3.8.13.14 -stable review patch. If anyone has any objections, please let me know. -- From: Greg Edwards commit 27ef63c7e97d1e585051c03f8d44cc887f34 upstream. When determining the page size we could use to map with the IOMMU, the page size should also be aligned with the h

[PATCH 3.11 248/272] KVM: IOMMU: hva align mapping page size

2013-12-06 Thread Luis Henriques
3.11.10.1 -stable review patch. If anyone has any objections, please let me know. -- From: Greg Edwards commit 27ef63c7e97d1e585051c03f8d44cc887f34 upstream. When determining the page size we could use to map with the IOMMU, the page size should also be aligned with the h

[PATCH 3.10 59/80] KVM: IOMMU: hva align mapping page size

2013-11-26 Thread Greg Kroah-Hartman
3.10-stable review patch. If anyone has any objections, please let me know. -- From: Greg Edwards commit 27ef63c7e97d1e585051c03f8d44cc887f34 upstream. When determining the page size we could use to map with the IOMMU, the page size should also be aligned with the hva, not

[PATCH 3.12 078/116] KVM: IOMMU: hva align mapping page size

2013-11-26 Thread Greg Kroah-Hartman
3.12-stable review patch. If anyone has any objections, please let me know. -- From: Greg Edwards commit 27ef63c7e97d1e585051c03f8d44cc887f34 upstream. When determining the page size we could use to map with the IOMMU, the page size should also be aligned with the hva, not

Re: [PATCH v2] KVM: IOMMU: hva align mapping page size

2013-11-04 Thread Gleb Natapov
On Mon, Nov 04, 2013 at 09:08:12AM -0700, Greg Edwards wrote: > When determining the page size we could use to map with the IOMMU, the > page size should also be aligned with the hva, not just the gfn. The > gfn may not reflect the real alignment within the hugetlbfs file. > For some reason you d

Re: [PATCH v2] KVM: IOMMU: hva align mapping page size

2013-11-04 Thread Marcelo Tosatti
On Mon, Nov 04, 2013 at 09:08:12AM -0700, Greg Edwards wrote: > When determining the page size we could use to map with the IOMMU, the > page size should also be aligned with the hva, not just the gfn. The > gfn may not reflect the real alignment within the hugetlbfs file. > > Signed-off-by: Greg

[PATCH v2] KVM: IOMMU: hva align mapping page size

2013-11-04 Thread Greg Edwards
When determining the page size we could use to map with the IOMMU, the page size should also be aligned with the hva, not just the gfn. The gfn may not reflect the real alignment within the hugetlbfs file. Signed-off-by: Greg Edwards Cc: sta...@vger.kernel.org --- virt/kvm/iommu.c | 4 1 f

Re: [PATCH] KVM: IOMMU: hva align mapping page size

2013-11-01 Thread Marcelo Tosatti
On Fri, Nov 01, 2013 at 10:08:55AM -0600, Greg Edwards wrote: > When determining the page size we could use to map with the IOMMU, the > page size should be aligned with the hva, not the gfn. The gfn may not > reflect the real alignment within the hugetlbfs file. > > Most of the time, this works

[PATCH] KVM: IOMMU: hva align mapping page size

2013-11-01 Thread Greg Edwards
When determining the page size we could use to map with the IOMMU, the page size should be aligned with the hva, not the gfn. The gfn may not reflect the real alignment within the hugetlbfs file. Most of the time, this works fine. However, if the hugetlbfs file is backed by non-contiguous huge p

[RFC PATCH 0/3] kvm/vfio: Manage KVM IOMMU coherency with virtual VFIO device

2013-09-12 Thread Alex Williamson
See patch 3/3 for a description of exactly why we need this. I know POWER folks are also interested in making use of VFIO's external user interface from KVM and Alexey's proposed patches have a similar device tailored for SPAPR use there. I'm hoping that we can make the base device common and ext

Re: [PATCH 0/2] kvm: IOMMU read-only mapping support

2013-01-29 Thread Takuya Yoshikawa
On Wed, 30 Jan 2013 12:06:32 +0800 Xiao Guangrong wrote: > So, i guess we can do the simple fix first. > > >>> By simple fix you mean calling kvm_arch_flush_shadow_all() on READONLY > >>> flag change? > >> > >> Simply disallow READONLY flag changing. > > Ok, can somebody craft a patch?

Re: [PATCH 0/2] kvm: IOMMU read-only mapping support

2013-01-29 Thread Xiao Guangrong
ov wrote: >>>>> On Fri, Jan 25, 2013 at 11:28:40AM +0800, Xiao Guangrong wrote: >>>>>> On 01/25/2013 09:17 AM, Takuya Yoshikawa wrote: >>>>>>> On Thu, 24 Jan 2013 15:03:57 -0700 >>>>>>> Alex Williamson wrote: >>>>>

Re: [PATCH 0/2] kvm: IOMMU read-only mapping support

2013-01-28 Thread Xiao Guangrong
wa wrote: >>>>> On Thu, 24 Jan 2013 15:03:57 -0700 >>>>> Alex Williamson wrote: >>>>> >>>>>> A couple patches to make KVM IOMMU support honor read-only mappings. >>>>>> This causes an un-map, re-map when the read-on

Re: [PATCH 0/2] kvm: IOMMU read-only mapping support

2013-01-28 Thread Gleb Natapov
57 -0700 > >>> Alex Williamson wrote: > >>> > >>>> A couple patches to make KVM IOMMU support honor read-only mappings. > >>>> This causes an un-map, re-map when the read-only flag changes and > >>>> makes use of it when setting IOM

Re: [PATCH 0/2] kvm: IOMMU read-only mapping support

2013-01-28 Thread Xiao Guangrong
On 01/28/2013 06:59 PM, Gleb Natapov wrote: > On Fri, Jan 25, 2013 at 11:28:40AM +0800, Xiao Guangrong wrote: >> On 01/25/2013 09:17 AM, Takuya Yoshikawa wrote: >>> On Thu, 24 Jan 2013 15:03:57 -0700 >>> Alex Williamson wrote: >>> >>>> A couple p

Re: [PATCH 0/2] kvm: IOMMU read-only mapping support

2013-01-28 Thread Takuya Yoshikawa
On Mon, 28 Jan 2013 08:36:56 -0700 Alex Williamson wrote: > On Mon, 2013-01-28 at 21:25 +0900, Takuya Yoshikawa wrote: > > On Mon, 28 Jan 2013 12:59:03 +0200 > > Gleb Natapov wrote: > > > > > > It sets spte based on the old value that means the readonly flag check > > > > is missed. We need to

Re: [PATCH 0/2] kvm: IOMMU read-only mapping support

2013-01-28 Thread Alex Williamson
On Mon, 2013-01-28 at 21:25 +0900, Takuya Yoshikawa wrote: > On Mon, 28 Jan 2013 12:59:03 +0200 > Gleb Natapov wrote: > > > > It sets spte based on the old value that means the readonly flag check > > > is missed. We need to call kvm_arch_flush_shadow_all under this case. > > Why not just disallo

Re: [PATCH 0/2] kvm: IOMMU read-only mapping support

2013-01-28 Thread Takuya Yoshikawa
On Mon, 28 Jan 2013 12:59:03 +0200 Gleb Natapov wrote: > > It sets spte based on the old value that means the readonly flag check > > is missed. We need to call kvm_arch_flush_shadow_all under this case. > Why not just disallow changing memory region KVM_MEM_READONLY flag > without deleting the r

Re: [PATCH 0/2] kvm: IOMMU read-only mapping support

2013-01-28 Thread Gleb Natapov
On Fri, Jan 25, 2013 at 11:28:40AM +0800, Xiao Guangrong wrote: > On 01/25/2013 09:17 AM, Takuya Yoshikawa wrote: > > On Thu, 24 Jan 2013 15:03:57 -0700 > > Alex Williamson wrote: > > > >> A couple patches to make KVM IOMMU support honor read-only mappings. >

Re: [PATCH 0/2] kvm: IOMMU read-only mapping support

2013-01-27 Thread Gleb Natapov
On Thu, Jan 24, 2013 at 03:03:57PM -0700, Alex Williamson wrote: > A couple patches to make KVM IOMMU support honor read-only mappings. > This causes an un-map, re-map when the read-only flag changes and > makes use of it when setting IOMMU attributes. Thanks, > > Alex >

Re: [PATCH 0/2] kvm: IOMMU read-only mapping support

2013-01-24 Thread Takuya Yoshikawa
On Fri, 25 Jan 2013 12:59:12 +0900 Takuya Yoshikawa wrote: > > The commit c972f3b1 changed the write-protect behaviour - it does > > wirte-protection only when dirty flag is set. > > [ I did not see this commit when we discussed the problem before. ] > > I'll look at the commit later, after the

Re: [PATCH 0/2] kvm: IOMMU read-only mapping support

2013-01-24 Thread Takuya Yoshikawa
On Fri, 25 Jan 2013 11:28:40 +0800 Xiao Guangrong wrote: > > I think I can naturally update my patch after this gets merged. > > > > Please wait. The patch I mentioned above won't change anything. Just cleans up set_memory_region(). The only possible change which we discussed before was whet

Re: [PATCH 0/2] kvm: IOMMU read-only mapping support

2013-01-24 Thread Xiao Guangrong
On 01/25/2013 09:17 AM, Takuya Yoshikawa wrote: > On Thu, 24 Jan 2013 15:03:57 -0700 > Alex Williamson wrote: > >> A couple patches to make KVM IOMMU support honor read-only mappings. >> This causes an un-map, re-map when the read-only flag changes and >> makes u

Re: [PATCH 0/2] kvm: IOMMU read-only mapping support

2013-01-24 Thread Takuya Yoshikawa
On Thu, 24 Jan 2013 15:03:57 -0700 Alex Williamson wrote: > A couple patches to make KVM IOMMU support honor read-only mappings. > This causes an un-map, re-map when the read-only flag changes and > makes use of it when setting IOMMU attributes. Thanks, Looks good to me. I th

[PATCH 0/2] kvm: IOMMU read-only mapping support

2013-01-24 Thread Alex Williamson
A couple patches to make KVM IOMMU support honor read-only mappings. This causes an un-map, re-map when the read-only flag changes and makes use of it when setting IOMMU attributes. Thanks, Alex --- Alex Williamson (2): kvm: Force IOMMU remapping on memory slot read-only flag changes

Re: [PATCH v2 01/10] KVM: iommu: fix releasing unmapped page

2012-08-06 Thread Avi Kivity
On 08/03/2012 10:36 AM, Xiao Guangrong wrote: > There are two bugs: > - the 'error page' is forgot to be released > [ it is unneeded after commit a2766325cf9f9, for backport, we > still do kvm_release_pfn_clean for the error pfn ] > > - guest pages are always released regardless of the unmap

Re: [PATCH v2 01/10] KVM: iommu: fix releasing unmapped page

2012-08-03 Thread Marcelo Tosatti
On Fri, Aug 03, 2012 at 03:36:52PM +0800, Xiao Guangrong wrote: > There are two bugs: > - the 'error page' is forgot to be released > [ it is unneeded after commit a2766325cf9f9, for backport, we > still do kvm_release_pfn_clean for the error pfn ] > > - guest pages are always released regar

[PATCH v2 01/10] KVM: iommu: fix releasing unmapped page

2012-08-03 Thread Xiao Guangrong
There are two bugs: - the 'error page' is forgot to be released [ it is unneeded after commit a2766325cf9f9, for backport, we still do kvm_release_pfn_clean for the error pfn ] - guest pages are always released regardless of the unmapped page (e,g, caused by hwpoison) Signed-off-by: Xiao

[PATCH 1/9] KVM: iommu: fix releasing unmapped page

2012-07-29 Thread Xiao Guangrong
There are two bugs: - the 'error page' is forgot to be released [ it is unneeded after commit a2766325cf9f9, for backport, we still do kvm_release_pfn_clean for the error pfn ] - guest pages are always released regardless of the unmapped page (e,g, caused by hwpoison) Signed-off-by: Xiao

Re: [kvm-devel] kvm + IOMMU

2007-06-13 Thread Gregory Haskins
On Wed, 2007-06-13 at 11:52 -0700, David Brown wrote: > > Hi David, > > I am not an expert here, but I don't believe it would work without > > changes to KVM. My understanding is that you use an IOMMU in this > > fashion if you want to direct-map a device into a guest for devices that > > do not

Re: [kvm-devel] kvm + IOMMU

2007-06-13 Thread Gregory Haskins
On Wed, 2007-06-13 at 10:27 -0700, David Brown wrote: > I was wondering if anyone has done any sort of virtualization testing > with kvm using IOMMU to improve performance of I/O and what sort of > results they've had... I currently don't have a box with IOMMU (at > least I don't think so, since it

Re: [kvm-devel] kvm + IOMMU

2007-06-13 Thread David Brown
Hi David, I am not an expert here, but I don't believe it would work without changes to KVM. My understanding is that you use an IOMMU in this fashion if you want to direct-map a device into a guest for devices that do not have a local IOMMU-like functionality built in already. For instance, p

kvm + IOMMU

2007-06-13 Thread David Brown
I was wondering if anyone has done any sort of virtualization testing with kvm using IOMMU to improve performance of I/O and what sort of results they've had... I currently don't have a box with IOMMU (at least I don't think so, since its an i386 box) but will be getting some amd64 boxes which, ho