From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44198) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zd25W-0007rP-0y for qemu-devel@nongnu.org; Fri, 18 Sep 2015 16:16:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zd25S-0004Ek-On for qemu-devel@nongnu.org; Fri, 18 Sep 2015 16:16:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55950) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zd25S-0004Ec-K3 for qemu-devel@nongnu.org; Fri, 18 Sep 2015 16:16:50 -0400 References: <1442566703-5091-1-git-send-email-markmb@redhat.com> <1442566729-5133-1-git-send-email-markmb@redhat.com> <1442566729-5133-5-git-send-email-markmb@redhat.com> From: Laszlo Ersek Message-ID: <55FC712E.2000306@redhat.com> Date: Fri, 18 Sep 2015 22:16:46 +0200 MIME-Version: 1.0 In-Reply-To: <1442566729-5133-5-git-send-email-markmb@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v3 4/5] Enable fw_cfg DMA interface for ARM List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Marc_Mar=c3=ad?= , qemu-devel@nongnu.org Cc: Stefan Hajnoczi , Drew , Kevin O'Connor , Gerd Hoffmann On 09/18/15 10:58, Marc Mar=C3=AD wrote: > Enable the fw_cfg DMA interface for the ARM virt machine. >=20 > Based on Gerd Hoffman's initial implementation. >=20 > Signed-off-by: Marc Mar=C3=AD > --- > hw/arm/virt.c | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) >=20 > diff --git a/hw/arm/virt.c b/hw/arm/virt.c > index 3568107..47f4ad3 100644 > --- a/hw/arm/virt.c > +++ b/hw/arm/virt.c > @@ -113,7 +113,7 @@ static const MemMapEntry a15memmap[] =3D { > [VIRT_GIC_V2M] =3D { 0x08020000, 0x00001000 }, > [VIRT_UART] =3D { 0x09000000, 0x00001000 }, > [VIRT_RTC] =3D { 0x09010000, 0x00001000 }, > - [VIRT_FW_CFG] =3D { 0x09020000, 0x0000000a }, > + [VIRT_FW_CFG] =3D { 0x09020000, 0x00000014 }, Okay, Laszlo is the hateful reviewer. Sorry about that. I'm late, yes. But: this says 0x00000014, ie 20 bytes in decimal. I don't think that's correct; it should be 0x18 -- 24 bytes in decimal. From patch #2: "DMA Address address: Base + 16 (8 bytes)". Thanks (and I'm sorry about being late!) Laszlo > [VIRT_MMIO] =3D { 0x0a000000, 0x00000200 }, > /* ...repeating for a total of NUM_VIRTIO_TRANSPORTS, each of that= size */ > [VIRT_PLATFORM_BUS] =3D { 0x0c000000, 0x02000000 }, > @@ -651,13 +651,13 @@ static void create_flash(const VirtBoardInfo *vbi= ) > g_free(nodename); > } > =20 > -static void create_fw_cfg(const VirtBoardInfo *vbi) > +static void create_fw_cfg(const VirtBoardInfo *vbi, AddressSpace *as) > { > hwaddr base =3D vbi->memmap[VIRT_FW_CFG].base; > hwaddr size =3D vbi->memmap[VIRT_FW_CFG].size; > char *nodename; > =20 > - fw_cfg_init_mem_wide(base + 8, base, 8, 0, NULL); > + fw_cfg_init_mem_wide(base + 8, base, 8, base + 16, as); > =20 > nodename =3D g_strdup_printf("/fw-cfg@%" PRIx64, base); > qemu_fdt_add_subnode(vbi->fdt, nodename); > @@ -919,6 +919,7 @@ static void machvirt_init(MachineState *machine) > =20 > create_fdt(vbi); > =20 > + > for (n =3D 0; n < smp_cpus; n++) { > ObjectClass *oc =3D cpu_class_by_name(TYPE_ARM_CPU, cpustr[0])= ; > CPUClass *cc =3D CPU_CLASS(oc); > @@ -984,7 +985,7 @@ static void machvirt_init(MachineState *machine) > */ > create_virtio_devices(vbi, pic); > =20 > - create_fw_cfg(vbi); > + create_fw_cfg(vbi, &address_space_memory); > rom_set_fw(fw_cfg_find()); > =20 > guest_info->smp_cpus =3D smp_cpus; >=20