ARM: reduce the memory consumed when mapping UEFI flash images
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest5 patches 0 repliesNew
- v1 RFC5 patches 11 repliesSuperseded
Changes in v2 from the cover letter
- quote the block device name in error messages (Philippe Mathieu-Daudé).
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | hw/block: blk_check_size_and_read_all should report backend namehw/ | +7 | 0 replies | |
| 2/5 | hw/block: Flash images can be smaller than the devicehw/ | +8 | 0 replies | |
| 3/5 | hw/arm: Convert assertions about flash image size to error_reporthw/ | +14 | 0 replies | |
| 4/5 | hw/arm: Flash image mapping follows image sizehw/ hw/ hw/ +1 more | +60 | 0 replies | |
| 5/5 | hw/arm: Only minimise flash size on older machineshw/ hw/ include/ | +60 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH v2 0/5] ARM: reduce the memory consumed when mapping UEFI flash images
Currently ARM UEFI images are built as 2MB/768kB flash images for code and variables respectively. These images are both then padded out to 64MB before being loaded by QEMU.
Because the images are 64MB each, QEMU allocates 128MB of memory to read them, and then proceeds to read all 128MB from disk (dirtying the memory). Of this 128MB less than 3MB is useful - the rest is zero padding.
On a machine with 100 VMs this wastes over 12GB of memory.
This set of patches aims to reclaim the wasted memory by allowing QEMU to respect the size of the flash images and allocate only the necessary memory. This will, of course, require that the flash build process be modified to avoid padding the images to 64MB.
Because older machine types expected the full 128MB reserved for flash to be occupied, do so for machine types older than virt-5.2. The changes are beneficial even in this case, because while the full 128MB of memory is allocated, only that required to actually load the flash images from disk is dirtied.
v2:
- quote the block device name in error messages (Philippe Mathieu-Daudé).
David Edmondson (5):
hw/block: blk_check_size_and_read_all should report backend name hw/block: Flash images can be smaller than the device hw/arm: Convert assertions about flash image size to error_report hw/arm: Flash image mapping follows image size
hw/arm: Only minimise flash size on older machines
hw/arm/trace-events | 2 + hw/arm/virt-acpi-build.c | 30 ++++++++------ hw/arm/virt.c | 86 +++++++++++++++++++++++++++++----------- hw/block/block.c | 26 ++++++------ include/hw/arm/virt.h | 2 + 5 files changed, 97 insertions(+), 49 deletions(-)
Signature · 1 line
2.29.2