From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52352) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aak1t-0003cL-Gd for qemu-devel@nongnu.org; Tue, 01 Mar 2016 08:08:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aak1o-0005Lr-Fw for qemu-devel@nongnu.org; Tue, 01 Mar 2016 08:07:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39199) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aak1o-0005Lk-8B for qemu-devel@nongnu.org; Tue, 01 Mar 2016 08:07:52 -0500 Date: Tue, 1 Mar 2016 15:07:47 +0200 From: "Michael S. Tsirkin" Message-ID: <20160301134419-mutt-send-email-mst@redhat.com> References: <1456078260-6669-1-git-send-email-davidkiarie4@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1456078260-6669-1-git-send-email-davidkiarie4@gmail.com> Subject: Re: [Qemu-devel] [V6 0/4] AMD IOMMU List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Kiarie Cc: marcel@redhat.com, valentine.sinitsyn@gmail.com, jan.kiszka@web.de, qemu-devel@nongnu.org On Sun, Feb 21, 2016 at 09:10:56PM +0300, David Kiarie wrote: > Hello there, > > Repost, AMD IOMMU patches version 6. > > Changes since version 5 > -Fixed macro formating issues > -changed occurences of IO MMU to IOMMU for consistency > -Fixed capability registers duplication > -Rebased to current master > > David Kiarie (4): > hw/i386: Introduce AMD IOMMU > hw/core: Add AMD IOMMU to machine properties > hw/i386: ACPI table for AMD IOMMU > hw/pci-host: Emulate AMD IOMMU I went over AMD IOMMU spec. I'm concerned that it appears that there's no chance for it to work correctly if host caches invalid PTE entries. The spec vaguely discusses write-protecting such PTEs but that would be very complex if it can be made to work at all. This means that this can't work with e.g. VFIO. It can only work with emulated devices. OTOH VTD can easily support PTE shadowing by setting a flag. I'd like us to find some way to avoid possibility of user error creating a configuration mixing e.g. vfio with the amd iommu. I'm not sure how to do this. Any idea? > hw/core/machine.c | 28 +- > hw/i386/Makefile.objs | 1 + > hw/i386/acpi-build.c | 208 +++++- > hw/i386/amd_iommu.c | 1432 +++++++++++++++++++++++++++++++++++++++++ > hw/i386/amd_iommu.h | 395 ++++++++++++ > hw/pci-host/piix.c | 1 + > 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 +- > 13 files changed, 2123 insertions(+), 27 deletions(-) > create mode 100644 hw/i386/amd_iommu.c > create mode 100644 hw/i386/amd_iommu.h > > -- > 2.1.4