From: David Kiarie <davidkiarie4@gmail.com>
To: qemu-devel@nongnu.org
Cc: mst@redhat.com, crosthwaitepeter@gmail.com,
valentine.sinitsyn@gmail.com, jan.kiszka@web.de,
marcel@redhat.com, David Kiarie <davidkiarie4@gmail.com>
Subject: [Qemu-devel] [V4 0/4] AMD IO MMU
Date: Mon, 18 Jan 2016 18:25:41 +0300 [thread overview]
Message-ID: <1453130745-25793-1-git-send-email-davidkiarie4@gmail.com> (raw)
David Kiarie (4):
hw/i386: Introduce AMD IO MMU
hw/core: Add AMD IO MMU to machine properties
hw/i386: ACPI table for AMD IO MMU
hw/pci-host: Emulate AMD IO MMU
hw/core/machine.c | 17 +-
hw/i386/Makefile.objs | 1 +
hw/i386/acpi-build.c | 70 ++
hw/i386/amd_iommu.c | 1409 +++++++++++++++++++++++++++++++++++++++++
hw/i386/amd_iommu.h | 399 ++++++++++++
hw/pci-host/piix.c | 11 +
hw/pci-host/q35.c | 14 +-
include/hw/acpi/acpi-defs.h | 55 ++
include/hw/boards.h | 3 +-
include/hw/i386/intel_iommu.h | 1 +
include/hw/pci/pci.h | 2 +
qemu-options.hx | 6 +-
util/qemu-config.c | 4 +-
vl.c | 8 +
14 files changed, 1984 insertions(+), 16 deletions(-)
create mode 100644 hw/i386/amd_iommu.c
create mode 100644 hw/i386/amd_iommu.h
Hi all,
V4 of IO MMU patches.
Changes since V3
-Fixed Marcel's comments
-byte swapping in ACPI code fixed
As for IO MMU MMIO region:
This is the code that sets up the IO MMU base address in coreboot. It seems to be reading something from the BUS config region which as per the comment should have a value written by BIOS.
case CB_AmdSetMidPostConfig:
nbConfigPtr->pNbConfig->IoApicBaseAddress = IO_APIC_ADDR;
#ifndef IOMMU_SUPPORT_DISABLE //TODO enable iommu
/* SBIOS must alloc 16K memory for IOMMU MMIO */
UINT32 MmcfgBarAddress; //using default IOmmuBaseAddress
LibNbPciRead(nbConfigPtr->NbPciAddress.AddressValue | 0x1C,
AccessWidth32,
&MmcfgBarAddress,
nbConfigPtr);
MmcfgBarAddress &= ~0xf;
if (MmcfgBarAddress != 0) {
nbConfigPtr->IommuBaseAddress = MmcfgBarAddress;
}
nbConfigPtr->IommuBaseAddress = 0; //disable iommu
#endif
I have a feeling that this is getting overly and unnecessary complex - AMD have their own BIOS which they, only know what it does and we have ours( which of course, we know how it behaves).
If we choose a static address and assign that to IO MMU mmio we could hypothetically have two problems.
-SeaBIOS allocating BAR from the same region.
-Someone selecting the region for other devices such as HPET.
The first problem can be solved as we know from what addresses seaBIOS allocats BARs while as for the second they should know better. I have therefore selected an unused IO region just next IOAPIC and HPET region and mapped 16K for IO MMU mmio.
David.
--
2.1.4
next reply other threads:[~2016-01-18 15:26 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-18 15:25 David Kiarie [this message]
2016-01-18 15:25 ` [Qemu-devel] [V4 1/4] hw/i386: Introduce AMD IO MMU David Kiarie
2016-02-04 15:03 ` Michael S. Tsirkin
2016-02-14 18:02 ` David kiarie
2016-02-15 3:41 ` David kiarie
2016-02-15 3:54 ` David kiarie
2016-02-15 15:46 ` Marcel Apfelbaum
2016-02-15 15:55 ` jack bean
2016-01-18 15:25 ` [Qemu-devel] [V4 2/4] hw/core: Add AMD IO MMU to machine properties David Kiarie
2016-01-18 16:21 ` Marcel Apfelbaum
2016-01-18 16:48 ` David Kiarie
2016-01-18 17:27 ` Marcel Apfelbaum
2016-01-18 17:57 ` David Kiarie
2016-02-14 13:06 ` Marcel Apfelbaum
2016-01-18 15:25 ` [Qemu-devel] [V4 3/4] hw/i386: ACPI table for AMD IO MMU David Kiarie
2016-02-14 12:54 ` Marcel Apfelbaum
2016-02-14 13:07 ` Michael S. Tsirkin
2016-02-14 18:11 ` David kiarie
2016-01-18 15:25 ` [Qemu-devel] [V4 4/4] hw/pci-host: Emulate " David Kiarie
2016-02-14 13:02 ` Marcel Apfelbaum
2016-02-14 18:06 ` David kiarie
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=1453130745-25793-1-git-send-email-davidkiarie4@gmail.com \
--to=davidkiarie4@gmail.com \
--cc=crosthwaitepeter@gmail.com \
--cc=jan.kiszka@web.de \
--cc=marcel@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=valentine.sinitsyn@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).