Re: [PATCH v4 6/6] x86/CPU/AMD: Print AGESA string from DMI additional information entry

From: Yazen Ghannam

Date: Wed Jan 21 2026 - 16:49:10 EST


On Wed, Jan 21, 2026 at 02:50:49PM -0600, Mario Limonciello wrote:
> On 1/21/26 8:26 AM, Yazen Ghannam wrote:

[...]

> > > + do {
> > > + struct dmi_a_info_entry *entry;
> > > + const char *string_ptr;
> > > +
> > > + entry = (struct dmi_a_info_entry *)next;
> > > +
> > > + /*
> > > + * Not much can be done to validate data. At least the entry
> > > + * length shouldn't be 0.
> > > + */
> > > + if (!entry->length)
> > > + return;
> > > +
> > > + string_ptr = dmi_string_nosave(&info->header, entry->str_num);
> > > +
> > > + /* Only one AGESA string is expected. */
> > > + if (!strncmp(string_ptr, "AGESA", 5)) {
> > > + pr_info("%s\n", string_ptr);
> > > + break;
> > > + }
> > > +

[...]

> > > +static inline const char *
> > > + dmi_string_nosave(const struct dmi_header *dm, u8 s) { return dmi_empty_string; }
> >
> > The dmi_empty_string needs to be moved to this header file from
> > dmi_scan.c.
> >
> > Otherwise, there's a build issue as the test bot reported.
> >
> > Thanks,
> > Yazen
>
> I don't think it's actually appropriate to move dmi_empty_string in this
> case. It's a static variable, shouldn't really be in a header.
>
> I would think it's better to just return NULL.

dmi_string_nosave() should always return a string. The callers expect
it. That's why we don't need a NULL pointer check above.

+static inline const char *
+ dmi_string_nosave(const struct dmi_header *dm, u8 s) { return ""; }

Rather than move the variable, just return the empty string directly.

Thanks,
Yazen