Skip to content
  • Mark Rutland's avatar
    b5df5b83
    arm64: idle: don't instrument idle code with KCOV · b5df5b83
    Mark Rutland authored
    
    
    The low-level idle code in arch_cpu_idle() and its callees runs at a
    time where where portions of the kernel environment aren't available.
    For example, RCU may not be watching, and lockdep state may be
    out-of-sync with the hardware. Due to this, it is not sound to
    instrument this code.
    
    We generally avoid instrumentation by marking the entry functions as
    `noinstr`, but currently this doesn't inhibit KCOV instrumentation.
    Prevent this by factoring these functions into a new idle.c so that we
    can disable KCOV for the entire compilation unit, as is done for the
    core idle code in kernel/sched/idle.c.
    
    We'd like to keep instrumentation of the rest of process.c, and for the
    existing code in cpuidle.c, so a new compilation unit is preferable. The
    arch_cpu_idle_dead() function in process.c is a cpu hotplug function
    that is safe to instrument, so it is left as-is in process.c.
    
    Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
    Acked-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
    Acked-by: default avatarMarc Zyngier <maz@kernel.org>
    Cc: James Morse <james.morse@arm.com>
    Cc: Will Deacon <will@kernel.org>
    Link: https://lore.kernel.org/r/20210607094624.34689-21-mark.rutland@arm.com
    
    
    Signed-off-by: default avatarWill Deacon <will@kernel.org>
    b5df5b83
    arm64: idle: don't instrument idle code with KCOV
    Mark Rutland authored
    
    
    The low-level idle code in arch_cpu_idle() and its callees runs at a
    time where where portions of the kernel environment aren't available.
    For example, RCU may not be watching, and lockdep state may be
    out-of-sync with the hardware. Due to this, it is not sound to
    instrument this code.
    
    We generally avoid instrumentation by marking the entry functions as
    `noinstr`, but currently this doesn't inhibit KCOV instrumentation.
    Prevent this by factoring these functions into a new idle.c so that we
    can disable KCOV for the entire compilation unit, as is done for the
    core idle code in kernel/sched/idle.c.
    
    We'd like to keep instrumentation of the rest of process.c, and for the
    existing code in cpuidle.c, so a new compilation unit is preferable. The
    arch_cpu_idle_dead() function in process.c is a cpu hotplug function
    that is safe to instrument, so it is left as-is in process.c.
    
    Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
    Acked-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
    Acked-by: default avatarMarc Zyngier <maz@kernel.org>
    Cc: James Morse <james.morse@arm.com>
    Cc: Will Deacon <will@kernel.org>
    Link: https://lore.kernel.org/r/20210607094624.34689-21-mark.rutland@arm.com
    
    
    Signed-off-by: default avatarWill Deacon <will@kernel.org>
Loading