Skip to content

Commit

Permalink
i386: load kernel on xen using DMA
Browse files Browse the repository at this point in the history
Kernel on Xen is loaded via fw_cfg. Previously it used non-DMA version,
which loaded the kernel (and initramfs) byte by byte. Change this
to DMA, to load in bigger chunks.
This change alone reduces load time of a (big) kernel+initramfs from
~10s down to below 1s.

This change was suggested initially here:
https://lore.kernel.org/xen-devel/20180216204031.000052e9@gmail.com/
Apparently this alone is already enough to get massive speedup.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
Message-Id: <20210426034709.595432-1-marmarek@invisiblethingslab.com>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
  • Loading branch information
marmarek authored and anthonyper-ctx committed Mar 12, 2024
1 parent 9253d83 commit 918a7f7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hw/i386/pc.c
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,8 @@ void xen_load_linux(PCMachineState *pcms)

assert(MACHINE(pcms)->kernel_filename != NULL);

fw_cfg = fw_cfg_init_io(FW_CFG_IO_BASE);
fw_cfg = fw_cfg_init_io_dma(FW_CFG_IO_BASE, FW_CFG_IO_BASE + 4,
&address_space_memory);
fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, x86ms->boot_cpus);
rom_set_fw(fw_cfg);

Expand Down

0 comments on commit 918a7f7

Please sign in to comment.