Re: [PATCH v2] iommu/vt-d: race setting IRQ CPU affinity while freeing IRQ

2014-07-29 Thread Greg Edwards
On Tue, Jul 29, 2014 at 12:45:31PM +0200, Joerg Roedel wrote: > On Wed, Jul 23, 2014 at 10:13:26AM -0600, Greg Edwards wrote: >> A user process setting the CPU affinity of an IRQ for a KVM >> direct-assigned device via /proc/irq//smp_affinity can race with >> the IRQ b

[PATCH v2] iommu/vt-d: race setting IRQ CPU affinity while freeing IRQ

2014-07-23 Thread Greg Edwards
A user process setting the CPU affinity of an IRQ for a KVM direct-assigned device via /proc/irq//smp_affinity can race with the IRQ being released by QEMU, resulting in a NULL iommu pointer dereference in get_irte(). Signed-off-by: Greg Edwards --- Dropped the Cc: for stable since this likely

Re: [PATCH] iommu/vt-d: fix race between free_irte() and get_irte()

2014-07-23 Thread Greg Edwards
On Wed, Jul 23, 2014 at 04:40:24PM +0200, Joerg Roedel wrote: > On Tue, Jul 22, 2014 at 08:27:19AM -0600, Greg Edwards wrote: >> get_irte() can race with free_irte() and dereference a NULL iommu >> pointer. > > Have you seen any real occurance of this race? Get_irte is called

[PATCH] iommu/vt-d: fix race between free_irte() and get_irte()

2014-07-22 Thread Greg Edwards
get_irte() can race with free_irte() and dereference a NULL iommu pointer. Signed-off-by: Greg Edwards Cc: sta...@vger.kernel.org --- drivers/iommu/intel_irq_remapping.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/iommu/intel_irq_remapping.c b/drivers/iommu

Re: intel-iommu: iova_to_phys: fill in bits from iova when large pte

2013-11-04 Thread Greg Edwards
On Fri, Nov 01, 2013 at 06:45:12PM -0700, Marcelo Tosatti wrote: > > intel_iommu_iova_to_phys returns incorrect physical address > when iova is translated by large pte. > > Fill in bits from iova when creating the physical address. Marcelo, for what it's worth, this patch alone didn't fix the BUG

[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

Re: BUG unpinning 1 GiB huge pages with KVM PCI assignment

2013-11-01 Thread Greg Edwards
On Fri, Nov 01, 2013 at 10:47:35AM -0700, Marcelo Tosatti wrote: > On Tue, Oct 29, 2013 at 05:19:43PM -0600, Greg Edwards wrote: >> On Mon, Oct 28, 2013 at 12:37:56PM -0700, Greg Edwards wrote: >>> Using KVM PCI assignment with 1 GiB huge pages trips a BUG in 3.12.0-rc7, >&

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

2013-11-01 Thread Greg Edwards
gfn, which does reflect the alignment within the hugetlbfs file. Signed-off-by: Greg Edwards Cc: sta...@vger.kernel.org --- This resolves the bug previously reported (and misdiagnosed) here: http://www.spinics.net/lists/kvm/msg97599.html virt/kvm/iommu.c | 4 ++-- 1 file changed, 2 insertions

Re: BUG unpinning 1 GiB huge pages with KVM PCI assignment

2013-10-29 Thread Greg Edwards
On Mon, Oct 28, 2013 at 12:37:56PM -0700, Greg Edwards wrote: > Using KVM PCI assignment with 1 GiB huge pages trips a BUG in 3.12.0-rc7, e.g. > > # qemu-system-x86_64 \ > -m 8192 \ > -mem-path /var/lib/hugetlbfs/pagesize-1GB \ > -mem-prealloc \ &