Re: [PATCH 4/6] test: dm: part: Check the GPT layout for large sector sizes

Simon Glass <[email protected]>
Newsgroups org.u-boot-project.lists.u-boot
Message-ID <CAFLszTji3OE8Vdepq8vyLnDWKaj5z6r7RQn_1=WK=P8xUB755g@mail.gmail.com>
On 2026-07-31T12:39:59, Alexey Charkov <[email protected]> wrote:
> test: dm: part: Check the GPT layout for large sector sizes
>
> Add a test that runs gpt_fill_header() and gpt_fill_pte() over a range of
> block sizes and checks that the partition entry array is sized and placed
> consistently, in particular that the backup array ends exactly where the
> backup GPT header begins.
>
> Neither function performs any block I/O, so the test builds a synthetic
> struct blk_desc rather than needing a block device with a configurable
> block size. The expected array size is taken from the GPT header fields
> rather than from GPT_ENTRY_NUMBERS, so the test still holds for builds
> with a non-default CONFIG_EFI_PARTITION_ENTRIES_NUMBERS, such as
> ARCH_SUNXI with 56 entries.
>
> Without the preceding fixes this fails on the first block size other than
> 512:
>
>   test/dm/part.c:313, dm_test_part_gpt_blksz():
>       entry_lba + pte_blks == first_lba: Expected 0x12 (18), got 0x22 (34)
>
> Signed-off-by: Alexey Charkov <[email protected]>
> Acked-by: Ilias Apalodimas <[email protected]>
>
> test/dm/part.c | 100 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 100 insertions(+)

Reviewed-by: Simon Glass <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.