From: "Pedro Falcato" <pedro.falcato@gmail.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: devel@edk2.groups.io, Isaac Oram <isaac.w.oram@intel.com>,
Theo Jehl <theojehl76@gmail.com>
Subject: Re: [PATCH edk2-platforms 1/2] QemuOpenBoardPkg: Redo PCI bus initialization
Date: Mon, 30 Jan 2023 11:27:59 +0000 [thread overview]
Message-ID: <CAKbZUD1_ZyrSHzviWYXn3An4Awi63NC+bN36t5L+SXsbUaoDHg@mail.gmail.com> (raw)
In-Reply-To: <20230113063308.rzaqgegewx3pp77i@sirius.home.kraxel.org>
On Fri, Jan 13, 2023 at 6:34 AM Gerd Hoffmann <kraxel@redhat.com> wrote:
>
> > diff --git a/Platform/Qemu/QemuOpenBoardPkg/PlatformInitPei/Memory.c b/Platform/Qemu/QemuOpenBoardPkg/PlatformInitPei/Memory.c
> > index 21705256191b..4f312c36016e 100644
> > --- a/Platform/Qemu/QemuOpenBoardPkg/PlatformInitPei/Memory.c
> > +++ b/Platform/Qemu/QemuOpenBoardPkg/PlatformInitPei/Memory.c
>
> There is OvmfPkg/Library/PlatformInitLib which you could use instead of
> reinventing the wheel ...
>
> If there are changes needed to make PlatformInitLib work for you feel
> free to propose patches (same goes for eventually moving code from
> OvmfPkg/PlatformPei to the Library).
Gerd,
Thank you for the comments.
That is an interesting idea, however I believe
OvmfPkg/Library/PlatformInitLib is ATM a bit too tightly coupled with
the rest of OVMF itself.
For instance, this work was partially inspired by your recent-ish work
in similar OvmfPkg code and also drove me to remove the dependency on
PciHostBridgeLib, et al (replacing it with the "standard"
MinPlatformPkg PCI libs). My solution is based on dynamic PCD
war-crimes but it Just Works(tm).
Changing it in OvmfPkg would be too invasive, I feel; it's not like my
solution is good or anything.
And because of the way the repos are split, there is no way to
currently dedup OVMF's PciHostBridgeLib by also making OVMF depend on
MinPlatformPkg's, because why would there be, right?
Anyway, doing deep changes to OVMF for QemuOpenBoardPkg is
uncomfortable for me because its place in Tiano is not defined. OVMF
and Intel folks have said very few things about QOBP.
At the moment, it's the typical "GSoC project stagnating in
edk2-platforms/-staging" that Tianocore seems to love so much. I don't
see much point in it being this way.
QemuOBP has been a nice fun exercise in reducing code duplication,
which shows a lot of promise, but it also doesn't support some of the
things OvmfPkg does, like PEI-less booting (and TDX/SEV but those
could certainly be worked in).
If this kicks off discussion on the future of QemuOpenBoardPkg, I'll be happy.
Until that happens, I am reluctant to change OVMF internals for an
obscure QEMU PlatformPkg hidden in the best worst repo, edk2-platforms
:)
> > + // It's worth noting that QEMU also grew an option to change lowmem based on the
> > + // user's preferences. Because of all of this, it's near impossible to hardcode
> > + // a range, so we grab TOLUD (not in a literal way, since QEMU does not implement
> > + // that register ;)) and calculate our PCI MMIO based on that. This also makes it so
> > + // the DSDT built by QEMU will have correct _CRS ranges.
> > + // hw/pci-host/q35.c explicitly says our PCI hole ranges from [TOLUD, IO APIC].
> > + // As far as I can tell, we seem to be allowed to add a 64-bit resource range anywhere.
>
> There is a etc/reserved-memory-end fw_cfg FwCfg file. If present it
> the 64-bit resource range should be placed above the address specified
> there (qemu uses that to reserve address space if needed, happens for
> example when you enable memory hotplug).
ACK, will change on v2 (together with Isaac's comments).
> The patch should be splitted up into smaller pieces to make it easier
> to review the changes.
Agreed, will try to devise a strategy to break it up in smaller, logical chunks.
Again, thank you so much for your time looking at something you're not
even a maintainer for :))
--
Pedro
next prev parent reply other threads:[~2023-01-30 11:28 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-12 23:13 [PATCH edk2-platforms 0/2] QemuOpenBoardPkg: PCI rework and small fixes Pedro Falcato
2023-01-12 23:13 ` [PATCH edk2-platforms 1/2] QemuOpenBoardPkg: Redo PCI bus initialization Pedro Falcato
2023-01-13 1:46 ` Isaac Oram
2023-01-13 6:33 ` Gerd Hoffmann
2023-01-30 11:27 ` Pedro Falcato [this message]
2023-03-09 3:48 ` [edk2-devel] " Isaac Oram
2023-05-08 23:48 ` Pedro Falcato
2023-01-12 23:13 ` [PATCH edk2-platforms 2/2] QemuOpenBoardPkg: Trivial code cleanup Pedro Falcato
2023-01-13 1:48 ` Isaac Oram
2023-01-13 12:58 ` Théo Jehl
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=CAKbZUD1_ZyrSHzviWYXn3An4Awi63NC+bN36t5L+SXsbUaoDHg@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