linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Cercueil <paul@crapouillou.net>
To: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Cc: Daniel Silsby <dansilsby@gmail.com>,
	Paul Burton <paul.burton@mips.com>,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	BROADCOM NVRAM DRIVER <linux-mips@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: config CPU_SUPPORTS_HUGEPAGES refers to the non-existing symbol ARCH_PHYS_ADDR_T_64BIT
Date: Thu, 09 Dec 2021 11:21:53 +0000	[thread overview]
Message-ID: <H8IU3R.H5QVNRA077PT@crapouillou.net> (raw)
In-Reply-To: <CAKXUXMyip-Ojt-uOsjU-LnajM+cV4EcAf6ABNoAus+t2fAizDg@mail.gmail.com>

Hi Lukas,

Le mer., déc. 8 2021 at 12:43:00 +0100, Lukas Bulwahn 
<lukas.bulwahn@gmail.com> a écrit :
> Dear Daniel, dear Paul, dear Thomas,
> 
> In commit d4a451d5fc84 ("arch: remove the ARCH_PHYS_ADDR_T_64BIT
> config symbol") from April 2018, the config ARCH_PHYS_ADDR_T_64BIT was
> removed and all instances of that config were refactored
> appropriately. Since then, it is recommended to use the config
> PHYS_ADDR_T_64BIT instead.
> 
> Then in June 2019, commit 171543e75272 ("MIPS: Disallow
> CPU_SUPPORTS_HUGEPAGES for XPA,EVA") introduces the expression
> "!(32BIT && (ARCH_PHYS_ADDR_T_64BIT || EVA))" for config
> CPU_SUPPORTS_HUGEPAGES, which refers to the non-existing symbol
> ARCH_PHYS_ADDR_T_64BIT.
> 
> In this expression, the symbol ARCH_PHYS_ADDR_T_64BIT always evaluates
> to false. So, the expression is effectively "!(32BIT && EVA)" right
> now.
> 
> Now, it is a bit unclear what is intended here, especially since it
> was not noticed to be wrong for the last two years:
> 
> - The commit is buggy, but nobody noticed it so far. It was intended
> to refer to PHYS_ADDR_T_64BIT. We need to provide a fix that changes
> the semantics by referring to the intended Kconfig symbol.

It should be PHYS_ADDR_T_64BIT, yes.

> - The commit is just a bit unclean and that is why nobody noticed. The
> reference to ARCH_PHYS_ADDR_T_64BIT can be dropped. We can provide a
> clean-up patch that preserves the current semantics.

AFAIK hugepages still don't work as-is on 32-bit as we are running out 
of available bits in PTEs. I do have hugepages enabled on a kernel 
build, but I have to manually disable ARCH_HAS_PTE_SPECIAL and 
CPU_HAS_RIXI to free up space. This is annoying but not something that 
can be fixed easily.

-Paul

> Once the situation for that commit and its intention is clear, I am
> happy to provide the suitable patch.
> 
> Best regards,
> 
> Lukas



      reply	other threads:[~2021-12-09 11:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-08 11:43 config CPU_SUPPORTS_HUGEPAGES refers to the non-existing symbol ARCH_PHYS_ADDR_T_64BIT Lukas Bulwahn
2021-12-09 11:21 ` Paul Cercueil [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=H8IU3R.H5QVNRA077PT@crapouillou.net \
    --to=paul@crapouillou.net \
    --cc=dansilsby@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=lukas.bulwahn@gmail.com \
    --cc=paul.burton@mips.com \
    --cc=tsbogend@alpha.franken.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).