diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2021-10-20 15:59:44 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2021-11-02 15:57:27 +0100 |
commit | 3ca8ce720f1be18ed3f13d28ef7c20704fdabffb (patch) | |
tree | 90b8e9d001bb9b778aa7f3d4c0e0f4df696a2f7a /hw/i386/multiboot.c | |
parent | 48972f8cad24eb4462c97ea68003e2dd35be0444 (diff) | |
download | qemu-3ca8ce720f1be18ed3f13d28ef7c20704fdabffb.zip qemu-3ca8ce720f1be18ed3f13d28ef7c20704fdabffb.tar.gz qemu-3ca8ce720f1be18ed3f13d28ef7c20704fdabffb.tar.bz2 |
target/i386: use DMA-enabled multiboot ROM for new-enough QEMU machine types
As long as fw_cfg supports DMA, the new ROM can be used also on older
machine types because it has the same size as the existing one.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/i386/multiboot.c')
-rw-r--r-- | hw/i386/multiboot.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/hw/i386/multiboot.c b/hw/i386/multiboot.c index 9e7d69d..0a10089 100644 --- a/hw/i386/multiboot.c +++ b/hw/i386/multiboot.c @@ -143,7 +143,8 @@ static void mb_add_mod(MultibootState *s, s->mb_mods_count++; } -int load_multiboot(FWCfgState *fw_cfg, +int load_multiboot(X86MachineState *x86ms, + FWCfgState *fw_cfg, FILE *f, const char *kernel_filename, const char *initrd_filename, @@ -151,6 +152,7 @@ int load_multiboot(FWCfgState *fw_cfg, int kernel_file_size, uint8_t *header) { + bool multiboot_dma_enabled = X86_MACHINE_GET_CLASS(x86ms)->fwcfg_dma_enabled; int i, is_multiboot = 0; uint32_t flags = 0; uint32_t mh_entry_addr; @@ -401,7 +403,11 @@ int load_multiboot(FWCfgState *fw_cfg, fw_cfg_add_bytes(fw_cfg, FW_CFG_INITRD_DATA, mb_bootinfo_data, sizeof(bootinfo)); - option_rom[nb_option_roms].name = "multiboot.bin"; + if (multiboot_dma_enabled) { + option_rom[nb_option_roms].name = "multiboot_dma.bin"; + } else { + option_rom[nb_option_roms].name = "multiboot.bin"; + } option_rom[nb_option_roms].bootindex = 0; nb_option_roms++; |