-
-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Have qemu boards support writeable pflash and internal flashing #1203
Comments
Leaving traces of pertinent mailing list sub threads
|
Specifically As referred by Dasharo/dasharo-issues#828 |
Question asked under Dasharo OSFV matrix channel at https://matrix.to/#/!MwWOJhMJzlxIdAQxae:matrix.3mdeb.com/$-G0q4GBkLoQwCk7d1geSf-U74XuqTNwtSb6HT072K-s?via=matrix.org&via=nitro.chat&via=matrix.3mdeb.com:
|
Of course, changes to qemu would need to be merged inside of nix, and then flake.lock under Heads using this new built qemu, included under nix based created docker images under Heads. When Heads needed canokey support built it under nix by default:
Leading to PR merging collaboration work, changing flake.lock and flake.nix to point to new qemu_full on which Heads docker image build atop of nix under #1687 |
This would definitely unblock some tests for us. We planned to use qemu for automating part of Dasharo tests but we found that many features (OEM factory reset and GPG most notably) depend on being able to write to the flash. Without this ability a lot of our testing has to be done manually on hardware instead |
I achieved writes in QEMU and Dasharo (coreboot+SeaBIOS) with sortbootorder as a secondary payload. Someone would have to build that with Heads for QEMU, but I need to see how it would work out of the box if coreboot contains @krystian-hebel driver. How I tested it? I used:
|
Eli5? |
That patch enables Qemu flash writes in coreboot, we would need someone to port this code to flashrom, that's what Heads uses to write to flash |
I'm not sure if pflash is something that can be easily added to flashrom, there is no way of probing for it, other than trying to write, which may fail miserably for any real flash device. Would it be good enough to add a dedicated app/script (I've been testing it with |
Since #1769, Heads is not hardcoding use of flashrom/flashprog, but instead requires each board to describe what is used to flash internally, now flashprog because of --progress output (and because @i-c-o-n responded and fixes everything that was needed for Heads tht flashrom took years to). The ideal, of course, would be to have internal flashing of qemu pflash from flashprog/flashrom with same minimal arguments so that Heads do not have to implement another set of workarounds just for qemu, while keeping the same output that is existing for all other boards for automated testing. If we take a look at a random #1769 board config change:
So as log as the internal flasher used permits similar flashrom/flashprog arugments (-r/-w/-v + filename), then Heads will prepend any internal flashing call with the content of Note that flash.sh script currently uses BOARD name to exclude qemu boards as of today and print a warning on console pointing to qemu.md docs. The ideal, in my opinion, would be the addition or a qemu programmer to flashrom/flashprog, ie
It would be enough. But would do things in the dark, without flashrom/flashprog progress bar, unified in all other boards and if failing because of WP regions or whatnot, would diverge in automated testings as opposed to where we want to go forward with flashprog, not leaving users/dev in the dark when reading/erasing/writing to a big flash chip. |
Wrt. flashprog, adding another "programmer" would be possible, but not sure if worth it. I see a few options with the
|
@pietrushnic @mkopec @krystian-hebel thoughts on prior comment? |
Seems like both qemu and flashrom will need to be patched. Meanwhile, injecting key is made from separate qemu board build statement, and "reflashing" is rebooting qemu/kvm with newer built rom.
Current limitations stated under OP under #1188, where the following traces are what needs to be resolved:
Looks like the size limit is just a matter of changing this default for max_fw_size: https://gitlab.com/qemu-project/qemu/-/blob/master/hw/i386/pc.c#L1833
Re: writable flash, it seems to exist but the only discussion I can find is about people using it incorrectly: https://bugs.launchpad.net/qemu/+bug/1818367/comments/4
This does sound like what we want, I have no idea right now how this works with plain qemu, whether flashrom supports it, or what it would take to add.
Originally posted by @JonathonHall-Purism in #1188 (comment)
The text was updated successfully, but these errors were encountered: