public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Isaac Oram" <isaac.w.oram@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
	"pedro.falcato@gmail.com" <pedro.falcato@gmail.com>,
	Gerd Hoffmann <kraxel@redhat.com>
Cc: Theo Jehl <theojehl76@gmail.com>
Subject: Re: [edk2-devel] [PATCH edk2-platforms 1/2] QemuOpenBoardPkg: Redo PCI bus initialization
Date: Thu, 9 Mar 2023 03:48:45 +0000	[thread overview]
Message-ID: <SA1PR11MB5801D266517D06AABA323EB2D0B59@SA1PR11MB5801.namprd11.prod.outlook.com> (raw)
In-Reply-To: <CAKbZUD1_ZyrSHzviWYXn3An4Awi63NC+bN36t5L+SXsbUaoDHg@mail.gmail.com>

We are doing some work to enable CI on edk2-platforms and would like to add QemuOpenBoardPkg to the CI list.  I do think that this will become more active over time.

Is there a V2 coming?  If so, I found a compiler issue with VS2019 and VS2015.
It doesn't like the local variable PlatformData having the same name as the global variable PlatformData.
I would suggest changing the global to mPlatformData.

Regards,
Isaac

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Pedro Falcato
Sent: Monday, January 30, 2023 3:28 AM
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: devel@edk2.groups.io; Oram, Isaac W <isaac.w.oram@intel.com>; Theo Jehl <theojehl76@gmail.com>
Subject: Re: [edk2-devel] [PATCH edk2-platforms 1/2] QemuOpenBoardPkg: Redo PCI bus initialization

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






  reply	other threads:[~2023-03-09  3:48 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
2023-03-09  3:48       ` Isaac Oram [this message]
2023-05-08 23:48         ` [edk2-devel] " 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=SA1PR11MB5801D266517D06AABA323EB2D0B59@SA1PR11MB5801.namprd11.prod.outlook.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