On Wed, 3 Jun 2026 at 08:08, Philippe Mathieu-Daudé <[email protected]> wrote:
>
> On 29/5/26 19:46, Peter Maydell wrote:
> > The fw_cfg_init_io_dma() function allows the caller to specify the
> > base port number of the selector/data register and the base port
> > number of the DMA address register separately. No caller actually
> > uses this: they all pass in base + 4 for the dma_iobase.
> >
> > To reduce the risk of unnecessary variation in what different x86
> > machine types use as their fw_cfg register layout, remove the
> > dma_iobase argument from fw_cfg_init_io_dma(), and have the function
> > always use the same "DMA port is base port + 4" layout.
> >
> > Signed-off-by: Peter Maydell <[email protected]>
> > ---
> >   hw/i386/fw_cfg.c          |  3 +--
> >   hw/i386/microvm.c         |  3 +--
> >   hw/i386/pc.c              |  3 +--
> >   hw/nvram/fw_cfg.c         |  8 ++++----
> >   include/hw/nvram/fw_cfg.h | 17 +++++++++++++++--
> >   5 files changed, 22 insertions(+), 12 deletions(-)
>
>
> > diff --git a/include/hw/nvram/fw_cfg.h b/include/hw/nvram/fw_cfg.h
> > index 45a3747908..be3fb5f8aa 100644
> > --- a/include/hw/nvram/fw_cfg.h
> > +++ b/include/hw/nvram/fw_cfg.h
> > @@ -305,8 +305,21 @@ bool fw_cfg_add_file_from_generator(FWCfgState *s,
> >                                       Object *parent, const char *part,
> >                                       const char *filename, Error **errp);
> >
> > -FWCfgState *fw_cfg_init_io_dma(uint32_t iobase, uint32_t dma_iobase,
> > -                                AddressSpace *dma_as);
> > +/**
> > + * fw_cfg_init_io_dma:
> > + * @iobase: x86 port number which is the base of the fw_cfg port range
>
> s/x86/ISA/?

This is specifically x86, because we use this where we're
wiring fw_cfg up to the x86 in/out port instructions. There's
no ISA-bus version of fw_cfg. Anything other than x86 should
be using the memory-mapped fw_cfg.

-- PMM

Reply via email to