mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 00/26] block: add support for non-512 byte sectors
@ 2026-06-26  8:42 Ahmad Fatoum
  2026-06-26  8:42 ` [PATCH 01/26] nvme: use barebox-appropriate 64-bit type for timeouts Ahmad Fatoum
                   ` (25 more replies)
  0 siblings, 26 replies; 27+ messages in thread
From: Ahmad Fatoum @ 2026-06-26  8:42 UTC (permalink / raw)
  To: barebox

barebox code is currently a mixture of code that reads as if it supports
runtime-determined block sizes and code that hardcodes assumption of
512 byte sectors. End result is that use of a 4K sector will likely
crash as e.g. partition table parser is hardcoded to 512 bytes.

This series fixes most of that. Apparently there are MMCs (but not SDs)
that have 4K sectors, which this series doesn't add support for.

The parted command also doesn't yet support anything but 512 byte
sectors for now, so an erorr is printed, but most everything else should
now function correctly with either sector size.

Tested both on QEMU with USB/EFI/NVMe as well as real hardware (RK3588 +
NVMe).

Ahmad Fatoum (26):
  nvme: use barebox-appropriate 64-bit type for timeouts
  nvme: fix buffer advancement when chunking due to max_hw_sectors
  nvme: allow flush opcode
  nvme: honor namespace block size for I/O
  bootscan: fix detection of GPT
  block: clarify that writebuffer_io_len returns sector counts
  block: fix wrong type for discard_start/size byte ranges
  block: fix discard zeroing too little memory
  block: use logical block size for reparse checks
  block: require lower bound of sector size to be 512 bytes
  filetype: don't hardcode sector size in file_detect_partition_table
  block: define helpers for non-512-byte sector support
  bootscan: use block size for partition table probe
  ramdisk: validate exported sector size
  efi: block: fix sector size mismatch in block device registration and
    ops
  efi: loader: disk: report block device size in Block I/O
  efi: loader: file: report cdev block size in file info
  partitions: use byte offset for first partition policy
  partitions: dos: allocate correctly sized buffer for
    dos_partition_desc
  partition: support non-512 byte sectors
  fs: fat: fix garbage read when writing with bigger block size
  fs: fat: support larger block device sectors
  usb-storage: preserve READ CAPACITY sector size
  fuzz: add 4K-sector partition ramdisk target
  commands: parted: prepare use of non-512-byte sectors
  commands: parted: exit if block size if not 512

 Documentation/devel/fuzzing.rst               |  1 +
 .../migration-guides/migration-master.rst     | 11 +++
 commands/createnv.c                           | 18 +++-
 commands/parted.c                             | 21 +++--
 common/block.c                                | 29 ++++--
 common/bootscan.c                             | 19 +++-
 common/filetype.c                             | 16 ++--
 common/partitions.c                           | 93 +++++++++++--------
 common/partitions/dos.c                       |  6 +-
 common/partitions/efi.c                       | 28 +++---
 drivers/block/efi-block-io.c                  | 21 +++--
 drivers/block/ramdisk.c                       | 36 +++++--
 drivers/nvme/host/core.c                      |  6 +-
 drivers/nvme/host/nvme.h                      |  9 +-
 drivers/nvme/host/pci.c                       |  5 +-
 drivers/usb/storage/usb.c                     | 44 +++++----
 efi/loader/protocols/disk.c                   |  9 +-
 efi/loader/protocols/file.c                   |  3 +-
 fs/fat/diskio.h                               |  9 ++
 fs/fat/fat-diskio.c                           | 10 +-
 fs/fat/fat.c                                  | 51 +++++++---
 fs/fat/ff.c                                   |  2 +-
 fs/fat/ffconf.h                               |  6 +-
 images/Makefile.sandbox                       |  1 +
 include/block.h                               | 38 +++++++-
 include/disks.h                               |  7 ++
 include/filetype.h                            |  3 +-
 include/fuzz.h                                |  9 +-
 include/partitions.h                          |  4 +-
 29 files changed, 351 insertions(+), 164 deletions(-)

-- 
2.47.3




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

end of thread, other threads:[~2026-06-26 11:07 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-26  8:42 [PATCH 00/26] block: add support for non-512 byte sectors Ahmad Fatoum
2026-06-26  8:42 ` [PATCH 01/26] nvme: use barebox-appropriate 64-bit type for timeouts Ahmad Fatoum
2026-06-26  8:42 ` [PATCH 02/26] nvme: fix buffer advancement when chunking due to max_hw_sectors Ahmad Fatoum
2026-06-26  8:42 ` [PATCH 03/26] nvme: allow flush opcode Ahmad Fatoum
2026-06-26  8:42 ` [PATCH 04/26] nvme: honor namespace block size for I/O Ahmad Fatoum
2026-06-26  8:42 ` [PATCH 05/26] bootscan: fix detection of GPT Ahmad Fatoum
2026-06-26  8:42 ` [PATCH 06/26] block: clarify that writebuffer_io_len returns sector counts Ahmad Fatoum
2026-06-26  8:42 ` [PATCH 07/26] block: fix wrong type for discard_start/size byte ranges Ahmad Fatoum
2026-06-26  8:42 ` [PATCH 08/26] block: fix discard zeroing too little memory Ahmad Fatoum
2026-06-26  8:42 ` [PATCH 09/26] block: use logical block size for reparse checks Ahmad Fatoum
2026-06-26  8:42 ` [PATCH 10/26] block: require lower bound of sector size to be 512 bytes Ahmad Fatoum
2026-06-26  8:42 ` [PATCH 11/26] filetype: don't hardcode sector size in file_detect_partition_table Ahmad Fatoum
2026-06-26  8:42 ` [PATCH 12/26] block: define helpers for non-512-byte sector support Ahmad Fatoum
2026-06-26  8:42 ` [PATCH 13/26] bootscan: use block size for partition table probe Ahmad Fatoum
2026-06-26  8:42 ` [PATCH 14/26] ramdisk: validate exported sector size Ahmad Fatoum
2026-06-26  8:42 ` [PATCH 15/26] efi: block: fix sector size mismatch in block device registration and ops Ahmad Fatoum
2026-06-26  8:42 ` [PATCH 16/26] efi: loader: disk: report block device size in Block I/O Ahmad Fatoum
2026-06-26  8:42 ` [PATCH 17/26] efi: loader: file: report cdev block size in file info Ahmad Fatoum
2026-06-26  8:42 ` [PATCH 18/26] partitions: use byte offset for first partition policy Ahmad Fatoum
2026-06-26  8:42 ` [PATCH 19/26] partitions: dos: allocate correctly sized buffer for dos_partition_desc Ahmad Fatoum
2026-06-26  8:42 ` [PATCH 20/26] partition: support non-512 byte sectors Ahmad Fatoum
2026-06-26  8:42 ` [PATCH 21/26] fs: fat: fix garbage read when writing with bigger block size Ahmad Fatoum
2026-06-26  8:42 ` [PATCH 22/26] fs: fat: support larger block device sectors Ahmad Fatoum
2026-06-26  8:42 ` [PATCH 23/26] usb-storage: preserve READ CAPACITY sector size Ahmad Fatoum
2026-06-26  8:42 ` [PATCH 24/26] fuzz: add 4K-sector partition ramdisk target Ahmad Fatoum
2026-06-26  8:42 ` [PATCH 25/26] commands: parted: prepare use of non-512-byte sectors Ahmad Fatoum
2026-06-26  8:42 ` [PATCH 26/26] commands: parted: exit if block size if not 512 Ahmad Fatoum

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