[PATCH v2 3/6] smbios: Use SMBIOS 3.0 to support an address above 4GB

Simon Glass sjg at chromium.org
Wed Dec 27 18:48:48 CET 2023


Hi Heinrich,

On Tue, Dec 26, 2023 at 11:01 AM Heinrich Schuchardt <xypron.glpk at gmx.de> wrote:
>
> On 10/15/23 04:45, Simon Glass wrote:
> > When the SMBIOS table is written to an address above 4GB a 32-bit table
> > address is not large enough.
> >
> > Use an SMBIOS3 table in that case.
> >
> > Note that we cannot use efi_allocate_pages() since this function has
> > nothing to do with EFI. There is no equivalent function to allocate
> > memory below 4GB in U-Boot. One solution would be to create a separate
> > malloc() pool, or just always put the malloc() pool below 4GB.
> >
> > Signed-off-by: Simon Glass <sjg at chromium.org>
> > ---
> >
> > Changes in v2:
> > - Check the end of the table rather than the start.
> >
> >   include/smbios.h | 22 +++++++++++++++++++++-
> >   lib/smbios.c     | 24 +++++++++++++++++++-----
> >   2 files changed, 40 insertions(+), 6 deletions(-)
> >
> > diff --git a/include/smbios.h b/include/smbios.h
> > index c9df2706f5a6..ddabb558299e 100644
> > --- a/include/smbios.h
> > +++ b/include/smbios.h
> > @@ -12,7 +12,8 @@
> >
> >   /* SMBIOS spec version implemented */
> >   #define SMBIOS_MAJOR_VER    3
> > -#define SMBIOS_MINOR_VER     0
> > +#define SMBIOS_MINOR_VER     7
> > +
> >
> >   enum {
> >       SMBIOS_STR_MAX  = 64,   /* Maximum length allowed for a string */
> > @@ -54,6 +55,25 @@ struct __packed smbios_entry {
> >       u8 bcd_rev;
> >   };
> >
> > +struct __packed smbios3_entry {
> > +     u8 anchor[5];
> > +     u8 checksum;
> > +     u8 length;
> > +     u8 major_ver;
> > +
>
> This empty line is superfluous.
>
> > +     u8 minor_ver;
> > +     u8 docrev;
>
> 'doc_rev' would be more consistent with the other fields.
>
> > +     u8 entry_point_rev;
> > +     u8 reserved;
> > +     u32 max_struct_size;
> > +
>
> This empty line is superfluous.
>
> Please, consider copying the comments from my patch
>
> [PATCH v2,1/2] smbios: SMBIOS 3.0 (64-bit) Entry Point structure
> https://patchwork.ozlabs.org/project/uboot/patch/20231223010334.248291-2-xypron.glpk@gmx.de/
>
> Otherwise looks good to me.

Thanks, I added in your patch and resent the series.

I tested it with dmicode and it seems to work OK.

Regards,
Simon


More information about the U-Boot mailing list