emulation/qemu-i440fx,q35: avoid writing to ROM

libcbfs has a workaround to avoid writing to ROM areas:

        /* Hacky way to not load programs over read only media. The stages
         * that would hit this path initialize themselves. */
        if ((ENV_BOOTBLOCK || ENV_SEPARATE_VERSTAGE) &&
            !CONFIG(NO_XIP_EARLY_STAGES) && CONFIG(BOOT_DEVICE_MEMORY_MAPPED)) {

This workaround is not triggered in QEMU, because
BOOT_DEVICE_MEMORY_MAPPED is only selected for SPI boot devices. This
results in confusing (to the VMM developer) writes to read-only
memory.

As far as I can tell, this issue is weird but harmless, because the
code does memcpy to ROM with source == destination. The concensus in
the mailing list thread [1] was that it's worthwhile to be fixed
regardless.

[1] https://mail.coreboot.org/hyperkitty/list/coreboot@coreboot.org/message/KDI6YQCPXSQF4NDUAAC7TIXQKSZ6T4X7/

Change-Id: I5cefbc31f917021236105f7dc969118d612ac399
Signed-off-by: Julian Stecklina <julian.stecklina@cyberus-technology.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59474
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
This commit is contained in:
Julian Stecklina 2021-11-18 17:16:45 +01:00 committed by Patrick Georgi
parent f1dbd67381
commit 15235b2d89
2 changed files with 2 additions and 0 deletions

View File

@ -16,6 +16,7 @@ config BOARD_SPECIFIC_OPTIONS
select HAVE_ASAN_IN_ROMSTAGE
select NO_SMM
select BOOT_DEVICE_NOT_SPI_FLASH
select BOOT_DEVICE_MEMORY_MAPPED
config VBOOT
select VBOOT_MUST_REQUEST_DISPLAY

View File

@ -16,6 +16,7 @@ config BOARD_SPECIFIC_OPTIONS
select MAINBOARD_HAS_CHROMEOS
select SOUTHBRIDGE_INTEL_COMMON_ACPI_MADT
select BOOT_DEVICE_NOT_SPI_FLASH
select BOOT_DEVICE_MEMORY_MAPPED
config VBOOT
select VBOOT_MUST_REQUEST_DISPLAY