qemu/hw/i386
Bernhard Beschow a44ea3fa7f hw/i386/pc_sysfw: Alias rather than copy isa-bios region
In the -bios case the "isa-bios" memory region is an alias to the BIOS mapped
to the top of the 4G memory boundary. Do the same in the -pflash case, but only
for new machine versions for migration compatibility. This establishes common
behavior and makes pflash commands work in the "isa-bios" region which some
real-world legacy bioses rely on.

Note that in the sev_enabled() case, the "isa-bios" memory region in the -pflash
case will now also point to encrypted memory, just like it already does in the
-bios case.

When running `info mtree` before and after this commit with
`qemu-system-x86_64 -S -drive \
if=pflash,format=raw,readonly=on,file=/usr/share/qemu/bios-256k.bin` and running
`diff -u before.mtree after.mtree` results in the following changes in the
memory tree:

   --- before.mtree
   +++ after.mtree
   @@ -71,7 +71,7 @@
        0000000000000000-ffffffffffffffff (prio -1, i/o): pci
        00000000000a0000-00000000000bffff (prio 1, i/o): vga-lowmem
        00000000000c0000-00000000000dffff (prio 1, rom): pc.rom
   -      00000000000e0000-00000000000fffff (prio 1, rom): isa-bios
   +      00000000000e0000-00000000000fffff (prio 1, romd): alias isa-bios @system.flash0 0000000000020000-000000000003ffff
        00000000000a0000-00000000000bffff (prio 1, i/o): alias smram-region @pci 00000000000a0000-00000000000bffff
        00000000000c0000-00000000000c3fff (prio 1, i/o): alias pam-pci @pci 00000000000c0000-00000000000c3fff
        00000000000c4000-00000000000c7fff (prio 1, i/o): alias pam-pci @pci 00000000000c4000-00000000000c7fff
   @@ -108,7 +108,7 @@
        0000000000000000-ffffffffffffffff (prio -1, i/o): pci
        00000000000a0000-00000000000bffff (prio 1, i/o): vga-lowmem
        00000000000c0000-00000000000dffff (prio 1, rom): pc.rom
   -      00000000000e0000-00000000000fffff (prio 1, rom): isa-bios
   +      00000000000e0000-00000000000fffff (prio 1, romd): alias isa-bios @system.flash0 0000000000020000-000000000003ffff
        00000000000a0000-00000000000bffff (prio 1, i/o): alias smram-region @pci 00000000000a0000-00000000000bffff
        00000000000c0000-00000000000c3fff (prio 1, i/o): alias pam-pci @pci 00000000000c0000-00000000000c3fff
        00000000000c4000-00000000000c7fff (prio 1, i/o): alias pam-pci @pci 00000000000c4000-00000000000c7fff
   @@ -131,11 +131,14 @@
   memory-region: pc.ram
   0000000000000000-0000000007ffffff (prio 0, ram): pc.ram

   +memory-region: system.flash0
   +  00000000fffc0000-00000000ffffffff (prio 0, romd): system.flash0
   +
   memory-region: pci
   0000000000000000-ffffffffffffffff (prio -1, i/o): pci
        00000000000a0000-00000000000bffff (prio 1, i/o): vga-lowmem
        00000000000c0000-00000000000dffff (prio 1, rom): pc.rom
   -    00000000000e0000-00000000000fffff (prio 1, rom): isa-bios
   +    00000000000e0000-00000000000fffff (prio 1, romd): alias isa-bios @system.flash0 0000000000020000-000000000003ffff

   memory-region: smram
        00000000000a0000-00000000000bffff (prio 0, ram): alias smram-low @pc.ram 00000000000a0000-00000000000bffff

Note that in both cases the "system" memory region contains the entry

  00000000fffc0000-00000000ffffffff (prio 0, romd): system.flash0

but the "system.flash0" memory region only appears standalone when "isa-bios" is
an alias.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Message-ID: <20240508175507.22270-7-shentey@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2024-05-22 15:53:30 +02:00
..
kvm hw/xen_evtchn: Initialize flush_kvm_routes 2024-04-02 16:15:07 +02:00
xen memory: Add Error** argument to the global_dirty_log routines 2024-04-23 18:36:01 -04:00
acpi-build.c hw/i386/acpi-build: Add support for SRAT Generic Initiator structures 2024-03-12 17:56:55 -04:00
acpi-build.h hw/acpi/ich9: Enable ACPI PCI hot-plug 2021-07-16 04:33:35 -04:00
acpi-common.c hw/i386/acpi: Set PCAT_COMPAT bit only when pic is not disabled 2024-04-23 17:35:25 +02:00
acpi-common.h hw/i386/acpi: Declare pc_madt_cpu_entry() in 'acpi-common.h' 2024-02-20 20:34:21 +03:00
acpi-microvm.c hw/i386/acpi-microvm.c: Use common function to add virtio in DSDT 2024-01-10 18:47:46 +10:00
acpi-microvm.h microvm/acpi: add minimal acpi support 2020-09-17 14:16:19 +02:00
amd_iommu-stub.c amd_iommu: report x2APIC support to the operating system 2024-02-14 06:09:32 -05:00
amd_iommu.c hw/i386/pc: Rename "bus" attribute to "pcibus" 2024-02-27 09:37:30 +01:00
amd_iommu.h amd_iommu: report x2APIC support to the operating system 2024-02-14 06:09:32 -05:00
e820_memory_layout.c hw/i386/e820: remove legacy reserved entries for e820 2022-11-02 06:56:31 -04:00
e820_memory_layout.h hw/i386/e820: remove legacy reserved entries for e820 2022-11-02 06:56:31 -04:00
fw_cfg.c i386: correctly select code in hw/i386 that depends on other components 2024-05-10 15:45:15 +02:00
fw_cfg.h smbios: get rid of global smbios_ep_type 2024-03-18 08:42:45 -04:00
intel_iommu_internal.h intel-iommu: Report interrupt remapping faults, fix return value 2023-10-22 05:18:17 -04:00
intel_iommu.c hw/i386/pc: Rename "bus" attribute to "pcibus" 2024-02-27 09:37:30 +01:00
Kconfig kconfig: express dependency of individual boards on libfdt 2024-05-10 15:45:15 +02:00
meson.build hw/i386: move rtc-reset-reinjection command out of hw/rtc 2024-05-10 15:45:15 +02:00
microvm-dt.c hw/rtc/mc146818rtc: QOM'ify io_base offset 2022-06-11 11:44:50 +02:00
microvm-dt.h microvm: add device tree support. 2021-11-02 17:24:17 +01:00
microvm.c hw/i386: Have x86_bios_rom_init() take X86MachineState rather than MachineState 2024-05-08 19:43:23 +02:00
monitor.c hw/i386: move rtc-reset-reinjection command out of hw/rtc 2024-05-10 15:45:15 +02:00
multiboot.c bulk: Rename TARGET_FMT_plx -> HWADDR_FMT_plx 2023-01-18 11:14:34 +01:00
multiboot.h target/i386: use DMA-enabled multiboot ROM for new-enough QEMU machine types 2021-11-02 15:57:27 +01:00
pc_piix.c hw/i386/pc_sysfw: Alias rather than copy isa-bios region 2024-05-22 15:53:30 +02:00
pc_q35.c hw/i386/pc_sysfw: Alias rather than copy isa-bios region 2024-05-22 15:53:30 +02:00
pc_sysfw_ovmf-stubs.c hw/i386: Introduce X86_FW_OVMF Kconfig symbol 2021-07-14 22:28:58 +02:00
pc_sysfw_ovmf.c hw/i386: Replace magic number with field length calculation 2022-03-06 05:08:23 -05:00
pc_sysfw.c hw/i386/pc_sysfw: Alias rather than copy isa-bios region 2024-05-22 15:53:30 +02:00
pc.c hw/i386/pc_sysfw: Alias rather than copy isa-bios region 2024-05-22 15:53:30 +02:00
port92.c hw/i386/port92: Add missing 'hw/isa/isa.h' header 2024-02-20 20:34:21 +03:00
sgx-epc.c Mark remaining global TypeInfo instances as const 2022-02-21 13:30:20 +00:00
sgx-stub.c target/i386: the sgx_epc_get_section stub is reachable 2023-12-31 09:11:27 +01:00
sgx.c hw/i386/sgx: Use QDev API 2024-02-27 09:37:30 +01:00
trace-events vmmouse: replace DPRINTF with tracing 2023-09-12 10:37:01 +04:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
vapic.c hw/i386: Rename kvmvapic.c -> vapic.c 2024-03-09 18:51:45 +01:00
vmmouse.c hw/i386: Constify VMState 2023-12-29 11:17:30 +11:00
vmport.c Do not include cpu.h if it's not really necessary 2021-05-02 17:24:51 +02:00
x86-common.c hw/i386: split x86.c in multiple parts 2024-05-10 15:45:15 +02:00
x86-cpu.c hw/i386: split x86.c in multiple parts 2024-05-10 15:45:15 +02:00
x86-iommu-stub.c hw/i386/pc: Remove x86_iommu_get_type() 2021-11-01 18:49:10 -04:00
x86-iommu.c hw/i386/pc: Rename "bus" attribute to "pcibus" 2024-02-27 09:37:30 +01:00
x86.c hw/i386: split x86.c in multiple parts 2024-05-10 15:45:15 +02:00