mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Brad Hawthorne <brad@sim.vu>
To: Yoshifumi SHU <envzhu@gmail.com>,
	Linus Walleij <linusw@kernel.org>,
	Arnd Bergmann <arnd@kernel.org>
Cc: Brad Hawthorne <brad@sim.vu>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 00/14] ARM: deprecated platform removal
Date: Sat, 21 Nov 2026 18:37:56 -0600	[thread overview]
Message-ID: <20261122003911.1203777-1-brad@sim.vu> (raw)
In-Reply-To: <CAD++jL=VJsnk-GzAvR4oR8oKJayQzq9Oes+ZW7K=iHGrQ1jh0w@mail.gmail.com>


Hi Arnd, Linus, Yoshifumi,

A second ARMv8-M user, in support of keeping CONFIG_CPU_V7M for v8-M.

I run Linux on the Raspberry Pi RP2350 (dual Cortex-M33, 520 KiB SRAM,
8 MiB PSRAM, XIP from QSPI flash) on an Adafruit Fruit Jam board. It
boots v7.4-rc3 to a userspace shell over the SoC's own USB device
controller, with the kernel executing in place from flash. Like
Yoshifumi I need the v7-M core, PMSAv8 and the NVIC far more than any
one platform, and I don't object to the MCU platform removals. The
Fruit Jam is a small self-contained computer (HDMI, USB host, SD card,
Wi-Fi), and I am preparing a public developer preview of this Linux for
it, so the core has users beyond me. On the RP2350 I use PMSAv8 to give
each process its own MPU windows, so a user program cannot write another
program's memory or the kernel's; that work is out of tree for now.

I tested the generic IRQ entry work on the board, v7.4-rc3 plus the
RP2350 platform patches, each case in its own process: a register-heavy
loop under a 1 ms SIGALRM, 1 ms sleeps, a pipe ping-pong between two
processes under timers, and rseq critical sections interrupted by a
signal and by preemption from a busy competitor (9000 sections):

                          rseq aborts on preemption   other cases
  v7.4-rc3                  820                         pass
  + Linus's v3                0 (all 9000 commit)       pass
  + v3 + Yoshifumi's RFC    802                         pass

So on hardware, as under QEMU (mps2-an385 and -an505) and as Yoshifumi
described, v3 alone lets a preempted rseq critical section commit on
v7-M instead of aborting, and the RFC fixes it. Signal-delivered aborts
work in all three. For the RFC on top of v3:

Tested-by: Brad Hawthorne <brad@sim.vu> # RP2350 (Cortex-M33)

Under QEMU, Yoshifumi's one-line arm_rseq_user_enter() call in
__pendsv_entry also closes the gap on v3 alone, if v3 should go first.

While bringing the board up I found a few things in the shared code:

 - mm/nommu: mremap() resizing in place updates vm_end but not the
   maple tree, so a shrunk VMA leaves a stale range that points at the
   VMA after it is freed. With Hajime Tazaki's agreement I've sent a
   minimal fix to linux-mm:
   https://lore.kernel.org/linux-mm/20261121083139.803682-1-brad@sim.vu/

 - irq-nvic: the priority registers are written at the wrong offset.
   Yoshifumi already found this, so I'll leave it to his series and
   test it on the RP2350, where the board does not take interrupts
   without it. For his changelog: the offset was right (0x300 from the
   node's base, ISER0 at 0xe000e100) until c5e0cbe2858d ("irqchip:
   nvic: Fix offset for Interrupt Priority Offsets") made it 0x400,
   taking 0xe000e400 as an offset from 0xe000e000; that commit went to
   stable as far back as 4.19, so the fix wants Fixes: c5e0cbe2858d
   and Cc stable.

 - v7-M itself: five patches, ready as an RFC series, each run on the
   board with and without it on v7.4-rc3:
     * an XIP kernel with HARDENED_USERCOPY BUGs on its first readdir
       (_etext ends after .rodata), a stable fix that stands alone;
     * a user program's fault stops the machine; with the patch it is
       a signal (SIGFPE, SIGTRAP, SIGILL, SIGBUS, SIGSEGV);
     * CPACR and CONTROL are inherited from the loader, so user space
       gets the FPU with no FP state switched;
     * on v8-M Mainline, MSPLIM catches a kernel stack overflow, which
       today runs past the stack unnoticed;
     * the Cortex-M33's ACTLR.EXTEXCLALL, set by pico-sdk loaders,
       makes every STREX to the RP2350's PSRAM fail, so the kernel
       never reaches its console.
   Two of them change __irq_entry and __pendsv_entry, which
   Yoshifumi's RFC rewrites, and they don't apply together. I'd rather
   rebase onto the generic entry work than collide: would you prefer
   them on top of it, and is linux-arm-kernel the right home?

Arnd, one question about the plan for the CPUs. After the 7.5
removals, nothing in-tree selects ARM_SINGLE_ARMV7M but !MMU itself,
and no board's device tree uses the v7-M core; Yoshifumi's boards and
mine are out of tree. Would a small RP2350 platform (DT, timer, clocks,
resets, watchdog), run on hardware for each -rc, be a welcome in-tree
user of CPU_V7M, or would you rather keep the core with no platform
and boards out of tree? I'd hold the platform series until the core
question is settled either way.

A note on method: I use an AI coding assistant for parts of this work.
Everything I send is reviewed, tested on hardware and signed off by me,
and each changelog says what the assistant did, per
Documentation/process/coding-assistants.rst.

Thanks,
Brad Hawthorne


  parent reply	other threads:[~2026-11-22  0:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-14 14:08 Arnd Bergmann
2026-09-14 14:08 ` [PATCH v2 06/14] ARM: omap2: remove omap24xx support Arnd Bergmann
2026-09-21 16:06   ` Kevin Hilman
2026-11-10 12:18   ` Hans Verkuil
2026-09-21 11:06 ` [PATCH v2 00/14] ARM: deprecated platform removal Yoshifumi SHU
2026-09-25 13:30   ` Linus Walleij
2026-09-26 19:29     ` Yoshifumi SHU
2026-11-22  0:37     ` Brad Hawthorne [this message]
2026-10-01 12:40 ` Krzysztof Kozlowski

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=20261122003911.1203777-1-brad@sim.vu \
    --to=brad@sim.vu \
    --cc=arnd@kernel.org \
    --cc=envzhu@gmail.com \
    --cc=linusw@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.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®