mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 00/13] ARM32: modules: fix bitrot and add test
@ 2026-01-16 16:06 Ahmad Fatoum
  2026-01-16 16:06 ` [PATCH 01/13] kbuild: fold rmdirs into rmfiles Ahmad Fatoum
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: Ahmad Fatoum @ 2026-01-16 16:06 UTC (permalink / raw)
  To: barebox; +Cc: David Dgien

v1 -> v2:
  - drop <fdt.h> include in <compressed-dtb.h> in favor of
    https://lore.barebox.org/barebox/20260114120221.941836-3-a.fatoum@pengutronix.de/T/#m191aec342beb0a80468f5c18a7cdd58dedad08ad
  - patch 01/13 is new to allow deleting the .tmp_barebox_modules_env
    directory
  - renamed virt-el2@multi_v8_defconfig.yaml to dt-2nd@multi_v8_defconfig.yaml
  - added YAML configs for ARM32 as well (Sascha)
  - changed printf in lowlevel.c to pr_info (Sascha)

---

We have had experimental module support in barebox for quite a while,
but AFAIK it doesn't see much real world usage and thus bitrots over time.

One use case I see for modules though is systems, where we want to fit
barebox prebootloader + compressed barebox proper into SRAM to avoid
the need for a PBL-only eMMC driver for example.

In these cases, it would be quite useful if we could strip barebox to
the bare minimum amount of drivers and just load e.g. network driver on
demand. There's a number of things we need before that though: At least
support for W^X (CONFIG_ARM_MMU_PERMISSIONS), ARM64 support and support
for module signature verification.

But for now, let's ensure the support we already have doesn't
deteriorate further and fix some bitrot accumulated so far and add a
test to the test suite to verify module loading continues to work in
future as well. The test is also wired into CI, so it runs on every push
(and Github pull request).


Ahmad Fatoum (13):
  kbuild: fold rmdirs into rmfiles
  boards: qemu-virt: reserve BIOS device tree
  ARM: qemu-virt: add image for use as -bios
  kbuild: build *.mod.c with -std=gnu11
  ARM32: mark modules as incompatible with ARM_MMU_PERMISSIONS
  treewide: fix some missing EXPORT_SYMBOL
  pci: ecam: enable build as module
  kbuild: add support for installing and stripping modules
  ARM32: module: handle more relocations
  commands: pm_domain: make command tristate
  test: conftest: add support for describing FW_CFG environment in YAML
  defaultenv: add barebox_modules_env target
  test: arm: add simple driver/command module test

 .github/workflows/test-labgrid-pytest.yml |   4 +
 Makefile                                  |  44 ++---
 arch/arm/boards/Makefile                  |   1 +
 arch/arm/boards/qemu-virt/Makefile        |   2 +-
 arch/arm/boards/qemu-virt/lowlevel.c      |  80 ++++++++
 arch/arm/configs/modules32_defconfig      | 230 ++++++++++++++++++++++
 arch/arm/cpu/Kconfig                      |   2 +-
 arch/arm/include/asm/elf.h                |   2 +
 arch/arm/lib32/Makefile                   |   1 +
 arch/arm/lib32/module.c                   |  20 ++
 arch/arm/lib32/string.c                   |   7 +
 commands/Kconfig                          |   2 +-
 common/Kconfig                            |  14 ++
 common/bbu.c                              |   1 +
 common/block.c                            |   2 +
 common/boards/qemu-virt/board.c           |  32 +++
 common/firmware.c                         |   1 +
 common/globalvar.c                        |   1 +
 common/machine_id.c                       |   1 +
 common/memory.c                           |   1 +
 common/structio.c                         |   3 +
 conftest.py                               |  19 ++
 defaultenv/.gitignore                     |   1 +
 drivers/base/bus.c                        |   2 +
 drivers/base/class.c                      |   1 +
 drivers/base/driver.c                     |   1 +
 drivers/base/platform.c                   |   1 +
 drivers/base/power.c                      |   2 +
 drivers/clk/clk-bulk.c                    |   2 +-
 drivers/clk/clk.c                         |   1 +
 drivers/firmware/arm_scmi/driver.c        |   1 +
 drivers/gpio/gpiolib.c                    |   2 +-
 drivers/hw_random/core.c                  |   1 +
 drivers/mtd/core.c                        |   1 +
 drivers/net/dsa.c                         |   1 +
 drivers/nvmem/core.c                      |   1 +
 drivers/of/base.c                         |   3 +-
 drivers/pci/Kconfig                       |   2 +-
 drivers/pci/pci.c                         |   2 +
 drivers/pinctrl/pinctrl.c                 |   1 +
 drivers/video/fb.c                        |   1 +
 fs/pstore/platform.c                      |   1 +
 images/Makefile.vexpress                  |   5 +
 lib/parameter.c                           |   1 +
 lib/string.c                              |   2 +
 lib/stringlist.c                          |   3 +
 lib/ucs2_string.c                         |   2 +-
 net/eth.c                                 |   1 +
 net/net.c                                 |   1 +
 scripts/Makefile.modinst                  |  67 +++++++
 test/arm/dt-2nd@multi_v7_defconfig.yaml   |  22 +++
 test/arm/dt-2nd@multi_v8_defconfig.yaml   |  23 +++
 test/arm/modules32_defconfig.yaml         |  27 +++
 test/arm/virt@multi_v7_defconfig.yaml     |   4 +-
 test/arm/virt@multi_v8_defconfig.yaml     |   4 +-
 test/py/test_module.py                    |  54 +++++
 56 files changed, 679 insertions(+), 35 deletions(-)
 create mode 100644 arch/arm/boards/qemu-virt/lowlevel.c
 create mode 100644 arch/arm/configs/modules32_defconfig
 create mode 100644 arch/arm/lib32/string.c
 create mode 100644 scripts/Makefile.modinst
 create mode 100644 test/arm/dt-2nd@multi_v7_defconfig.yaml
 create mode 100644 test/arm/dt-2nd@multi_v8_defconfig.yaml
 create mode 100644 test/arm/modules32_defconfig.yaml
 create mode 100644 test/py/test_module.py

-- 
2.47.3




^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2026-01-19  7:29 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-16 16:06 [PATCH 00/13] ARM32: modules: fix bitrot and add test Ahmad Fatoum
2026-01-16 16:06 ` [PATCH 01/13] kbuild: fold rmdirs into rmfiles Ahmad Fatoum
2026-01-16 16:06 ` [PATCH 02/13] boards: qemu-virt: reserve BIOS device tree Ahmad Fatoum
2026-01-16 16:06 ` [PATCH 03/13] ARM: qemu-virt: add image for use as -bios Ahmad Fatoum
2026-01-16 16:06 ` [PATCH 04/13] kbuild: build *.mod.c with -std=gnu11 Ahmad Fatoum
2026-01-16 16:06 ` [PATCH 05/13] ARM32: mark modules as incompatible with ARM_MMU_PERMISSIONS Ahmad Fatoum
2026-01-16 16:06 ` [PATCH 06/13] treewide: fix some missing EXPORT_SYMBOL Ahmad Fatoum
2026-01-16 16:06 ` [PATCH 07/13] pci: ecam: enable build as module Ahmad Fatoum
2026-01-16 16:06 ` [PATCH 08/13] kbuild: add support for installing and stripping modules Ahmad Fatoum
2026-01-16 16:06 ` [PATCH 09/13] ARM32: module: handle more relocations Ahmad Fatoum
2026-01-16 16:06 ` [PATCH 10/13] commands: pm_domain: make command tristate Ahmad Fatoum
2026-01-16 16:06 ` [PATCH 11/13] test: conftest: add support for describing FW_CFG environment in YAML Ahmad Fatoum
2026-01-16 16:06 ` [PATCH 12/13] defaultenv: add barebox_modules_env target Ahmad Fatoum
2026-01-16 16:06 ` [PATCH 13/13] test: arm: add simple driver/command module test Ahmad Fatoum
2026-01-19  7:28 ` [PATCH 00/13] ARM32: modules: fix bitrot and add test Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox