From: "Marc Marí" <markmb@redhat.com>
To: qemu-devel@nongnu.org
Cc: Drew <drjones@redhat.com>, "Stefan Hajnoczi" <stefanha@gmail.com>,
"Kevin O'Connor" <kevin@koconnor.net>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Marc Marí" <markmb@redhat.com>, Laszlo <lersek@redhat.com>
Subject: [Qemu-devel] [PATCH v2 5/5] Enable fw_cfg DMA interface for x86
Date: Mon, 31 Aug 2015 11:10:17 +0200 [thread overview]
Message-ID: <1441012217-8213-6-git-send-email-markmb@redhat.com> (raw)
In-Reply-To: <1441012217-8213-1-git-send-email-markmb@redhat.com>
Enable the fw_cfg DMA interface for all the x86 platforms.
Based on Gerd Hoffman's initial implementation.
Signed-off-by: Marc Marí <markmb@redhat.com>
---
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 9f2924e..c6dc84f 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -753,14 +753,15 @@ static void pc_build_smbios(FWCfgState *fw_cfg)
}
}
-static FWCfgState *bochs_bios_init(void)
+static FWCfgState *bochs_bios_init(AddressSpace *as)
{
FWCfgState *fw_cfg;
uint64_t *numa_fw_cfg;
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
@@ -1316,6 +1317,7 @@ FWCfgState *pc_memory_init(PCMachineState *pcms,
MemoryRegion *ram_below_4g, *ram_above_4g;
FWCfgState *fw_cfg;
MachineState *machine = MACHINE(pcms);
+ AddressSpace *as;
assert(machine->ram_size == pcms->below_4g_mem_size +
pcms->above_4g_mem_size);
@@ -1407,7 +1409,10 @@ FWCfgState *pc_memory_init(PCMachineState *pcms,
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
prev parent reply other threads:[~2015-08-31 9:10 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-31 9:08 [Qemu-devel] QEMU fw_cfg DMA interface Marc Marí
2015-08-31 9:10 ` [Qemu-devel] [PATCH v2 0/5] " Marc Marí
2015-08-31 9:10 ` [Qemu-devel] [PATCH v2 1/5] fw_cfg: document fw_cfg_modify_iXX() update functions Marc Marí
2015-09-01 17:33 ` Peter Maydell
2015-09-01 17:45 ` Gabriel L. Somlo
2015-09-01 18:45 ` Peter Maydell
2015-09-01 19:13 ` Gabriel L. Somlo
2015-09-01 20:10 ` Peter Maydell
2015-09-01 20:27 ` Gabriel L. Somlo
2015-09-01 20:30 ` Peter Maydell
2015-09-02 8:08 ` Gerd Hoffmann
2015-09-02 9:21 ` Laszlo Ersek
2015-08-31 9:10 ` [Qemu-devel] [PATCH v2 2/5] fw_cfg DMA interface documentation Marc Marí
2015-08-31 15:36 ` Kevin O'Connor
2015-09-01 17:47 ` Peter Maydell
2015-09-01 17:56 ` Peter Maydell
2015-08-31 9:10 ` [Qemu-devel] [PATCH v2 3/5] Implement fw_cfg DMA interface Marc Marí
2015-08-31 15:58 ` Kevin O'Connor
2015-09-01 18:35 ` Peter Maydell
2015-08-31 9:10 ` [Qemu-devel] [PATCH v2 4/5] Enable fw_cfg DMA interface for ARM Marc Marí
2015-09-01 18:02 ` Peter Maydell
2015-08-31 9:10 ` Marc Marí [this message]
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=1441012217-8213-6-git-send-email-markmb@redhat.com \
--to=markmb@redhat.com \
--cc=drjones@redhat.com \
--cc=kevin@koconnor.net \
--cc=kraxel@redhat.com \
--cc=lersek@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
/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).