Module devices::pflash

source ·
Expand description

Programmable flash device that supports the minimum interface that OVMF requires. This is purpose-built to allow OVMF to store UEFI variables in the same way that it stores them on QEMU.

For that reason it’s heavily based on QEMU’s pflash implementation, while taking even more shortcuts, chief among them being the complete lack of CFI tables, which systems would normally use to learn how to use the device.

In addition to full-width reads, we only support single byte writes, block erases, and status requests, which OVMF uses to probe the device to determine if it is pflash.

Note that without SMM support in crosvm (which it doesn’t yet have) this device is directly accessible to potentially malicious kernels. With SMM and the appropriate changes to this device this could be made more secure by ensuring only the BIOS is able to touch the pflash.

Structs

Enums

Constants

Functions