Received: from eggs.gnu.org ([208.118.235.92]:47983) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TiMdp-0004vR-ES for qemu-devel@nongnu.org; Tue, 11 Dec 2012 05:00:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TiMdf-0008Em-6c for qemu-devel@nongnu.org; Tue, 11 Dec 2012 05:00:45 -0500 Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=us-ascii From: Alexander Graf In-Reply-To: <20121210130005.GB28118@redhat.com> Date: Tue, 11 Dec 2012 10:59:46 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <7724BB01-10D6-4FFF-95E9-BCAB29BA9274@suse.de> References: <1353996453-24262-1-git-send-email-david@gibson.dropbear.id.au> <1353996453-24262-2-git-send-email-david@gibson.dropbear.id.au> <20121210130005.GB28118@redhat.com> Subject: Re: [Qemu-devel] [PATCH 1/2] pseries: Don't allow TCE (iommu) tables to be registered with duplicate LIOBNs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S.Tsirkin" Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, David Gibson On 10.12.2012, at 14:00, Michael S. Tsirkin wrote: > 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. >>=20 >> Signed-off-by: David Gibson >=20 > Acked-by: Michael S. Tsirkin Thanks, applied to ppc-next. Alex >=20 >> --- >> hw/spapr_iommu.c | 6 ++++++ >> 1 file changed, 6 insertions(+) >>=20 >> 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; >>=20 >> + 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; >> } >> --=20 >> 1.7.10.4