Re: [PATCHv11 6/6] asm-generic/io: Add logging support for MMIO accessors

From: Greg KH
Date: Thu Apr 28 2022 - 04:24:17 EST


On Thu, Apr 28, 2022 at 10:18:36AM +0200, Arnd Bergmann wrote:
> On Thu, Apr 28, 2022 at 9:35 AM Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
> >
> > On Thu, Apr 28, 2022 at 12:59:13PM +0530, Sai Prakash Ranjan wrote:
> > > On 4/28/2022 11:21 AM, Greg KH wrote:
> > > > On Thu, Apr 28, 2022 at 09:00:13AM +0530, Sai Prakash Ranjan wrote:
> >
> > > -D__NO_FORTIFY, -D__DISABLE_EXPORTS, -DDISABLE_BRANCH_PROFILING".
> >
> > Those are compiler flags that affect gcc, not kernel code functionality.
>
> It's normal for invasive instrumentation to need flags to disable them. If you
> look at mm/kasan/Makefile, you see
>
> KASAN_SANITIZE := n
> UBSAN_SANITIZE := n
> KCOV_INSTRUMENT := n
> CC_FLAGS_KASAN_RUNTIME += -DDISABLE_BRANCH_PROFILING
> CFLAGS_REMOVE_common.o = $(CC_FLAGS_FTRACE)
>
> all of which disable one of the instrumentation options, either per file
> or per directory, in order to break recursion.

That's not for logging stuff (which seems to change the functionality of
the driver), it's for system-wide profiling/code-coverage/checking/etc
type of stuff.

Let's keep a #define at the top of the driver for the drivers that
absolutely need this feature disabled as it is much easier to track that
and to see how it affects things. If you put it in a Makefile,
reviewers will miss it and wonder what is going on.

thanks,

greg k-h