Re: [PATCH] firmware: google: coreboot_table: skip no-map CBMEM entries
From: Tzung-Bi Shih
Date: Thu Jul 16 2026 - 03:44:18 EST
On Tue, Jul 14, 2026 at 09:19:18AM +0000, Hsin-Te Yuan wrote:
> @@ -147,6 +149,23 @@ static int coreboot_table_populate(struct device *dev, void *ptr, resource_size_
>
> switch (device->entry.tag) {
> case LB_TAG_CBMEM_ENTRY:
> + /*
> + * Skip entries that are not exclusively System RAM or
> + * Reserved memory.
> + * On ARM, no-map reserved regions are not System RAM.
> + * On x86, CBMEM often resides in IORES_DESC_RESERVED regions.
> + */
> + if (region_intersects(device->cbmem_entry.address,
> + device->cbmem_entry.entry_size,
> + IORESOURCE_SYSTEM_RAM,
> + IORES_DESC_NONE) != REGION_INTERSECTS &&
> + region_intersects(device->cbmem_entry.address,
> + device->cbmem_entry.entry_size,
> + IORESOURCE_MEM,
> + IORES_DESC_RESERVED) != REGION_INTERSECTS) {
Per comments of region_intersects():
Note that REGION_INTERSECTS is also returned in the case when the
specified region overlaps RAM and undefined memory holes.
Won't the check falsely be bypassed if the region overlaps SYSTEM_RAM
and `no-map` memory?