mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 00/12] ARM32: modules: fix bitrot and add test
@ 2026-01-15 11:54 Ahmad Fatoum
  2026-01-15 11:54 ` [PATCH 01/12] boards: qemu-virt: reserve BIOS device tree Ahmad Fatoum
                   ` (11 more replies)
  0 siblings, 12 replies; 17+ messages in thread
From: Ahmad Fatoum @ 2026-01-15 11:54 UTC (permalink / raw)
  To: barebox; +Cc: David Dgien

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 (12):
  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                                  |  31 +--
 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 +
 include/compressed-dtb.h                  |   1 +
 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/modules32_defconfig.yaml         |  27 +++
 test/arm/virt-el2@multi_v8_defconfig.yaml |  23 +++
 test/arm/virt@multi_v8_defconfig.yaml     |   4 +-
 test/py/test_module.py                    |  54 +++++
 55 files changed, 653 insertions(+), 23 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/modules32_defconfig.yaml
 create mode 100644 test/arm/virt-el2@multi_v8_defconfig.yaml
 create mode 100644 test/py/test_module.py

-- 
2.47.3




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

end of thread, other threads:[~2026-01-16 15:17 UTC | newest]

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

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