qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Alex Williamson <alex.williamson@redhat.com>
Cc: qemu-devel@nongnu.org, mst@redhat.com, aik@ozlabs.ru,
	bd.aviv@gmail.com, peterx@redhat.com, marcel@redhat.com,
	pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH 2/2] intel_iommu: Throw hw_error on notify_started
Date: Thu, 16 Jun 2016 11:12:55 +1000	[thread overview]
Message-ID: <20160616011255.GJ28087@voom.fritz.box> (raw)
In-Reply-To: <20160615155616.32658.17560.stgit@gimli.home>

[-- Attachment #1: Type: text/plain, Size: 1971 bytes --]

On Wed, Jun 15, 2016 at 09:56:16AM -0600, 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>

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>

> ---
>  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;
> 

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2016-06-16  1:11 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 [this message]
2016-06-16  7:22   ` Marcel Apfelbaum
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=20160616011255.GJ28087@voom.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=aik@ozlabs.ru \
    --cc=alex.williamson@redhat.com \
    --cc=bd.aviv@gmail.com \
    --cc=marcel@redhat.com \
    --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).