Re: [tip:x86/mm] x86, mm: fault.c, simplify kmmio_fault()

From: Ingo Molnar
Date: Sun Feb 22 2009 - 04:26:33 EST



* Pekka Paalanen <pq@xxxxxx> wrote:

> On Fri, 20 Feb 2009 22:40:09 GMT
> Ingo Molnar <mingo@xxxxxxx> wrote:
>
> > Author: Ingo Molnar <mingo@xxxxxxx>
> > AuthorDate: Fri, 20 Feb 2009 22:32:10 +0100
> > Commit: Ingo Molnar <mingo@xxxxxxx>
> > CommitDate: Sat, 21 Feb 2009 00:09:42 +0100
> >
> > x86, mm: fault.c, simplify kmmio_fault()
> >
> > Impact: cleanup
> >
> > Remove an #ifdef from kmmio_fault() - we can do this by
> > providing default implementations for is_kmmio_active()
> > and kmmio_handler(). The compiler optimizes it all away
> > in the !CONFIG_MMIOTRACE case.
> >
> > Also, while at it, clean up mmiotrace.h a bit:
> >
> > - standard header guards
> > - standard vertical spaces for structure definitions
> >
> > No code changed (both with mmiotrace on and off in the config):
> >
> > text data bss dec hex filename
> > 2947 12 12 2971 b9b fault.o.before
> > 2947 12 12 2971 b9b fault.o.after
> >
> > Cc: Pekka Paalanen <pq@xxxxxx>
> > Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
> > Signed-off-by: Ingo Molnar <mingo@xxxxxxx>
> >
>
> Acked-by: Pekka Paalanen <pq@xxxxxx>
> except for one minor detail below.
>
> >
> > ---
> > arch/x86/mm/fault.c | 5 ++-
> > include/linux/mmiotrace.h | 78 +++++++++++++++++++++++++++------------------
> > 2 files changed, 50 insertions(+), 33 deletions(-)
> >
> > diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
> > index 3e36614..fe99af4 100644
> > --- a/arch/x86/mm/fault.c
> > +++ b/arch/x86/mm/fault.c
> > @@ -55,13 +55,14 @@ enum x86_pf_error_code {
> > PF_INSTR = 1 << 4,
> > };
> >
> > +/*
> > + * (returns 0 if mmiotrace is disabled)
>
> Returns 0 if the fault was not handled in mmiotrace.

ok, i've updated the comment. I did not mean the comment to be
an exclusive statement, but in hindsight it's indeed ambiguous.

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/