[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCHv2 1/4] fw_cfg: don't map the fw_cfg IO ports in
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCHv2 1/4] fw_cfg: don't map the fw_cfg IO ports in fw_cfg_io_realize() |
Date: |
Wed, 14 Jun 2017 14:34:38 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 |
On 12/06/2017 23:21, Mark Cave-Ayland wrote:
> As indicated by Laszlo it is a QOM bug for the realize() method to actually
> map the device. Set up the IO regions with sysbus_init_mmio() and defer
> the mapping to the caller, as already done in fw_cfg_init_mem_wide().
... sort of.
The idea is that the ISA bridge (including all the legacy I/O devices,
of which fw_cfg part) does subtractive decoding, i.e. "if nobody else
wants it, I'll take it". So that's why fw_cfg's realize() maps I/O
ports, and why the API is sysbus_add_io.
Sysbus MMIO maps a different hardware concept, where the "base" is
decoded by the SoC and forwarded to the component at that address. This
is represented by the sysbus_init_mmio/sysbus_mmio_map pair.
Documentation for this would be welcome, but sysbus.h doesn't have many
function comments. :(
Paolo
- [Qemu-devel] [PATCHv2 0/4] fw_cfg: qdev-related tidy-ups, Mark Cave-Ayland, 2017/06/12
- [Qemu-devel] [PATCHv2 4/4] fw_cfg: move QOM type defines into fw_cfg.h, Mark Cave-Ayland, 2017/06/12
- [Qemu-devel] [PATCHv2 1/4] fw_cfg: don't map the fw_cfg IO ports in fw_cfg_io_realize(), Mark Cave-Ayland, 2017/06/12
- [Qemu-devel] [PATCHv2 2/4] fw_cfg: move setting of FW_CFG_VERSION_DMA bit to fw_cfg_init1(), Mark Cave-Ayland, 2017/06/12
- [Qemu-devel] [PATCHv2 3/4] fw_cfg: move qdev_init_nofail() from fw_cfg_init1() to callers, Mark Cave-Ayland, 2017/06/12
- Re: [Qemu-devel] [PATCHv2 0/4] fw_cfg: qdev-related tidy-ups, Paolo Bonzini, 2017/06/14