Re: [PATCH 02/20] powerpc/8xx: Map linear kernel RAM with 8M pages

From: Segher Boessenkool
Date: Thu Aug 13 2015 - 03:01:32 EST


On Wed, Aug 12, 2015 at 03:40:56PM +0200, Christophe Leroy wrote:
> /* Insert level 1 index */
> rlwimi r11, r10, 32 - ((PAGE_SHIFT - 2) << 1), (PAGE_SHIFT - 2) << 1, 29
> lwz r11, (swapper_pg_dir-PAGE_OFFSET)@l(r11) /* Get the level 1 entry */
> + mtcr r11

Maybe mtcrf is faster? You only want one field, anyhow.

> + bgt- cr7,5f /* CR7.GT = bit 29 = Large page (8M or 512K) */

You can write this as bt- 29,5f which should be easier to read.

> /* Insert level 1 index */
> 3: rlwimi r11, r10, 32 - ((PAGE_SHIFT - 2) << 1), (PAGE_SHIFT - 2) << 1, 29
> lwz r11, (swapper_pg_dir-PAGE_OFFSET)@l(r11) /* Get the level 1 entry */
> + mtcr r11
> + bgt cr7,200f

Same here... Probably good to comment it, too.


Segher
--
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/