POWERPC: IOMMU support for honoring dma_mask
PATCH 1/2 POWERPC: IOMMU support for honoring dma_mask
Hi,
Paulus -- Ben mentioned being interested in this going into 2.6.17, since the bcm43xx driver will need it to be usable on G5s with more than 1GB memory.
Built with iseries_defconfig and ppc64_defconfig, boot tested on pSeries and G5, but I'm away from home so I haven't been able to install an Airport card in the G5.
Since time is somewhat of essense (if 2.6.17 is still an option), I went for the choice of sending now and follow up with a small bugfix later in case something shows up, especially since quick regression tests seem ok.
Thanks,
Olof
---
Some devices don't support full 32-bit DMA address space, which we currently assume. Add the required mask-passing to the IOMMU allocators.
arch/powerpc/kernel/iommu.c +26 -10
@@ -61,6 +61,7 @@ __setup("iommu=", setup_iommu);static unsigned long iommu_range_alloc (struct iommu_table *tbl,unsigned long npages,unsigned long *handle, +unsigned long mask,unsigned int align_order) {unsigned long n, end, i, start;
@@ -97,9 +98,21 @@ static unsigned long iommu_range_alloc(s*/ if (start >= limit) start = largealloc ? tbl->it_largehint : tbl->it_hint; - + again: +if (limit + tbl->it_offset > mask) { + limit = mask - tbl->it_offset +1 ; +/* If we're constrained on address range, first try +* at the masked hint to avoid O(n) search complexity, +* but on second pass, start at 0. +*/ +if ((start & mask) >= limit || pass >0 ) + start =0 ; +else + start &= mask; + } + n =find_next_zero_bit (tbl->it_map, limit, start);/* Align allocation */
@@ -150,14 +163,14 @@ static unsigned long iommu_range_alloc(sstatic dma_addr_t iommu_alloc (struct iommu_table *tbl,void *page,unsigned int npages,enum dma_data_direction direction, -unsigned int align_order) +unsigned long mask,unsigned int align_order) {unsigned long entry, flags;dma_addr_t ret =DMA_ERROR_CODE ; - +spin_lock_irqsave (&(tbl->it_lock), flags); - entry =iommu_range_alloc (tbl, npages,NULL , align_order); + entry =iommu_range_alloc (tbl, npages,NULL , mask, align_order);if (unlikely (entry ==DMA_ERROR_CODE )) {spin_unlock_irqrestore (&(tbl->it_lock), flags);
@@ -236,7 +249,7 @@ static void iommu_free(struct iommu_tablint iommu_map_sg (struct device *dev,struct iommu_table *tbl,struct scatterlist *sglist,int nelems, -enum dma_data_direction direction) +unsigned long mask,enum dma_data_direction direction) {dma_addr_t dma_next =0 , dma_addr;unsigned long flags;
@@ -274,7 +287,7 @@ int iommu_map_sg(struct device *dev, str vaddr = (unsigned long )page_address (s->page) + s->offset; npages =PAGE_ALIGN (vaddr + slen) - (vaddr &PAGE_MASK ); npages >>=PAGE_SHIFT ; - entry =iommu_range_alloc (tbl, npages, &handle,0 ); + entry =iommu_range_alloc (tbl, npages, &handle, mask >>PAGE_SHIFT ,0 );DBG (" - vaddr: %lx, size: %lx\n" , vaddr, slen);
@@ -479,7 +492,8 @@ void iommu_free_table(struct device_node* byte within the page as vaddr. */ dma_addr_t iommu_map_single (struct iommu_table *tbl,void *vaddr, -size_t size,enum dma_data_direction direction) +size_t size,unsigned long mask, +enum dma_data_direction direction) {dma_addr_t dma_handle =DMA_ERROR_CODE ;unsigned long uaddr;
@@ -492,7 +506,8 @@ dma_addr_t iommu_map_single(struct iommu npages >>=PAGE_SHIFT ;if (tbl) { - dma_handle =iommu_alloc (tbl, vaddr, npages, direction,0 ); + dma_handle =iommu_alloc (tbl, vaddr, npages, direction, + mask >>PAGE_SHIFT ,0 );if (dma_handle ==DMA_ERROR_CODE ) {if (printk_ratelimit ()) { printk(KERN_INFO "iommu_alloc failed, "
@@ -521,7 +536,7 @@ void iommu_unmap_single(struct iommu_tab* to the dma address (mapping) of the first page. */ void *iommu_alloc_coherent (struct iommu_table *tbl,size_t size, -dma_addr_t *dma_handle,gfp_t flag) +dma_addr_t *dma_handle,unsigned long mask,gfp_t flag) {void *ret =NULL ;dma_addr_t mapping;
@@ -551,7 +566,8 @@ void *iommu_alloc_coherent(struct iommu_memset (ret,0 , size);/* Set up tces to cover the allocated range */ - mapping =iommu_alloc (tbl, ret, npages,DMA_BIDIRECTIONAL , order); + mapping =iommu_alloc (tbl, ret, npages,DMA_BIDIRECTIONAL , + mask >>PAGE_SHIFT , order);if (mapping ==DMA_ERROR_CODE ) {free_pages ((unsigned long )ret, order); ret =NULL ;
arch/powerpc/kernel/vio.c +3 -3
@@ -202,7 +202,7 @@ static dma_addr_t vio_map_single(struct size_t size, enum dma_data_direction direction) { return iommu_map_single(to_vio_dev(dev)->iommu_table, vaddr, size, -direction ); + ~0ul, direction); } static void vio_unmap_single(struct device *dev, dma_addr_t dma_handle,
@@ -216,7 +216,7 @@ static int vio_map_sg(struct device *dev int nelems, enum dma_data_direction direction) { return iommu_map_sg(dev, to_vio_dev(dev)->iommu_table, sglist, -nelems ,direction ); + nelems, ~0ul, direction); } static void vio_unmap_sg(struct device *dev, struct scatterlist *sglist,
@@ -229,7 +229,7 @@ static void *vio_alloc_coherent(struct d dma_addr_t *dma_handle, gfp_t flag) {return iommu_alloc_coherent (to_vio_dev (dev)->iommu_table, size, - dma_handle, flag); + dma_handle, ~0ul , flag); } static void vio_free_coherent(struct device *dev, size_t size,
include/asm-powerpc/iommu.h +4 -3
@@ -70,17 +70,18 @@ extern void iommu_free_table(struct deviextern struct iommu_table *iommu_init_table (struct iommu_table * tbl);extern int iommu_map_sg (struct device *dev,struct iommu_table *tbl, -struct scatterlist *sglist,int nelems, +struct scatterlist *sglist,int nelems,unsigned long mask,enum dma_data_direction direction);extern void iommu_unmap_sg (struct iommu_table *tbl,struct scatterlist *sglist,int nelems,enum dma_data_direction direction);extern void *iommu_alloc_coherent (struct iommu_table *tbl,size_t size, -dma_addr_t *dma_handle,gfp_t flag); +dma_addr_t *dma_handle,unsigned long mask,gfp_t flag);extern void iommu_free_coherent (struct iommu_table *tbl,size_t size,void *vaddr,dma_addr_t dma_handle);extern dma_addr_t iommu_map_single (struct iommu_table *tbl,void *vaddr, -size_t size,enum dma_data_direction direction); +size_t size,unsigned long mask, +enum dma_data_direction direction);extern void iommu_unmap_single (struct iommu_table *tbl,dma_addr_t dma_handle,size_t size,enum dma_data_direction direction);
arch/powerpc/kernel/pci_iommu.c +35 -4
@@ -59,6 +59,25 @@ static inline struct iommu_table *devnod } +static inline unsigned long device_to_mask (struct device *hwdev) +{ +struct pci_dev *pdev; + +if (!hwdev) { + pdev = ppc64_isabridge_dev; +if (!pdev)/* This is the best guess we can do */ +return 0xfffffffful ; + }else + pdev =to_pci_dev (hwdev); + +if (pdev->dma_mask) +return pdev->dma_mask; + +/* Assume devices without mask can take 32 bit addresses */ +return 0xfffffffful ; +} + +/* Allocates a contiguous real buffer and creates mappings over it. * Returns the virtual address of the buffer and sets dma_handle * to the dma address (mapping) of the first page.
@@ -67,7 +86,7 @@ static void *pci_iommu_alloc_coherent(st dma_addr_t *dma_handle, gfp_t flag) { return iommu_alloc_coherent(devnode_table(hwdev), size, dma_handle, - flag); +device_to_mask (hwdev ),flag ); } static void pci_iommu_free_coherent(struct device *hwdev, size_t size,
@@ -86,7 +105,7 @@ static dma_addr_t pci_iommu_map_single(s size_t size, enum dma_data_direction direction) { return iommu_map_single(devnode_table(hwdev), vaddr, size, -direction ); +device_to_mask (hwdev ),direction ); }
@@ -101,7 +120,7 @@ static int pci_iommu_map_sg(struct devic int nelems, enum dma_data_direction direction) { return iommu_map_sg(pdev, devnode_table(pdev), sglist, -nelems ,direction ); +nelems ,device_to_mask (pdev ),direction ); } static void pci_iommu_unmap_sg(struct device *pdev, struct scatterlist *sglist,
@@ -113,7 +132,19 @@ static void pci_iommu_unmap_sg(struct de/* We support DMA to/from any memory page via the iommu */ static int pci_iommu_dma_supported (struct device *dev,u64 mask) { -return 1 ; +struct iommu_table *tbl =devnode_table (dev); + +if (!tbl || tbl->it_offset > mask) { +printk (KERN_INFO "Warning: IOMMU table offset too big for device mask\n" ); +if (tbl) +printk (KERN_INFO "mask: 0x%08lx, table offset: 0x%08lx\n" , + mask, tbl->it_offset); +else +printk (KERN_INFO "mask: 0x%08lx, table unavailable\n" , + mask); +return 0 ; + }else +return 1 ; }void pci_iommu_init (void )
PATCH 2/2 POWERPC: Lower threshold for DART enablement to 1GB
Hi,
This goes with the previous dma_mask patch -- enable DART at 1GB due to Airport Extreme cards needing it. Please consider for 2.6.17.
Thanks,
Olof
---
Turn on the DART already at 1GB. This is needed because of crippled devices in some systems, i.e. Airport Extreme cards, only supporting 30-bit DMA addresses.
Otherwise, users with between 1 and 2GB of memory will need to manually enable it with iommu=force, and that's no good.
Some simple performance tests show that there's a slight impact of enabling DART, but it's in the 1-3% range (kernel build with disk I/O as well as over NFS).
iommu=off can still be used for those who don't want to deal with the overhead (and don't need it for any devices).
arch/powerpc/sysdev/dart_iommu.c +6 -2
@@ -329,10 +329,14 @@ void iommu_init_early_dart(void)void __init alloc_dart_table (void ) { -/* Only reserve DART space if machine has more than 2GB of RAM +/* Only reserve DART space if machine has more than 1GB of RAM * or if requested with iommu=on on cmdline. +* +* 1GB of RAM is picked as limit because some default devices +* (i.e. Airport Extreme) have 30 bit address range limits. */ -if (lmb_end_of_DRAM () <=0x80000000ull && !iommu_force_on) + +if (lmb_end_of_DRAM () <=0x40000000ull && !iommu_force_on)return ;/* 512 pages (2MB) is max DART tablesize. */
PATCH 2/2 POWERPC: Lower threshold for DART enablement to 1GB, V2
Quoted 4 lines · Olof Johansson
Hi,
This goes with the previous
dma_maskpatch -- enable DART at 1GB due to Airport Extreme cards needing it. Please consider for 2.6.17.
Crap, I missed a quilt refresh. Here's the version that handles iommu=off between 1GB and 2GB right.
---
Turn on the DART already at 1GB. This is needed because of crippled devices in some systems, i.e. Airport Extreme cards, only supporting 30-bit DMA addresses.
Otherwise, users with between 1 and 2GB of memory will need to manually enable it with iommu=force, and that's no good.
Some simple performance tests show that there's a slight impact of enabling DART, but it's in the 1-3% range (kernel build with disk I/O as well as over NFS).
iommu=off can still be used for those who don't want to deal with the overhead (and don't need it for any devices).
arch/powerpc/sysdev/dart_iommu.c +10 -2
@@ -49,6 +49,7 @@#include "dart.h" +extern int iommu_is_off;extern int iommu_force_on;/* Physical base address and size of the DART table */
@@ -329,10 +330,17 @@ void iommu_init_early_dart(void)void __init alloc_dart_table (void ) { -/* Only reserve DART space if machine has more than 2GB of RAM +/* Only reserve DART space if machine has more than 1GB of RAM * or if requested with iommu=on on cmdline. +* +* 1GB of RAM is picked as limit because some default devices +* (i.e. Airport Extreme) have 30 bit address range limits. */ -if (lmb_end_of_DRAM () <=0x80000000ull && !iommu_force_on) + +if (iommu_is_off) +return ; + +if (!iommu_force_on &&lmb_end_of_DRAM () <=0x40000000ull )return ;/* 512 pages (2MB) is max DART tablesize. */
arch/powerpc/kernel/prom.c +1 -1
@@ -62,7 +62,7 @@ static int __initdata dt_root_addr_cellsstatic int __initdata dt_root_size_cells;#ifdef CONFIG_PPC64 -static int __initdata iommu_is_off; +int __initdata iommu_is_off;int __initdata iommu_force_on;unsigned long tce_alloc_start, tce_alloc_end;#endif
Re: [PATCH] [2/2] POWERPC: Lower threshold for DART enablement to 1GB, V2
Quoted 2 lines · Olof Johansson
iommu=off can still be used for those who don't want to deal with the overhead (and don't need it for any devices).
I've been pondering walking the PCI bus before deciding to enable an IOMMU and checking each device's DMA mask. Is this something that you considered and rejected, or just something no one got around to doing?
Cheers,
Muli
Signature · 2 lines
Muli Ben-Yehuda http://www.mulix.org | http://mulix.livejournal.com/
Re: [PATCH] [2/2] POWERPC: Lower threshold for DART enablement to 1GB, V2
Quoted 8 lines · Muli Ben-Yehuda
Quoted 2 lines · Olof Johansson
iommu=off can still be used for those who don't want to deal with the overhead (and don't need it for any devices).
I've been pondering walking the PCI bus before deciding to enable an IOMMU and checking each device's DMA mask. Is this something that you considered and rejected, or just something no one got around to doing?
It would do the trick for airport cards in G5s.. a little bit of OF walking to find the card.
It won't help with cardbus broadcom's but then, there is currently no G5 with a cardbus adaptor that I know of :) It's possible I suppose to get a pci<->cardbus adapter but I suppose in that case, we can ignore it ...
Ben.
Re: [PATCH] [2/2] POWERPC: Lower threshold for DART enablement to 1GB, V2
Quoted 6 lines · Benjamin Herrenschmidt
Quoted 5 lines · Muli Ben-Yehuda
Quoted 2 lines · Olof Johansson
iommu=off can still be used for those who don't want to deal with the overhead (and don't need it for any devices).
Quoted 6 lines
Quoted 3 lines
I've been pondering walking the PCI bus before deciding to enable an IOMMU and checking each device's DMA mask. Is this something that you considered and rejected, or just something no one got around to doing?
It would do the trick for airport cards in G5s.. a little bit of OF walking to find the card.
Walking the DT means we need to hardcode it on PCI IDs, since the Apple OF doesn't give the Airport device a logical name. It's probably easier to implement than walking PCI, but we'd need to maintain a table. My vote is for PCI walking, I'll give that a shot over the weekend.
Quoted 3 lines
It won't help with cardbus broadcom's but then, there is currently no G5 with a cardbus adaptor that I know of :) It's possible I suppose to get a pci<->cardbus adapter but I suppose in that case, we can ignore it ...
Yep, that should be rare enough.
-Olof
Re: [PATCH] [2/2] POWERPC: Lower threshold for DART enablement to 1GB, V2
Quoted 4 lines · Olof Johansson
Walking the DT means we need to hardcode it on PCI IDs, since the Apple OF doesn't give the Airport device a logical name. It's probably easier to implement than walking PCI, but we'd need to maintain a table. My vote is for PCI walking, I'll give that a shot over the weekend.
Cool! bonus points if you do it in drivers/pci and we can steal it easily for Calgary on x8-64 :-)
Cheers,
Muli
Signature · 2 lines
Muli Ben-Yehuda http://www.mulix.org | http://mulix.livejournal.com/
Re: [PATCH] [2/2] POWERPC: Lower threshold for DART enablement to 1GB, V2
Quoted 9 lines · Muli Ben-Yehuda
Quoted 4 lines · Olof Johansson
Walking the DT means we need to hardcode it on PCI IDs, since the Apple OF doesn't give the Airport device a logical name. It's probably easier to implement than walking PCI, but we'd need to maintain a table. My vote is for PCI walking, I'll give that a shot over the weekend.
Cool! bonus points if you do it in
drivers/pciand we can steal it easily for Calgary on x8-64 :-)
How so ? Anything remotely related to the iommu is totally different... Besides, on x86-64, laptops _are_ more common, and thus the problem of cardbus cards is much more significant.
Ben.
Re: [PATCH] [2/2] POWERPC: Lower threshold for DART enablement to 1GB, V2
Quoted 8 lines · Benjamin Herrenschmidt
Quoted 7 lines · Muli Ben-Yehuda
Quoted 4 lines · Olof Johansson
Walking the DT means we need to hardcode it on PCI IDs, since the Apple OF doesn't give the Airport device a logical name. It's probably easier to implement than walking PCI, but we'd need to maintain a table. My vote is for PCI walking, I'll give that a shot over the weekend.
Quoted 6 lines
Quoted 2 lines
Cool! bonus points if you do it in
drivers/pciand we can steal it easily for Calgary on x8-64 :-)How so ? Anything remotely related to the iommu is totally different... Besides, on x86-64, laptops _are_ more common, and thus the problem of cardbus cards is much more significant.
What I had in mind is an interface that given a PCI bridge will tell you what's the most restrictive DMA mask for a device on that bridge, so that you'll know whether you need to enable the IOMMU for that bridge. I'll even settle for a function that tells you what's the most restrictive DMA mask in the system, preiod. There's nothing inherently arch specific about this.
(and as a side note, the IOMMU we are working on on x86-64 is Calgary, which is actually roughly the same chipset used in some PPC machines...)
Cheers,
Muli
Signature · 2 lines
Muli Ben-Yehuda http://www.mulix.org | http://mulix.livejournal.com/
Re: [PATCH] [2/2] POWERPC: Lower threshold for DART enablement to 1GB, V2
Quoted 11 lines
What I had in mind is an interface that given a PCI bridge will tell you what's the most restrictive DMA mask for a device on that bridge, so that you'll know whether you need to enable the IOMMU for that bridge. I'll even settle for a function that tells you what's the most restrictive DMA mask in the system, preiod. There's nothing inherently arch specific about this.
(and as a side note, the IOMMU we are working on on x86-64 is Calgary, which is actually roughly the same chipset used in some PPC machines...)
Not sure I ever heard about that... What chipsets ?
Ben.
Re: [PATCH] [2/2] POWERPC: Lower threshold for DART enablement to 1GB, V2
Quoted 1 line · Benjamin Herrenschmidt
Not sure I ever heard about that... What chipsets ?
I'm not sure which IBM pSeries modesl have Calgary in them. Perhaps Jon or Olof know?
Cheers,
Muli
Signature · 2 lines
Muli Ben-Yehuda http://www.mulix.org | http://mulix.livejournal.com/
Re: [PATCH] [2/2] POWERPC: Lower threshold for DART enablement to 1GB, V2
I believe its in Regatta platforms, spin 180 degrees and ask anton :) -JX
Quoted 17 lines · Muli Ben-Yehuda
Quoted 1 line · Benjamin Herrenschmidt
Not sure I ever heard about that... What chipsets ?
I'm not sure which IBM pSeries modesl have Calgary in them. Perhaps Jon or Olof know?
Cheers,
MuliSignature · 7 lines
Muli Ben-Yehuda http://www.mulix.org | http://mulix.livejournal.com/ _______________________________________________ Linuxppc-dev mailing list [email protected] https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH] [2/2] POWERPC: Lower threshold for DART enablement to 1GB, V2
In reply to Benjamin HerrenschmidtQuoted 8 lines · Benjamin Herrenschmidt
Quoted 8 lines
What I had in mind is an interface that given a PCI bridge will tell you what's the most restrictive DMA mask for a device on that bridge, so that you'll know whether you need to enable the IOMMU for that bridge. I'll even settle for a function that tells you what's the most restrictive DMA mask in the system, period. There's nothing inherently arch specific about this.
Quoted 5 lines
Quoted 3 lines
(and as a side note, the IOMMU we are working on on x86-64 is Calgary, which is actually roughly the same chipset used in some PPC machines...)
Not sure I ever heard about that... What chipsets ?
The pSeries POWER4 based systems (Regatta) had Calgary, and the RS/6000 POWER3 based systems (Condor) had Winnipeg (a precursor to Calgary, with many of the same features).
Thanks,
Jon
Quoted 8 lines
Ben.
_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH] [2/2] POWERPC: Lower threshold for DART enablement to 1GB, V2
Quoted 13 lines · Jon Mason
Quoted 12 lines · Benjamin Herrenschmidt
Quoted 11 lines
What I had in mind is an interface that given a PCI bridge will tell you what's the most restrictive DMA mask for a device on that bridge, so that you'll know whether you need to enable the IOMMU for that bridge. I'll even settle for a function that tells you what's the most restrictive DMA mask in the system, period. There's nothing inherently arch specific about this.
(and as a side note, the IOMMU we are working on on x86-64 is Calgary, which is actually roughly the same chipset used in some PPC machines...)
Quoted 5 lines
Quoted 1 line
Not sure I ever heard about that... What chipsets ?
The pSeries POWER4 based systems (Regatta) had Calgary, and the RS/6000 POWER3 based systems (Condor) had Winnipeg (a precursor to Calgary, with many of the same features).
Ah ok, I'm not familiar with the IBM chipset names
Ben.
Re: [PATCH] [2/2] POWERPC: Lower threshold for DART enablement to 1GB, V2
In reply to Olof JohanssonQuoted 11 lines · Olof Johansson
Quoted 10 lines · Benjamin Herrenschmidt
Quoted 8 lines · Muli Ben-Yehuda
Quoted 2 lines · Olof Johansson
iommu=off can still be used for those who don't want to deal with the overhead (and don't need it for any devices).
I've been pondering walking the PCI bus before deciding to enable an IOMMU and checking each device's DMA mask. Is this something that you considered and rejected, or just something no one got around to doing?
Quoted 7 lines
Quoted 2 lines
It would do the trick for airport cards in G5s.. a little bit of OF walking to find the card.
Walking the DT means we need to hardcode it on PCI IDs, since the Apple OF doesn't give the Airport device a logical name. It's probably easier to implement than walking PCI, but we'd need to maintain a table. My vote is for PCI walking, I'll give that a shot over the weekend.
PCI walking it soo late to decide wether to enable the DART no ? In any case, we need a table, so I wouldn't bother with PCI walking here. Anyway... we should be able to have almost no perf. degradation or even an improvement with the DART thanks to virtual merging. Currently, we pay a cost due to our stupid invalidate mecanism that we should really fix by shooting the TLB directly. Also have you made sure all your additions for handling crappy hardware are nicely wrapped in unlikely() statements ? :)
Quoted 5 lines
Quoted 3 lines
It won't help with cardbus broadcom's but then, there is currently no G5 with a cardbus adaptor that I know of :) It's possible I suppose to get a pci<->cardbus adapter but I suppose in that case, we can ignore it ...
Yep, that should be rare enough.
Re: [PATCH] [2/2] POWERPC: Lower threshold for DART enablement to 1GB, V2
Quoted 3 lines · Benjamin Herrenschmidt
an improvement with the DART thanks to virtual merging. Currently, we pay a cost due to our stupid invalidate mecanism that we should really fix by shooting the TLB directly.
What was keeping me from implementing this before was the lack of public documentation on how to do it. Has that changed? I'd be happy to do the implementation.
Quoted 3 lines
Also have you made sure all your
additions for handling crappy hardware are nicely wrapped inunlikely()statements ? :)
I would expect the dynamic predictor to work quite well on this. I'm not worried about the overhead of the tests as much as the overhead of having to enable the DART for smaller configs. If benchmark profiling shows different down the road then we can add them.
-Olof
Re: [PATCH] [2/2] POWERPC: Lower threshold for DART enablement to 1GB, V2
Quoted 9 lines · Olof Johansson
Quoted 3 lines · Benjamin Herrenschmidt
an improvement with the DART thanks to virtual merging. Currently, we pay a cost due to our stupid invalidate mecanism that we should really fix by shooting the TLB directly.
What was keeping me from implementing this before was the lack of public documentation on how to do it. Has that changed? I'd be happy to do the implementation.
Darwin has the macros to access the TLB though it doesn't use them... I suppose I can get the necessary doco bit from the microelectronics folks for the CPC925, that should apply to U3 as well, though U4 has a different format afaik. I'll dig and will come back to you.
Quoted 8 lines
Quoted 3 lines
Also have you made sure all your
additions for handling crappy hardware are nicely wrapped inunlikely()statements ? :)I would expect the dynamic predictor to work quite well on this. I'm not worried about the overhead of the tests as much as the overhead of having to enable the DART for smaller configs. If benchmark profiling shows different down the road then we can add them.
Ok.
Ben.
Re: [PATCH] [2/2] POWERPC: Lower threshold for DART enablement to 1GB, V2
In reply to Muli Ben-YehudaQuoted 8 lines · Muli Ben-Yehuda
Quoted 2 lines · Olof Johansson
iommu=off can still be used for those who don't want to deal with the overhead (and don't need it for any devices).
I've been pondering walking the PCI bus before deciding to enable an IOMMU and checking each device's DMA mask. Is this something that you considered and rejected, or just something no one got around to doing?
It's something I thought about, but right now we enable the IOMMU quite early during boot. It'd take a bit of surgery to shuffle things, and I decided that it's not worth the work (and risk of regressions) for 2.6.17.
-Olof
Quoted 4 lines · Olof Johansson
Since time is somewhat of essense (if 2.6.17 is still an option), I went for the choice of sending now and follow up with a small bugfix later in case something shows up, especially since quick regression tests seem ok.
FYI, I now have a positive test report from a bcm43xx user with a 1.5GB G5. (Thanks for testing this, Marc!).
-Olof