[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 5/5] Enable fw_cfg DMA interface for x86
From: |
Marc Marí |
Subject: |
[Qemu-devel] [PATCH 5/5] Enable fw_cfg DMA interface for x86 |
Date: |
Thu, 6 Aug 2015 13:01:18 +0200 |
Enable the fw_cfg DMA interface for all the x86 platforms.
Based on Gerd Hoffman's initial implementation.
Signed-off-by: Marc Marí <address@hidden>
---
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;
}
-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 = pc_apic_id_limit(max_cpus);
- fw_cfg = fw_cfg_init_io(BIOS_CFG_IOPORT);
+ fw_cfg = 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 hotplug
@@ -1302,6 +1303,7 @@ FWCfgState *pc_memory_init(MachineState *machine,
MemoryRegion *ram_below_4g, *ram_above_4g;
FWCfgState *fw_cfg;
PCMachineState *pcms = PC_MACHINE(machine);
+ AddressSpace *as;
assert(machine->ram_size == below_4g_mem_size + above_4g_mem_size);
@@ -1391,7 +1393,10 @@ FWCfgState *pc_memory_init(MachineState *machine,
option_rom_mr,
1);
- fw_cfg = bochs_bios_init();
+ as = g_malloc(sizeof(*as));
+ address_space_init(as, ram_below_4g, "pc.as");
+ fw_cfg = bochs_bios_init(as);
+
rom_set_fw(fw_cfg);
if (guest_info->has_reserved_memory && pcms->hotplug_memory.base) {
--
2.4.3
- Re: [Qemu-devel] [PATCH 3/5] Implement fw_cfg DMA interface, (continued)
- Re: [Qemu-devel] [PATCH 3/5] Implement fw_cfg DMA interface, Laszlo Ersek, 2015/08/06
- Re: [Qemu-devel] [PATCH 3/5] Implement fw_cfg DMA interface, Marc Marí, 2015/08/06
- Re: [Qemu-devel] [PATCH 3/5] Implement fw_cfg DMA interface, Laszlo Ersek, 2015/08/06
- Re: [Qemu-devel] [PATCH 3/5] Implement fw_cfg DMA interface, Marc Marí, 2015/08/07
- Re: [Qemu-devel] [PATCH 3/5] Implement fw_cfg DMA interface, Eric Blake, 2015/08/07
[Qemu-devel] [PATCH 4/5] Enable fw_cfg DMA interface for ARM, Marc Marí, 2015/08/06
[Qemu-devel] [PATCH 5/5] Enable fw_cfg DMA interface for x86,
Marc Marí <=
Re: [Qemu-devel] QEMU fw_cfg DMA interface, Stefan Hajnoczi, 2015/08/06
- Re: [Qemu-devel] QEMU fw_cfg DMA interface, Marc Marí, 2015/08/06
- Re: [Qemu-devel] QEMU fw_cfg DMA interface, Stefan Hajnoczi, 2015/08/06
- Re: [Qemu-devel] QEMU fw_cfg DMA interface, Kevin O'Connor, 2015/08/06
- Re: [Qemu-devel] QEMU fw_cfg DMA interface, Marc Marí, 2015/08/06
- Re: [Qemu-devel] QEMU fw_cfg DMA interface, Kevin O'Connor, 2015/08/07
- Re: [Qemu-devel] QEMU fw_cfg DMA interface, Gerd Hoffmann, 2015/08/18
[Qemu-devel] QEMU fw_cfg DMA interface, Marc Marí, 2015/08/31