public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Prarit Bhargava <prarit@redhat.com>
To: joro@8bytes.org
Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>,
	linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
	jbarnes@virtuousgeek.org, ed.pollard@ibm.com,
	epollard@redhat.com
Subject: Re: [PATCH]: PCI: GART iommu alignment fixes [v2]
Date: Wed, 23 Jul 2008 19:47:03 -0400	[thread overview]
Message-ID: <4887C2F7.6040506@redhat.com> (raw)
In-Reply-To: <20080724081528F.fujita.tomonori@lab.ntt.co.jp>


>> Interesting. Have you experienced any problems because of that
>> misbehavior in the GART code? AMD IOMMU currently also violates this
>> requirement. I will send a patch to fix that there too.
>>     
>
>   

Joerg,  yes I can see misbehavior caused by this code.  O/w I wouldn't 
be spending my time fixing it :) :)

See below ....

> IIRC, only PARISC and POWER IOMMUs follow the above rule. So I also
> wondered what problem he hit.
>   

I wonder if IBM's Calgary IOMMU needs this fix? ... I've added Ed 
Pollard to find out.

On big memory footprint (16G or above) systems it is possible that the 
e820 map reserves most of the lower 4G of memory for system use*.  So 
it's possible that the 4G region is almost completely reserved at boot 
time and so the kernel starts using the IOMMU for DMA (see 
dma_alloc_coherent()).  The addresses returned are not properly aligned, 
and this causes serious problems for some drivers that require a 
physical aligned address for the device.

P.

* I have one large system with 64G of memory on which I can reproduce 
this issue very quickly.  Even booting the system with mem=16G seems to 
cause the problem, although I did have to load a module that reserved a 
few M of DMA addresses before I started alloc'ing from the IOMMU.

I also reproduced this on a smaller system by loading one module that 
reserved as much DMA-able region as possible, and then loaded another 
module that reserved from the IOMMU.  While this situation is a bit 
contrived the bug still hit -- the returned addresses are not properly 
aligned.


  reply	other threads:[~2008-07-23 23:49 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-23 11:19 [PATCH]: PCI: GART iommu alignment fixes [v2] Prarit Bhargava
2008-07-23 22:10 ` Joerg Roedel
2008-07-23 23:14   ` FUJITA Tomonori
2008-07-23 23:47     ` Prarit Bhargava [this message]
2008-07-24  7:46       ` Joerg Roedel
2008-07-24 10:09         ` Prarit Bhargava
2008-07-24 10:34           ` FUJITA Tomonori
2008-07-24 12:37             ` Joerg Roedel
2008-07-24 12:49               ` Prarit Bhargava
2008-07-24 13:32               ` FUJITA Tomonori
2008-07-24 14:31                 ` Prarit Bhargava
2008-07-24 14:40                   ` FUJITA Tomonori
2008-07-24 15:13                     ` Prarit Bhargava
2008-07-24 14:45                   ` Prarit Bhargava
2008-07-28 22:23     ` Jesse Barnes
2008-07-29 14:24       ` Prarit Bhargava
2008-07-29 17:08         ` Jesse Barnes
2008-07-30  0:43       ` FUJITA Tomonori
2008-08-06 12:29         ` Prarit Bhargava
2008-08-06 13:23           ` Prarit Bhargava
2008-08-06 13:35           ` FUJITA Tomonori
2008-08-06 14:32             ` Prarit Bhargava
2008-08-07 17:03               ` Jesse Barnes
2008-08-07 17:41                 ` Prarit Bhargava
2008-08-08  7:12                   ` Muli Ben-Yehuda
2008-08-08 15:18                     ` Prarit Bhargava
2008-08-08 16:15                       ` Jesse Barnes
2008-08-08 21:13                         ` FUJITA Tomonori
2008-08-09  1:40                           ` Prarit Bhargava
2008-08-09  3:50                   ` FUJITA Tomonori
2008-08-15 16:16                     ` Ingo Molnar
2008-08-15 18:00                       ` Ingo Molnar
2008-08-15 20:39                         ` Prarit Bhargava
2008-08-15 21:20                           ` Ingo Molnar
2008-08-16  1:15                         ` FUJITA Tomonori
2008-08-17 12:56                           ` Ingo Molnar
2008-08-17 15:36                             ` FUJITA Tomonori
2008-08-17 15:42                               ` Ingo Molnar
2008-08-17 15:48                                 ` FUJITA Tomonori
2008-08-17 15:54                                   ` FUJITA Tomonori
2008-08-07 17:45                 ` Prarit Bhargava
2008-07-23 23:23 ` FUJITA Tomonori
2008-07-23 23:24   ` Prarit Bhargava

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4887C2F7.6040506@redhat.com \
    --to=prarit@redhat.com \
    --cc=ed.pollard@ibm.com \
    --cc=epollard@redhat.com \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=jbarnes@virtuousgeek.org \
    --cc=joro@8bytes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox