qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Marcel Apfelbaum <marcel@redhat.com>
To: Alex Williamson <alex.williamson@redhat.com>, qemu-devel@nongnu.org
Cc: mst@redhat.com, aik@ozlabs.ru, bd.aviv@gmail.com,
	peterx@redhat.com, pbonzini@redhat.com,
	david@gibson.dropbear.id.au
Subject: Re: [Qemu-devel] [PATCH 2/2] intel_iommu: Throw hw_error on notify_started
Date: Thu, 16 Jun 2016 10:22:33 +0300	[thread overview]
Message-ID: <576253B9.7060802@redhat.com> (raw)
In-Reply-To: <20160615155616.32658.17560.stgit@gimli.home>

On 06/15/2016 06:56 PM, Alex Williamson wrote:
> We don't currently support the MemoryRegionIOMMUOps notifier, so throw
> an error should a device require it.
>
> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
> ---
>   hw/i386/intel_iommu.c |   12 ++++++++++++
>   1 file changed, 12 insertions(+)
>
> diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
> index 347718f..5eba704 100644
> --- a/hw/i386/intel_iommu.c
> +++ b/hw/i386/intel_iommu.c
> @@ -24,6 +24,7 @@
>   #include "exec/address-spaces.h"
>   #include "intel_iommu_internal.h"
>   #include "hw/pci/pci.h"
> +#include "hw/pci/pci_bus.h"
>
>   /*#define DEBUG_INTEL_IOMMU*/
>   #ifdef DEBUG_INTEL_IOMMU
> @@ -1871,6 +1872,16 @@ static IOMMUTLBEntry vtd_iommu_translate(MemoryRegion *iommu, hwaddr addr,
>       return ret;
>   }
>
> +static void vtd_iommu_notify_started(MemoryRegion *iommu)
> +{
> +    VTDAddressSpace *vtd_as = container_of(iommu, VTDAddressSpace, iommu);
> +
> +    hw_error("Device at bus %s addr %02x.%d requires iommu notifier which "
> +             "is currently not supported by intel-iommu emulation",
> +             vtd_as->bus->qbus.name, PCI_SLOT(vtd_as->devfn),
> +             PCI_FUNC(vtd_as->devfn));
> +}
> +
>   static const VMStateDescription vtd_vmstate = {
>       .name = "iommu-intel",
>       .unmigratable = 1,
> @@ -1938,6 +1949,7 @@ static void vtd_init(IntelIOMMUState *s)
>       memset(s->womask, 0, DMAR_REG_SIZE);
>
>       s->iommu_ops.translate = vtd_iommu_translate;
> +    s->iommu_ops.notify_started = vtd_iommu_notify_started;
>       s->root = 0;
>       s->root_extended = false;
>       s->dmar_enabled = false;
>

Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>

Thanks,
Marcel

  parent reply	other threads:[~2016-06-16  7:22 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-15 15:56 [Qemu-devel] [PATCH 0/2] memory/intel_iommu: Generate error for incompatible usage Alex Williamson
2016-06-15 15:56 ` [Qemu-devel] [PATCH 1/2] memory: Add MemoryRegionIOMMUOps.notify_started/stopped callbacks Alex Williamson
2016-06-15 15:56 ` [Qemu-devel] [PATCH 2/2] intel_iommu: Throw hw_error on notify_started Alex Williamson
2016-06-16  1:12   ` David Gibson
2016-06-16  7:22   ` Marcel Apfelbaum [this message]
2016-06-16  1:43 ` [Qemu-devel] [PATCH 0/2] memory/intel_iommu: Generate error for incompatible usage Alexey Kardashevskiy
2016-06-27  4:46   ` Alexey Kardashevskiy
2016-06-27  5:12     ` Alex Williamson
2016-06-16  3:21 ` Peter Xu
2016-06-28 14:49 ` Alex Williamson
2016-06-29 10:53   ` Paolo Bonzini
2016-06-29 15:56     ` Alex Williamson
2016-06-29 15:58       ` Paolo Bonzini

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=576253B9.7060802@redhat.com \
    --to=marcel@redhat.com \
    --cc=aik@ozlabs.ru \
    --cc=alex.williamson@redhat.com \
    --cc=bd.aviv@gmail.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).