Benjamin,

 

Thanks for sharing, it is interesting that Simics gets that far.  In looking at the QemuPkg, I note that they have QEMU drivers for all the DXE and SMM HW needs that likely explain .  Timer, SMM access, SMM control, FVB services …  I haven’t gotten to the next level of details yet, like what chipsets the QemuPkg supports.  Readme says “The minimum required QEMU machine type is "pc-q35-2.5".”   Also I note that there is a whole section on QEMU SMM and flash options. 

 

It seems promising to make the MinPlatform QEMU board port using the QemuPkg for all the “silicon” support needed.  As Pedro indicated though, we have not yet had a chance to get into project details yet.  As we get through GSoC community bonding period, we should get better understanding. 

 

Regards,
Isaac

 

From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Pedro Falcato
Sent: Monday, May 23, 2022 10:34 AM
To: edk2-devel-groups-io <devel@edk2.groups.io>; Benjamin Doron <benjamin.doron00@gmail.com>
Cc: Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>; Gerd Hoffmann <kraxel@redhat.com>; Oram, Isaac W <isaac.w.oram@intel.com>
Subject: Re: [edk2-devel] [GSoC 2022] Introducing myself & seeking for project ideas

 

(CC Gerd, Isaac)

 

Comments inline.

 

On Mon, May 23, 2022 at 5:50 PM Benjamin Doron <benjamin.doron00@gmail.com> wrote:

Hi Theo and Nate,
I took a brief look at this myself, because having an emulated environment would help me with my project. I didn't know then that QemuOpenBoardPkg was an accepted project this year. OvmfPkg is large, I'm unfamiliar with QEMU's codebase and I'm only minimally familiar with Intel's old ICH chipsets (the platform some emulators expose), so I looked at porting QEMU's Q35 + ICH9 support into SimicsOpenBoardPkg. I don't know how you're preparing, but I'd recommend at least a look there: Q35's ICH9 and Simics' ICH10 are fairly similar. There are other QEMU machines, but I can't comment on those.

We're still trying to figure everything out and since the GSoC projects were only announced Friday, we haven't discussed much. My idea was to try to get something relatively smaller and simpler than current OVMF, as the end result can be a lot more interesting than just repackaging OVMF or straight up copying SimicsOpenBoardPkg; we're also mostly aiming for Stage IV (Booting to an OS), so we can safely discard some of the advanced features of OVMF for now. Again, I'd like to give you more details but it's still too early and we're trying to introduce Theo to UEFI; hopefully we'll get a better idea of the project for the summer this week.


SimicsOpenBoardPkg can partially boot QEMU with a minimum of changes. It makes it into the DXE phase (where we'd eventually get a shell), but fails to initialise SMM, so it can't load the variable driver in there. Many drivers depend on the variable protocol, including critical UEFI-architecture ones, so the DXE core will assert and hang after printing a bunch of "driver GUID discovered but not loaded" messages. To fix this, the SMM access, maybe SMM control drivers would need to be patched; some register definitions differ between chipsets.

One issue with QEMU is that you currently have 3 machines worth supporting: the i440fx (i440fx + PIIX), which is the default, the Q35 (Q35 + ICH9), and the microvm (probably not going to be apart of the scope of this project, at least for now, even though OVMF supports it). I don't know much about Simics or SimicsOpenBoardPkg, but I imagine that taking way too much inspiration from them would possibly negatively impact the capability of supporting multiple platforms in one OpenBoardPkg.


Anyways, I can send you my diff if you'd like, or you're welcome to approach this any way you'd like. SimicsOpenBoardPkg is not a true MinPlatform board because it implements a number of init steps itself rather than using some of MinPlatform's FSP-centric libraries. I'm probably going to skip to the step where I try Frankensteining enough MinPlatform code in to suffice my testing.

Best regards,
Benjamin



--

Pedro Falcato