public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: "Ni, Ruiyu" <ruiyu.ni@intel.com>
Cc: 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>,
	 "leif.lindholm@linaro.org" <leif.lindholm@linaro.org>
Subject: Re: [PATCH] MdeModulePkg/PciBusDxe: make BAR degradation dependent on OPROM presence
Date: Tue, 13 Sep 2016 08:43:39 +0100	[thread overview]
Message-ID: <CAKv+Gu_8gz2wiebdFh=sZ_10L55U6CvgYjpE_gP4_kkoy7jaQA@mail.gmail.com> (raw)
In-Reply-To: <734D49CCEBEEF84792F5B80ED585239D58D54EC7@SHSMSX103.ccr.corp.intel.com>

On 13 September 2016 at 06:46, Ni, Ruiyu <ruiyu.ni@intel.com> wrote:
>
>
> Regards,
> Ray
>
>>-----Original Message-----
>>From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Laszlo Ersek
>>Sent: Monday, September 12, 2016 9:49 PM
>>To: Ard Biesheuvel <ard.biesheuvel@linaro.org>; Yao, Jiewen <jiewen.yao@intel.com>
>>Cc: Ni, Ruiyu <ruiyu.ni@intel.com>; Tian, Feng <feng.tian@intel.com>; edk2-devel@lists.01.org <edk2-devel@ml01.01.org>;
>>leif.lindholm@linaro.org; Gao, Liming <liming.gao@intel.com>; Zeng, Star <star.zeng@intel.com>
>>Subject: Re: [edk2] [PATCH] MdeModulePkg/PciBusDxe: make BAR degradation dependent on OPROM presence
>>
>>On 09/12/16 15:16, Ard Biesheuvel wrote:
>>> On 12 September 2016 at 14:15, Yao, Jiewen <jiewen.yao@intel.com> wrote:
>>>> HI Ard
>>>> We should not let MdeModulePkg depend on IntelFrameworkPkg.
>>>> You patch violates the dependency rule.
>>>> I suggest we figure out other solution to resolve the problem.
>>>>
>>>
>>> Yes, please. And please keep us informed about any solutions you come up with.
>>
>>* One idea is to parse the PCI expansion ROM in order to see what image
>>types are contained within. If there is no (Code type == 0x00) image in
>>the oprom, then the oprom is useless for legacy boot anyway, so it
>>shouldn't trigger degradation.
>>
>>Unfortunately, this wouldn't help a lot in practice, since it's surely
>>going to be years before hw vendors migrate to pure UEFI oproms on their
>>graphics and network cards. :(
> Yes the first idea doesn't work because it cannot solve all the problems: some
> cards may still contain legacy option ROM. The resource degrade happens
> before PciBus knows which option rom to run by platform. And we even met case
> the card only contains legacy option rom but platform just don't want to dispatch
> the legacy rom.
>
>>* 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

-- 
Ard.


  reply	other threads:[~2016-09-13  7:43 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 [this message]
2016-09-13 14:56           ` Leif Lindholm

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='CAKv+Gu_8gz2wiebdFh=sZ_10L55U6CvgYjpE_gP4_kkoy7jaQA@mail.gmail.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