From: Laszlo Ersek <lersek@redhat.com>
To: Roman Bacik <roman.bacik@broadcom.com>
Cc: edk2-devel@lists.01.org, Ruiyu Ni <ruiyu.ni@intel.com>,
Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com>
Subject: Re: [PATCH v2] MdeModulePkg/Bus: Enable ascending resource list
Date: Thu, 3 May 2018 21:02:17 +0200 [thread overview]
Message-ID: <ee787357-d641-b9bd-30e7-e546b8882d8e@redhat.com> (raw)
In-Reply-To: <45404ff573f49b7807e06e0462ab4018@mail.gmail.com>
On 05/03/18 17:23, Roman Bacik wrote:
> [...]
Let me quote the two sets of assignments:
- current (not working for you):
> PciBus: Resource Map for Bridge [00|00|00]
> Type = PMem32; Base = 0x60B00000; Length = 0x100000; Alignment = 0xFFFFF
> Base = 0x60B00000; Length = 0x20000; Alignment = 0x1FFFF; Owner = PCI [01|00|03:18]; Type = PMem64
> Base = 0x60B20000; Length = 0x20000; Alignment = 0x1FFFF; Owner = PCI [01|00|02:18]; Type = PMem64
> Base = 0x60B40000; Length = 0x20000; Alignment = 0x1FFFF; Owner = PCI [01|00|01:18]; Type = PMem64
> Base = 0x60B60000; Length = 0x20000; Alignment = 0x1FFFF; Owner = PCI [01|00|00:18]; Type = PMem64
> Base = 0x60B80000; Length = 0x10000; Alignment = 0xFFFF; Owner = PCI [01|00|03:10]; Type = PMem64
> Base = 0x60B90000; Length = 0x10000; Alignment = 0xFFFF; Owner = PCI [01|00|02:10]; Type = PMem64
> Base = 0x60BA0000; Length = 0x10000; Alignment = 0xFFFF; Owner = PCI [01|00|01:10]; Type = PMem64
> Base = 0x60BB0000; Length = 0x10000; Alignment = 0xFFFF; Owner = PCI [01|00|00:10]; Type = PMem64
> Base = 0x60BC0000; Length = 0x1000; Alignment = 0xFFF; Owner = PCI [01|00|03:20]; Type = PMem64
> Base = 0x60BC1000; Length = 0x1000; Alignment = 0xFFF; Owner = PCI [01|00|02:20]; Type = PMem64
> Base = 0x60BC2000; Length = 0x1000; Alignment = 0xFFF; Owner = PCI [01|00|01:20]; Type = PMem64
> Base = 0x60BC3000; Length = 0x1000; Alignment = 0xFFF; Owner = PCI [01|00|00:20]; Type = PMem64
- desired (working for you):
> PciBus: Resource Map for Bridge [00|00|00]
> Type = PMem32; Base = 0x60000000; Length = 0x100000; Alignment = 0xFFFFF
> Base = 0x60000000; Length = 0x20000; Alignment = 0x1FFFF; Owner = PCI [01|00|00:18]; Type = PMem64
> Base = 0x60020000; Length = 0x20000; Alignment = 0x1FFFF; Owner = PCI [01|00|01:18]; Type = PMem64
> Base = 0x60040000; Length = 0x20000; Alignment = 0x1FFFF; Owner = PCI [01|00|02:18]; Type = PMem64
> Base = 0x60060000; Length = 0x20000; Alignment = 0x1FFFF; Owner = PCI [01|00|03:18]; Type = PMem64
> Base = 0x60080000; Length = 0x10000; Alignment = 0xFFFF; Owner = PCI [01|00|00:10]; Type = PMem64
> Base = 0x60090000; Length = 0x10000; Alignment = 0xFFFF; Owner = PCI [01|00|01:10]; Type = PMem64
> Base = 0x600A0000; Length = 0x10000; Alignment = 0xFFFF; Owner = PCI [01|00|02:10]; Type = PMem64
> Base = 0x600B0000; Length = 0x10000; Alignment = 0xFFFF; Owner = PCI [01|00|03:10]; Type = PMem64
> Base = 0x600C0000; Length = 0x1000; Alignment = 0xFFF; Owner = PCI [01|00|00:20]; Type = PMem64
> Base = 0x600C1000; Length = 0x1000; Alignment = 0xFFF; Owner = PCI [01|00|01:20]; Type = PMem64
> Base = 0x600C2000; Length = 0x1000; Alignment = 0xFFF; Owner = PCI [01|00|02:20]; Type = PMem64
> Base = 0x600C3000; Length = 0x1000; Alignment = 0xFFF; Owner = PCI [01|00|03:20]; Type = PMem64
In both listings, the alignment decreases, and the base address
increases. So there's no difference between the current and the desired
behaviors in that regard.
There is one difference though, in the Owner column. Your platform
requirement seems to be:
For all (Bus, Device, RegionN):
if ((FunctionA < FunctionB) &&
(Size(Bus.Device.FunctionA.RegionN) ==
Size(Bus.Device.FunctionB.RegionN)))
then (Base(Bus.Device.FunctionA.RegionN) <
Base(Bus.Device.FunctionB.RegionN))
This is a very strange requirement. It means that for any PCI device
that has (at least) two functions, such that both functions have the
same RegionN with identical size, the function with lower number must
receive a lower base address for RegionN.
Is my understanding correct?
If it is, then it should be enough to refine the sorting in
InsertResourceNode(). Namely, introduce the PCI B/D/F triplet as the
"least significant" component for the sorting, such that it decide about
ordering only when the resource sizes are equal.
I *guess* the PCI B/D/F can be reached via
PCI_RESOURCE_NODE.PciDev->{BusNumber,DeviceNumber,FunctionNumber}.
If that works, the next question is how to expose this platform quirk.
Perhaps Ray will prefer a PCD, or else an addition to the PI spec, which
already defines EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL (but can't
cover the above requirement yet, AFAICS).
Thanks
Laszlo
next prev parent reply other threads:[~2018-05-03 19:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-02 18:07 [PATCH v2] MdeModulePkg/Bus: Enable ascending resource list Roman Bacik
2018-05-03 13:51 ` Laszlo Ersek
2018-05-03 14:58 ` Roman Bacik
2018-05-03 15:23 ` Roman Bacik
2018-05-03 19:02 ` Laszlo Ersek [this message]
2018-05-03 16:45 ` Roman Bacik
2018-05-03 19:01 ` Roman Bacik
2018-05-03 19:35 ` Ard Biesheuvel
2018-05-03 19:39 ` Roman Bacik
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=ee787357-d641-b9bd-30e7-e546b8882d8e@redhat.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