Re: Linux 2.6.25-rc4

From: Grant Grundler
Date: Wed Mar 05 2008 - 11:47:23 EST


On Wed, Mar 05, 2008 at 05:09:30PM +0900, FUJITA Tomonori wrote:
> On Tue, 4 Mar 2008 21:03:44 -0800 (PST)
> Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> >
> > It's a few days late, but I was waiting for some updates for some of the
> > most annoying regressions until releasing it, so the end result is
> > hopefully more useful as a result.
>
> Ah, the IOMMU patches (alpha and parisc) that I submitted for -mm have
> been merged somehow.
>
> The parisc patches were tested but probably the alpha patches not.
>
> Here's a patch for 32bits arch parisc.
>
> =
> From: FUJITA Tomonori <fujita.tomonori@xxxxxxxxxxxxx>
> Subject: [PATCH] parisc: fix IOMMU's device boundary overflow bug on 32bits arch
>
> On 32bits boxes, boundary_size becomes zero due to a overflow and we
> hit BUG_ON in iommu_is_span_boundary.
>
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@xxxxxxxxxxxxx>
> Cc: Kyle McMartin <kyle@xxxxxxxxxxxxxxxx>
> Cc: Matthew Wilcox <matthew@xxxxxx>
> Cc: Grant Grundler <grundler@xxxxxxxxxxxxxxxx>

Acked-by: Grant Grundler <grundler@xxxxxxxxxxxxxxxx>

thanks,
grant

> ---
> drivers/parisc/ccio-dma.c | 4 ++--
> drivers/parisc/sba_iommu.c | 4 ++--
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/parisc/ccio-dma.c b/drivers/parisc/ccio-dma.c
> index 60d338c..62db3c3 100644
> --- a/drivers/parisc/ccio-dma.c
> +++ b/drivers/parisc/ccio-dma.c
> @@ -366,8 +366,8 @@ ccio_alloc_range(struct ioc *ioc, struct device *dev, size_t size)
> ** ggg sacrifices another 710 to the computer gods.
> */
>
> - boundary_size = ALIGN(dma_get_seg_boundary(dev) + 1, 1 << IOVP_SHIFT);
> - boundary_size >>= IOVP_SHIFT;
> + boundary_size = ALIGN((unsigned long long)dma_get_seg_boundary(dev) + 1,
> + 1ULL << IOVP_SHIFT) >> IOVP_SHIFT;
>
> if (pages_needed <= 8) {
> /*
> diff --git a/drivers/parisc/sba_iommu.c b/drivers/parisc/sba_iommu.c
> index e834127..bdbe780 100644
> --- a/drivers/parisc/sba_iommu.c
> +++ b/drivers/parisc/sba_iommu.c
> @@ -341,8 +341,8 @@ sba_search_bitmap(struct ioc *ioc, struct device *dev,
> unsigned long shift;
> int ret;
>
> - boundary_size = ALIGN(dma_get_seg_boundary(dev) + 1, 1 << IOVP_SHIFT);
> - boundary_size >>= IOVP_SHIFT;
> + boundary_size = ALIGN((unsigned long long)dma_get_seg_boundary(dev) + 1,
> + 1ULL << IOVP_SHIFT) >> IOVP_SHIFT;
>
> #if defined(ZX1_SUPPORT)
> BUG_ON(ioc->ibase & ~IOVP_MASK);
> --
> 1.5.3.7
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/