From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45974) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zd2DP-0001Vn-Kn for qemu-devel@nongnu.org; Fri, 18 Sep 2015 16:25:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zd2DM-0007U5-GQ for qemu-devel@nongnu.org; Fri, 18 Sep 2015 16:25:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34910) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zd2DM-0007Ty-9q for qemu-devel@nongnu.org; Fri, 18 Sep 2015 16:25:00 -0400 Date: Fri, 18 Sep 2015 22:24:54 +0200 From: Marc =?UTF-8?B?TWFyw60=?= Message-ID: <20150918222454.406f81ae@markmb_rh> In-Reply-To: <55FC712E.2000306@redhat.com> 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> <55FC712E.2000306@redhat.com> MIME-Version: 1.0 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: Laszlo Ersek Cc: Stefan Hajnoczi , Drew , Kevin O'Connor , qemu-devel@nongnu.org, Gerd Hoffmann On Fri, 18 Sep 2015 22:16:46 +0200 Laszlo Ersek wrote: > 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 }, >=20 > Okay, Laszlo is the hateful reviewer. Sorry about that. I'm late, yes. >=20 > 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)". It's not your problem if I don't know how to count. So don't apologize :). And it's better to catch this stupid little mistakes now. Thanks Marc > Thanks (and I'm sorry about being late!) > Laszlo >=20 > > [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 >=20