• Christophe Leroy's avatar
    powerpc/8xx: Use hardware assistance in TLB handlers · 6a8f911b
    Christophe Leroy authored
    Today, on the 8xx the TLB handlers do SW tablewalk by doing all
    the calculation in ASM, in order to match with the Linux page
    table structure.
    
    The 8xx offers hardware assistance which allows significant size
    reduction of the TLB handlers, hence also reduces the time spent
    in the handlers.
    
    However, using this HW assistance implies some constraints on the
    page table structure:
    - Regardless of the main page size used (4k or 16k), the
    level 1 table (PGD) contains 1024 entries and each PGD entry covers
    a 4Mbytes area which is managed by a level 2 table (PTE) containing
    also 1024 entries each describing a 4k page.
    - 16k pages require 4 identifical entries in the L2 table
    - 512k pages PTE have to be spread every 128 bytes in the L2 table
    - 8M pages PTE are at the address pointed by the L1 entry and each
    8M page require 2 identical entries in the PGD.
    
    This patch modifies the TLB handlers to use HW assistance for 4K PAGES.
    
    Before that patch, the mean time spent in TLB miss handlers is:
    - ITLB miss: 80 ticks
    - DTLB miss: 62 ticks
    After that patch, the mean time spent in TLB miss handlers is:
    - ITLB miss: 72 ticks
    - DTLB miss: 54 ticks
    So the improvement is 10% for ITLB and 13% for DTLB misses
    Signed-off-by: default avatarChristophe Leroy <christophe.leroy@c-s.fr>
    Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
    6a8f911b
8xx_mmu.c 4.96 KB