* [PATCH] MdeModulePkg/PeiMain: Substantial change for PeiAllocatePool @ 2019-06-12 4:50 Gao, Zhichao 2019-06-12 8:33 ` [edk2-devel] " Laszlo Ersek 0 siblings, 1 reply; 6+ messages in thread From: Gao, Zhichao @ 2019-06-12 4:50 UTC (permalink / raw) To: devel Cc: Bret Barkelew, Jian J Wang, Hao Wu, Ray Ni, Star Zeng, Liming Gao, Sean Brogan, Michael Turner From: Bret Barkelew <Bret.Barkelew@microsoft.com> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1901 The original logic is ASSERT if fail to create HOB. But that doesn't make sense for release version. So it is required to set the Buffer to null to indicate the failure. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao Wu <hao.a.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Michael Turner <Michael.Turner@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> --- MdeModulePkg/Core/Pei/Memory/MemoryServices.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Core/Pei/Memory/MemoryServices.c b/MdeModulePkg/Core/Pei/Memory/MemoryServices.c index 42f79ab076..37b0cfa3cf 100644 --- a/MdeModulePkg/Core/Pei/Memory/MemoryServices.c +++ b/MdeModulePkg/Core/Pei/Memory/MemoryServices.c @@ -802,7 +802,12 @@ PeiAllocatePool ( (VOID **)&Hob ); ASSERT_EFI_ERROR (Status); - *Buffer = Hob+1; + + if (EFI_ERROR (Status)) { + *Buffer = NULL; + } else { + *Buffer = Hob+1; + } return Status; } -- 2.21.0.windows.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [edk2-devel] [PATCH] MdeModulePkg/PeiMain: Substantial change for PeiAllocatePool 2019-06-12 4:50 [PATCH] MdeModulePkg/PeiMain: Substantial change for PeiAllocatePool Gao, Zhichao @ 2019-06-12 8:33 ` Laszlo Ersek 2019-06-13 0:32 ` Gao, Zhichao 2019-06-18 5:14 ` Wu, Hao A 0 siblings, 2 replies; 6+ messages in thread From: Laszlo Ersek @ 2019-06-12 8:33 UTC (permalink / raw) To: devel, zhichao.gao Cc: Bret Barkelew, Jian J Wang, Hao Wu, Ray Ni, Star Zeng, Liming Gao, Sean Brogan, Michael Turner Hi Zhichao, On 06/12/19 06:50, Gao, Zhichao wrote: > From: Bret Barkelew <Bret.Barkelew@microsoft.com> > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1901 > > The original logic is ASSERT if fail to create HOB. But > that doesn't make sense for release version. So it is required > to set the Buffer to null to indicate the failure. this patch may or may not be worthwhile; that's for the PEI Core maintainers to evaluate. Either way, the subject line is completely useless. "Substantial change" means nothing at all. Please write a subject line that reflects what this patch *actually does*. For example: MdeModulePkg/PeiMain: PeiAllocatePool: output NULL if HOB creation fails (72 characters). Thanks Laszlo > Cc: Jian J Wang <jian.j.wang@intel.com> > Cc: Hao Wu <hao.a.wu@intel.com> > Cc: Ray Ni <ray.ni@intel.com> > Cc: Star Zeng <star.zeng@intel.com> > Cc: Liming Gao <liming.gao@intel.com> > Cc: Sean Brogan <sean.brogan@microsoft.com> > Cc: Michael Turner <Michael.Turner@microsoft.com> > Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> > Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> > --- > MdeModulePkg/Core/Pei/Memory/MemoryServices.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/MdeModulePkg/Core/Pei/Memory/MemoryServices.c b/MdeModulePkg/Core/Pei/Memory/MemoryServices.c > index 42f79ab076..37b0cfa3cf 100644 > --- a/MdeModulePkg/Core/Pei/Memory/MemoryServices.c > +++ b/MdeModulePkg/Core/Pei/Memory/MemoryServices.c > @@ -802,7 +802,12 @@ PeiAllocatePool ( > (VOID **)&Hob > ); > ASSERT_EFI_ERROR (Status); > - *Buffer = Hob+1; > + > + if (EFI_ERROR (Status)) { > + *Buffer = NULL; > + } else { > + *Buffer = Hob+1; > + } > > return Status; > } > ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [edk2-devel] [PATCH] MdeModulePkg/PeiMain: Substantial change for PeiAllocatePool 2019-06-12 8:33 ` [edk2-devel] " Laszlo Ersek @ 2019-06-13 0:32 ` Gao, Zhichao 2019-06-18 5:14 ` Wu, Hao A 1 sibling, 0 replies; 6+ messages in thread From: Gao, Zhichao @ 2019-06-13 0:32 UTC (permalink / raw) To: devel@edk2.groups.io, lersek@redhat.com Cc: Bret Barkelew, Wang, Jian J, Wu, Hao A, Ni, Ray, Zeng, Star, Gao, Liming, Sean Brogan, Michael Turner Thanks for the comments. Your example makes the purpose clear. I would update the subject like that. Thanks, Zhichao > -----Original Message----- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > Laszlo Ersek > Sent: Wednesday, June 12, 2019 4:34 PM > To: devel@edk2.groups.io; Gao, Zhichao <zhichao.gao@intel.com> > Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>; Wang, Jian J > <jian.j.wang@intel.com>; Wu, Hao A <hao.a.wu@intel.com>; Ni, Ray > <ray.ni@intel.com>; Zeng, Star <star.zeng@intel.com>; Gao, Liming > <liming.gao@intel.com>; Sean Brogan <sean.brogan@microsoft.com>; > Michael Turner <Michael.Turner@microsoft.com> > Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/PeiMain: Substantial > change for PeiAllocatePool > > Hi Zhichao, > > On 06/12/19 06:50, Gao, Zhichao wrote: > > From: Bret Barkelew <Bret.Barkelew@microsoft.com> > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1901 > > > > The original logic is ASSERT if fail to create HOB. But that doesn't > > make sense for release version. So it is required to set the Buffer to > > null to indicate the failure. > > this patch may or may not be worthwhile; that's for the PEI Core maintainers > to evaluate. > > Either way, the subject line is completely useless. "Substantial change" > means nothing at all. Please write a subject line that reflects what this patch > *actually does*. > > For example: > > MdeModulePkg/PeiMain: PeiAllocatePool: output NULL if HOB creation fails > > (72 characters). > > Thanks > Laszlo > > > Cc: Jian J Wang <jian.j.wang@intel.com> > > Cc: Hao Wu <hao.a.wu@intel.com> > > Cc: Ray Ni <ray.ni@intel.com> > > Cc: Star Zeng <star.zeng@intel.com> > > Cc: Liming Gao <liming.gao@intel.com> > > Cc: Sean Brogan <sean.brogan@microsoft.com> > > Cc: Michael Turner <Michael.Turner@microsoft.com> > > Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> > > Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> > > --- > > MdeModulePkg/Core/Pei/Memory/MemoryServices.c | 7 ++++++- > > 1 file changed, 6 insertions(+), 1 deletion(-) > > > > diff --git a/MdeModulePkg/Core/Pei/Memory/MemoryServices.c > > b/MdeModulePkg/Core/Pei/Memory/MemoryServices.c > > index 42f79ab076..37b0cfa3cf 100644 > > --- a/MdeModulePkg/Core/Pei/Memory/MemoryServices.c > > +++ b/MdeModulePkg/Core/Pei/Memory/MemoryServices.c > > @@ -802,7 +802,12 @@ PeiAllocatePool ( > > (VOID **)&Hob > > ); > > ASSERT_EFI_ERROR (Status); > > - *Buffer = Hob+1; > > + > > + if (EFI_ERROR (Status)) { > > + *Buffer = NULL; > > + } else { > > + *Buffer = Hob+1; > > + } > > > > return Status; > > } > > > > > ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [edk2-devel] [PATCH] MdeModulePkg/PeiMain: Substantial change for PeiAllocatePool 2019-06-12 8:33 ` [edk2-devel] " Laszlo Ersek 2019-06-13 0:32 ` Gao, Zhichao @ 2019-06-18 5:14 ` Wu, Hao A 2019-06-18 5:16 ` Liming Gao 1 sibling, 1 reply; 6+ messages in thread From: Wu, Hao A @ 2019-06-18 5:14 UTC (permalink / raw) To: devel@edk2.groups.io, lersek@redhat.com, Gao, Zhichao, Gao, Liming Cc: Bret Barkelew, Wang, Jian J, Ni, Ray, Zeng, Star, Sean Brogan, Michael Turner > -----Original Message----- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > Laszlo Ersek > Sent: Wednesday, June 12, 2019 4:34 PM > To: devel@edk2.groups.io; Gao, Zhichao > Cc: Bret Barkelew; Wang, Jian J; Wu, Hao A; Ni, Ray; Zeng, Star; Gao, Liming; > Sean Brogan; Michael Turner > Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/PeiMain: Substantial > change for PeiAllocatePool > > Hi Zhichao, > > On 06/12/19 06:50, Gao, Zhichao wrote: > > From: Bret Barkelew <Bret.Barkelew@microsoft.com> > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1901 > > > > The original logic is ASSERT if fail to create HOB. But > > that doesn't make sense for release version. So it is required > > to set the Buffer to null to indicate the failure. > > this patch may or may not be worthwhile; that's for the PEI Core > maintainers to evaluate. Looks to me like a valid enhancement for error handling. Liming, Do you have any comment on this one? Best Regards, Hao Wu > > Either way, the subject line is completely useless. "Substantial change" > means nothing at all. Please write a subject line that reflects what > this patch *actually does*. > > For example: > > MdeModulePkg/PeiMain: PeiAllocatePool: output NULL if HOB creation fails > > (72 characters). > > Thanks > Laszlo > > > Cc: Jian J Wang <jian.j.wang@intel.com> > > Cc: Hao Wu <hao.a.wu@intel.com> > > Cc: Ray Ni <ray.ni@intel.com> > > Cc: Star Zeng <star.zeng@intel.com> > > Cc: Liming Gao <liming.gao@intel.com> > > Cc: Sean Brogan <sean.brogan@microsoft.com> > > Cc: Michael Turner <Michael.Turner@microsoft.com> > > Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> > > Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> > > --- > > MdeModulePkg/Core/Pei/Memory/MemoryServices.c | 7 ++++++- > > 1 file changed, 6 insertions(+), 1 deletion(-) > > > > diff --git a/MdeModulePkg/Core/Pei/Memory/MemoryServices.c > b/MdeModulePkg/Core/Pei/Memory/MemoryServices.c > > index 42f79ab076..37b0cfa3cf 100644 > > --- a/MdeModulePkg/Core/Pei/Memory/MemoryServices.c > > +++ b/MdeModulePkg/Core/Pei/Memory/MemoryServices.c > > @@ -802,7 +802,12 @@ PeiAllocatePool ( > > (VOID **)&Hob > > ); > > ASSERT_EFI_ERROR (Status); > > - *Buffer = Hob+1; > > + > > + if (EFI_ERROR (Status)) { > > + *Buffer = NULL; > > + } else { > > + *Buffer = Hob+1; > > + } > > > > return Status; > > } > > > > > ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [edk2-devel] [PATCH] MdeModulePkg/PeiMain: Substantial change for PeiAllocatePool 2019-06-18 5:14 ` Wu, Hao A @ 2019-06-18 5:16 ` Liming Gao 2019-06-24 2:20 ` Wu, Hao A 0 siblings, 1 reply; 6+ messages in thread From: Liming Gao @ 2019-06-18 5:16 UTC (permalink / raw) To: Wu, Hao A, devel@edk2.groups.io, lersek@redhat.com, Gao, Zhichao Cc: Bret Barkelew, Wang, Jian J, Ni, Ray, Zeng, Star, Sean Brogan, Michael Turner >-----Original Message----- >From: Wu, Hao A >Sent: Tuesday, June 18, 2019 1:15 PM >To: devel@edk2.groups.io; lersek@redhat.com; Gao, Zhichao ><zhichao.gao@intel.com>; Gao, Liming <liming.gao@intel.com> >Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>; Wang, Jian J ><jian.j.wang@intel.com>; Ni, Ray <ray.ni@intel.com>; Zeng, Star ><star.zeng@intel.com>; Sean Brogan <sean.brogan@microsoft.com>; Michael >Turner <Michael.Turner@microsoft.com> >Subject: RE: [edk2-devel] [PATCH] MdeModulePkg/PeiMain: Substantial >change for PeiAllocatePool > >> -----Original Message----- >> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of >> Laszlo Ersek >> Sent: Wednesday, June 12, 2019 4:34 PM >> To: devel@edk2.groups.io; Gao, Zhichao >> Cc: Bret Barkelew; Wang, Jian J; Wu, Hao A; Ni, Ray; Zeng, Star; Gao, Liming; >> Sean Brogan; Michael Turner >> Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/PeiMain: Substantial >> change for PeiAllocatePool >> >> Hi Zhichao, >> >> On 06/12/19 06:50, Gao, Zhichao wrote: >> > From: Bret Barkelew <Bret.Barkelew@microsoft.com> >> > >> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1901 >> > >> > The original logic is ASSERT if fail to create HOB. But >> > that doesn't make sense for release version. So it is required >> > to set the Buffer to null to indicate the failure. >> >> this patch may or may not be worthwhile; that's for the PEI Core >> maintainers to evaluate. > > >Looks to me like a valid enhancement for error handling. > >Liming, >Do you have any comment on this one? > I agree the code change. With subject update, Reviewed-by: Liming Gao <liming.gao@intel.com> >Best Regards, >Hao Wu > > >> >> Either way, the subject line is completely useless. "Substantial change" >> means nothing at all. Please write a subject line that reflects what >> this patch *actually does*. >> >> For example: >> >> MdeModulePkg/PeiMain: PeiAllocatePool: output NULL if HOB creation fails >> >> (72 characters). >> >> Thanks >> Laszlo >> >> > Cc: Jian J Wang <jian.j.wang@intel.com> >> > Cc: Hao Wu <hao.a.wu@intel.com> >> > Cc: Ray Ni <ray.ni@intel.com> >> > Cc: Star Zeng <star.zeng@intel.com> >> > Cc: Liming Gao <liming.gao@intel.com> >> > Cc: Sean Brogan <sean.brogan@microsoft.com> >> > Cc: Michael Turner <Michael.Turner@microsoft.com> >> > Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> >> > Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> >> > --- >> > MdeModulePkg/Core/Pei/Memory/MemoryServices.c | 7 ++++++- >> > 1 file changed, 6 insertions(+), 1 deletion(-) >> > >> > diff --git a/MdeModulePkg/Core/Pei/Memory/MemoryServices.c >> b/MdeModulePkg/Core/Pei/Memory/MemoryServices.c >> > index 42f79ab076..37b0cfa3cf 100644 >> > --- a/MdeModulePkg/Core/Pei/Memory/MemoryServices.c >> > +++ b/MdeModulePkg/Core/Pei/Memory/MemoryServices.c >> > @@ -802,7 +802,12 @@ PeiAllocatePool ( >> > (VOID **)&Hob >> > ); >> > ASSERT_EFI_ERROR (Status); >> > - *Buffer = Hob+1; >> > + >> > + if (EFI_ERROR (Status)) { >> > + *Buffer = NULL; >> > + } else { >> > + *Buffer = Hob+1; >> > + } >> > >> > return Status; >> > } >> > >> >> >> ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [edk2-devel] [PATCH] MdeModulePkg/PeiMain: Substantial change for PeiAllocatePool 2019-06-18 5:16 ` Liming Gao @ 2019-06-24 2:20 ` Wu, Hao A 0 siblings, 0 replies; 6+ messages in thread From: Wu, Hao A @ 2019-06-24 2:20 UTC (permalink / raw) To: Gao, Liming, devel@edk2.groups.io, lersek@redhat.com, Gao, Zhichao Cc: Bret Barkelew, Wang, Jian J, Ni, Ray, Zeng, Star, Sean Brogan, Michael Turner > -----Original Message----- > From: Gao, Liming > Sent: Tuesday, June 18, 2019 1:16 PM > To: Wu, Hao A; devel@edk2.groups.io; lersek@redhat.com; Gao, Zhichao > Cc: Bret Barkelew; Wang, Jian J; Ni, Ray; Zeng, Star; Sean Brogan; Michael > Turner > Subject: RE: [edk2-devel] [PATCH] MdeModulePkg/PeiMain: Substantial > change for PeiAllocatePool > > > >-----Original Message----- > >From: Wu, Hao A > >Sent: Tuesday, June 18, 2019 1:15 PM > >To: devel@edk2.groups.io; lersek@redhat.com; Gao, Zhichao > ><zhichao.gao@intel.com>; Gao, Liming <liming.gao@intel.com> > >Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>; Wang, Jian J > ><jian.j.wang@intel.com>; Ni, Ray <ray.ni@intel.com>; Zeng, Star > ><star.zeng@intel.com>; Sean Brogan <sean.brogan@microsoft.com>; > Michael > >Turner <Michael.Turner@microsoft.com> > >Subject: RE: [edk2-devel] [PATCH] MdeModulePkg/PeiMain: Substantial > >change for PeiAllocatePool > > > >> -----Original Message----- > >> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > >> Laszlo Ersek > >> Sent: Wednesday, June 12, 2019 4:34 PM > >> To: devel@edk2.groups.io; Gao, Zhichao > >> Cc: Bret Barkelew; Wang, Jian J; Wu, Hao A; Ni, Ray; Zeng, Star; Gao, > Liming; > >> Sean Brogan; Michael Turner > >> Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/PeiMain: Substantial > >> change for PeiAllocatePool > >> > >> Hi Zhichao, > >> > >> On 06/12/19 06:50, Gao, Zhichao wrote: > >> > From: Bret Barkelew <Bret.Barkelew@microsoft.com> > >> > > >> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1901 > >> > > >> > The original logic is ASSERT if fail to create HOB. But > >> > that doesn't make sense for release version. So it is required > >> > to set the Buffer to null to indicate the failure. > >> > >> this patch may or may not be worthwhile; that's for the PEI Core > >> maintainers to evaluate. > > > > > >Looks to me like a valid enhancement for error handling. > > > >Liming, > >Do you have any comment on this one? > > > I agree the code change. With subject update, Reviewed-by: Liming Gao > <liming.gao@intel.com> Acked-by: Hao A Wu <hao.a.wu@intel.com> Pushed via commit 8797683f96. (With subject updated.) Best Regards, Hao Wu > > > >Best Regards, > >Hao Wu > > > > > >> > >> Either way, the subject line is completely useless. "Substantial change" > >> means nothing at all. Please write a subject line that reflects what > >> this patch *actually does*. > >> > >> For example: > >> > >> MdeModulePkg/PeiMain: PeiAllocatePool: output NULL if HOB creation > fails > >> > >> (72 characters). > >> > >> Thanks > >> Laszlo > >> > >> > Cc: Jian J Wang <jian.j.wang@intel.com> > >> > Cc: Hao Wu <hao.a.wu@intel.com> > >> > Cc: Ray Ni <ray.ni@intel.com> > >> > Cc: Star Zeng <star.zeng@intel.com> > >> > Cc: Liming Gao <liming.gao@intel.com> > >> > Cc: Sean Brogan <sean.brogan@microsoft.com> > >> > Cc: Michael Turner <Michael.Turner@microsoft.com> > >> > Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> > >> > Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> > >> > --- > >> > MdeModulePkg/Core/Pei/Memory/MemoryServices.c | 7 ++++++- > >> > 1 file changed, 6 insertions(+), 1 deletion(-) > >> > > >> > diff --git a/MdeModulePkg/Core/Pei/Memory/MemoryServices.c > >> b/MdeModulePkg/Core/Pei/Memory/MemoryServices.c > >> > index 42f79ab076..37b0cfa3cf 100644 > >> > --- a/MdeModulePkg/Core/Pei/Memory/MemoryServices.c > >> > +++ b/MdeModulePkg/Core/Pei/Memory/MemoryServices.c > >> > @@ -802,7 +802,12 @@ PeiAllocatePool ( > >> > (VOID **)&Hob > >> > ); > >> > ASSERT_EFI_ERROR (Status); > >> > - *Buffer = Hob+1; > >> > + > >> > + if (EFI_ERROR (Status)) { > >> > + *Buffer = NULL; > >> > + } else { > >> > + *Buffer = Hob+1; > >> > + } > >> > > >> > return Status; > >> > } > >> > > >> > >> > >> ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-06-24 2:20 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2019-06-12 4:50 [PATCH] MdeModulePkg/PeiMain: Substantial change for PeiAllocatePool Gao, Zhichao 2019-06-12 8:33 ` [edk2-devel] " Laszlo Ersek 2019-06-13 0:32 ` Gao, Zhichao 2019-06-18 5:14 ` Wu, Hao A 2019-06-18 5:16 ` Liming Gao 2019-06-24 2:20 ` Wu, Hao A
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox