On Thu, May 08, 2025 at 03:35:32PM +0200, Philippe Mathieu-Daudé wrote:
> Date: Thu, 8 May 2025 15:35:32 +0200
> From: Philippe Mathieu-Daudé <[email protected]>
> Subject: [PATCH v4 09/27] hw/nvram/fw_cfg: Remove
> fw_cfg_io_properties::dma_enabled
> X-Mailer: git-send-email 2.47.1
>
> Now than all calls to fw_cfg_init_io_dma() pass DMA arguments,
Yes,
> the 'dma_enabled' of the TYPE_FW_CFG_IO type is not used anymore.
> Remove it, simplifying fw_cfg_init_io_dma() and fw_cfg_io_realize().
but the 'dma_enabled' of the TYPE_FW_CFG_IO type is still used in
hw/sparc64/sun4u.c:
dev = qdev_new(TYPE_FW_CFG_IO);
qdev_prop_set_bit(dev, "dma_enabled", false);
The creation of TYPE_FW_CFG_IO is similar to fw_cfg_init_io_dma(), but
it still has little difference so I find sun4uv can't use
fw_cfg_init_io_dma() directly for now, or it may require more careful
clarification that it can use fw_cfg_init_io_dma().
So, at least we have to keep "dma_enabled" property in
fw_cfg_io_properties[].
...
> diff --git a/hw/i386/x86-common.c b/hw/i386/x86-common.c
> index 27254a0e9f1..ee594364415 100644
> --- a/hw/i386/x86-common.c
> +++ b/hw/i386/x86-common.c
> @@ -991,10 +991,7 @@ void x86_load_linux(X86MachineState *x86ms,
> }
>
> option_rom[nb_option_roms].bootindex = 0;
> - option_rom[nb_option_roms].name = "linuxboot.bin";
> - if (fw_cfg_dma_enabled(fw_cfg)) {
> - option_rom[nb_option_roms].name = "linuxboot_dma.bin";
> - }
> + option_rom[nb_option_roms].name = "linuxboot_dma.bin";
> nb_option_roms++;
> }
But now all x86 machines have enabled dma, so it's still possible to
drop "linuxboot.bin".
For this, I think we could add a DMA check in the x86 common code to
guarantee DMA is enabled and then we won't need to constantly check
DMA enable in every corner.
Regards,
Zhao