From: "Arnd Bergmann" <arnd@arndb.de>
To: "Jessica Clarke" <jrtc27@jrtc27.com>,
"Christoph Hellwig" <hch@infradead.org>
Cc: "Matthew Wilcox" <willy@infradead.org>,
Prabhakar <prabhakar.csengg@gmail.com>,
Linux-MM <linux-mm@kvack.org>,
linux-riscv <linux-riscv@lists.infradead.org>,
Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
<devicetree@vger.kernel.org>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Rob Herring" <robh+dt@kernel.org>,
"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
"Geert Uytterhoeven" <geert.uytterhoeven@gmail.com>,
"Fabrizio Castro" <fabrizio.castro.jz@renesas.com>,
"Biju Das" <biju.das.jz@bp.renesas.com>,
"Chris Paterson" <Chris.Paterson2@renesas.com>
Subject: Re: [QUERY]: Block region to mmap
Date: Wed, 01 Feb 2023 09:05:41 +0100 [thread overview]
Message-ID: <b064f754-4d94-4c0d-ad27-e0ad223d022c@app.fastmail.com> (raw)
In-Reply-To: <11BE997B-93C7-4D38-99BF-FD025A1FB945@jrtc27.com>
On Wed, Feb 1, 2023, at 08:05, Jessica Clarke wrote:
> On 1 Feb 2023, at 06:31, Christoph Hellwig <hch@infradead.org> wrote:
>> On Mon, Jan 30, 2023 at 03:24:40PM +0000, Matthew Wilcox wrote:
>>
>>> Before we go too deeply into it, how much would it cost to buy all of
>>> these parts and feed them into a shredder? I'm not entirely joking;
>>> if it's less than the software engineering time it'd take to develop
>>> and support this feature, we should do it.
>>
>> The above suggests this is in no way an actual hardware problem, but the
>> stupid decision is done in the M-Mode firmware. I think it is very
>> reasonable to simply not support the devices in Linux until the firmware
>> is fixed.
>
> No, it really is a hardware spec violation. Virtual addresses within
> the magic range bypass translation with no way to turn it off. The
> firmware is being (has been?) patched to block those accesses at the
> physical memory protection level so any attempt to use those virtual
> addresses will fault, but if Linux wants to support this cursed
> hardware and its gross spec violation then it needs to forbid any
> allocation of the VA range.
For a local build of an embedded system it's probably enough to
set CONFIG_DEFAULT_MMAP_MIN_ADDR and CONFIG_LSM_MMAP_MIN_ADDR
in order to force userspace outside of the broken address
range.
If that configuration can no longer run most regular userspace
binaries, there is probably not much need to detect the hardware
that needs it and do this automatically in the kernel, beyond
perhaps some platform specific code that refuses to boot unless
the config options are set this way on the affected chip
revisions.
Arnd
prev parent reply other threads:[~2023-02-01 8:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-25 12:30 Lad, Prabhakar
2023-01-26 14:37 ` Matthew Wilcox
2023-01-30 10:53 ` Lad, Prabhakar
2023-01-30 15:24 ` Matthew Wilcox
2023-02-01 6:31 ` Christoph Hellwig
2023-02-01 7:05 ` Jessica Clarke
2023-02-01 8:05 ` Arnd Bergmann [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=b064f754-4d94-4c0d-ad27-e0ad223d022c@app.fastmail.com \
--to=arnd@arndb.de \
--cc=Chris.Paterson2@renesas.com \
--cc=biju.das.jz@bp.renesas.com \
--cc=devicetree@vger.kernel.org \
--cc=fabrizio.castro.jz@renesas.com \
--cc=geert.uytterhoeven@gmail.com \
--cc=hch@infradead.org \
--cc=jrtc27@jrtc27.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-mm@kvack.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=prabhakar.csengg@gmail.com \
--cc=robh+dt@kernel.org \
--cc=willy@infradead.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