Re: [PATCH 04/19] mm: assert that we preserve header vs region alignment

2022-03-24 Thread Daniel Kiper
On Wed, Mar 23, 2022 at 04:47:51PM +1100, Daniel Axtens wrote: > > s/struct grub_mm_region/grub_mm_region_t/ > > s/struct grub_mm_header/grub_mm_header_t/ > > The problem is that grub_mm_{region,header}_t is a pointer type, not a > struct type. So sizeof (grub_mm_region_t) == sizeof(void *). You

Re: [PATCH 04/19] mm: assert that we preserve header vs region alignment

2022-03-22 Thread Daniel Axtens
> s/struct grub_mm_region/grub_mm_region_t/ > s/struct grub_mm_header/grub_mm_header_t/ The problem is that grub_mm_{region,header}_t is a pointer type, not a struct type. So sizeof (grub_mm_region_t) == sizeof(void *). You also can't do sizeof (*grub_mm_region_t), because you can't dereference

Re: [PATCH 04/19] mm: assert that we preserve header vs region alignment

2021-10-20 Thread Daniel Kiper
On Tue, Oct 12, 2021 at 06:29:53PM +1100, Daniel Axtens wrote: > grub_mm_region_init() does: > > h = (grub_mm_header_t) (r + 1); > > where h is a grub_mm_header_t and r is a grub_mm_region_t. > > Cells are supposed to be GRUB_MM_ALIGN aligned, but while grub_mm_dump > ensures this vs the region

[PATCH 04/19] mm: assert that we preserve header vs region alignment

2021-10-12 Thread Daniel Axtens
grub_mm_region_init() does: h = (grub_mm_header_t) (r + 1); where h is a grub_mm_header_t and r is a grub_mm_region_t. Cells are supposed to be GRUB_MM_ALIGN aligned, but while grub_mm_dump ensures this vs the region header, grub_mm_region_init() does not. It's better to be explicit than