(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