• Balbir Singh's avatar
    powerpc/lib/code-patching: Use alternate map for patch_instruction() · 37bc3e5f
    Balbir Singh authored
    This patch creates the window using text_poke_area, allocated via
    get_vm_area(). text_poke_area is per CPU to avoid locking.
    text_poke_area for each cpu is setup using late_initcall, prior to
    setup of these alternate mapping areas, we continue to use direct
    write to change/modify kernel text. With the ability to use alternate
    mappings to write to kernel text, it provides us the freedom to then
    turn text read-only and implement CONFIG_STRICT_KERNEL_RWX.
    
    This code is CPU hotplug aware to ensure that the we have mappings for
    any new cpus as they come online and tear down mappings for any CPUs
    that go offline.
    Signed-off-by: default avatarBalbir Singh <bsingharora@gmail.com>
    Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
    37bc3e5f
code-patching.c 18 KB