Calgary and bad_dma_address
Hi, guys:
I was reading arch/x86/kernel/pci-calgary_64.c today, and noticed that apparently nothing prevents iommu_area_alloc from returning a zero. But bad_dma_address is zero too. Doesn't it concern anyone? If the first allocation asks for a page-aligned buffer to be mapped, a spurious bad address will result, if I understand this right.
The simplest way to avoid the problem is to lose a page and set a bit in tce_table_setparms():
set_bit(tbl->it_map, bad_dma_address);
But I don't see anything like that done anywhere.
-- Pete
From: Pete Zaitcev <[email protected]>
Date: Tue, 9 Sep 2008 21:19:41 -0600
Quoted 5 lines
I was reading
arch/x86/kernel/pci-calgary_64.ctoday, and noticed that apparently nothing preventsiommu_area_allocfrom returning a zero. Butbad_dma_addressis zero too. Doesn't it concern anyone? If the first allocation asks for a page-aligned buffer to be mapped, a spurious bad address will result, if I understand this right.
Won't the device range reserves done by calls of calgary_reserve_mem_region() take care of this?
Quoted 6 lines · David Miller
Quoted 3 lines
I was reading
arch/x86/kernel/pci-calgary_64.ctoday, and noticed that apparently nothing preventsiommu_area_allocfrom returning a zero. Butbad_dma_addressis zero too. Doesn't it concern anyone?Won't the device range reserves done by calls of
calgary_reserve_mem_region()take care of this?
Sorry, my mistake. Indeed it does, thanks.
-- Pete
Quoted 7 lines · On Tue, 9 Sep 2008 21:19:41 -0600 Pete Zaitcev <[email protected]> wrote:
Hi, guys:
I was reading
arch/x86/kernel/pci-calgary_64.ctoday, and noticed that apparently nothing preventsiommu_area_allocfrom returning a zero. Butbad_dma_addressis zero too. Doesn't it concern anyone? If the first allocation asks for a page-aligned buffer to be mapped, a spurious bad address will result, if I understand this right.
Does calgary_reserve_regions() prevent that?