On 2/12/25 17:28, Zhao Liu wrote:
From: Philippe Mathieu-Daudé <[email protected]>
Now all calls of x86 machines to fw_cfg_init_io_dma() pass DMA
arguments, so the FWCfgState (FWCfgIoState) created by x86 machines
enables DMA by default.
Although other callers of fw_cfg_init_io_dma() besides x86 also pass
DMA arguments to create DMA-enabled FwCfgIoState, the "dma_enabled"
property of FwCfgIoState cannot yet be removed, because Sun4u and Sun4v
still create DMA-disabled FwCfgIoState (bypass fw_cfg_init_io_dma()) in
sun4uv_init() (hw/sparc64/sun4u.c).
Maybe reusing fw_cfg_init_io_dma() for them would be a better choice, or
adding fw_cfg_init_io_nodma(). However, before that, first simplify the
handling of FwCfgState in x86.
I answered these concerns here:
https://lore.kernel.org/qemu-devel/[email protected]/
Considering that FwCfgIoState in x86 enables DMA by default, remove the
handling for DMA-disabled cases and replace DMA checks with assertions
to ensure that the default DMA-enabled setting is not broken.
Then 'linuxboot.bin' isn't used anymore, and it will be removed in the
next commit.
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Zhao Liu <[email protected]>
---
Changes since v4:
* Keep "dma_enabled" property in fw_cfg_io_properties[].
* Replace DMA checks with assertions for x86 machines.
---
hw/i386/fw_cfg.c | 16 ++++++++--------
hw/i386/x86-common.c | 6 ++----
2 files changed, 10 insertions(+), 12 deletions(-)