mbox series

[GIT,PULL] arm64: fix for -rc3

Message ID 20180907154516.GG12788@arm.com
State New
Headers show
Series [GIT,PULL] arm64: fix for -rc3 | expand

Pull-request

git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git tags/arm64-fixes

Message

Will Deacon Sept. 7, 2018, 3:45 p.m. UTC
Hi Linus,

Just one small fix here, preventing a VM_WARN_ON when a !present PMD/PUD
is "freed" as part of a huge ioremap() operation. The correct behaviour
is to skip the free silently in this case, which is a little weird (the
function is a bit of a misnomer), but it follows the x86 implementation.

I also renewed the expiry dates on my gpg subkeys this week, so you might
need to re-fetch them if you can find a working keyserver.

Cheers,

Will

--->8

The following changes since commit 57361846b52bc686112da6ca5368d11210796804:

  Linux 4.19-rc2 (2018-09-02 14:37:30 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git tags/arm64-fixes

for you to fetch changes up to fac880c7d074fdfca874114b5c47b36aa034e4ee:

  arm64: fix erroneous warnings in page freeing functions (2018-09-06 18:01:13 +0100)

----------------------------------------------------------------
arm64 fix

- Remove accidental VM_WARN_ON

----------------------------------------------------------------
Mark Rutland (1):
      arm64: fix erroneous warnings in page freeing functions

 arch/arm64/mm/mmu.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Comments

Linus Torvalds Sept. 7, 2018, 5:51 p.m. UTC | #1
On Fri, Sep 7, 2018 at 8:45 AM Will Deacon <will.deacon@arm.com> wrote:
>
> Just one small fix here, preventing a VM_WARN_ON when a !present PMD/PUD
> is "freed" as part of a huge ioremap() operation. The correct behaviour
> is to skip the free silently in this case, which is a little weird (the
> function is a bit of a misnomer), but it follows the x86 implementation.

Hmm. I've obviously pulled it, but it does strike me that maybe the
confusing semantics could be fixed?

There's only one call site, and only two implementations (x86 and arm64).

Maybe the whole "read pmd, check for present" could just be in the
caller, avoiding that oddity wrt name-vs-behavior.

I'm not entirely sure why that code has that special case to begin
with. I guess this is the only case of a kernel mapping of a hugepage,
and people wanted to avoid polluting the generic code with stuff that
was only relevant for architectures that implemented it? But we
already have that ioremap_pmd_enabled() guard, so architectures that
don't do this wouldn't actually have any extra code.

Anyway, I'll let it be, but I think it could be a good idea to simply
change the semantics, and in the process also make it a lot clearer
what that thing actually is expected to do.

                 Linus
Linus Torvalds Sept. 11, 2018, 6:45 p.m. UTC | #2
On Mon, Sep 10, 2018 at 7:45 AM Will Deacon <will.deacon@arm.com> wrote:
>
> Happy to send as a proper patch if you think this is the right sort of
> idea.

Looks sane to me,

            Linus