
On Mon, 28 Jan 2019 at 12:40, Gerd Hoffmann <kraxel@redhat.com> wrote:
The tricky part is the access control here. On physical hardware you typically have one flash rom, say 16M below 4G (on x86).
Our pflash device doesn't allow to define multiple regions, so we use multiple pflash devices instead, each with different access permissions (code vs. vars). Because of that they are more dynamic than they are on phyiscal hardware, x86 sizes them according to the size of the firmware images (arm is easier here, we have fixed size and location no matter how big the firmware images are).
So I think the options we have are: (a) leave pflash as-is, which pretty much implies physaddr and size must be user-configurable. (b) add support for multiple regions to pflash, so one can attach multiple blockdev at different offsets to a single pflash device.
The latter makes more sense to me -- we should model what the hardware actually has, because the guest can tell the difference. (Migration compat is left as an exercise for the reader :-)) thanks -- PMM