Subject: Re: [PATCH 2/4] 8xx: Avoid testing for kernel space in ITLB Miss.

From: Benjamin Herrenschmidt <[email-masked]>
Date: Wed, 17 Mar 2010 08:19:36 +1100

On Fri, 2010-02-26 at 09:29 +0100, Joakim Tjernlund wrote:
> +#ifdef CONFIG_MODULES
> +       /* Only modules will cause ITLB Misses as we always
> +        * pin the first 8MB of kernel memory */
>         andi.   r11, r10, 0x0800        /* Address >= 0x80000000 */
>         beq     3f
>         lis     r11, swapper_pg_dir@h
>         ori     r11, r11, swapper_pg_dir@l
>         rlwimi  r10, r11, 0, 2, 19
>  3:
> +#endif

You can optimize that further I think...

You can probably just remove the code above, and add something to
do_page_fault() that lazily copies the kernel PGD entries from
swapper_pg_dir to the app pgdir. (You can even pre-fill that when
creating a new mm).

Cheers,
Ben.