From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
qemu-devel@nongnu.org, lersek@redhat.com, somlo@cmu.edu,
ehabkost@redhat.com, mst@redhat.com, pbonzini@redhat.com,
rjones@redhat.com, imammedo@redhat.com, peter.maydell@linaro.org
Subject: Re: [Qemu-devel] [PATCHv6 2/5] fw_cfg: move setting of FW_CFG_VERSION_DMA bit to fw_cfg_init1()
Date: Tue, 20 Jun 2017 00:18:49 -0300 [thread overview]
Message-ID: <36f76b27-f90a-ab22-76dd-4024d34ee31a@amsat.org> (raw)
In-Reply-To: <1497877149-19253-3-git-send-email-mark.cave-ayland@ilande.co.uk>
On 06/19/2017 09:59 AM, Mark Cave-Ayland wrote:
> The setting of the FW_CFG_VERSION_DMA bit is the same across both the
> TYPE_FW_CFG_MEM and TYPE_FW_CFG_IO devices, so unify the logic in
> fw_cfg_init1().
>
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
> Tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> hw/nvram/fw_cfg.c | 16 +++++++---------
> 1 file changed, 7 insertions(+), 9 deletions(-)
>
> diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
> index 4e4f71a..99bdbc2 100644
> --- a/hw/nvram/fw_cfg.c
> +++ b/hw/nvram/fw_cfg.c
> @@ -913,6 +913,7 @@ static void fw_cfg_init1(DeviceState *dev)
> {
> FWCfgState *s = FW_CFG(dev);
> MachineState *machine = MACHINE(qdev_get_machine());
> + uint32_t version = FW_CFG_VERSION;
>
> assert(!object_resolve_path(FW_CFG_PATH, NULL));
>
> @@ -927,6 +928,12 @@ static void fw_cfg_init1(DeviceState *dev)
> fw_cfg_bootsplash(s);
> fw_cfg_reboot(s);
>
> + if (s->dma_enabled) {
> + version |= FW_CFG_VERSION_DMA;
> + }
> +
> + fw_cfg_add_i32(s, FW_CFG_ID, version);
> +
> s->machine_ready.notify = fw_cfg_machine_ready;
> qemu_add_machine_init_done_notifier(&s->machine_ready);
> }
> @@ -938,7 +945,6 @@ FWCfgState *fw_cfg_init_io_dma(uint32_t iobase, uint32_t dma_iobase,
> SysBusDevice *sbd;
> FWCfgIoState *ios;
> FWCfgState *s;
> - uint32_t version = FW_CFG_VERSION;
> bool dma_requested = dma_iobase && dma_as;
>
> dev = qdev_create(NULL, TYPE_FW_CFG_IO);
> @@ -959,12 +965,8 @@ FWCfgState *fw_cfg_init_io_dma(uint32_t iobase, uint32_t dma_iobase,
> s->dma_as = dma_as;
> s->dma_addr = 0;
> sysbus_add_io(sbd, dma_iobase, &s->dma_iomem);
> -
> - version |= FW_CFG_VERSION_DMA;
> }
>
> - fw_cfg_add_i32(s, FW_CFG_ID, version);
> -
> return s;
> }
>
> @@ -980,7 +982,6 @@ FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr,
> DeviceState *dev;
> SysBusDevice *sbd;
> FWCfgState *s;
> - uint32_t version = FW_CFG_VERSION;
> bool dma_requested = dma_addr && dma_as;
>
> dev = qdev_create(NULL, TYPE_FW_CFG_MEM);
> @@ -1001,11 +1002,8 @@ FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr,
> s->dma_as = dma_as;
> s->dma_addr = 0;
> sysbus_mmio_map(sbd, 2, dma_addr);
> - version |= FW_CFG_VERSION_DMA;
> }
>
> - fw_cfg_add_i32(s, FW_CFG_ID, version);
> -
> return s;
> }
>
>
next prev parent reply other threads:[~2017-06-20 3:19 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-19 12:59 [Qemu-devel] [PATCHv6 0/5] fw_cfg: qdev-related tidy-ups Mark Cave-Ayland
2017-06-19 12:59 ` [Qemu-devel] [PATCHv6 1/5] fw_cfg: don't map the fw_cfg IO ports in fw_cfg_io_realize() Mark Cave-Ayland
2017-06-19 14:10 ` Eduardo Habkost
2017-06-19 12:59 ` [Qemu-devel] [PATCHv6 2/5] fw_cfg: move setting of FW_CFG_VERSION_DMA bit to fw_cfg_init1() Mark Cave-Ayland
2017-06-19 14:11 ` Eduardo Habkost
2017-06-20 3:18 ` Philippe Mathieu-Daudé [this message]
2017-06-19 12:59 ` [Qemu-devel] [PATCHv6 3/5] fw_cfg: move assert() and linking of fw_cfg device to the machine into instance_init() Mark Cave-Ayland
2017-06-19 14:28 ` Eduardo Habkost
2017-06-19 14:56 ` Laszlo Ersek
2017-06-19 16:57 ` Mark Cave-Ayland
2017-06-19 17:09 ` Laszlo Ersek
2017-06-19 18:49 ` Mark Cave-Ayland
2017-06-19 22:43 ` Laszlo Ersek
2017-06-21 6:58 ` Mark Cave-Ayland
2017-06-21 7:48 ` Laszlo Ersek
2017-06-21 11:36 ` Eduardo Habkost
2017-06-21 12:17 ` Mark Cave-Ayland
2017-06-21 13:23 ` Eduardo Habkost
2017-06-23 8:12 ` Mark Cave-Ayland
2017-06-23 11:50 ` Eduardo Habkost
2017-06-23 15:52 ` Laszlo Ersek
2017-06-23 16:10 ` Eduardo Habkost
2017-06-23 16:48 ` Laszlo Ersek
2017-06-23 18:50 ` Eduardo Habkost
2017-06-25 18:58 ` Mark Cave-Ayland
2017-06-27 0:49 ` Eduardo Habkost
2017-06-28 7:09 ` Mark Cave-Ayland
2017-06-28 14:12 ` Igor Mammedov
2017-06-28 14:21 ` Laszlo Ersek
2017-06-28 15:31 ` Igor Mammedov
2017-06-29 12:12 ` Mark Cave-Ayland
2017-06-19 12:59 ` [Qemu-devel] [PATCHv6 4/5] fw_cfg: move qdev_init_nofail() from fw_cfg_init1() to callers Mark Cave-Ayland
2017-06-19 12:59 ` [Qemu-devel] [PATCHv6 5/5] fw_cfg: move QOM type defines and fw_cfg types into fw_cfg.h Mark Cave-Ayland
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=36f76b27-f90a-ab22-76dd-4024d34ee31a@amsat.org \
--to=f4bug@amsat.org \
--cc=ehabkost@redhat.com \
--cc=imammedo@redhat.com \
--cc=lersek@redhat.com \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=rjones@redhat.com \
--cc=somlo@cmu.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).