From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: David Edmondson <dme@dme.org>, qemu-block@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com>
Subject: Re: [RFC PATCH 0/3] hw/pflash_cfi01: Reduce memory consumption when flash image is smaller than region
Date: Tue, 16 Feb 2021 16:44:58 +0100 [thread overview]
Message-ID: <fcff2ad0-0280-f78f-c563-5e18ec37f800@redhat.com> (raw)
In-Reply-To: <cunh7mcjaw3.fsf@dme.org>
On 2/16/21 4:22 PM, David Edmondson wrote:
> On Tuesday, 2021-02-16 at 16:03:05 +01, Philippe Mathieu-Daudé wrote:
>
>> I am not a block expert, but I wonder if something like this could
>> be used:
>>
>> - create a raw (parent) block image of 64MiB
>>
>> - add a raw (child) block with your 768kB of VARS file
>>
>> - add a null-co (child) block of 63Mib + 256kiB
>>
>> - pass the parent block to the pflash device
>
> I'm not clear how this would behave if there is a write to the device at
> (say) 1MiB.
Discarded.
> More philosophically, how should it behave?
null-co: reads return zeroes, writes are discarded.
> My expectation was that if the machine says that there is 64MiB of
> writable flash, we have to allow writes throughout the full 64MiB and
> (significantly) persist them to the backing block device.
>
> Just because the backing block device started out 768KiB big doesn't
> mean that we should not write to the remaining extent if that's what the
> VM attempts.
>
> Would the above approach achieve that? (It doesn't sound like it.)
Well this was a simple suggestion if you know your guest won't access
anything beside these 768KiB (IIRC AAVMF "consumes" the flash devices
and doesn't expose them to the guest via ACPI/other).
If you are into memory optimization, this is worth considering.
Else it doesn't make sense.
AAVMF is designed for virtual world. Is the virtual world interested in
doing firmware upgrade on the CODE flash? Unlikely, if you want to
upgrade AAVMF you'd do it on the host. Why not mount the CODE flash as
ROM? I suppose because AAVMF does CFI MMIO accesses to detect the flash,
but I wonder what is the point if this flash will be ever written...
Regards,
Phil.
next prev parent reply other threads:[~2021-02-16 15:47 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-16 14:27 [RFC PATCH 0/3] hw/pflash_cfi01: Reduce memory consumption when flash image is smaller than region David Edmondson
2021-02-16 14:27 ` [RFC PATCH 1/3] hw/pflash_cfi*: Replace DPRINTF with trace events David Edmondson
2021-02-16 14:27 ` [RFC PATCH 2/3] hw/pflash_cfi01: Correct the type of PFlashCFI01.ro David Edmondson
2021-02-16 14:27 ` [RFC PATCH 3/3] hw/pflash_cfi01: Allow read-only devices to have a smaller backing device David Edmondson
2021-02-16 15:03 ` [RFC PATCH 0/3] hw/pflash_cfi01: Reduce memory consumption when flash image is smaller than region Philippe Mathieu-Daudé
2021-02-16 15:22 ` David Edmondson
2021-02-16 15:44 ` Philippe Mathieu-Daudé [this message]
2021-02-16 15:53 ` David Edmondson
2021-02-18 10:34 ` David Edmondson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fcff2ad0-0280-f78f-c563-5e18ec37f800@redhat.com \
--to=philmd@redhat.com \
--cc=dme@dme.org \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).