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é <phi...@linaro.org> > 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, > 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(). > > Note, we can not remove the equivalent in fw_cfg_mem_properties[] > because it is still used in HPPA and MIPS Loongson3 machines: > > $ git grep -w fw_cfg_init_mem_nodma > hw/hppa/machine.c:204: fw_cfg = fw_cfg_init_mem_nodma(addr, addr + 4, 1); > hw/mips/loongson3_virt.c:289: fw_cfg = fw_cfg_init_mem_nodma(cfg_addr, > cfg_addr + 8, 8); > > 'linuxboot.bin' isn't used anymore, we'll remove it in the > next commit. > > Signed-off-by: Philippe Mathieu-Daudé <phi...@linaro.org> > Reviewed-by: Zhao Liu <zhao1....@intel.com> > --- > hw/i386/fw_cfg.c | 5 +---- > hw/i386/x86-common.c | 5 +---- > hw/nvram/fw_cfg.c | 26 ++++++++------------------ > 3 files changed, 10 insertions(+), 26 deletions(-) > > diff --git a/hw/i386/fw_cfg.c b/hw/i386/fw_cfg.c > index 5c0bcd5f8a9..1fe084fd720 100644 > --- a/hw/i386/fw_cfg.c > +++ b/hw/i386/fw_cfg.c > @@ -221,10 +221,7 @@ void fw_cfg_add_acpi_dsdt(Aml *scope, FWCfgState *fw_cfg) > * of the i/o region used is FW_CFG_CTL_SIZE; when using DMA, the > * DMA control register is located at FW_CFG_DMA_IO_BASE + 4 > */ > - Object *obj = OBJECT(fw_cfg); > - uint8_t io_size = object_property_get_bool(obj, "dma_enabled", NULL) ? > - ROUND_UP(FW_CFG_CTL_SIZE, 4) + sizeof(dma_addr_t) : > - FW_CFG_CTL_SIZE; > + uint8_t io_size = ROUND_UP(FW_CFG_CTL_SIZE, 4) + sizeof(dma_addr_t); > Aml *dev = aml_device("FWCF"); > Aml *crs = aml_resource_template(); > > 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++; > } > > diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c > index 51b028b5d0a..ef976a4bce2 100644 > --- a/hw/nvram/fw_cfg.c > +++ b/hw/nvram/fw_cfg.c > @@ -1026,12 +1026,9 @@ FWCfgState *fw_cfg_init_io_dma(uint32_t iobase, > uint32_t dma_iobase, > FWCfgIoState *ios; > FWCfgState *s; > MemoryRegion *iomem = get_system_io(); > - bool dma_requested = dma_iobase && dma_as; > > + assert(dma_iobase);
Maybe a rebase nit? In v3, it is: assert(dma_iobase && dma_as); Others are fine for me.