public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Leif Lindholm <leif.lindholm@linaro.org>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: "Ni, Ruiyu" <ruiyu.ni@intel.com>,
	Laszlo Ersek <lersek@redhat.com>,
	"Yao, Jiewen" <jiewen.yao@intel.com>,
	"Zeng, Star" <star.zeng@intel.com>,
	"Tian, Feng" <feng.tian@intel.com>,
	"Gao, Liming" <liming.gao@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@ml01.01.org>,
	Andrew Fish <afish@apple.com>,
	"Kinney, Michael D" <michael.d.kinney@intel.com>
Subject: Re: [PATCH] MdeModulePkg/PciBusDxe: make BAR degradation dependent on OPROM presence
Date: Tue, 13 Sep 2016 15:56:17 +0100	[thread overview]
Message-ID: <20160913145617.GX16080@bivouac.eciton.net> (raw)
In-Reply-To: <CAKv+Gu_8gz2wiebdFh=sZ_10L55U6CvgYjpE_gP4_kkoy7jaQA@mail.gmail.com>

Adding Andrew, Mike,

On Tue, Sep 13, 2016 at 08:43:39AM +0100, Ard Biesheuvel wrote:
> On 13 September 2016 at 06:46, Ni, Ruiyu <ruiyu.ni@intel.com> wrote:
> >>* Another idea is to check a dynamic PCD that the platform can set. New
> >>PCDs are frowned upon in MdeModulePkg however, so I don't expect this to
> >>be a popular fix.
> >
> > I agree with you.
> > The requirement of dynamic PCD actually indicates we have a
> > missing interface between platform and PciBus core driver.
> > I personally don't like dynamic PCD very much. It's equivalent to
> > protocol. Then why should we use PCD instead of protocol? To avoid
> > changing spec??
> >
> > The usage of PciIncompatibleDevice protocol is the solution we came up.
> > It's also the currently recommended way to solve this type of issue.
> > ECR 1529 introduced in PI 1.4A was initiated by this issue.
>
> We are all aware that the PciIncompatibleDevice protocol can be used
> to work around this. But this means that, while this issue only exists
> on X64, all architectures need to install additional protocols and
> rely on runtime processing to disable a feature they did not want in
> the first place. Is the practice of degrading 64-bit MMIO BARs for
> option ROMs even in the specs?
> 
> So how about a PCD feature flag? Or even simply a '#ifdef MDE_CPU_X64'
> around the block that degrades the 64-bit MMIO BARs if an option ROM
> is detected? Ideally, we should implement PciIncompatibleDevice
> protocol the other way around, and add a default implementation to
> IntelFrameworkModulePkg to performs the BAR degradation on platforms
> with a legacy BIOS and option ROMs

Yes, the situation of requiring an implementation of
PciIncompatibleDevice to support an actually compatible device, in
order to not require it for actually incompatible platforms seems at
the very least somewhat semantically dubious to me.

By order of my preference, I would say we could:
- Invert the use of PciIncompatibleDevice with a default
  implementation for IntelFrameworkModulePkg
- #ifdef MDE_CPU_X64
- Add a dynamic Pcd
- Retain the semantically incorrect use of PciIncompatibleDevice, but
  provide a single implementation reusable across OvmfPkg and all !X64
  platforms.

Regards,

Leif


      reply	other threads:[~2016-09-13 14:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-12 13:06 [PATCH] MdeModulePkg/PciBusDxe: make BAR degradation dependent on OPROM presence Ard Biesheuvel
2016-09-12 13:15 ` Yao, Jiewen
2016-09-12 13:16   ` Ard Biesheuvel
2016-09-12 13:41     ` Ni, Ruiyu
2016-09-12 13:46       ` Ard Biesheuvel
2016-09-12 13:48     ` Laszlo Ersek
2016-09-13  5:46       ` Ni, Ruiyu
2016-09-13  7:43         ` Ard Biesheuvel
2016-09-13 14:56           ` Leif Lindholm [this message]

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=20160913145617.GX16080@bivouac.eciton.net \
    --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