public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Nikita Leshenko <nikita.leshchenko@oracle.com>
To: Laszlo Ersek <lersek@redhat.com>
Cc: Liran Alon <liran.alon@oracle.com>,
	edk2-devel@lists.01.org, ard.biesheuvel@linaro.org
Subject: Re: PciBusDxe: PCI-Express bug with dynamic PcdPciExpressBaseAddress
Date: Thu, 13 Sep 2018 14:27:54 +0200	[thread overview]
Message-ID: <AEE4DCD3-4F75-4375-B400-7BFBB1888053@oracle.com> (raw)
In-Reply-To: <ef64cb33-1a20-0a3c-3374-efb0e3cd337b@redhat.com>



> On 11 Sep 2018, at 15:34, Laszlo Ersek <lersek@redhat.com> wrote:
> 
> "BasePciExpressLib" has the prefix "Base", meaning that it is supposed
> to be usable in all types of firmware modules, even in SEC and PEIMs --
> which may not have access to writeable memory except stack (i.e.
> writeable global variables). Therefore modifying the original lib
> instance so that it depend on writeable globals wouldn't have been right.
> 
> We could have attempted to add the new library instance under MdePkg,
> and not ArmVirtPkg, but that's just a (more difficult) special case of
> point (1).
> 
> (Obviously if you try to apply the nomenclature I describe above to
> "BaseCachingPciExpressLib" as well, you'll see that it doesn't match.
> And that's because, when I invented the name for that lib instance, in
> 2015, I didn't know about the naming rules myself. :) In reality the lib
> instance should be called "DxePciExpressLibCaching" -- with "Dxe" for
> prefix, and "Caching" for suffix.)

Thanks for the detailed explanation. I guess we have no choice
but to copy BaseCachingPciExpressLib (renamed to
DxePciExpressLibCaching) from ArmVirt to OVMF as well.

In order to prevent such bugs in the future, what do you think
about changing the PCD reference in BasePciExpressLib.inf (in
MdePkg) from [Pcd] to [FixedPcd]? This way a module that has a
dynamic PcdPciExpressBaseAddress will fail to link with the
default PCIE library. Is it practical to get such change into
MdePkg despite their strict change policy?

Nikita

> 
> Thanks
> Laszlo
> 



  reply	other threads:[~2018-09-13 12:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-06 19:08 PciBusDxe: PCI-Express bug with dynamic PcdPciExpressBaseAddress Nikita Leshenko
2018-09-07  0:25 ` Ni, Ruiyu
2018-09-07  8:44 ` Laszlo Ersek
2018-09-07 17:01   ` Liran Alon
2018-09-11 13:34     ` Laszlo Ersek
2018-09-13 12:27       ` Nikita Leshenko [this message]
2018-09-13 13:15         ` Laszlo Ersek
2018-09-16 12:28           ` Nikita Leshenko

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=AEE4DCD3-4F75-4375-B400-7BFBB1888053@oracle.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