[PATCH 01/17] arm64: entry: mark all entry code as notrace
mark.rutland at arm.com
Mon Jan 13 07:44:04 PST 2020
On Thu, Jan 09, 2020 at 10:51:10AM +0530, Anshuman Khandual wrote:
> On 01/09/2020 12:26 AM, Mark Rutland wrote:
> > Almost all functions in entry-common.c are marked notrace, with
> > el1_undef and el1_inv being the only exceptions. We appear to have done
> > this on the assumption that there were no exception registers that we
> > needed to snapshot, and thus it was safe to run trace code that might
> > result in further exceptions and clobber those registers.
> > However, until we inherit the DAIF flags, our irq flag tracing is stale,
> > and this discrepancy could set off warnings in some configurations.
> Could you give some example scenarios when this might happen ?
With CONFIG_DEBUG_LOCKDEP, any locked-instrumented function which calls
check_flags() would trigger this. So if your trace function does any
sort of lock manipulation it's liable to set this off.
I'll amend the above:
| However, until we inherit the DAIF flags, our irq flag tracing is
| stale, and this discrepancy could set off warnings in some
| configurations (e.g. with CONFIG_DEBUG_LOCKDEP).
I also hope that flag checking is performed more generally in future,
since at the moment it's only strictly performed for locking operations.
More information about the linux-arm-kernel