From: "Pedro Falcato" <pedro.falcato@gmail.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: Théo <theojehl76@gmail.com>,
edk2-devel-groups-io <devel@edk2.groups.io>,
"Leif Lindholm" <quic_llindhol@quicinc.com>,
"Michael D Kinney" <michael.d.kinney@intel.com>,
"Isaac Oram" <isaac.w.oram@intel.com>,
"Stefan Hajnoczi" <stefanha@gmail.com>
Subject: Re: [edk2-platforms][PATCH v1 01/02] QemuOpenBoardPkg: Add QemuOpenBoardPkg
Date: Fri, 2 Sep 2022 17:51:33 +0100 [thread overview]
Message-ID: <CAKbZUD07Y7uP_d7_eay06OS6o32sOB2sYTom9X0vFV=kwMy5Tg@mail.gmail.com> (raw)
In-Reply-To: <20220902100245.m5mgcpvub4gmwj54@sirius.home.kraxel.org>
[-- Attachment #1: Type: text/plain, Size: 4685 bytes --]
On Fri, Sep 2, 2022 at 11:02 AM Gerd Hoffmann <kraxel@redhat.com> wrote:
> On Sat, Aug 27, 2022 at 02:02:00AM +0200, Théo wrote:
> > From: Théo Jehl <theojehl76@gmail.com>
> >
> > QemuOpenBoardPkg adds a MinPlatform port to Qemu x86_64
> > It can boots UEFI Linux and Windows, and works on PIIX4 and Q35
> > This board port provides a simple starting place for investigating edk2
> and
> > MinPlatform Arch.
> > Currently we implement up to stage 4 of the MinPlatform spec and can boot
> > Windows/Linux.
>
> That is a rather short description for a patch of this size. It
> probably makes sense to break that down into smaller pieces and make a
> patch series out of it because you can describe the specific pieces much
> better then.
>
> I'm not familiar with MinPlatform, just skimmed the manual. Can't
> comment much on those details.
>
> It seems the goal is to have a MinPlatform board which can easily be
> used to learn about and experiment with MinPlatform, is that correct?
>
Hi Gerd,
Yes, for now the goal is to have a MinPlatform board that is simple and
easy to use as a learning tool. However, in my opinion the future remains
unclear. I think we (as in EDK2) could benefit by moving OVMF itself to
MinPlatform, so some merging of QemuOpenBoardPkg and OvmfPkg (in the
future, of course) would be a cool idea. I think OVMF has grown a bit hairy
in a few places and has a bunch of logic that is already covered in
MinPlatform. I believe that we got something close enough to OVMF (of
course, while using some OvmfPkg modules and libraries) but drastically
simpler. I don't know if you share the same opinion; some feedback from you
OvmfPkg folks would be interesting.
At the very least, it will serve as a learning tool - it's a great example
of "How to create your own firmware", in a relatively straightforward and
blobless way. Maybe more valuable as a learning tool than an OVMF
replacement, but that of course is open for discussion. We've limited
ourselves to targeting "simple learning MinPlatform (and firmware
programming in general) tool" as writing a full replacement of OVMF would
be very much impossible in 3 months, as you're aware :)
>
> >
> Platform/Qemu/QemuOpenBoardPkg/Library/OpenQemuFwCfgLib/OpenQemuFwCfgLib.inf
> | 23 +
> > Platform/Qemu/QemuOpenBoardPkg/Include/Library/OpenQemuFwCfgLib.h
> | 102 +++
> >
> Platform/Qemu/QemuOpenBoardPkg/Library/OpenQemuFwCfgLib/OpenQemuFwCfgLib.c
> | 130 ++++
>
> Why duplicate that lib instead of just using the OvmfPkg version (which
> you do elsewhere)?
>
> > Platform/Qemu/QemuOpenBoardPkg/PlatformInitPei/Cpu.c
> | 56 ++
> > Platform/Qemu/QemuOpenBoardPkg/PlatformInitPei/Memory.c
> | 244 ++++++++
> > Platform/Qemu/QemuOpenBoardPkg/PlatformInitPei/Pci.c
> | 59 ++
> > Platform/Qemu/QemuOpenBoardPkg/PlatformInitPei/Pcie.c
> | 91 +++
> > Platform/Qemu/QemuOpenBoardPkg/PlatformInitPei/PlatformInit.c
> | 67 ++
>
> Note that OvmfPkg got a PlatformInitLib recently which you might be able
> to use to reduce code duplication (didn't check the code though and
> maybe MinPlatform init is different enough that this doesn't help much).
>
> Some context on these two libs:
OpenQemuFwCfgLib was created early on as a way to manage initial complexity
and as a way to get Théo to code a bit. I'm not too sure we'll want to keep
that library around.
PlatformInitPei was again created to manage complexity (and to implement
MinPlatform of course) - this ended up getting all the PEI platform
initialization code, instead of using OVMF's PlatformInitLib.
You'll notice that there's some overlap in functionality between QemuOBP
and OVMF. While it's not the most elegant solution from a "UEFI
super-duper-modular" POV, I think it was a better end product than getting
Théo to look at .dsc and .fdf files for 3 months; we actually went through
x86 PC platform initialization and I'm reasonably confident Théo not only
understands how x86 PC works, but that he could write it all on his own
again. We also got something with less historical baggage and that resulted
in cleaner, simpler code. It also doesn't support every bell and whistle in
QEMU and I'm willing to bet it straight up breaks if you go back enough in
QEMU versions; but again, at the current stage it's not a replacement for
full OVMF functionality, but rather the most common subset of it (no TDX,
no SEV, no CPU hotplug, restricts itself to relatively recent versions, SMM
and secure boot are not in this patch set but are in progress).
Thanks,
Pedro
[-- Attachment #2: Type: text/html, Size: 5649 bytes --]
next prev parent reply other threads:[~2022-09-02 16:51 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-27 0:01 [edk2-platforms][PATCH v1 00/02] Add QemuOpenBoardPkg Théo Jehl
2022-08-27 0:02 ` [edk2-platforms][PATCH v1 01/02] QemuOpenBoardPkg: " Théo Jehl
2022-08-29 21:41 ` Pedro Falcato
2022-09-02 10:02 ` Gerd Hoffmann
2022-09-02 13:36 ` Théo Jehl
2022-09-02 16:49 ` Gerd Hoffmann
2022-09-02 16:51 ` Pedro Falcato [this message]
2022-08-27 0:02 ` [edk2-platforms][PATCH v1 02/02] Maintainers: Add maintainers for QemuOpenBoardPkg Théo Jehl
2022-08-29 20:15 ` [edk2-devel] [edk2-platforms][PATCH v1 00/02] Add QemuOpenBoardPkg Oram, Isaac W
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='CAKbZUD07Y7uP_d7_eay06OS6o32sOB2sYTom9X0vFV=kwMy5Tg@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