public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Michael D Kinney" <michael.d.kinney@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
	"ard.biesheuvel@linaro.org" <ard.biesheuvel@linaro.org>,
	"Kinney, Michael D" <michael.d.kinney@intel.com>
Cc: "ming.huang@linaro.org" <ming.huang@linaro.org>,
	"Wu, Hao A" <hao.a.wu@intel.com>,
	"Wang, Jian J" <jian.j.wang@intel.com>
Subject: Re: [edk2-devel] [PATCH resend] MdeModulePkg/EsrtDxe: allocate ESRT table from RtServicesData memory
Date: Fri, 19 Apr 2019 18:23:49 +0000	[thread overview]
Message-ID: <E92EE9817A31E24EB0585FDF735412F5B9C9B6C0@ORSMSX113.amr.corp.intel.com> (raw)
In-Reply-To: <CAKv+Gu8eS0vAN=3X8ATFVSJuKemi4sinZmtWbdFWx1L66TnHXw@mail.gmail.com>

Ard,

Let's see if we can remove the ESRT access from those
paths.  That would be the better fix.

Thanks,

Mike

> -----Original Message-----
> From: devel@edk2.groups.io
> [mailto:devel@edk2.groups.io] On Behalf Of Ard
> Biesheuvel
> Sent: Friday, April 19, 2019 11:11 AM
> To: Kinney, Michael D <michael.d.kinney@intel.com>
> Cc: devel@edk2.groups.io; ming.huang@linaro.org; Wu,
> Hao A <hao.a.wu@intel.com>; Wang, Jian J
> <jian.j.wang@intel.com>
> Subject: Re: [edk2-devel] [PATCH resend]
> MdeModulePkg/EsrtDxe: allocate ESRT table from
> RtServicesData memory
> 
> On Fri, 19 Apr 2019 at 20:08, Kinney, Michael D
> <michael.d.kinney@intel.com> wrote:
> >
> > Ard,
> >
> > Where is the use of ESRT at runtime?
> >
> 
> DxeCapsuleLibFmp is invoked at runtime by the
> UpdateCapsule() and
> QueryCapsuleCapabilities() code.
> 
> The Canonical FWTS crashes on this runtime service on
> some ARM and x86
> systems due to this issue, hence the patch.
> 
> 
> > The SetVa conversion of the ESRT table may be an old
> artifact
> > that we should consider removing.
> >
> 
> No, it is definitely live code.
> 
> 
> >
> > > -----Original Message-----
> > > From: devel@edk2.groups.io
> > > [mailto:devel@edk2.groups.io] On Behalf Of Ard
> > > Biesheuvel
> > > Sent: Friday, April 19, 2019 10:54 AM
> > > To: edk2-devel-groups-io <devel@edk2.groups.io>;
> > > Kinney, Michael D <michael.d.kinney@intel.com>
> > > Cc: ming.huang@linaro.org; Wu, Hao A
> > > <hao.a.wu@intel.com>; Wang, Jian J
> > > <jian.j.wang@intel.com>
> > > Subject: Re: [edk2-devel] [PATCH resend]
> > > MdeModulePkg/EsrtDxe: allocate ESRT table from
> > > RtServicesData memory
> > >
> > > On Fri, 19 Apr 2019 at 19:42, Ard Biesheuvel
> > > <ard.biesheuvel@linaro.org> wrote:
> > > >
> > > > On Fri, 19 Apr 2019 at 19:36, Michael D Kinney
> > > > <michael.d.kinney@intel.com> wrote:
> > > > >
> > > > > Hi Ard,
> > > > >
> > > > > The UEFI Specification Section 23.3 says:
> > > > >
> > > > >         "The ESRT shall be stored in memory of
> type
> > > EfiBootServicesData."
> > > > >
> > > > > If an RT driver needs ESRT info after
> > > ExitBootServices(), then the
> > > > > RT driver should collect that information
> before
> > > ExitBootServices().
> > > > >
> > > >
> > > > But that means that before EBS(), we will have to
> > > make a copy of the
> > > > ESRT into runtime services data, and we will end
> up
> > > using twice as
> > > > much memory - one copy in boot services data for
> the
> > > OS, and one copy
> > > > in runtime services data for the firmware itself.
> I
> > > understand the
> > > > reasoning behind preferring boot over runtime, so
> > > that the OS is not
> > > > burdened with it if it does not care. But it this
> > > case, the RT
> > > > services data will be allocated regardless, and
> so we
> > > end up using
> > > > less memory if we expose that same copy to the
> OS.
> > > >
> > >
> > > Actually, DxeCapsuleLibVirtualAddressChangeEvent()
> in
> > > DxeCapsuleLibFmp
> > > updates the ESRT pointer to virtual, so this code
> is
> > > clearly based on
> > > the assumption that the ESRT resides in memory that
> is
> > > covered by a
> > > runtime VA mapping.
> > >
> > > Could we instead clarify the UEFI spec to something
> > > like
> > >
> > > "The ESRT shall be stored in memory of type
> > > EfiBootServicesData unless
> > > the runtime services implementations themselves
> need to
> > > access it at
> > > OS runtime, in which case it may be stored in
> > > EfiRuntimeServicesData."
> > >
> > >
> >
> 
> 


  reply	other threads:[~2019-04-19 18:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-19 14:13 [PATCH resend] MdeModulePkg/EsrtDxe: allocate ESRT table from RtServicesData memory Ard Biesheuvel
2019-04-19 17:36 ` [edk2-devel] " Michael D Kinney
2019-04-19 17:42   ` Ard Biesheuvel
2019-04-19 17:53     ` Ard Biesheuvel
2019-04-19 18:08       ` Michael D Kinney
2019-04-19 18:11         ` Ard Biesheuvel
2019-04-19 18:23           ` Michael D Kinney [this message]
2019-04-19 18:38             ` Ard Biesheuvel
2019-04-19 18:43               ` Ard Biesheuvel
2019-04-19 19:46                 ` Michael D Kinney
2019-04-19 20:04                   ` Michael D Kinney
2019-04-20 10:25                     ` Ard Biesheuvel

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=E92EE9817A31E24EB0585FDF735412F5B9C9B6C0@ORSMSX113.amr.corp.intel.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