[PATCH 10/14] cell: add iommu support for larger memory

Arnd Bergmann arnd at arndb.de
Sat Dec 10 02:30:27 EST 2005


On Middeweken 07 Dezember 2005 18:24, Milton Miller wrote:
> > @@ -221,7 +224,7 @@ set_iopt_cache(void __iomem *base, unsig
> >         unsigned long __iomem *tags = base + IOC_PT_CACHE_DIR;
> >         unsigned long __iomem *p = base + IOC_PT_CACHE_REG;
> >         pr_debug("iopt %02lx was v%016lx/t%016lx, store 
> > v%016lx/t%016lx\n",
> > -               index, get_iopt_cache(base, index, &oldtag), oldtag, 
> > val, tag);
> > +               index, get_iopt_cache(base, index, &tag), tag, val, 
> > tag);
> 
> Assuming get_iopt_cache takes &tag to fill it in, this code is wrong.
> The order of function argument evaluation is undefined in C, and the
> compiler can choose to change its order at any time.

Good catch. The old code simply got a compile error with pr_debug
enabled, the new code would to actual harm. I'll just remove the
line completely.

> > +       for (real_address = 0, io_address = 0;
> > +            io_address <= map_start + map_size;
> > +            real_address += io_page_size, io_address += io_page_size) 
> > {
> > +               ioste = get_iost_entry(fake_iopt, io_address, 
> > io_page_size);
> > +               if ((real_address & 0xfffffff) == 0) /* segment start 
> > */
> > +                       set_iost_cache(ioc_mmio_base,
> > +                                      io_address >> 28, ioste);
> > +               index = get_ioc_hash_1way(ioste, io_address);
> 
> [comment] more magic numbers remain...

Ok, I'll try to make that more readable.

	Arnd <><



More information about the Linuxppc64-dev mailing list