qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: qemu-ppc@nongnu.org, agraf@suse.de, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/2] pseries: Don't allow TCE (iommu) tables to be registered with duplicate LIOBNs
Date: Mon, 10 Dec 2012 15:00:05 +0200	[thread overview]
Message-ID: <20121210130005.GB28118@redhat.com> (raw)
In-Reply-To: <1353996453-24262-2-git-send-email-david@gibson.dropbear.id.au>

On Tue, Nov 27, 2012 at 05:07:32PM +1100, David Gibson wrote:
> The PAPR specification requires that every bus or device mediated by the
> IOMMU have a unique Logical IO Bus Number (LIOBN).  This patch adds a check
> to enforce this, which will help catch errors in configuration earlier.
> 
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>

Acked-by: Michael S. Tsirkin <mst@redhat.com>

> ---
>  hw/spapr_iommu.c |    6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/hw/spapr_iommu.c b/hw/spapr_iommu.c
> index 02d78cc..3011b25 100644
> --- a/hw/spapr_iommu.c
> +++ b/hw/spapr_iommu.c
> @@ -120,6 +120,12 @@ DMAContext *spapr_tce_new_dma_context(uint32_t liobn, size_t window_size)
>  {
>      sPAPRTCETable *tcet;
>  
> +    if (spapr_tce_find_by_liobn(liobn)) {
> +        fprintf(stderr, "Attempted to create TCE table with duplicate"
> +                " LIOBN 0x%x\n", liobn);
> +        return NULL;
> +    }
> +
>      if (!window_size) {
>          return NULL;
>      }
> -- 
> 1.7.10.4

  reply	other threads:[~2012-12-10 12:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-27  6:07 [Qemu-devel] [0/2] pseries: Rework PCI code for handling multiple PHBs David Gibson
2012-11-27  6:07 ` [Qemu-devel] [PATCH 1/2] pseries: Don't allow TCE (iommu) tables to be registered with duplicate LIOBNs David Gibson
2012-12-10 13:00   ` Michael S. Tsirkin [this message]
2012-12-11  9:59     ` Alexander Graf
2012-11-27  6:07 ` [Qemu-devel] [PATCH 2/2] pseries: Properly handle allocation of multiple PCI host bridges David Gibson
2012-11-28  2:50   ` [Qemu-devel] [Qemu-ppc] " David Gibson
2012-12-10 13:00   ` [Qemu-devel] " Michael S. Tsirkin
2012-11-27 12:36 ` [Qemu-devel] [0/2] pseries: Rework PCI code for handling multiple PHBs Michael S. Tsirkin
2012-11-28  2:50   ` [Qemu-devel] [Qemu-ppc] " David Gibson
2012-12-10 12:58     ` Michael S. Tsirkin

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=20121210130005.GB28118@redhat.com \
    --to=mst@redhat.com \
    --cc=agraf@suse.de \
    --cc=david@gibson.dropbear.id.au \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@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).