Date: Fri, 26 Aug 2022 12:43:55 -0600 From: Warner Losh <imp@bsdimp.com> To: Jessica Clarke <jrtc27@freebsd.org> Cc: Warner Losh <imp@freebsd.org>, "src-committers@freebsd.org" <src-committers@freebsd.org>, "dev-commits-src-all@freebsd.org" <dev-commits-src-all@freebsd.org>, "dev-commits-src-main@freebsd.org" <dev-commits-src-main@freebsd.org> Subject: Re: git: 74704a26bc2c - main - efi: Create a define for memory descriptor version Message-ID: <CANCZdfrxCHGqhmyV=fbwFU--bGuiRmtFHOJuD4PWe5B31p3z3w@mail.gmail.com> In-Reply-To: <563EB46C-FEA6-4E1D-B9D5-9EFCF3427FCF@freebsd.org> References: <202208261741.27QHfVse092900@gitrepo.freebsd.org> <563EB46C-FEA6-4E1D-B9D5-9EFCF3427FCF@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000790ac905e7294cf0 Content-Type: text/plain; charset="UTF-8" On Fri, Aug 26, 2022 at 11:45 AM Jessica Clarke <jrtc27@freebsd.org> wrote: > On 26 Aug 2022, at 18:41, Warner Losh <imp@FreeBSD.org> wrote: > > > > The branch main has been updated by imp: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=74704a26bc2cfc72de6821d29a1f53b9d8c65f55 > > > > commit 74704a26bc2cfc72de6821d29a1f53b9d8c65f55 > > Author: Warner Losh <imp@FreeBSD.org> > > AuthorDate: 2022-08-26 17:39:37 +0000 > > Commit: Warner Losh <imp@FreeBSD.org> > > CommitDate: 2022-08-26 17:40:42 +0000 > > > > efi: Create a define for memory descriptor version > > > > For true EFI platforms, the EFI BIOS will return version 1 (since no > > other version is defined as of this commit). However, for environments > > that wish to create an EFI memory mapping table that aren't actually > > EFI, we need to know this. Add EFI_MEMORY_DESCRIPTOR_VERSION for this > > constant. > > Should such environments not be hard-coding version 1? Otherwise you > risk starting to silently create version 2 structures in the future if > this is bumped, but initialised as if they were version 1, which could > mean leaving some new fields uninitialised. > Hmmm, currently we don't check the version.... But we likely should add an assert to say that this version is 1, because who knows what version 2 will bring... But yes, it's a good idea to be explicit about that. Warner --000000000000790ac905e7294cf0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">= <div dir=3D"ltr" class=3D"gmail_attr">On Fri, Aug 26, 2022 at 11:45 AM Jess= ica Clarke <<a href=3D"mailto:jrtc27@freebsd.org">jrtc27@freebsd.org</a>= > wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px = 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 2= 6 Aug 2022, at 18:41, Warner Losh <imp@FreeBSD.org> wrote:<br> > <br> > The branch main has been updated by imp:<br> > <br> > URL: <a href=3D"https://cgit.FreeBSD.org/src/commit/?id=3D74704a26bc2c= fc72de6821d29a1f53b9d8c65f55" rel=3D"noreferrer" target=3D"_blank">https://= cgit.FreeBSD.org/src/commit/?id=3D74704a26bc2cfc72de6821d29a1f53b9d8c65f55<= /a><br> > <br> > commit 74704a26bc2cfc72de6821d29a1f53b9d8c65f55<br> > Author:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org><br> > AuthorDate: 2022-08-26 17:39:37 +0000<br> > Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh <imp@FreeBSD.org><br> > CommitDate: 2022-08-26 17:40:42 +0000<br> > <br> >=C2=A0 =C2=A0 efi: Create a define for memory descriptor version<br> > <br> >=C2=A0 =C2=A0 For true EFI platforms, the EFI BIOS will return version = 1 (since no<br> >=C2=A0 =C2=A0 other version is defined as of this commit). However, for= environments<br> >=C2=A0 =C2=A0 that wish to create an EFI memory mapping table that aren= 't actually<br> >=C2=A0 =C2=A0 EFI, we need to know this. Add EFI_MEMORY_DESCRIPTOR_VERS= ION for this<br> >=C2=A0 =C2=A0 constant.<br> <br> Should such environments not be hard-coding version 1? Otherwise you<br> risk starting to silently create version 2 structures in the future if<br> this is bumped, but initialised as if they were version 1, which could<br> mean leaving some new fields uninitialised.<br></blockquote><div><br></div>= <div>Hmmm, currently we don't check the version.... But we likely shoul= d</div><div>add an assert to say that this version is 1, because who knows = what version</div><div>2 will bring... But yes, it's a good idea to be = explicit about that.</div><div><br></div><div>Warner</div></div></div> --000000000000790ac905e7294cf0--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfrxCHGqhmyV=fbwFU--bGuiRmtFHOJuD4PWe5B31p3z3w>