public inbox for linux-riscv@lists.infradead.org
 help / color / mirror / Atom feed
From: Niklas Cassel <Niklas.Cassel@wdc.com>
To: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Paul Walmsley <paul.walmsley@sifive.com>,
	"aou@eecs.berkeley.edu" <aou@eecs.berkeley.edu>,
	"linux-riscv@lists.infradead.org"
	<linux-riscv@lists.infradead.org>
Subject: Re: [PATCH] riscv: Don't output a bogus mmu-type on a no MMU kernel
Date: Mon, 23 May 2022 15:29:24 +0000	[thread overview]
Message-ID: <YouoU8BDQTVcnosb@x1-carbon> (raw)
In-Reply-To: <mhng-f33607d6-1b1f-4cd4-b90b-d25f16900881@palmer-ri-x1c9>

On Sat, May 21, 2022 at 01:46:43PM -0700, Palmer Dabbelt wrote:
> On Thu, 14 Apr 2022 10:30:36 PDT (-0700), niklas.cassel@wdc.com wrote:
> > Currently on a 64-bit kernel built without CONFIG_MMU, /proc/cpuinfo will
> > show the current MMU mode as sv57.
> > 
> > While the device tree property "mmu-type" does have a value "riscv,none" to
> > describe a CPU without a MMU, since commit 73c7c8f68e72 ("riscv: Use
> > pgtable_l4_enabled to output mmu_type in cpuinfo"), we no longer rely on
> > device tree to output the MMU mode. (Not even for CONFIG_32BIT.)
> > 
> > Therefore, instead of readding code to look at the "mmu-type" device tree
> > property, let's continue with the existing convention to use fixed values
> > for configurations where we don't determine the MMU mode at runtime.
> > 
> > Add a new fixed value for !CONFIG_MMU in order to output the correct
> > MMU mode in cpuinfo.
> 
> There's really two ideas as to what /proc/cpuinfo should be: do we show what
> the HW has, or what we userspace sees.  This sort of thing is a perfect
> example of that split.  We've been kind of vague about this in the past, but
> IMO putting what userspace sees in /proc/cpuinfo (and HWCAP, etc) is the
> right way to go.  That does hide a bit from userspace WRT what hardware it's
> running on, but it's more in line with the design of RISC-V (ie, a lot is
> hidden from userspace).
> 
> I've put this on for-next.

Thank you Palmer!

I did send out (somewhat) related device tree binding fix:
https://lore.kernel.org/linux-riscv/YoH9TE%2F4ruFQw3fV@x1-carbon/T/#m894179b986b2e1ef8ef43dd4a865f872e2564c18

Any chance of that getting picked up as well?


Kind regards,
Niklas
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

      parent reply	other threads:[~2022-05-23 15:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-14 17:30 [PATCH] riscv: Don't output a bogus mmu-type on a no MMU kernel Niklas Cassel
2022-05-21 20:46 ` Palmer Dabbelt
2022-05-22  8:25   ` Atish Patra
2022-05-23 15:29   ` Niklas Cassel [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=YouoU8BDQTVcnosb@x1-carbon \
    --to=niklas.cassel@wdc.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    /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