Chrome platform driver development
 help / color / mirror / Atom feed
From: Tzung-Bi Shih <tzungbi@kernel.org>
To: Hsin-Te Yuan <yuanhsinte@chromium.org>
Cc: Brian Norris <briannorris@chromium.org>,
	Julius Werner <jwerner@chromium.org>,
	chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org,
	Yidi Lin <yidilin@google.com>
Subject: Re: [PATCH] firmware: google: coreboot_table: skip no-map CBMEM entries
Date: Fri, 17 Jul 2026 07:59:51 +0000	[thread overview]
Message-ID: <alng9zHTD854NBk1@google.com> (raw)
In-Reply-To: <CAHc4DNJwVOa-j5D3SiSiXTzA8MGq9p_RxYHXjXSd1po=uDHPqw@mail.gmail.com>

On Fri, Jul 17, 2026 at 03:23:30PM +0800, Hsin-Te Yuan wrote:
> On Thu, Jul 16, 2026 at 3:44 PM Tzung-Bi Shih <tzungbi@kernel.org> wrote:
> >
> > 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.

To be specific,

   On ARM, no-map reserved regions are IORESOURCE_MEM.

> > > +                      * 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?
> 
> Just discussed this with Yidi Lin.
> It seems that 'no-map' region will be marked as IORESOURCE_MEM instead
> of undefined memory holes
> (See arch/arm64/kernel/setup.c:request_standard_resources). If a cbmem
> entry contains a real memory
> hole, it is likely a coreboot bug.

I see.

Please rephrase the commit message and code comment to be clear.  E.g.:
1. On ARM64, no-map regions are filtered out as they are IORESOURCE_MEM
   (See arch/arm64/kernel/setup.c:request_standard_resources).
2. On X86, standard reserved regions (IORES_DESC_RESERVED) ...

3. Mixed regions containing holes are safely skipped.
Remove it as this is inaccurate (the patch can't skip holes).

      reply	other threads:[~2026-07-17  7:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-14  9:19 [PATCH] firmware: google: coreboot_table: skip no-map CBMEM entries Hsin-Te Yuan
2026-07-16  7:44 ` Tzung-Bi Shih
2026-07-17  7:23   ` Hsin-Te Yuan
2026-07-17  7:59     ` Tzung-Bi Shih [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alng9zHTD854NBk1@google.com \
    --to=tzungbi@kernel.org \
    --cc=briannorris@chromium.org \
    --cc=chrome-platform@lists.linux.dev \
    --cc=jwerner@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yidilin@google.com \
    --cc=yuanhsinte@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox