mirror of
https://github.com/xemu-project/xemu.git
synced 2024-11-23 11:39:53 +00:00
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>
This commit is contained in:
parent
48972f8cad
commit
3ca8ce720f
@ -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++;
|
||||
|
||||
|
@ -2,8 +2,10 @@
|
||||
#define QEMU_MULTIBOOT_H
|
||||
|
||||
#include "hw/nvram/fw_cfg.h"
|
||||
#include "hw/i386/x86.h"
|
||||
|
||||
int load_multiboot(FWCfgState *fw_cfg,
|
||||
int load_multiboot(X86MachineState *x86ms,
|
||||
FWCfgState *fw_cfg,
|
||||
FILE *f,
|
||||
const char *kernel_filename,
|
||||
const char *initrd_filename,
|
||||
|
@ -780,7 +780,8 @@ void xen_load_linux(PCMachineState *pcms)
|
||||
assert(!strcmp(option_rom[i].name, "linuxboot.bin") ||
|
||||
!strcmp(option_rom[i].name, "linuxboot_dma.bin") ||
|
||||
!strcmp(option_rom[i].name, "pvh.bin") ||
|
||||
!strcmp(option_rom[i].name, "multiboot.bin"));
|
||||
!strcmp(option_rom[i].name, "multiboot.bin") ||
|
||||
!strcmp(option_rom[i].name, "multiboot_dma.bin"));
|
||||
rom_add_option(option_rom[i].name, option_rom[i].bootindex);
|
||||
}
|
||||
x86ms->fw_cfg = fw_cfg;
|
||||
|
@ -814,7 +814,7 @@ void x86_load_linux(X86MachineState *x86ms,
|
||||
* PVH), so we try multiboot first since we check the multiboot magic
|
||||
* header before to load it.
|
||||
*/
|
||||
if (load_multiboot(fw_cfg, f, kernel_filename, initrd_filename,
|
||||
if (load_multiboot(x86ms, fw_cfg, f, kernel_filename, initrd_filename,
|
||||
kernel_cmdline, kernel_size, header)) {
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user