OSDN Git Service

xtensa: fix NOMMU build with lock_mm_and_find_vma() conversion
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 1 Jul 2023 01:24:49 +0000 (18:24 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 1 Jul 2023 04:08:05 +0000 (21:08 -0700)
commitd85a143b69abb4d7544227e26d12c4c7735ab27d
treea045ded33504b2274387b628a936bd6d1e2e5cee
parentb25f62ccb490680a8cee755ac4528909395e0711
xtensa: fix NOMMU build with lock_mm_and_find_vma() conversion

It turns out that xtensa has a really odd configuration situation: you
can do a no-MMU config, but still have the page fault code enabled.
Which doesn't sound all that sensible, but it turns out that xtensa can
have protection faults even without the MMU, and we have this:

    config PFAULT
        bool "Handle protection faults" if EXPERT && !MMU
        default y
        help
          Handle protection faults. MMU configurations must enable it.
          noMMU configurations may disable it if used memory map never
          generates protection faults or faults are always fatal.

          If unsure, say Y.

which completely violated my expectations of the page fault handling.

End result: Guenter reports that the xtensa no-MMU builds all fail with

  arch/xtensa/mm/fault.c: In function ‘do_page_fault’:
  arch/xtensa/mm/fault.c:133:8: error: implicit declaration of function ‘lock_mm_and_find_vma’

because I never exposed the new lock_mm_and_find_vma() function for the
no-MMU case.

Doing so is simple enough, and fixes the problem.

Reported-and-tested-by: Guenter Roeck <linux@roeck-us.net>
Fixes: a050ba1e7422 ("mm/fault: convert remaining simple cases to lock_mm_and_find_vma()")
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/mm.h
mm/nommu.c