From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44141) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNIvv-0003Jw-41 for qemu-devel@nongnu.org; Thu, 06 Aug 2015 07:02:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZNIvt-0006UF-Kv for qemu-devel@nongnu.org; Thu, 06 Aug 2015 07:01:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50230) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZNIvt-0006Tt-9e for qemu-devel@nongnu.org; Thu, 06 Aug 2015 07:01:57 -0400 From: =?UTF-8?q?Marc=20Mar=C3=AD?= Date: Thu, 6 Aug 2015 13:01:18 +0200 Message-Id: <1438858878-29450-6-git-send-email-markmb@redhat.com> In-Reply-To: <1438858878-29450-1-git-send-email-markmb@redhat.com> References: <1438858816-29385-1-git-send-email-markmb@redhat.com> <1438858878-29450-1-git-send-email-markmb@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 5/5] Enable fw_cfg DMA interface for x86 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Drew , Stefan Hajnoczi , Kevin O'Connor , Gerd Hoffmann , =?UTF-8?q?Marc=20Mar=C3=AD?= , Laszlo Enable the fw_cfg DMA interface for all the x86 platforms. Based on Gerd Hoffman's initial implementation. Signed-off-by: Marc Mar=C3=AD --- hw/i386/pc.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 7661ea9..e5ca805 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -718,7 +718,7 @@ static unsigned int pc_apic_id_limit(unsigned int max= _cpus) return x86_cpu_apic_id_from_index(max_cpus - 1) + 1; } =20 -static FWCfgState *bochs_bios_init(void) +static FWCfgState *bochs_bios_init(AddressSpace *as) { FWCfgState *fw_cfg; uint8_t *smbios_tables, *smbios_anchor; @@ -727,7 +727,8 @@ static FWCfgState *bochs_bios_init(void) int i, j; unsigned int apic_id_limit =3D pc_apic_id_limit(max_cpus); =20 - fw_cfg =3D fw_cfg_init_io(BIOS_CFG_IOPORT); + fw_cfg =3D fw_cfg_init_io_dma(BIOS_CFG_IOPORT, as); + /* FW_CFG_MAX_CPUS is a bit confusing/problematic on x86: * * SeaBIOS needs FW_CFG_MAX_CPUS for CPU hotplug, but the CPU hotplu= g @@ -1302,6 +1303,7 @@ FWCfgState *pc_memory_init(MachineState *machine, MemoryRegion *ram_below_4g, *ram_above_4g; FWCfgState *fw_cfg; PCMachineState *pcms =3D PC_MACHINE(machine); + AddressSpace *as; =20 assert(machine->ram_size =3D=3D below_4g_mem_size + above_4g_mem_siz= e); =20 @@ -1391,7 +1393,10 @@ FWCfgState *pc_memory_init(MachineState *machine, option_rom_mr, 1); =20 - fw_cfg =3D bochs_bios_init(); + as =3D g_malloc(sizeof(*as)); + address_space_init(as, ram_below_4g, "pc.as"); + fw_cfg =3D bochs_bios_init(as); + rom_set_fw(fw_cfg); =20 if (guest_info->has_reserved_memory && pcms->hotplug_memory.base) { --=20 2.4.3