mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: Mark Rutland <mark.rutland@arm.com>, Rob Herring <robh@kernel.org>
Cc: Calvin Zhang <calvinzhang.cool@gmail.com>,
	Frank Rowand <frowand.list@gmail.com>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] of: unmap memory regions in /memreserve node
Date: Fri, 03 Dec 2021 12:11:26 +1100	[thread overview]
Message-ID: <874k7qpk5d.fsf@mpe.ellerman.id.au> (raw)
In-Reply-To: <YaiRAD40xCK7u3Hl@FVFF77S0Q05N>

Mark Rutland <mark.rutland@arm.com> writes:
> On Tue, Nov 30, 2021 at 04:43:31PM -0600, Rob Herring wrote:
>> +linuxppc-dev
 
Sorry missed this until now ...

>> On Wed, Nov 24, 2021 at 09:33:47PM +0800, Calvin Zhang wrote:
>> > Reserved memory regions in /memreserve node aren't and shouldn't
>> > be referenced elsewhere. So mark them no-map to skip direct mapping
>> > for them.
>> 
>> I suspect this has a high chance of breaking some platform. There's no 
>> rule a region can't be accessed.
>
> The subtlety is that the region shouldn't be explicitly accessed (e.g.
> modified),

I think "modified" is the key there, reserved means Linux doesn't use
the range for its own data, but may still read from whatever is in the
range.

On some platforms the initrd will be marked as reserved, which Linux
obviously needs to read from.

> but the OS is permitted to have the region mapped. In ePAPR this is
> described as:
>
>    This requirement is necessary because the client program is permitted to map
>    memory with storage attributes specified as not Write Through Required, not
>    Caching Inhibited, and Memory Coherence Required (i.e., WIMG = 0b001x), and
>    VLE=0 where supported. The client program may use large virtual pages that
>    contain reserved memory. However, the client program may not modify reserved
>    memory, so the boot program may perform accesses to reserved memory as Write
>    Through Required where conflicting values for this storage attribute are
>    architecturally permissible.
>
> Historically arm64 relied upon this for spin-table to work, and I *think* we
> might not need that any more I agree that there's a high chance this will break
> something (especially on 16K or 64K page size kernels), so I'd prefer to leave
> it as-is.

Yeah I agree. On powerpc we still use large pages for the linear mapping
(direct map), so reserved regions will be incidentally mapped as
described above.

> If someone requires no-map behaviour, they should use a /reserved-memory entry
> with a no-map property, which will work today and document their requirement
> explicitly.

+1.

cheers

      reply	other threads:[~2021-12-03  1:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-24 13:33 Calvin Zhang
2021-11-30 22:43 ` Rob Herring
2021-12-02  9:25   ` Mark Rutland
2021-12-03  1:11     ` Michael Ellerman [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=874k7qpk5d.fsf@mpe.ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=calvinzhang.cool@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mark.rutland@arm.com \
    --cc=robh@kernel.org \
    /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

all inboxes | Powered by JetHome®