From: "Gerd Hoffmann" <kraxel@redhat.com>
To: "Albecki, Mateusz" <mateusz.albecki@intel.com>
Cc: devel@edk2.groups.io
Subject: Re: [edk2-devel] [PATCH v5 1/6] MdeModulePkg/PciHostBridge: io range is not mandatory
Date: Tue, 24 May 2022 08:24:46 +0200 [thread overview]
Message-ID: <20220524062446.x4gpibum74zwi4zu@sirius.home.kraxel.org> (raw)
In-Reply-To: <2650.1653306485291202681@groups.io>
On Mon, May 23, 2022 at 04:48:05AM -0700, Albecki, Mateusz wrote:
> @Ni, Ray
>
> I think EDK2 needs to provide a way for root port to operate without IO space assigned in a platform-independent way. I can think of the following cases when root port didn't get IO space:
>
> 1. We have run out of IO space but it's fine since the device under the root port doesn't use IO or has only non-critical functionalities under IO
> 2. We have run out of IO space and it's really not fine since device needs IO
> 3. We are running on a CPU which doesn't support IO
>
> For 1. the question is whether the device driver in EDK2 understands that IO bar for that device is optional and will bother to check if it has been assigned and either fail gracefully or continue operation in limited capacity. For 2. the question is whether the driver will fail gracefully. 3 is for completeness at this point I think since the only other architecture that uses EDK2 is ARM which has to deal with it in some way right now which I think maps IO region into MMIO so in a way it supports IO.
Well, the case I'm trying to handle here is qemu microvm. It's x86, but
io address space support for pcie devices is not wired up. So the pcie
host bridge doesn't support io, which is rather close to case (3).
> I've checked the device driver behavior in EDK2 for devices which use IO bar here is the rundown:
> 1. IDE - Doesn't check if IO has been assigned, not giving IO results in undefined behavior
> 2. SerialIo -> Doesn't check, will assert the system when IO is not assigned (although the logic there is really strange as it can use 3 different access methods)
> 3. UHCI -> Checks but too late, will most likely result in undefined behavior
Current edk2 behavior is that the initialization of the pcie host bridge
fails in case no io space is present (and all devices connected to it are
not initialized either of course).
With this patch applied pcie host bridge initialization works. PCIe
devices without io bars are enumerated and initialized sucessfully.
PCIe devices with io bar fail to initialize. That isn't much of a
problem tough as a qemu microvm typically has no pcie devices with io
bars.
> Even with those bad device drivers I would agree that taking this
> change presents low risk given that those devices are pretty old and
> should be mostly unused on new systems(SerialIo being an exception but
> that one is usually an RCIEP).
Also note that for pcie root bridges which do support io address space
this patch changes nothing.
> That said I think we are missing a larger issue here - why are we
> running out of IO when we have 16 root ports?
I don't think so. I see the *linux kernel* hand out io address space to
pcie root ports (until it runs out). edk2 doesn't.
take care,
Gerd
next prev parent reply other threads:[~2022-05-24 6:24 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-22 7:37 [PATCH v5 0/6] OvmfPkg/Microvm/pcie: add pcie support Gerd Hoffmann
2022-04-22 7:37 ` [PATCH v5 1/6] MdeModulePkg/PciHostBridge: io range is not mandatory Gerd Hoffmann
2022-04-25 20:49 ` [edk2-devel] " Ard Biesheuvel
2022-04-27 0:32 ` 回复: " gaoliming
2022-04-27 3:08 ` Ni, Ray
2022-04-29 6:50 ` Gerd Hoffmann
2022-04-29 7:00 ` Ard Biesheuvel
2022-04-29 8:13 ` Ni, Ray
2022-04-29 8:47 ` Gerd Hoffmann
2022-04-29 9:08 ` Ni, Ray
2022-04-29 9:46 ` Gerd Hoffmann
2022-05-02 10:48 ` Gerd Hoffmann
2022-05-23 11:48 ` Albecki, Mateusz
2022-05-24 6:24 ` Gerd Hoffmann [this message]
2022-05-25 18:26 ` Albecki, Mateusz
2022-05-31 16:11 ` Gerd Hoffmann
2022-06-02 10:00 ` Ni, Ray
[not found] ` <16E9A2157ED8983D.16936@groups.io>
2022-04-27 3:13 ` Ni, Ray
2022-04-22 7:37 ` [PATCH v5 2/6] OvmfPkg/FdtPciHostBridgeLib: " Gerd Hoffmann
2022-04-22 15:01 ` Abner Chang
2022-04-22 7:37 ` [PATCH v5 3/6] OvmfPkg/Platform: unfix PcdPciExpressBaseAddress Gerd Hoffmann
2022-04-22 7:37 ` [PATCH v5 4/6] OvmfPkg/Microvm/pcie: no vbeshim please Gerd Hoffmann
2022-04-22 7:37 ` [PATCH v5 5/6] OvmfPkg/Microvm/pcie: mPhysMemAddressWidth tweak Gerd Hoffmann
2022-04-22 7:37 ` [PATCH v5 6/6] OvmfPkg/Microvm/pcie: add pcie support Gerd Hoffmann
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=20220524062446.x4gpibum74zwi4zu@sirius.home.kraxel.org \
--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