public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ni, Ray" <ray.ni@intel.com>
To: "Marvin Häuser" <mhaeuser@posteo.de>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Ma, Maurice" <maurice.ma@intel.com>,
	"Dong, Guo" <guo.dong@intel.com>,
	"You, Benjamin" <benjamin.you@intel.com>
Subject: Re: [edk2-devel] [PATCH v2 2/3] UefiPayloadPkg: Add PayloadLoaderPeim which can load ELF payload
Date: Thu, 10 Jun 2021 03:40:17 +0000	[thread overview]
Message-ID: <CO1PR11MB49307462C346035757486B638C359@CO1PR11MB4930.namprd11.prod.outlook.com> (raw)
In-Reply-To: <8eb8db11-90c2-57e0-6868-3532c5af8073@posteo.de>

> > Without the ParseStatus field, callee cannot know whether ParseElfImage()
> is called.
> 
> It can by function contracts, the caller guarantees it. I.e. with the PE
> library I linked, no other function must be called before the init function.
> Your "ParseElfImage" function is very similar. The context is
> initialized by it, i.e. it is trash if it is not called, i.e. it must be
> called before other functions.
> If it is called, which we know, the caller has the return status. For
> PE, it means the caller must not proceed with any further PE processing
> and abort immediately.
> Is there any scenario where this does not work for ELF? Sorry if I
> missed something.

Caller might call LoadElfImage() without firstly calling ParseElfImage() by mistake.
ParseStatus is added to catch such mistake.

I don't trust the caller would follow the contracts properly😊.

  reply	other threads:[~2021-06-10  3:40 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-03  6:22 [PATCH v2 0/3] Add PayloadLoaderPeim which can load ELF payload Ni, Ray
2021-06-03  6:22 ` [PATCH v2 1/3] MdeModulePkg/UniversalPayload: Add definition for extra info in payload Ni, Ray
2021-06-03  6:37   ` [edk2-devel] " Wu, Hao A
2021-06-04  1:01     ` Ni, Ray
2021-06-04  1:02       ` Wu, Hao A
2021-06-07  9:07         ` Ni, Ray
2021-06-07 23:25   ` Wu, Hao A
2021-06-03  6:22 ` [PATCH v2 2/3] UefiPayloadPkg: Add PayloadLoaderPeim which can load ELF payload Ni, Ray
2021-06-07  1:47   ` Guo Dong
2021-06-07 21:53   ` [edk2-devel] " Marvin Häuser
2021-06-08  2:06     ` Ni, Ray
2021-06-08  3:10     ` Ni, Ray
2021-06-08  8:12       ` Marvin Häuser
2021-06-09  9:49         ` Ni, Ray
2021-06-09 10:03           ` Marvin Häuser
2021-06-10  3:40             ` Ni, Ray [this message]
2021-06-10  7:30               ` Marvin Häuser
2021-06-10  9:39                 ` Ni, Ray
2021-06-10 10:13                   ` Marvin Häuser
2021-06-10 10:43                     ` Michael Brown
2021-06-10 11:37                       ` Ni, Ray
     [not found]                       ` <168735878F610E03.10233@groups.io>
2021-06-15 14:36                         ` Ni, Ray
2021-06-15 17:31                           ` Marvin Häuser
2021-06-03  6:22 ` [PATCH v2 3/3] PeiCore: Remove assertion when failing to load PE image Ni, Ray
2021-06-07 23:28   ` Wu, Hao A
2021-06-07 20:33 ` [edk2-devel] [PATCH v2 0/3] Add PayloadLoaderPeim which can load ELF payload Guo Dong

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-list 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=CO1PR11MB49307462C346035757486B638C359@CO1PR11MB4930.namprd11.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /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