• Mark Rutland's avatar
    arm64: mm: convert cpu_do_switch_mm() to C · 25b92693
    Mark Rutland authored
    There's no reason that cpu_do_switch_mm() needs to be written as an
    assembly function, and having it as a C function would make it easier to
    maintain.
    
    This patch converts cpu_do_switch_mm() to C, removing code that this
    change makes redundant (e.g. the mmid macro). Since the header comment
    was stale and the prototype now implies all the necessary information,
    this comment is removed. The 'pgd_phys' argument is made a phys_addr_t
    to match the return type of virt_to_phys().
    
    At the same time, post_ttbr_update_workaround() is updated to use
    IS_ENABLED(), which allows the compiler to figure out it can elide calls
    for !CONFIG_CAVIUM_ERRATUM_27456 builds.
    
    There should be no functional change as a result of this patch.
    Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
    Cc: Will Deacon <will@kernel.org>
    [catalin.marinas@arm.com: change comments from asm-style to C-style]
    Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
    25b92693
mmu_context.h 6.67 KB